linux/kernel/kcsan
Mark Rutland 6f2d98192c kcsan: Simplify value change detection
In kcsan_setup_watchpoint() we store snapshots of a watched value into a
union of u8/u16/u32/u64 sized fields, modify this in place using a
consistent field, then later check for any changes via the u64 field.

We can achieve the safe effect more simply by always treating the field
as a u64, as smaller values will be zero-extended. As the values are
zero-extended, we don't need to truncate the access_mask when we apply
it, and can always apply the full 64-bit access_mask to the 64-bit
value.

Finally, we can store the two snapshots and calculated difference
separately, which makes the code a little easier to read, and will
permit reporting the old/new values in subsequent patches.

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

Signed-off-by: Mark Rutland <mark.rutland@arm.com>
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: Simplify value change detection 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: Add missing license and copyright headers 2021-03-08 14:27:43 -08:00
Makefile kcsan: Make test follow KUnit style recommendations 2021-03-08 14:27:43 -08:00
report.c kcsan: Add missing license and copyright headers 2021-03-08 14:27:43 -08:00
selftest.c kcsan: Add missing license and copyright headers 2021-03-08 14:27:43 -08:00