summaryrefslogtreecommitdiff
path: root/tools/perf/scripts/python/arm-cs-trace-disasm.py
diff options
context:
space:
mode:
authorMarc Zyngier <maz@kernel.org>2024-11-17 19:57:57 +0300
committerOliver Upton <oliver.upton@linux.dev>2024-11-21 04:21:08 +0300
commit3b2c81d5feb250dfdcb0ef5825319f36c29f8336 (patch)
treeb5940a48a887e423f602cefd4440ba1f03795059 /tools/perf/scripts/python/arm-cs-trace-disasm.py
parente7619f2a2f8f9b10feb784ec6b8ea5320ad3b97e (diff)
downloadlinux-3b2c81d5feb250dfdcb0ef5825319f36c29f8336.tar.xz
KVM: arm64: vgic-its: Add stronger type-checking to the ITS entry sizes
The ITS ABI infrastructure allows for some pretty lax code, where the size of the data doesn't have to match the size of the entry, potentially leading to a collection of interesting bugs. Commit 7fe28d7e68f9 ("KVM: arm64: vgic-its: Add a data length check in vgic_its_save_*") added some checks, but starts by implicitly casting all writes to a 64bit value, hiding some of the issues. Instead, introduce macros that will check the data type actually used for dealing with the table entries. The macros are taking a symbolic entry type that is used to fetch the size of the entry type for the current ABI. This immediately catches a couple of low-impact gotchas (zero values that are implicitly 32bit), easy enough to fix. Given that we currently only have a single ABI, hardcode a couple of BUILD_BUG_ON()s that will fire if we use anything but a 64bit quantity, and some (currently unreachable) fallback code that may become useful one day. Signed-off-by: Marc Zyngier <maz@kernel.org> Link: https://lore.kernel.org/r/20241117165757.247686-5-maz@kernel.org Signed-off-by: Oliver Upton <oliver.upton@linux.dev>
Diffstat (limited to 'tools/perf/scripts/python/arm-cs-trace-disasm.py')
0 files changed, 0 insertions, 0 deletions