aboutsummaryrefslogtreecommitdiff
path: root/tools/perf/util/trace-event-scripting.c
diff options
context:
space:
mode:
authorAlexandru Elisei <[email protected]>2021-10-11 11:58:38 +0100
committerMarc Zyngier <[email protected]>2021-10-11 14:13:58 +0100
commit00d5101b254b77c35a8d55fe46331b19192866f3 (patch)
treea384c14debab6892e1ab0ae5fd4261e01dec223c /tools/perf/util/trace-event-scripting.c
parent9e1ff307c779ce1f0f810c7ecce3d95bbae40896 (diff)
KVM: arm64: Return early from read_id_reg() if register is RAZ
If read_id_reg() is called for an ID register which is Read-As-Zero (RAZ), it initializes the return value to zero, then goes through a list of registers which require special handling before returning the final value. By not returning as soon as it checks that the register should be RAZ, the function creates the opportunity for bugs, if, for example, a patch changes a register to RAZ (like has happened with PMSWINC_EL0 in commit 11663111cd49), but doesn't remove the special handling from read_id_reg(); or if a register is RAZ in certain situations, but readable in others. Return early to make it impossible for a RAZ register to be anything other than zero. Reviewed-by: Andrew Jones <[email protected]> Signed-off-by: Alexandru Elisei <[email protected]> Signed-off-by: Marc Zyngier <[email protected]> Link: https://lore.kernel.org/r/[email protected]
Diffstat (limited to 'tools/perf/util/trace-event-scripting.c')
0 files changed, 0 insertions, 0 deletions