[PATCH v3] tools/mm: add hwpoison-panic tool
David Hildenbrand (Arm)
david at kernel.org
Wed Nov 4 06:35:16 PST 2026
On 8/13/26 13:45, Breno Leitao wrote:
> Add a tool that enables the vm.panic_on_unrecoverable_memory_failure
> sysctl, picks a kernel-owned PFN and writes its physical address to
> hard_offline_page. Three page kinds are selectable with -k: rodata
> (default), slab or pgtable. In all cases the host should panic.
>
> Example:
>
> # ./hwpoison-panic -k slab --yes-panic-my-kernel
> injecting hwpoison at phys 0x100032000 (pfn 0x100032, kind=slab)
> expecting kernel panic: 'Memory failure: <pfn>: unrecoverable page'
>
> In dmesg, you will see:
>
> Memory failure: 0x100032: unhandlable page.
> Memory failure: 0x100032: recovery action for reserved kernel page: Ignored
> Kernel panic - not syncing: Memory failure: 0x100032: unrecoverable page
>
> This lives in tools/mm rather than selftests/mm because every successful
> run crashes the machine, which is not something to run from CI.
>
> The --yes-panic-my-kernel argument is required so an accidental
> invocation does not take the box down.
This is not upstream yet, right?
Anything missing or is this good to go in?
--
Cheers,
David
More information about the linux-riscv
mailing list