From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7F48DD3E78D for ; Wed, 6 Nov 2024 06:07:26 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 7BA406B0085; Wed, 6 Nov 2024 01:07:25 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 743096B0088; Wed, 6 Nov 2024 01:07:25 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 60AC06B0089; Wed, 6 Nov 2024 01:07:25 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id 419FE6B0085 for ; Wed, 6 Nov 2024 01:07:25 -0500 (EST) Received: from smtpin15.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id A676C121993 for ; Wed, 6 Nov 2024 06:07:24 +0000 (UTC) X-FDA: 82754637210.15.6EC4D47 Received: from out30-131.freemail.mail.aliyun.com (out30-131.freemail.mail.aliyun.com [115.124.30.131]) by imf05.hostedemail.com (Postfix) with ESMTP id D14CA100028 for ; Wed, 6 Nov 2024 06:06:17 +0000 (UTC) Authentication-Results: imf05.hostedemail.com; dkim=pass header.d=linux.alibaba.com header.s=default header.b=kSlx7nSh; spf=pass (imf05.hostedemail.com: domain of xueshuai@linux.alibaba.com designates 115.124.30.131 as permitted sender) smtp.mailfrom=xueshuai@linux.alibaba.com; dmarc=pass (policy=none) header.from=linux.alibaba.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1730873058; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=ifC7maoPLJGfpi4Xs27e8HUfbbxX8LbnbtLNxWgwIr4=; b=0Vi5GG4RAXMNNYiFy/NkEGymYCui9jKLobPma24dvYEq4blaj0dDUqSOm6yW6ivPJiDfbN rUGBJ2fG43zQQIuljx3qTzhEbofdjAIxyZoOt2mrzyuKEKxTGyEWiOxiFGF1qM7H3HE/eY h8WClzoO38oDYYhHLXn1LARRCnNfz3E= ARC-Authentication-Results: i=1; imf05.hostedemail.com; dkim=pass header.d=linux.alibaba.com header.s=default header.b=kSlx7nSh; spf=pass (imf05.hostedemail.com: domain of xueshuai@linux.alibaba.com designates 115.124.30.131 as permitted sender) smtp.mailfrom=xueshuai@linux.alibaba.com; dmarc=pass (policy=none) header.from=linux.alibaba.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1730873058; a=rsa-sha256; cv=none; b=jCM8z7YrbGNDBPWrr8iJoz5IpIKCv6Y4/jqYP3y8um/I4KsyuQLyliB99Im5Awq3cMzrjZ 5a9dS5Bz2AhsL+1DQurdyK3c3dfyQhYaaiDecwG/NzGizQTnja80OXvGfORAVW2k+6Kqc9 gkjAI6NpTtJN7fKOBmroTCdqpg3+Hn8= DKIM-Signature:v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.alibaba.com; s=default; t=1730873239; h=Message-ID:Date:MIME-Version:Subject:To:From:Content-Type; bh=ifC7maoPLJGfpi4Xs27e8HUfbbxX8LbnbtLNxWgwIr4=; b=kSlx7nSh5m/L0DCqndEUHIPPBMMAF2PxDPJVr6CfXraqoyY5/1b7DXKMOJ57se7oewzDmvIoF2n+a82tcREit5URAn5k2UQcE+d4W/q0HZZK7aFrXH8EfahM7hkHnIJFXPu8km6lZ+u1CH7Ef+QD6uFgxot8rVynIQNirsjp4R8= Received: from 30.246.162.170(mailfrom:xueshuai@linux.alibaba.com fp:SMTPD_---0WIqDixT_1730873235 cluster:ay36) by smtp.aliyun-inc.com; Wed, 06 Nov 2024 14:07:17 +0800 Message-ID: <64dff7c7-95c9-48e5-b549-ec37ed6a6587@linux.alibaba.com> Date: Wed, 6 Nov 2024 14:07:14 +0800 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v16 1/3] ACPI: APEI: send SIGBUS to current task if synchronous memory error not recovered To: Yazen Ghannam Cc: mark.rutland@arm.com, catalin.marinas@arm.com, mingo@redhat.com, robin.murphy@arm.com, Jonathan.Cameron@huawei.com, bp@alien8.de, rafael@kernel.org, wangkefeng.wang@huawei.com, tanxiaofei@huawei.com, mawupeng1@huawei.com, tony.luck@intel.com, linmiaohe@huawei.com, naoya.horiguchi@nec.com, james.morse@arm.com, tongtiangen@huawei.com, gregkh@linuxfoundation.org, will@kernel.org, jarkko@kernel.org, linux-acpi@vger.kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, akpm@linux-foundation.org, linux-edac@vger.kernel.org, x86@kernel.org, justin.he@arm.com, ardb@kernel.org, ying.huang@intel.com, ashish.kalra@amd.com, baolin.wang@linux.alibaba.com, tglx@linutronix.de, dave.hansen@linux.intel.com, lenb@kernel.org, hpa@zytor.com, robert.moore@intel.com, lvying6@huawei.com, xiexiuqi@huawei.com, zhuo.song@linux.alibaba.com References: <20221027042445.60108-1-xueshuai@linux.alibaba.com> <20241104015430.98599-2-xueshuai@linux.alibaba.com> <20241105150945.GE916505@yaz-khff2.amd.com> From: Shuai Xue In-Reply-To: <20241105150945.GE916505@yaz-khff2.amd.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Rspamd-Server: rspam07 X-Rspamd-Queue-Id: D14CA100028 X-Stat-Signature: ugxpqih9fguj5qi6cqk57yn6591kynk4 X-Rspam-User: X-HE-Tag: 1730873177-334746 X-HE-Meta: U2FsdGVkX1/KYdJPmF4CXFXw9T4JknQLNECuS95DnsYkehlj0WSliaXzUvBQBg1dxNF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/IaLl1uM8CKulgxV/NmMIVls4go7CEnQpW/aZFHsu/EbpugAK4ot/UGTAjmYklKJvSg0SG8pMj06nwb1TZWf804cpefEumcvrKn96scxJsu0QTYfntJRuYC/a199KWcJubp6wCX4A+SG7fKkg7xrjiq8s5tShiwQx1pfKghT7iVvQ4W9+Et3vBbGzY3kwaPN5s9vZy9vzQhOjRC+6Vw== X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: 在 2024/11/5 23:09, Yazen Ghannam 写道: > On Mon, Nov 04, 2024 at 09:54:28AM +0800, Shuai Xue wrote: >> Synchronous error was detected as a result of user-space process accessing >> a 2-bit uncorrected error. The CPU will take a synchronous error exception >> such as Synchronous External Abort (SEA) on Arm64. The kernel will queue a >> memory_failure() work which poisons the related page, unmaps the page, and >> then sends a SIGBUS to the process, so that a system wide panic can be >> avoided. >> >> However, no memory_failure() work will be queued when abnormal synchronous >> errors occur. These errors can include situations such as invalid PA, >> unexpected severity, no memory failure config support, invalid GUID >> section, etc. In such case, the user-space process will trigger SEA again. >> This loop can potentially exceed the platform firmware threshold or even >> trigger a kernel hard lockup, leading to a system reboot. >> >> Fix it by performing a force kill if no memory_failure() work is queued >> for synchronous errors. >> >> Signed-off-by: Shuai Xue >> Reviewed-by: Jarkko Sakkinen >> Reviewed-by: Jonathan Cameron >> --- >> drivers/acpi/apei/ghes.c | 10 ++++++++++ >> 1 file changed, 10 insertions(+) >> >> diff --git a/drivers/acpi/apei/ghes.c b/drivers/acpi/apei/ghes.c >> index ada93cfde9ba..af3339dd3817 100644 >> --- a/drivers/acpi/apei/ghes.c >> +++ b/drivers/acpi/apei/ghes.c >> @@ -801,6 +801,16 @@ static bool ghes_do_proc(struct ghes *ghes, >> } >> } >> >> + /* >> + * If no memory failure work is queued for abnormal synchronous >> + * errors, do a force kill. >> + */ >> + if (sync && !queued) { >> + pr_err(HW_ERR GHES_PFX "%s:%d: hardware memory corruption (SIGBUS)\n", > > Is this always a memory error? The code flow above implies that an > unrecoverable ARM processor error can all be !queued. So should the > message be more generic like "synchronous unrecoverable error" or > similar? Yes, you are right. Will fix it. > > In any case, this is just a minor nit if this is not an issue in > practice. > > Reviewed-by: Yazen Ghannam > > Thanks, > Yazen Thank you for valuable comments. Shuai