Kernel OOPs while running powerpc/mce/ selftest
Greetings!!!
IBM CI has reported a kernel crash while running mce selftests on mainline kernel, from tools/testing/selftests/powerpc/mce/.
This issue is hit when CONFIG_KASAN is enabled. If its disabled, test passes.
Traces:
[ 8041.225432] BUG: Unable to handle kernel data access on read at 0xc00e0001a1ad6103 [ 8041.225453] Faulting instruction address: 0xc0000000008c54d8 [ 8041.225461] Oops: Kernel access of bad area, sig: 11 [#1] [ 8041.225467] LE PAGE_SIZE=64K MMU=Radix SMP NR_CPUS=8192 NUMA pSeries [ 8041.225475] Modules linked in: nft_fib_inet nft_fib_ipv4 nft_fib_ipv6 nft_fib nft_reject_inet nf_reject_ipv4 nf_reject_ipv6 nft_reject nft_ct nft_chain_nat nf_nat nf_conntrack bonding tls nf_defrag_ipv6 nf_defrag_ipv4 rfkill ip_set nf_tables nfnetlink pseries_rng vmx_crypto dax_pmem fuse ext4 crc16 mbcache jbd2 nd_pmem papr_scm sd_mod libnvdimm sg ibmvscsi ibmveth scsi_transport_srp pseries_wdt [ 8041.225558] CPU: 17 UID: 0 PID: 877869 Comm: inject-ra-err Kdump: loaded Not tainted 6.18.0-rc2+ #1 VOLUNTARY [ 8041.225569] Hardware name: IBM,9080-HEX Power11 (architected) 0x820200 0xf000007 of:IBM,FW1110.01 (NH1110_069) hv:phyp pSeries [ 8041.225576] NIP: c0000000008c54d8 LR: c00000000004e464 CTR: 0000000000000000 [ 8041.225583] REGS: c0000000fff778d0 TRAP: 0300 Not tainted (6.18.0-rc2+) [ 8041.225590] MSR: 8000000000001003 <SF,ME,RI,LE> CR: 48002828 XER: 00000000 [ 8041.225607] CFAR: c00000000004e460 DAR: c00e0001a1ad6103 DSISR: 40000000 IRQMASK: 3 [ 8041.225607] GPR00: c0000000019d0598 c0000000fff77b70 c00000000244a400 c000000d0d6b0818 [ 8041.225607] GPR04: 0000000000004d43 0000000000000008 c00000000004e464 004d424900000000 [ 8041.225607] GPR08: 0000000000000001 18000001a1ad6103 a80e000000000000 0000000003000048 [ 8041.225607] GPR12: 0000000000000000 c000000d0ddf3300 0000000000000000 0000000000000000 [ 8041.225607] GPR16: 0000000000000000 0000000000000000 0000000000000000 0000000000000000 [ 8041.225607] GPR20: 0000000000000000 0000000000000000 0000000000000000 0000000000000000 [ 8041.225607] GPR24: 0000000000000000 0000000000000000 0000000000000000 0000000000000000 [ 8041.225607] GPR28: c000000d0d6b0888 c000000d0d6b0800 0000000000004d43 c000000d0d6b0818 [ 8041.225701] NIP [c0000000008c54d8] __asan_load2+0x54/0xd8 [ 8041.225712] LR [c00000000004e464] pseries_errorlog_id+0x20/0x3c [ 8041.225722] Call Trace: [ 8041.225726] [c0000000fff77b90] [c0000000001f8748] fwnmi_get_errinfo+0xd4/0x104 [ 8041.225738] [c0000000fff77bc0] [c0000000019d0598] get_pseries_errorlog+0xa8/0x110 [ 8041.225750] [c0000000fff77c00] [c0000000001f8f68] pseries_machine_check_realmode+0x11c/0x214 [ 8041.225762] [c0000000fff77ce0] [c000000000049ca4] machine_check_early+0x74/0xc0 [ 8041.225771] [c0000000fff77d30] [c0000000000084a4] machine_check_early_common+0x1b4/0x2c0 [ 8041.225782] ---- interrupt: 200 at 0x100105cc [ 8041.225788] NIP: 00000000100105cc LR: 00000000100105c4 CTR: 0000000000000000 [ 8041.225795] REGS: c0000000fff77d60 TRAP: 0200 Not tainted (6.18.0-rc2+) [ 8041.225801] MSR: 8000000002a0f033 <SF,VEC,VSX,EE,PR,FP,ME,IR,DR,RI,LE> CR: 84002822 XER: 00000000 [ 8041.225829] CFAR: 000000000000021c DAR: 00007fffa0a40000 DSISR: 02000008 IRQMASK: 0 [ 8041.225829] GPR00: 00000000100105c4 00007fffdaa5bd20 0000000010047f00 00007fffa0a40000 [ 8041.225829] GPR04: 0000000000001000 0000000000000003 0000000000000001 0000000000000005 [ 8041.225829] GPR08: 0000000000000000 fffffffffffff000 0000000000000000 0000000000000000 [ 8041.225829] GPR12: 0000000000000000 00007fffa0b3ad20 0000000000000000 0000000000000000 [ 8041.225829] GPR16: 0000000000000000 0000000000000000 0000000000000000 0000000000000000 [ 8041.225829] GPR20: 0000000000000000 0000000000000000 0000000000000000 00000000100102c0 [ 8041.225829] GPR24: 00007fffa0b30000 00007fffa0b2f6c0 00007fffdaa5c408 000000001003fce8 [ 8041.225829] GPR28: 00007fffdaa5c658 0000000000000001 0000000000000005 0000000000000000 [ 8041.225919] NIP [00000000100105cc] 0x100105cc [ 8041.225925] LR [00000000100105c4] 0x100105c4 [ 8041.225930] ---- interrupt: 200 [ 8041.225934] Code: 6129ffff 792907c6 6529ffff 6129ffff 7c234840 40810058 39230001 3d40a80e 71280007 41820034 7929e8c2 794a07c6 <7d2950ae> 7d290775 40820070 38210020 [ 8041.225969] ---[ end trace 0000000000000000 ]---
If you happen to fix this issue, please add below tag.
Regards,
Venkat.
Le 23/10/2025 à 06:54, Venkat Rao Bagalkote a écrit :
Quoted 31 lines
Greetings!!!
IBM CI has reported a kernel crash while running mce selftests on mainline kernel, from
tools/testing/selftests/powerpc/mce/.This issue is hit when
CONFIG_KASANis enabled. If its disabled, test passes.Traces:
[ 8041.225432] BUG: Unable to handle kernel data access on read at 0xc00e0001a1ad6103 [ 8041.225453] Faulting instruction address: 0xc0000000008c54d8 [ 8041.225461] Oops: Kernel access of bad area, sig: 11 [#1] [ 8041.225467] LE PAGE_SIZE=64K MMU=Radix SMP NR_CPUS=8192 NUMA pSeries [ 8041.225475] Modules linked in: nft_fib_inet nft_fib_ipv4 nft_fib_ipv6 nft_fib nft_reject_inet nf_reject_ipv4 nf_reject_ipv6 nft_reject nft_ct nft_chain_nat nf_nat nf_conntrack bonding tls nf_defrag_ipv6 nf_defrag_ipv4 rfkill ip_set nf_tables nfnetlink pseries_rng vmx_crypto dax_pmem fuse ext4 crc16 mbcache jbd2 nd_pmem papr_scm sd_mod libnvdimm sg ibmvscsi ibmveth scsi_transport_srp pseries_wdt [ 8041.225558] CPU: 17 UID: 0 PID: 877869 Comm: inject-ra-err Kdump: loaded Not tainted 6.18.0-rc2+ #1 VOLUNTARY [ 8041.225569] Hardware name: IBM,9080-HEX Power11 (architected) 0x820200 0xf000007 of:IBM,FW1110.01 (NH1110_069) hv:phyp pSeries [ 8041.225576] NIP: c0000000008c54d8 LR: c00000000004e464 CTR: 0000000000000000 [ 8041.225583] REGS: c0000000fff778d0 TRAP: 0300 Not tainted (6.18.0- rc2+) [ 8041.225590] MSR: 8000000000001003 <SF,ME,RI,LE> CR: 48002828 XER: 00000000 [ 8041.225607] CFAR: c00000000004e460 DAR: c00e0001a1ad6103 DSISR: 40000000 IRQMASK: 3 [ 8041.225607] GPR00: c0000000019d0598 c0000000fff77b70 c00000000244a400 c000000d0d6b0818 [ 8041.225607] GPR04: 0000000000004d43 0000000000000008 c00000000004e464 004d424900000000 [ 8041.225607] GPR08: 0000000000000001 18000001a1ad6103 a80e000000000000 0000000003000048 [ 8041.225607] GPR12: 0000000000000000 c000000d0ddf3300 0000000000000000 0000000000000000 [ 8041.225607] GPR16: 0000000000000000 0000000000000000 0000000000000000 0000000000000000 [ 8041.225607] GPR20: 0000000000000000 0000000000000000 0000000000000000 0000000000000000 [ 8041.225607] GPR24: 0000000000000000 0000000000000000 0000000000000000 0000000000000000 [ 8041.225607] GPR28: c000000d0d6b0888 c000000d0d6b0800 0000000000004d43 c000000d0d6b0818
Quoted 8 lines
[ 8041.225701] NIP [c0000000008c54d8] __asan_load2+0x54/0xd8 [ 8041.225712] LR [c00000000004e464] pseries_errorlog_id+0x20/0x3c [ 8041.225722] Call Trace: [ 8041.225726] [c0000000fff77b90] [c0000000001f8748] fwnmi_get_errinfo+0xd4/0x104 [ 8041.225738] [c0000000fff77bc0] [c0000000019d0598] get_pseries_errorlog+0xa8/0x110 [ 8041.225750] [c0000000fff77c00] [c0000000001f8f68] pseries_machine_check_realmode+0x11c/0x214 [ 8041.225762] [c0000000fff77ce0] [c000000000049ca4] machine_check_early+0x74/0xc0 [ 8041.225771] [c0000000fff77d30] [c0000000000084a4] machine_check_early_common+0x1b4/0x2c0
Is it a new problem or has it always been there ?
The problem is because KASAN is not compatible with realmode (MMU translation is OFF).
pseries_machine_check_realmode() is located in arch/powerpc/platforms/pseries/ras.c built with KASAN_SANITIZE_ras.o := n
But pseries_machine_check_realmode() calls mce_handle_error() which calls get_pseries_errorlog().
get_pseries_errorlog() is in arch/powerpc/kernel/rtas.c which is _not_ built with KASAN_SANITIZE disabled hence the Oops.
Unrelated, but it looks like there is also a problem with commit cc15ff327569 ("powerpc/mce: Avoid using irq_work_queue() in realmode"), which removed the re-enabling of translation but left the call to mce_handle_err_virtmode().
Christophe
Quoted 43 lines · Christophe Leroy
Le 23/10/2025 à 06:54, Venkat Rao Bagalkote a écrit :
Quoted 31 lines
Greetings!!!
IBM CI has reported a kernel crash while running mce selftests on mainline kernel, from
tools/testing/selftests/powerpc/mce/.This issue is hit when
CONFIG_KASANis enabled. If its disabled, test passes.Traces:
[ 8041.225432] BUG: Unable to handle kernel data access on read at 0xc00e0001a1ad6103 [ 8041.225453] Faulting instruction address: 0xc0000000008c54d8 [ 8041.225461] Oops: Kernel access of bad area, sig: 11 [#1] [ 8041.225467] LE PAGE_SIZE=64K MMU=Radix SMP NR_CPUS=8192 NUMA pSeries [ 8041.225475] Modules linked in: nft_fib_inet nft_fib_ipv4 nft_fib_ipv6 nft_fib nft_reject_inet nf_reject_ipv4 nf_reject_ipv6 nft_reject nft_ct nft_chain_nat nf_nat nf_conntrack bonding tls nf_defrag_ipv6 nf_defrag_ipv4 rfkill ip_set nf_tables nfnetlink pseries_rng vmx_crypto dax_pmem fuse ext4 crc16 mbcache jbd2 nd_pmem papr_scm sd_mod libnvdimm sg ibmvscsi ibmveth scsi_transport_srp pseries_wdt [ 8041.225558] CPU: 17 UID: 0 PID: 877869 Comm: inject-ra-err Kdump: loaded Not tainted 6.18.0-rc2+ #1 VOLUNTARY [ 8041.225569] Hardware name: IBM,9080-HEX Power11 (architected) 0x820200 0xf000007 of:IBM,FW1110.01 (NH1110_069) hv:phyp pSeries [ 8041.225576] NIP: c0000000008c54d8 LR: c00000000004e464 CTR: 0000000000000000 [ 8041.225583] REGS: c0000000fff778d0 TRAP: 0300 Not tainted (6.18.0- rc2+) [ 8041.225590] MSR: 8000000000001003 <SF,ME,RI,LE> CR: 48002828 XER: 00000000 [ 8041.225607] CFAR: c00000000004e460 DAR: c00e0001a1ad6103 DSISR: 40000000 IRQMASK: 3 [ 8041.225607] GPR00: c0000000019d0598 c0000000fff77b70 c00000000244a400 c000000d0d6b0818 [ 8041.225607] GPR04: 0000000000004d43 0000000000000008 c00000000004e464 004d424900000000 [ 8041.225607] GPR08: 0000000000000001 18000001a1ad6103 a80e000000000000 0000000003000048 [ 8041.225607] GPR12: 0000000000000000 c000000d0ddf3300 0000000000000000 0000000000000000 [ 8041.225607] GPR16: 0000000000000000 0000000000000000 0000000000000000 0000000000000000 [ 8041.225607] GPR20: 0000000000000000 0000000000000000 0000000000000000 0000000000000000 [ 8041.225607] GPR24: 0000000000000000 0000000000000000 0000000000000000 0000000000000000 [ 8041.225607] GPR28: c000000d0d6b0888 c000000d0d6b0800 0000000000004d43 c000000d0d6b0818Quoted 8 lines
[ 8041.225701] NIP [c0000000008c54d8] __asan_load2+0x54/0xd8 [ 8041.225712] LR [c00000000004e464] pseries_errorlog_id+0x20/0x3c [ 8041.225722] Call Trace: [ 8041.225726] [c0000000fff77b90] [c0000000001f8748] fwnmi_get_errinfo+0xd4/0x104 [ 8041.225738] [c0000000fff77bc0] [c0000000019d0598] get_pseries_errorlog+0xa8/0x110 [ 8041.225750] [c0000000fff77c00] [c0000000001f8f68] pseries_machine_check_realmode+0x11c/0x214 [ 8041.225762] [c0000000fff77ce0] [c000000000049ca4] machine_check_early+0x74/0xc0 [ 8041.225771] [c0000000fff77d30] [c0000000000084a4] machine_check_early_common+0x1b4/0x2c0
Quoted 1 line
Is it a new problem or has it always been there ?
Its not a new problem. I have enabled KASAN recently in the config, and then I started seeing this issue.
I have tested on 6.17, 6.16 and 6.15 kernels and issues is there all along.
Regards,
Venkat.
Quoted 13 lines
The problem is because KASAN is not compatible with realmode (MMU translation is OFF).
pseries_machine_check_realmode()is located inarch/powerpc/platforms/pseries/ras.cbuilt with KASAN_SANITIZE_ras.o := nBut
pseries_machine_check_realmode()callsmce_handle_error()which callsget_pseries_errorlog().
get_pseries_errorlog()is inarch/powerpc/kernel/rtas.cwhich is _not_ built withKASAN_SANITIZEdisabled hence the Oops.Unrelated, but it looks like there is also a problem with commit
cc15ff327569("powerpc/mce: Avoid usingirq_work_queue()in realmode"), which removed the re-enabling of translation but left the call tomce_handle_err_virtmode().Christophe