[PATCH v3] tools/mm: add hwpoison-panic tool
David Hildenbrand (Arm)
david at kernel.org
Wed Nov 4 07:34:21 PST 2026
On 11/4/26 15:43, Breno Leitao wrote:
> On Wed, Nov 04, 2026 at 03:35:16PM +0100, David Hildenbrand (Arm) wrote:
>> 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?
>
> Right. :-(
>
>> Anything missing or is this good to go in?
>
> I would say this is good to go, David.
Agreed, nothing jumped at me and this is useful.
Acked-by: David Hildenbrand (Arm) <david at kernel.org>
@Andrew will you pick this up?
--
Cheers,
David
More information about the linux-riscv
mailing list