Re: [PATCH v2] x86/mce: Set PG_hwpoison page flag to avoid the capture kernel panic

From: HORIGUCHI NAOYA(堀口 直也)
Date: Mon Mar 27 2023 - 04:42:16 EST


On Mon, Mar 27, 2023 at 10:33:58AM +0800, Zhiquan Li wrote:
> Kdump can exclude the HWPosion page to avoid touch the error page
> again, the prerequisite is the PG_hwpoison page flag is set.
> However, for some MCE fatal error cases, there is no opportunity
> to queue a task for calling memory_failure(), as a result,
> the capture kernel touches the error page again and panics.
>
> Add function mce_set_page_hwpoison_now() which marks a page as
> HWPoison before kernel panic() for MCE error, so that the dump
> program can check and skip the error page and prevent the capture
> kernel panic.
>
> [Tony: Changed TestSetPageHWPoison() to SetPageHWPoison()]
>
> Co-developed-by: Youquan Song <youquan.song@xxxxxxxxx>
> Signed-off-by: Youquan Song <youquan.song@xxxxxxxxx>
> Signed-off-by: Zhiquan Li <zhiquan1.li@xxxxxxxxx>
> Signed-off-by: Tony Luck <tony.luck@xxxxxxxxx>

Looks good to me, thank you.

Reviewed-by: Naoya Horiguchi <naoya.horiguchi@xxxxxxx>