linux-IllusionX/scripts
Marco Elver 14e2ac8de0 kcsan: Support compounded read-write instrumentation
Add support for compounded read-write instrumentation if supported by
the compiler. Adds the necessary instrumentation functions, and a new
type which is used to generate a more descriptive report.

Furthermore, such compounded memory access instrumentation is excluded
from the "assume aligned writes up to word size are atomic" rule,
because we cannot assume that the compiler emits code that is atomic for
compound ops.

LLVM/Clang added support for the feature in:
785d41a261

The new instrumentation is emitted for sets of memory accesses in the
same basic block to the same address with at least one read appearing
before a write. These typically result from compound operations such as
++, --, +=, -=, |=, &=, etc. but also equivalent forms such as "var =
var + 1". Where the compiler determines that it is equivalent to emit a
call to a single __tsan_read_write instead of separate __tsan_read and
__tsan_write, we can then benefit from improved performance and better
reporting for such access patterns.

The new reports now show that the ops are both reads and writes, for
example:

	read-write to 0xffffffff90548a38 of 8 bytes by task 143 on cpu 3:
	 test_kernel_rmw_array+0x45/0xa0
	 access_thread+0x71/0xb0
	 kthread+0x21e/0x240
	 ret_from_fork+0x22/0x30

	read-write to 0xffffffff90548a38 of 8 bytes by task 144 on cpu 2:
	 test_kernel_rmw_array+0x45/0xa0
	 access_thread+0x71/0xb0
	 kthread+0x21e/0x240
	 ret_from_fork+0x22/0x30

Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Signed-off-by: Marco Elver <elver@google.com>
Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
2020-08-24 15:09:32 -07:00
..
atomic locking/atomics: Provide the arch_atomic_ interface to generic code 2020-06-25 08:23:22 -07:00
basic kbuild: introduce hostprogs-always-y and userprogs-always-y 2020-08-10 01:32:59 +09:00
coccinelle mm, treewide: rename kzfree() to kfree_sensitive() 2020-08-07 11:33:22 -07:00
dtc kbuild: introduce hostprogs-always-y and userprogs-always-y 2020-08-10 01:32:59 +09:00
dummy-tools
gcc-plugins Kbuild updates for v5.9 2020-08-09 14:10:26 -07:00
gdb scripts/gdb: fix python 3.8 SyntaxWarning 2020-08-12 10:58:02 -07:00
genksyms kbuild: introduce hostprogs-always-y and userprogs-always-y 2020-08-10 01:32:59 +09:00
kconfig kconfig: qconf: move setOptionMode() to ConfigList from ConfigView 2020-08-14 13:47:21 +09:00
ksymoops
mod Kbuild updates for v5.9 2020-08-09 14:10:26 -07:00
package kbuild: Replace HTTP links with HTTPS ones 2020-08-10 01:32:59 +09:00
selinux Kbuild updates for v5.9 2020-08-09 14:10:26 -07:00
tracing
.gitignore
adjust_autoksyms.sh
asn1_compiler.c
bin2c.c
bloat-o-meter scripts/bloat-o-meter: Support comparing library archives 2020-08-07 11:33:21 -07:00
bootgraph.pl
bpf_helpers_doc.py bpf: Introduce SK_LOOKUP program type with a dedicated attach point 2020-07-17 20:18:16 -07:00
cc-can-link.sh
check-sysctl-docs
check_extable.sh
checkincludes.pl
checkkconfigsymbols.py kconfig: remove '---help---' support 2020-08-14 13:30:03 +09:00
checkpatch.pl Kconfig updates for v5.9 2020-08-14 11:04:45 -07:00
checkstack.pl
checksyscalls.sh
checkversion.pl
clang-version.sh
cleanfile
cleanpatch
coccicheck
config
const_structs.checkpatch const_structs.checkpatch: add regulator_ops 2020-08-07 11:33:21 -07:00
decode_stacktrace.sh scripts/decode_stacktrace.sh: guess path to vmlinux by release name 2020-08-07 11:33:21 -07:00
decodecode
depmod.sh
diffconfig
documentation-file-ref-check
export_report.pl
extract-cert.c
extract-ikconfig
extract-module-sig.pl
extract-sys-certs.pl
extract-vmlinux
extract_xc3028.pl
faddr2line
file-size.sh
find-unused-docs.sh
gcc-goto.sh
gcc-ld
gcc-plugin.sh
gcc-version.sh
gcc-x86_32-has-stack-protector.sh
gcc-x86_64-has-stack-protector.sh
gen_autoksyms.sh
gen_compile_commands.py
gen_ksymdeps.sh
get_abi.pl
get_dvb_firmware
get_maintainer.pl
gfp-translate
headerdep.pl
headers_check.pl
headers_install.sh Merge branch 'work.fdpic' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs 2020-08-07 13:29:39 -07:00
insert-sys-cert.c
jobserver-exec
kallsyms.c KVM: arm64: Add build rules for separate VHE/nVHE object files 2020-07-05 18:37:55 +01:00
Kbuild.include kbuild: stop filtering out $(GCC_PLUGINS_CFLAGS) from cc-option base 2020-08-10 01:32:59 +09:00
Kconfig.include
kernel-doc scripts/kernel-doc: optionally treat warnings as errors 2020-07-31 11:11:17 -06:00
ld-version.sh
leaking_addresses.pl
Lindent
link-vmlinux.sh Kbuild updates for v5.9 2020-08-09 14:10:26 -07:00
Makefile kbuild: introduce hostprogs-always-y and userprogs-always-y 2020-08-10 01:32:59 +09:00
Makefile.asm-generic
Makefile.build kbuild: sort hostprogs before passing it to ifneq 2020-08-10 01:32:59 +09:00
Makefile.clean kbuild: introduce hostprogs-always-y and userprogs-always-y 2020-08-10 01:32:59 +09:00
Makefile.dtbinst
Makefile.extrawarn kbuild: Move -Wtype-limits to W=2 2020-07-09 18:00:56 -07:00
Makefile.gcc-plugins gcc-plugins/stackleak: Use asm instrumentation to avoid useless register saving 2020-06-24 07:48:28 -07:00
Makefile.headersinst
Makefile.host kbuild: sort hostprogs before passing it to ifneq 2020-08-10 01:32:59 +09:00
Makefile.kasan kasan: allow enabling stack tagging for tag-based mode 2020-08-07 11:33:28 -07:00
Makefile.kcov kbuild: include scripts/Makefile.* only when relevant CONFIG is enabled 2020-08-10 01:32:59 +09:00
Makefile.kcsan kcsan: Support compounded read-write instrumentation 2020-08-24 15:09:32 -07:00
Makefile.lib Kbuild updates for v5.9 2020-08-09 14:10:26 -07:00
Makefile.modfinal
Makefile.modinst
Makefile.modpost kbuild: remove redundant FORCE definition in scripts/Makefile.modpost 2020-08-02 23:09:16 +09:00
Makefile.modsign
Makefile.package
Makefile.ubsan kbuild: include scripts/Makefile.* only when relevant CONFIG is enabled 2020-08-10 01:32:59 +09:00
Makefile.userprogs
makelst
markup_oops.pl
mkcompile_h
mkmakefile
mksysmap
mkuboot.sh
module-common.lds
modules-check.sh
namespace.pl
nsdeps scripts: add dummy report mode to add_namespace.cocci 2020-07-10 14:19:58 +02:00
objdiff
parse-maintainers.pl
patch-kernel
profile2linkerlist.pl
prune-kernel
recordmcount.c recordmcount: Fix build failure on non arm64 2020-08-10 15:22:06 +01:00
recordmcount.h
recordmcount.pl
setlocalversion
show_delta
sign-file.c
sorttable.c s390/kernel: expand exception table logic to allow new handling options 2020-07-20 10:55:50 +02:00
sorttable.h
spdxcheck-test.sh
spdxcheck.py
spelling.txt scripts/spelling.txt: add more spellings to spelling.txt 2020-08-07 11:33:21 -07:00
sphinx-pre-install docs: Don't push Sphinx upgrades quite so readily 2020-06-26 09:31:53 -06:00
split-man.pl
stackdelta
stackusage
subarch.include
tags.sh scripts/tags.sh: collect compiled source precisely 2020-08-07 11:33:21 -07:00
tools-support-relr.sh
unifdef.c
ver_linux
xen-hypercalls.sh
xz_wrap.sh