Received: by 2002:a05:7412:b112:b0:f9:3106:f1c0 with SMTP id az18csp85863rdb; Sun, 17 Dec 2023 22:54:06 -0800 (PST) X-Google-Smtp-Source: AGHT+IEMmYBxwHyMCbQHHy88W8prUKtkVPIz1pqYF1kkUfwSrbKCPXlRycIQDBteToQYkeArYSAE X-Received: by 2002:a17:906:3f13:b0:a1e:7683:4da4 with SMTP id c19-20020a1709063f1300b00a1e76834da4mr6829382ejj.11.1702882446328; Sun, 17 Dec 2023 22:54:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702882446; cv=none; d=google.com; s=arc-20160816; b=vJSt/ib0mP3ufH/qQipOTR9RaG0gzSsIBU7b8qc8HUXkv4UPIKtV3s+5mQCmCHEnIF plIZFiF+zxx3a4zwAMVQsusFM3pw9wJEg9tfLmczMyECx7T0hyIKCxPlKA8c+QB4diEX RzlDLO/SMfIow9oTgBX9WwG9y0JvvNDzhUdvv5luNcmTYUYpOcfdt242LwwSjB2ApoSE iljtYfB4InoU5HFFQA/Hpxbuf1cnVbSbKNkVF5aEMmOCK1HgAd1ZT3ZkmPs8XnYDb7Gv 5/jh/9Iuvc2lGcwWJ+MdjXD45qIvx20lWbwUTl08dWKFiX8DADucZlrK23HuKjaq15Bj HXYQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=2ZDuAFjeEzL9lDEoA5dG1ZTedsP325R41ERFmkWjvx0=; fh=tg6IlgxB4zzEgcDs3My+TAoclDht2V20wP9Lk5qqw54=; b=EfpnTNQPKUpD2mClpdCwwektO8zn8Un0VbvmcbdjH8nY7aCC0CBvFjym10b3mJy4KO kgjJGfEn2vXoGzoeTOLK83yz4fuZ+qDzDoPa81GC1tOJ+LVfl5s8kCJlosBKqVaTbBF8 2//VrDqbuJOa9m2jB6a1xMX164csXO09OixeAiZPCqtVYc56sYFmJjz0acoqiv0JqfZc aiHfioaOGiUuwdRQ+kG6VtCMpQ0gbnHaUB6Do56Rz55h1Y0q/1ewf0eAtIuqKAtZ4Pcm 2VW4KvCJTkn/ijfbVfXTsBUWoOqey7Y3XpcbKv4UNRaiYX3H4SvwARr4Nm+mTpJMugXP xFpg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=hJFscnMJ; spf=pass (google.com: domain of linux-kernel+bounces-3067-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-3067-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id xo3-20020a170907bb8300b00a2358185189si609664ejc.792.2023.12.17.22.54.06 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 17 Dec 2023 22:54:06 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-3067-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=hJFscnMJ; spf=pass (google.com: domain of linux-kernel+bounces-3067-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-3067-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org 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 am.mirrors.kernel.org (Postfix) with ESMTPS id D9F0C1F22D62 for ; Mon, 18 Dec 2023 06:54:05 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 675BE79C3; Mon, 18 Dec 2023 06:53:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="hJFscnMJ" X-Original-To: linux-kernel@vger.kernel.org Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 6CAAB101D9; 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> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20231218064521.37324-2-xueshuai@linux.alibaba.com> 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.