From patchwork Mon Dec 5 16:00:43 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xie XiuQi X-Patchwork-Id: 13064713 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 9A52AC4332F for ; Mon, 5 Dec 2022 15:45:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:CC:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=5Eqae1qsGvFiWbs+bC3kvHm72reuB5aUsQBGgS4z4Cc=; b=cCjP0NbryepE6U f7rsA9RLUczvtKMLiVLLUVXA614l+odnmzBzss9uDFkww+S/H61CE5rTlLKJLr5fF5dTk1nNxQI3h cUJ3yV2x28oyNGd+FEK2v7YemDMtEgr1P1Y5EltR8b5ps+rPedvrjTpne126+g47C+x9D8PApodOx dGg2a7UzDhA7B0mNF+wg8KxUVEnplNFH/KYtDWnzMJfbUxwEceHKQfJD6c5fYdeno0dx2W2NlhCla 3yehSSr3rMtHzFMMaP2+5Dzi7928QucBS/M4Kv/eu+OVcAzKeGVt4lp3xWEfpcZ1K/hOy4zVbM3yI 2v/tKA2X5qnDnbr2TnfQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1p2Ddv-005B1h-CU; Mon, 05 Dec 2022 15:44:31 +0000 Received: from szxga02-in.huawei.com ([45.249.212.188]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1p2Dd5-0059BX-3a for linux-arm-kernel@lists.infradead.org; Mon, 05 Dec 2022 15:43:41 +0000 Received: from canpemm500001.china.huawei.com (unknown [172.30.72.53]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4NQnqk5ZDrzRpmX; Mon, 5 Dec 2022 23:42:42 +0800 (CST) Received: from localhost.localdomain.localdomain (10.175.113.25) by canpemm500001.china.huawei.com (7.192.104.163) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Mon, 5 Dec 2022 23:43:30 +0800 From: Xie XiuQi To: , , , , , , , , , , CC: , , , , Subject: [PATCH v3 4/4] arm64: ghes: pass MF_ACTION_REQUIRED to memory_failure when sea Date: Tue, 6 Dec 2022 00:00:43 +0800 Message-ID: <20221205160043.57465-5-xiexiuqi@huawei.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20221205160043.57465-1-xiexiuqi@huawei.com> References: <20221205160043.57465-1-xiexiuqi@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.175.113.25] X-ClientProxiedBy: dggems705-chm.china.huawei.com (10.3.19.182) To canpemm500001.china.huawei.com (7.192.104.163) X-CFilter-Loop: Reflected X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221205_074339_383530_555CBF13 X-CRM114-Status: UNSURE ( 9.86 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org For synchronous external data abort case, pass MF_ACTION_REQUIRED to memory_failure, ensure that error recovery is performed before return to the user space. Synchronous external data abort happened in current execution context, so as the description for 'action required', MF_ACTION_REQUIRED flag is needed. ``action optional'' if they are not immediately affected by the error ``action required'' if error happened in current execution context Signed-off-by: Xie XiuQi --- drivers/acpi/apei/ghes.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/drivers/acpi/apei/ghes.c b/drivers/acpi/apei/ghes.c index ddc4da603215..043a91a7dd17 100644 --- a/drivers/acpi/apei/ghes.c +++ b/drivers/acpi/apei/ghes.c @@ -463,7 +463,7 @@ static bool ghes_do_memory_failure(u64 physical_addr, int flags) } static bool ghes_handle_memory_failure(struct acpi_hest_generic_data *gdata, - int sev) + int sev, int notify_type) { int flags = -1; int sec_sev = ghes_severity(gdata->error_severity); @@ -472,6 +472,9 @@ static bool ghes_handle_memory_failure(struct acpi_hest_generic_data *gdata, if (!(mem_err->validation_bits & CPER_MEM_VALID_PA)) return false; + if (notify_type == ACPI_HEST_NOTIFY_SEA) + flags |= MF_ACTION_REQUIRED; + /* iff following two events can be handled properly by now */ if (sec_sev == GHES_SEV_CORRECTED && (gdata->flags & CPER_SEC_ERROR_THRESHOLD_EXCEEDED)) @@ -513,7 +516,12 @@ static bool ghes_handle_arm_hw_error(struct acpi_hest_generic_data *gdata, * and don't filter out 'corrected' error here. */ if (is_cache && has_pa) { - queued = ghes_do_memory_failure(err_info->physical_fault_addr, 0); + int flags = 0; + + if (notify_type == ACPI_HEST_NOTIFY_SEA) + flags |= MF_ACTION_REQUIRED; + + queued = ghes_do_memory_failure(err_info->physical_fault_addr, flags); p += err_info->length; continue; } @@ -657,7 +665,7 @@ static bool ghes_do_proc(struct ghes *ghes, ghes_edac_report_mem_error(sev, mem_err); arch_apei_report_mem_error(sev, mem_err); - queued = ghes_handle_memory_failure(gdata, sev); + queued = ghes_handle_memory_failure(gdata, sev, notify_type); } else if (guid_equal(sec_type, &CPER_SEC_PCIE)) { ghes_handle_aer(gdata);