linux/kernel/kcsan
Mark Rutland 793c2579be kcsan: Distinguish kcsan_report() calls
Currently kcsan_report() is used to handle three distinct cases:

* The caller hit a watchpoint when attempting an access. Some
  information regarding the caller and access are recorded, but no
  output is produced.

* A caller which previously setup a watchpoint detected that the
  watchpoint has been hit, and possibly detected a change to the
  location in memory being watched. This may result in output reporting
  the interaction between this caller and the caller which hit the
  watchpoint.

* A caller detected a change to a modification to a memory location
  which wasn't detected by a watchpoint, for which there is no
  information on the other thread. This may result in output reporting
  the unexpected change.

... depending on the specific case the caller has distinct pieces of
information available, but the prototype of kcsan_report() has to handle
all three cases. This means that in some cases we pass redundant
information, and in others we don't pass all the information we could
pass. This also means that the report code has to demux these three
cases.

So that we can pass some additional information while also simplifying
the callers and report code, add separate kcsan_report_*() functions for
the distinct cases, updating callers accordingly. As the watchpoint_idx
is unused in the case of kcsan_report_unknown_origin(), this passes a
dummy value into kcsan_report(). Subsequent patches will refactor the
report code to avoid this.

There should be no functional change as a result of this patch.

Signed-off-by: Mark Rutland <mark.rutland@arm.com>
[ elver@google.com: try to make kcsan_report_*() names more descriptive ]
Signed-off-by: Marco Elver <elver@google.com>
Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
2021-05-18 10:58:14 -07:00
..
atomic.h kcsan: Add missing license and copyright headers 2021-03-08 14:27:43 -08:00
core.c kcsan: Distinguish kcsan_report() calls 2021-05-18 10:58:14 -07:00
debugfs.c kcsan: Fix debugfs initcall return type 2021-05-18 10:58:02 -07:00
encoding.h kcsan: Add missing license and copyright headers 2021-03-08 14:27:43 -08:00
kcsan_test.c kcsan: Fix printk format string 2021-04-22 14:36:03 +02:00
kcsan.h kcsan: Distinguish kcsan_report() calls 2021-05-18 10:58:14 -07:00
Makefile kcsan: Make test follow KUnit style recommendations 2021-03-08 14:27:43 -08:00
report.c kcsan: Distinguish kcsan_report() calls 2021-05-18 10:58:14 -07:00
selftest.c kcsan: Add missing license and copyright headers 2021-03-08 14:27:43 -08:00