Received: by 2002:a05:7412:bbc7:b0:fc:a2b0:25d7 with SMTP id kh7csp1767757rdb; Sun, 4 Feb 2024 00:02:28 -0800 (PST) X-Google-Smtp-Source: AGHT+IHnElqlLm0yVEqgDSYsVTJLJBsRb4yIdSh4FEsGlob3KRVjASuYqY8fvAW66MKvCRlzXybs X-Received: by 2002:a05:6214:c82:b0:68c:908e:eae1 with SMTP id r2-20020a0562140c8200b0068c908eeae1mr3997863qvr.26.1707033747980; Sun, 04 Feb 2024 00:02:27 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707033747; cv=pass; d=google.com; s=arc-20160816; b=QvxjIBRADn9QrwDDZjzNXN+/df2gdzRF26YT0Ty7te8X0N3CwELiABQAyWVutgDDUQ KukGJR04XN5FHvy4GEfM/UqAxu9dz2LBehptBojD2E3SgxldXdA7rI+bGMRrEM+SgolM fn62PNFpyeJs1KjjzC0cN8lOf5j0xFMq0gWLniAhcOUF9xz7pOj1kxN6/O3cTIeVEgk3 R2Ral7NCqfe45pzOGKg/TCKQ1Bi9rmP9019uXI3LX9h5ZniSGtOVQ6inx99+f29edrvD U0W1oJF3wMDA3J7s94D5CsmBss6zC9vUlpwAX5fpL3hKtFvicKJwQE4XW6uQaLoyQUQR EJrw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=da8Wgzxv5myuYH4WAVzsx3YJvaNBmr54eTJ+3qvFUD4=; fh=tv3GlZuKkfBe1zvubVU8puO6FA+vKuxIHZEYveaBQ50=; b=BCb/FAIiRWbPF4j5+WgILLksFGQG1Jx26bpQt1FJ5G+HA9TGtTjXbQuQ0mgf0qfj9z CMPv+jaXF8oEmqJFPZ7FLe5idkCocEslgjr6P8m3qMa2wbii67dLhfHu7y9Dj2AZOfgs xoaLAWrI0Qs8uE2xVaK21lRlg0b6e8oQzJYzNyZxWVXh4+AUR+9xjKMRp8gBhJDwcAYU oapjyymhIY/SldUeBsZ8wji1WY70qmEOk/t110+DqNZFE2I2DGTgNpcUXOlYgrap4JEi GUTv6z6Izv26Pdjl3ga5yOz+N9+YxyCF4Pz0QZeSrnbQbsRsSJoG3dP2hRC+TtxBpd9/ rOcQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linux.alibaba.com header.s=default header.b=TY3+MeP3; arc=pass (i=1 spf=pass spfdomain=linux.alibaba.com dkim=pass dkdomain=linux.alibaba.com dmarc=pass fromdomain=linux.alibaba.com); spf=pass (google.com: domain of linux-kernel+bounces-51509-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-51509-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.alibaba.com X-Forwarded-Encrypted: i=1; AJvYcCVoAghIvEp2N7MHWicw+yGGsPZsSb1x3P09DzHV14JpFYCi/YcwJayRHVB8TOqAW6qYzZSirNgbNsXh7gLDiA9BOWrss4KEJ7+4xly0Yw== Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id x3-20020a0ceb83000000b0068c46dccca1si5990950qvo.393.2024.02.04.00.02.27 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 04 Feb 2024 00:02:27 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-51509-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.alibaba.com header.s=default header.b=TY3+MeP3; arc=pass (i=1 spf=pass spfdomain=linux.alibaba.com dkim=pass dkdomain=linux.alibaba.com dmarc=pass fromdomain=linux.alibaba.com); spf=pass (google.com: domain of linux-kernel+bounces-51509-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-51509-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.alibaba.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id B81161C2164A for ; Sun, 4 Feb 2024 08:02:27 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 4D006E570; Sun, 4 Feb 2024 08:02:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.alibaba.com header.i=@linux.alibaba.com header.b="TY3+MeP3" Received: from out30-110.freemail.mail.aliyun.com (out30-110.freemail.mail.aliyun.com [115.124.30.110]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D1914C139; Sun, 4 Feb 2024 08:02:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=115.124.30.110 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707033733; cv=none; b=KB6q7iHsTjoY3dKvTXrDiA8xUOBzApIJCtbhhM0NhyaHunRVgtS+eMasHhiVqjv8NkwSzKbHS1xc3Bdzr72d9Ju8FUJDp/q7dBnLv/J9drKjumVtjZh6qPEvk4OzvPGI6blri3AJs3BcxkJB/fLmODV+jrbpM6m/z07+eUbJ9gI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707033733; c=relaxed/simple; bh=91jMp1zqiCFeYpSsr2SaCC6w78t1qGrqnT5tMqIAdfU=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=HQLjuOAk3tDxYOWB4yxsT2n7K6B7dpBzcjJSrC+udCAi+/RnV3gB7rPzKNj+kaNGyWFWODI8BiNgxNl4ft9vKK6RvXYCOLP+v3xD/yeeSOa3rSIZAdivntJYndDKD+7jvl8P3fQPr9rGHjwjCOzdEeypJT8VKg3zVbqd3HdAhSQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.alibaba.com; spf=pass smtp.mailfrom=linux.alibaba.com; dkim=pass (1024-bit key) header.d=linux.alibaba.com header.i=@linux.alibaba.com header.b=TY3+MeP3; arc=none smtp.client-ip=115.124.30.110 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.alibaba.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.alibaba.com DKIM-Signature:v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.alibaba.com; s=default; t=1707033723; h=From:To:Subject:Date:Message-Id:MIME-Version; bh=da8Wgzxv5myuYH4WAVzsx3YJvaNBmr54eTJ+3qvFUD4=; b=TY3+MeP3MzxAkrQF+/624RPSmBF9HoLlB9NdCSG6f4pMA9GzQzVGiWiq2LAqC6ETuSEpyDUMQ55jb1RRVk/9fR+CA4CASqqAlCZb4Jti0jTsb+4nR2yLwo2Kour20dYV1vk3Ms4rb3IfgPU/Z/S/9QoGOXghyNIn5ECurur52dU= X-Alimail-AntiSpam:AC=PASS;BC=-1|-1;BR=01201311R471e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=ay29a033018045168;MF=xueshuai@linux.alibaba.com;NM=1;PH=DS;RN=33;SR=0;TI=SMTPD_---0W0003JZ_1707033719; Received: from localhost.localdomain(mailfrom:xueshuai@linux.alibaba.com fp:SMTPD_---0W0003JZ_1707033719) by smtp.aliyun-inc.com; Sun, 04 Feb 2024 16:02:01 +0800 From: Shuai Xue To: 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, gregkh@linuxfoundation.org, will@kernel.org, jarkko@kernel.org Cc: 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, xueshuai@linux.alibaba.com, justin.he@arm.com, ardb@kernel.org, ying.huang@intel.com, ashish.kalra@amd.com, baolin.wang@linux.alibaba.com, tglx@linutronix.de, mingo@redhat.com, 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 Subject: [PATCH v11 1/3] ACPI: APEI: send SIGBUS to current task if synchronous memory error not recovered Date: Sun, 4 Feb 2024 16:01:42 +0800 Message-Id: <20240204080144.7977-2-xueshuai@linux.alibaba.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221027042445.60108-1-xueshuai@linux.alibaba.com> References: <20221027042445.60108-1-xueshuai@linux.alibaba.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 --- drivers/acpi/apei/ghes.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/drivers/acpi/apei/ghes.c b/drivers/acpi/apei/ghes.c index 7b7c605166e0..0892550732d4 100644 --- a/drivers/acpi/apei/ghes.c +++ b/drivers/acpi/apei/ghes.c @@ -806,6 +806,15 @@ 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("Sending SIGBUS to current task due to memory error not recovered"); + force_sig(SIGBUS); + } + return queued; } -- 2.39.3