summaryrefslogtreecommitdiff
path: root/tools/perf/scripts/python
diff options
context:
space:
mode:
authorVenkat Rao Bagalkote <venkat88@linux.ibm.com>2026-09-09 18:02:40 +0530
committerMadhavan Srinivasan <maddy@linux.ibm.com>2026-09-29 22:12:27 +0530
commit644ffb02746690c0ebfe143e066f81c9bde2975e (patch)
tree92cf47964a0e78ddefa8997d187975ee6ce7d509 /tools/perf/scripts/python
parent31895b0ff96778b524c74b43a108090581271603 (diff)
powerpc/interrupt: Use early_radix_enabled() in NMI real-mode guard
radix_enabled() uses a jump label which is only valid after setup_feature_keys() is called. Before that point, on a pSeries hash guest, early_check_vec5() clears MMU_FTR_TYPE_RADIX in cur_cpu_spec->mmu_features, but the jump label has not yet been patched, so radix_enabled() incorrectly returns true. The dangerous usage window where it goes wrong in early_setup(): early_setup: configure_exceptions(); <exceptions can happen now, and handler enter/exit can be invoked> <those could use radix_enabled(), which returns stale true> setup_feature_keys(); <jump labels set up; post this it is safe to use radix_enabled()> If an NMI occurs in this window, !radix_enabled() evaluates to false in DEFINE_INTERRUPT_HANDLER_NMI. The handler fails to skip NMI entry in real mode and attempts to access memory outside the Real Mode Area (RMA), hanging the boot. Since common interrupt wrappers do not have the context of early or late, using early_radix_enabled() is the safer option. It does a plain bitmask check against cur_cpu_spec->mmu_features and is correct at all times. Console logs from a pSeries HASH guest showing values across boot stages: [ 0.000000] DEBUG: after early_init_devtree: early_radix_enabled=0 radix_enabled=1 (mismatch means NMI real-mode check is unsafe!) [ 0.000000] DEBUG: after configure_exceptions (DANGEROUS WINDOW): early_radix_enabled=0 radix_enabled=1 [ 0.000000] DEBUG: after setup_feature_keys (jump labels initialized): early_radix_enabled=0 radix_enabled=0 (should now match!) [ 0.057124] DEBUG: post secondary CPU bringup: early_radix_enabled=0 radix_enabled=0 (should match!) Console logs from a RADIX guest showing values across boot stages: [ 0.000000] DEBUG: after early_init_devtree: early_radix_enabled=1 radix_enabled=1 (mismatch means NMI real-mode check is unsafe!) [ 0.000000] DEBUG: after configure_exceptions (DANGEROUS WINDOW): early_radix_enabled=1 radix_enabled=1 [ 0.000000] DEBUG: after setup_feature_keys (jump labels initialized): early_radix_enabled=1 radix_enabled=1 (should now match!) [ 0.057016] DEBUG: post secondary CPU bringup: early_radix_enabled=1 radix_enabled=1 (should match!) Add the missing #include <asm/mmu.h> in alphabetical order since early_radix_enabled() is declared there. Fixes: 8d0e21012743 ("powerpc/mce: Avoid nmi_enter/exit in real mode on pseries hash") Signed-off-by: Venkat Rao Bagalkote <venkat88@linux.ibm.com> Reviewed-by: Mukesh Kumar Chaurasiya <mkchauras@gmail.com> Reviewed-by: Shrikanth Hegde <sshegde@linux.ibm.com> Signed-off-by: Madhavan Srinivasan <maddy@linux.ibm.com> Link: https://patch.msgid.link/20260909123240.58786-1-venkat88@linux.ibm.com
Diffstat (limited to 'tools/perf/scripts/python')
0 files changed, 0 insertions, 0 deletions