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 63471C35274 for ; Mon, 18 Dec 2023 06:54:01 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id F2F736B0081; Mon, 18 Dec 2023 01:54:00 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id EE1256B0082; Mon, 18 Dec 2023 01:54:00 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id DA8766B0083; Mon, 18 Dec 2023 01:54:00 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id CAED36B0081 for ; Mon, 18 Dec 2023 01:54:00 -0500 (EST) Received: from smtpin27.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id 9902C120881 for ; Mon, 18 Dec 2023 06:54:00 +0000 (UTC) X-FDA: 81579024240.27.3260151 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by imf13.hostedemail.com (Postfix) with ESMTP id B462120004 for ; Mon, 18 Dec 2023 06:53:58 +0000 (UTC) Authentication-Results: imf13.hostedemail.com; dkim=pass header.d=linuxfoundation.org header.s=korg header.b=hJFscnMJ; dmarc=pass (policy=none) header.from=linuxfoundation.org; spf=pass (imf13.hostedemail.com: domain of gregkh@linuxfoundation.org designates 145.40.68.75 as permitted sender) smtp.mailfrom=gregkh@linuxfoundation.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1702882439; 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: in-reply-to:in-reply-to:references:references:dkim-signature; bh=2ZDuAFjeEzL9lDEoA5dG1ZTedsP325R41ERFmkWjvx0=; b=QUnsRLJYEd5HzluFRXPUqgeQVJyBBDtCMTiCLbmgznJ4iKI7H0jRvQ13Ix6AAJ5vkarSM6 ICfDXHzPYZJD7L/wQqQRxA8HAebLOKm07Yq+wjkRU1I6/Xv5Rh7LgPg//SgtP1fA/QkQXI P3LPSgKYi+a+mBf0umJIphhQ+1b2hXU= ARC-Authentication-Results: i=1; imf13.hostedemail.com; dkim=pass header.d=linuxfoundation.org header.s=korg header.b=hJFscnMJ; dmarc=pass (policy=none) header.from=linuxfoundation.org; spf=pass (imf13.hostedemail.com: domain of gregkh@linuxfoundation.org designates 145.40.68.75 as permitted sender) smtp.mailfrom=gregkh@linuxfoundation.org ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1702882439; a=rsa-sha256; cv=none; b=pv7haBxLLb3RswVizTNSh/WT49WL8w4cxR/Qn5vAN114CwmYXaSUjgUe919lQDvjY6raBk f0NnRpB2k/TCItdcyPOY3UghSP8Hxt3w/r8VtiiUka/n6TmQkN+RSanQceKvDO+3fkIwxP LBNun9R0eXVCF+wJ14CHja4ivolCFqk= Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by ams.source.kernel.org (Postfix) with ESMTP id 838C7B80D7B; Mon, 18 Dec 2023 06:53:56 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 63DC5C433C7; Mon, 18 Dec 2023 06:53:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1702882435; bh=VNz5SxVR3JFdRousanTI1EoLW8p9ziakyuKcU0mnkO8=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=hJFscnMJtLb9LdeI/+jAZWsRpGP3S8VQ+fTilSt/YMbslTwa0XacvAD8hTCG755gc rfFUp3MdnS2CXxwp6h6T/d2xGnluoDtbsXlgJE3rYaGAEe+YOpLX44c2NkI/MqiSgh Hj4ELbTjrFD6LwZIpeVEFbUkk9S6E60XfzGBU1pE= Date: Mon, 18 Dec 2023 07:53:53 +0100 From: Greg KH To: Shuai Xue Cc: 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, 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, acpica-devel@lists.linuxfoundation.org, stable@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, 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: Re: [PATCH v10 1/4] ACPI: APEI: set memory failure flags as MF_ACTION_REQUIRED on synchronous events Message-ID: <2023121847-resistant-fleshy-0c4b@gregkh> References: <20221027042445.60108-1-xueshuai@linux.alibaba.com> <20231218064521.37324-2-xueshuai@linux.alibaba.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20231218064521.37324-2-xueshuai@linux.alibaba.com> X-Rspamd-Server: rspam09 X-Rspamd-Queue-Id: B462120004 X-Stat-Signature: hiyn4axipuqgqq7oz4go4wt9pm69kspf X-Rspam-User: X-HE-Tag: 1702882438-598286 X-HE-Meta: U2FsdGVkX18JAB78jvIkti8wg7oh7q3Ymk0ie8yxTXORStT8jlPcYphfkAZCcLOOHSrznStQvQ1dckBty8FY2TKR83m3q9c9xq/uFlImmkRblFoEOfrPnZazDpc6jmCi2pAB+59UbwCSlyD9DSGIjrSczlZsJKNgiS3fuw0AYVt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tO3HeG7uo66O9tHzAO4AojfHiP9eLJuetqHQGB9jJnAgUmcS/UsmAQqRD5c0G1pGZ/GLzeo5+Q+6iOHmnmNQNvjfNmRNsIIWvSN0pqMlSzv+CMV66CYpJatzaTEzWgNwZaTSIAWZ50WMCWSYw4vHpguL/k9O1fthDZpCUIxmaWCRv03AMQTcMOLFiaKcLdC/ngOeQ0ctAlPluwfJYyT5hjZGvoZQceRqKmj5T38k7RWx 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: On Mon, Dec 18, 2023 at 02:45:18PM +0800, Shuai Xue wrote: > There are two major types of uncorrected recoverable (UCR) errors : > > - Synchronous error: The error is detected and raised at the point of the > consumption in the execution flow, e.g. when a CPU tries to access > a poisoned cache line. The CPU will take a synchronous error exception > such as Synchronous External Abort (SEA) on Arm64 and Machine Check > Exception (MCE) on X86. OS requires to take action (for example, offline > failure page/kill failure thread) to recover this uncorrectable error. > > - Asynchronous error: The error is detected out of processor execution > context, e.g. when an error is detected by a background scrubber. Some data > in the memory are corrupted. But the data have not been consumed. OS is > optional to take action to recover this uncorrectable error. > > When APEI firmware first is enabled, a platform may describe one error > source for the handling of synchronous errors (e.g. MCE or SEA notification > ), or for handling asynchronous errors (e.g. SCI or External Interrupt > notification). In other words, we can distinguish synchronous errors by > APEI notification. For synchronous errors, kernel will kill the current > process which accessing the poisoned page by sending SIGBUS with > BUS_MCEERR_AR. In addition, for asynchronous errors, kernel will notify the > process who owns the poisoned page by sending SIGBUS with BUS_MCEERR_AO in > early kill mode. However, the GHES driver always sets mf_flags to 0 so that > all synchronous errors are handled as asynchronous errors in memory failure. > > To this end, set memory failure flags as MF_ACTION_REQUIRED on synchronous > events. > > Signed-off-by: Shuai Xue > Tested-by: Ma Wupeng > Reviewed-by: Kefeng Wang > Reviewed-by: Xiaofei Tan > Reviewed-by: Baolin Wang > Reviewed-by: James Morse > --- > drivers/acpi/apei/ghes.c | 29 +++++++++++++++++++++++------ > 1 file changed, 23 insertions(+), 6 deletions(-) > This is not the correct way to submit patches for inclusion in the stable kernel tree. Please read: https://www.kernel.org/doc/html/latest/process/stable-kernel-rules.html for how to do this properly.