aboutsummaryrefslogtreecommitdiff
path: root/tools/lib/lockdep/uinclude/linux
AgeCommit message (Collapse)AuthorFilesLines
2017-06-05tools/lib/lockdep: Define the ARRAY_SIZE() macroGravatar Ben Hutchings 1-0/+2
lockdep.c now uses ARRAY_SIZE(). Signed-off-by: Ben Hutchings <ben@decadent.org.uk> Signed-off-by: Sasha Levin <sasha.levin@oracle.com> Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: a.p.zijlstra@chello.nl Fixes: 75dd602a5198 ("lockdep: Fix lock_chain::base size") Link: http://lkml.kernel.org/r/20170525130005.5947-4-alexander.levin@verizon.com Signed-off-by: Ingo Molnar <mingo@kernel.org>
2017-06-05tools/lib/lockdep: Reduce MAX_LOCK_DEPTH to avoid overflowing lock_chain/: DepthGravatar Ben Hutchings 1-1/+1
liblockdep has been broken since commit 75dd602a5198 ("lockdep: Fix lock_chain::base size"), as that adds a check that MAX_LOCK_DEPTH is within the range of lock_chain::depth and in liblockdep it is much too large. That should have resulted in a compiler error, but didn't because: - the check uses ARRAY_SIZE(), which isn't yet defined in liblockdep so is assumed to be an (undeclared) function - putting a function call inside a BUILD_BUG_ON() expression quietly turns it into some nonsense involving a variable-length array It did produce a compiler warning, but I didn't notice because liblockdep already produces too many warnings if -Wall is enabled (which I'll fix shortly). Even before that commit, which reduced lock_chain::depth from 8 bits to 6, MAX_LOCK_DEPTH was too large. Signed-off-by: Ben Hutchings <ben@decadent.org.uk> Signed-off-by: Sasha Levin <sasha.levin@oracle.com> Cc: <stable@vger.kernel.org> # for versions before 4.6, use a value of 255 Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: a.p.zijlstra@chello.nl Link: http://lkml.kernel.org/r/20170525130005.5947-3-alexander.levin@verizon.com Signed-off-by: Ingo Molnar <mingo@kernel.org>
2016-02-29tools/lib/lockdep: Add userspace version of READ_ONCE()Gravatar Alfredo Alvarez Fernandez 1-0/+1
This was added to the kernel code in <1658d35ead5d> ("list: Use READ_ONCE() when testing for empty lists"). There's nothing special we need to do about it in userspace. Signed-off-by: Alfredo Alvarez Fernandez <alfredoalvarezfernandez@gmail.com> Cc: Andrew Morton <akpm@linux-foundation.org> Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: Paul E. McKenney <paulmck@linux.vnet.ibm.com> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Sasha Levin <sasha.levin@oracle.com> Cc: Thomas Gleixner <tglx@linutronix.de> Link: http://lkml.kernel.org/r/1455864533-7536-2-git-send-email-alfredoalvarezernandez@gmail.com Signed-off-by: Ingo Molnar <mingo@kernel.org>
2015-11-06tools/liblockdep: explicitly declare lockdep API we call from liblockdepGravatar Sasha Levin 1-1/+2
It seems that newer gcc complains about lack of explicit declaration for some of the API we use, add it in. Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
2015-11-06tools/liblockdep: add userspace versions of WRITE_ONCE and RCU_INIT_POINTERGravatar Sasha Levin 1-0/+2
These were added to the kernel code in cee34d88c ("lockdep: Fix a race between /proc/lock_stat and module unload"). There's nothing special we need to do about them in userspace. Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
2015-08-25tools/liblockdep: Use the rbtree header provided by common tools headersGravatar Sasha Levin 1-1/+0
Recent changes to rbtree.h may break compilation. There is no reason to use a liblockdep specific header to begin with, so we'll use the one shared with all other tools/. Signed-off-by: Sasha Levin <sasha.levin@oracle.com> Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Thomas Gleixner <tglx@linutronix.de> Link: http://lkml.kernel.org/r/1440479985-6696-3-git-send-email-sasha.levin@oracle.com Signed-off-by: Ingo Molnar <mingo@kernel.org>
2015-08-25tools/liblockdep: Correct macro for WARNGravatar Sasha Levin 1-1/+1
As Peter Zijlstra pointed out, the varargs for WARN() are optional, so we need to correctly handle the case where they don't exist. This would cause a compilation error. Signed-off-by: Sasha Levin <sasha.levin@oracle.com> Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Thomas Gleixner <tglx@linutronix.de> Link: http://lkml.kernel.org/r/1440479985-6696-2-git-send-email-sasha.levin@oracle.com Signed-off-by: Ingo Molnar <mingo@kernel.org>
2015-05-13tools/liblockdep: Fix compilation errorGravatar Eunbong Song 1-0/+3
Recent changes to kernel/locking/lockdep.c broke the liblockdep build. Fix that. Signed-off-by: Eunbong Song <eunb.song@samsung.com> Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
2014-05-01tools: Consolidate types.hGravatar Borislav Petkov 1-58/+0
Combine all definitions into a common tools/include/linux/types.h and kill the wild growth elsewhere. Move DECLARE_BITMAP to its proper bitmap.h header. Signed-off-by: Borislav Petkov <bp@suse.de> Acked-by: Rusty Russell <rusty@rustcorp.com.au> Link: http://lkml.kernel.org/n/tip-azczs7qcv6h9xek9od10hiv2@git.kernel.org Signed-off-by: Jiri Olsa <jolsa@kernel.org>
2014-05-01tools: Unify export.hGravatar Borislav Petkov 1-7/+0
So tools/ has been growing three, at a different stage of their development export.h headers and so we should unite into one. Add tools/include/ to the include path of virtio and liblockdep to pick the shared header now. Signed-off-by: Borislav Petkov <bp@suse.de> Acked-by: Rusty Russell <rusty@rustcorp.com.au> Cc: Arnaldo Carvalho de Melo <acme@kernel.org> Cc: Ingo Molnar <mingo@redhat.com> Cc: Michael S. Tsirkin <mst@redhat.com> Cc: Paul Mackerras <paulus@samba.org> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: Sasha Levin <sasha.levin@oracle.com> Cc: virtio-dev@lists.oasis-open.org Cc: virtualization@lists.linux-foundation.org Link: http://lkml.kernel.org/r/1397493185-19521-2-git-send-email-bp@alien8.de Signed-off-by: Jiri Olsa <jolsa@kernel.org>
2014-04-01tools/liblockdep: Ignore asmlinkage and visibleGravatar Sasha Levin 1-0/+3
Commit 63f9a7fde7 "asmlinkage: Make lockdep_sys_exit asmlinkage" has added asmlinkage annotation to lockdep_sys_exit, which broke build of liblockdep. Since we don't need asmlinkage in liblockep, just ignore it. Reported-by: Eunbong Song <eunb.song@samsung.com> Reported-by: Robin Hack <rhack@redhat.com> Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
2014-02-26tools/liblockdep: Add a stub for new rcu_is_watchingGravatar Sasha Levin 1-0/+5
Stub out rcu_is_watching(), prevents build error with the updated tree. Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
2013-11-27liblockdep: Wrap kernel/locking/lockdep.c to allow usage from userspaceGravatar Sasha Levin 31-0/+422
kernel/locking/lockdep.c deals with validating locking scenarios for various architectures supported by the kernel. There isn't anything kernel specific going on in lockdep, and when we compare userspace to other architectures that don't have to deal with irqs such as s390, they become all too similar. We wrap kernel/locking/lockdep.c and include/linux/lockdep.h with several headers which allow us to build and use lockdep from userspace. We don't touch the kernel code itself which means that any work done on lockdep in the kernel will automatically benefit userspace lockdep as well! Signed-off-by: Sasha Levin <sasha.levin@oracle.com> Signed-off-by: Peter Zijlstra <peterz@infradead.org> Cc: torvalds@linux-foundation.org Link: http://lkml.kernel.org/r/1371163284-6346-3-git-send-email-sasha.levin@oracle.com Signed-off-by: Ingo Molnar <mingo@kernel.org>