From: Shuai Xue <xueshuai@linux.alibaba.com>
To: hejunhao <hejunhao3@h-partners.com>,
rafael@kernel.org, tony.luck@intel.com, guohanjun@huawei.com,
mchehab@kernel.org, jarkko@kernel.org, yazen.ghannam@amd.com,
jane.chu@oracle.com, lenb@kernel.org, linmiaohe@huawei.com,
Borislav Petkov <bp@alien8.de>
Cc: linux-acpi@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org, linux-edac@vger.kernel.org,
tanxiaofei@huawei.com, liuyonglong@huawei.com,
mawupeng1@huawei.com
Subject: Re: [PATCH v2] ACPI: APEI: Handle repeated SEA error storms
Date: Wed, 8 Jul 2026 09:42:58 +0800 [thread overview]
Message-ID: <3f77c23d-5f04-4617-99f9-b08b1740cc21@linux.alibaba.com> (raw)
In-Reply-To: <6ebea989-81c7-6237-1a31-8d6975796680@h-partners.com>
+ Tony, and BP,
On 7/2/26 8:50 PM, hejunhao wrote:
> Gentle ping for this one, and it's ready.
>
> Best regards,
>
>
> On 2026/5/27 16:27, Junhao He wrote:
>> When hardware memory corruption occurs and a user process accesses the
>> corrupted page, the CPU triggers a Synchronous External Abort (SEA).
>> The kernel invokes do_sea() to handle the exception, which calls
>> memory_failure() to handle the faulty page.
>>
>> Scenario 1: Memory Error Interrupt First, then SEA
>> The page is already poisoned by the memory error interrupt path. The
>> subsequent SEA handler sends a SIGBUS to the task, which accesses the
>> poisoned page. This flow is correct.
>>
>> Scenario 2: SEA first, then memory error interrupt (problematic scenario)
>> If a user task directly accesses corrupted memory through a PFNMAP-style
>> mapping (e.g., devmem), the page may still be in the free-buddy state when
>> SEA is handled. In this case, memory_failure() will poison the page without
>> invoking kill_accessing_process(), and then takes the free-buddy recovery
>> path.
>>
>> After the CPU returns to the task context, the task re-enters the SEA
>> handler due to the same access. However, ghes_estatus_cached() suppresses
>> all subsequent entries during the 10-second window, preventing
>> ghes_do_proc() from being called. This suppression blocks the
>> MF_ACTION_REQUIRED-based SIGBUS delivery, causing the kernel to fail to
>> kill the task immediately. Consequently, the process keeps re-entering
>> the SEA handler, leading to an SEA storm. Later, the memory error
>> interrupt path also cannot kill the task, leaving the system stuck in
>> this repeated loop.
>>
>> The following error logs are explained using the devmem process:
>> NOTICE: SEA Handle
>> [Hardware Error]: Hardware error from APEI Generic Hardware Error Source: 9
>> [Hardware Error]: event severity: recoverable
>> [Hardware Error]: section_type: ARM processor error
>> [Hardware Error]: physical fault address: 0x0000001000093c00
>> [T54990] Memory failure: 0x1000093: recovery action for free buddy page: Recovered
>> [ T9955] EDAC MC0: 1 UE Multi-bit ECC on unknown memory
>> (page:0x1000093 offset:0xc00 grain:1 - APEI location: ...)
>> NOTICE: SEA Handle
>> NOTICE: SEA Handle
>> ...
>> ... ---> SEA storm
>> ...
>> NOTICE: SEA Handle
>> [ T9955] Memory failure: 0x1000093: already hardware poisoned
>> ghes_print_estatus: 1 callbacks suppressed
>> [Hardware Error]: Hardware error from APEI Generic Hardware Error Source: 9
>> [Hardware Error]: event severity: recoverable
>> [Hardware Error]: section_type: ARM processor error
>> [Hardware Error]: physical fault address: 0x0000001000093c00
>> [T54990] Memory failure: 0x1000093: already hardware poisoned
>> [T54990] 0x1000093: Sending SIGBUS to devmem:54990 due to hardware memory corruption
>>
>> To resolve this, return an error when encountering the same SEA again.
>> The subsequent SEA handler invocation uses arm64_notify_die() to send a
>> SIGBUS signal to the task, which terminates the process and prevents it
>> from re-entering the handler loop.
>>
>> Signed-off-by: Junhao He <hejunhao3@h-partners.com>
>> ---
>> drivers/acpi/apei/ghes.c | 10 +++++++++-
>> 1 file changed, 9 insertions(+), 1 deletion(-)
>>
>> Changes in V2:
>> 1. update the commit message per suggestion from Xueshuai
>> 2. Add a check to only return failure on the ghes_notify_sea() path,
>> avoiding impact on other NMI-type GHES handlers.
>> Link to V1 - https://lore.kernel.org/all/20251030071321.2763224-1-hejunhao3@h-partners.com/
>>
>> diff --git a/drivers/acpi/apei/ghes.c b/drivers/acpi/apei/ghes.c
>> index 3236a3ce79d6..787664740150 100644
>> --- a/drivers/acpi/apei/ghes.c
>> +++ b/drivers/acpi/apei/ghes.c
>> @@ -1383,8 +1383,16 @@ static int ghes_in_nmi_queue_one_entry(struct ghes *ghes,
>> ghes_clear_estatus(ghes, &tmp_header, buf_paddr, fixmap_idx);
>>
>> /* This error has been reported before, don't process it again. */
>> - if (ghes_estatus_cached(estatus))
>> + if (ghes_estatus_cached(estatus)) {
>> + /*
>> + * Return failure on duplicate SEA entries so that the
>> + * subsequent SEA handler invocation sends a SIGBUS signal to
>> + * the task to prevent it from re-entering the handler loop.
>> + */
>> + if (is_hest_sync_notify(ghes))
>> + rc = -ECANCELED;
>> goto no_work;
>> + }
>>
>> llist_add(&estatus_node->llnode, &ghes_estatus_llist);
>>
Hello Tony, BP,
Could you please take a look at this patch?
Since `ghes_in_nmi_queue_one_entry()` is a common path for both ARM64
and x86, an Ack from the x86 side would be appreciated.
For ARM part, look good to me.
Reviewed-by: Shuai Xue <xueshuai@linux.alibaba.com>
Thanks.
Shuai
next prev parent reply other threads:[~2026-07-08 1:43 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-27 8:27 [PATCH v2] ACPI: APEI: Handle repeated SEA error storms Junhao He
2026-05-28 1:48 ` mawupeng
2026-07-02 12:50 ` hejunhao
2026-07-02 13:01 ` Rafael J. Wysocki (Intel)
2026-07-08 1:42 ` Shuai Xue [this message]
2026-07-08 17:14 ` Luck, Tony
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=3f77c23d-5f04-4617-99f9-b08b1740cc21@linux.alibaba.com \
--to=xueshuai@linux.alibaba.com \
--cc=bp@alien8.de \
--cc=guohanjun@huawei.com \
--cc=hejunhao3@h-partners.com \
--cc=jane.chu@oracle.com \
--cc=jarkko@kernel.org \
--cc=lenb@kernel.org \
--cc=linmiaohe@huawei.com \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-edac@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=liuyonglong@huawei.com \
--cc=mawupeng1@huawei.com \
--cc=mchehab@kernel.org \
--cc=rafael@kernel.org \
--cc=tanxiaofei@huawei.com \
--cc=tony.luck@intel.com \
--cc=yazen.ghannam@amd.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox