From patchwork Sat Sep 16 13:03:08 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shuai Xue X-Patchwork-Id: 141043 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:172:b0:3f2:4152:657d with SMTP id h50csp1648122vqi; Sat, 16 Sep 2023 06:05:43 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGNtBeJptR5Dj2R/Nu7JYji58YpHACumWinJ/ARzCgYbBVzjOIvif8gg6xcu6HHqKpLV9E8 X-Received: by 2002:a05:6a00:39a5:b0:68b:a137:373d with SMTP id fi37-20020a056a0039a500b0068ba137373dmr5135056pfb.17.1694869542767; Sat, 16 Sep 2023 06:05:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694869542; cv=none; d=google.com; s=arc-20160816; b=nsq4CTTp8NtdMvQtjBhVuSPIb3z1pipcEpA5PwDHQCjdme8/rp0Ny/OpViwv8c7m2c 0d2djhjmSOqhuyQiAeIViBMq0Ly8KSmgtkDJBRh2ibp12zc1oSFu8slBSb/k0xUgDnuC LU+TxuDVnO0wu5YHfU/WoY9as1USocSYX6Fbu9uqCRExphKF4CFSlEQ98Vh+3Ag1W/D3 FzPKiuVGGuqH5t0TtCANhI2IJaFevXkMQmI1JStJhJxSz5JgeLYkt7etsoLRO8TXj9X3 WXX39zPA64tbr/wd5Bpg5PaekrpxLSAKuK3VvC0pw2XeP6rbQrEvzMIRHfVwsNkKOxC+ R5Xg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=wo5aRE7v49PP21OSTtQfTSVkBgWIoZUj6tUwQmFvobc=; fh=FxxuQyV5zt5uOZlISi71Gibj4pONM7+jzC8ls2GxgWY=; b=nvEt1vclSAhis9i62M4294k6B5Rh/3KxgdP/obp3WLExE+ct4PZRc8PHAxGIfhl7ls ZlveeW0updIuAtvu+6MWzFhdDz+Pe7ulxQqrMOMzWTGCA+XlHwTRfLavTmwPg/Pf+wqg +JbrSlhMjpv8ZeCmSnn9TVvfS54eISis5CD5ZincGVKZkVJqxX5MjIVF+XVRLwcD5/c/ UwnLLx0CXN2jOTztUug5RAmRAKvQEoNXUf8xAdLfSTkCfHSDMKOWKIx7g8I1ew3BM5D1 Ooejb6LyVibGvxqaK9Vc+EeoHE3zBq69+fBscqD1ejfLEAQtx5WDWdXsj5pW100jBBHg wbjA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Received: from pete.vger.email (pete.vger.email. [23.128.96.36]) by mx.google.com with ESMTPS id q12-20020a056a00150c00b0068e405d9217si5245305pfu.302.2023.09.16.06.05.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 16 Sep 2023 06:05:42 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) client-ip=23.128.96.36; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by pete.vger.email (Postfix) with ESMTP id C72C181C4A8D; Sat, 16 Sep 2023 06:04:55 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239303AbjIPNDx (ORCPT + 29 others); Sat, 16 Sep 2023 09:03:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38178 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231487AbjIPNDd (ORCPT ); Sat, 16 Sep 2023 09:03:33 -0400 Received: from out30-112.freemail.mail.aliyun.com (out30-112.freemail.mail.aliyun.com [115.124.30.112]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7ACA4DD; Sat, 16 Sep 2023 06:03:26 -0700 (PDT) X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R151e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=ay29a033018046050;MF=xueshuai@linux.alibaba.com;NM=1;PH=DS;RN=22;SR=0;TI=SMTPD_---0VsA36tW_1694869400; Received: from localhost.localdomain(mailfrom:xueshuai@linux.alibaba.com fp:SMTPD_---0VsA36tW_1694869400) by smtp.aliyun-inc.com; Sat, 16 Sep 2023 21:03:21 +0800 From: Shuai Xue To: keescook@chromium.org, tony.luck@intel.com, gpiccoli@igalia.com, rafael@kernel.org, lenb@kernel.org, james.morse@arm.com, bp@alien8.de, tglx@linutronix.de, mingo@redhat.com, dave.hansen@linux.intel.com, x86@kernel.org, hpa@zytor.com, ardb@kernel.org, robert.moore@intel.com Cc: linux-hardening@vger.kernel.org, linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org, linux-edac@vger.kernel.org, linux-efi@vger.kernel.org, acpica-devel@lists.linuxfoundation.org, xueshuai@linux.alibaba.com, baolin.wang@linux.alibaba.com Subject: [RFC PATCH 1/9] pstore: move pstore creator id, section type and record struct to common header Date: Sat, 16 Sep 2023 21:03:08 +0800 Message-Id: <20230916130316.65815-2-xueshuai@linux.alibaba.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230916130316.65815-1-xueshuai@linux.alibaba.com> References: <20230916130316.65815-1-xueshuai@linux.alibaba.com> MIME-Version: 1.0 X-Spam-Status: No, score=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,UNPARSEABLE_RELAY autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on pete.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (pete.vger.email [0.0.0.0]); Sat, 16 Sep 2023 06:04:55 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1777199525816443137 X-GMAIL-MSGID: 1777199525816443137 Move pstore creator id, section type and record struct to the common header, so that it can be use by MCE and GHES driver. Signed-off-by: Shuai Xue --- drivers/acpi/apei/erst.c | 19 ------------------- include/linux/pstore.h | 24 ++++++++++++++++++++++++ 2 files changed, 24 insertions(+), 19 deletions(-) diff --git a/drivers/acpi/apei/erst.c b/drivers/acpi/apei/erst.c index 247989060e29..528ac5eb4871 100644 --- a/drivers/acpi/apei/erst.c +++ b/drivers/acpi/apei/erst.c @@ -997,25 +997,6 @@ static struct pstore_info erst_info = { .erase = erst_clearer }; -#define CPER_CREATOR_PSTORE \ - GUID_INIT(0x75a574e3, 0x5052, 0x4b29, 0x8a, 0x8e, 0xbe, 0x2c, \ - 0x64, 0x90, 0xb8, 0x9d) -#define CPER_SECTION_TYPE_DMESG \ - GUID_INIT(0xc197e04e, 0xd545, 0x4a70, 0x9c, 0x17, 0xa5, 0x54, \ - 0x94, 0x19, 0xeb, 0x12) -#define CPER_SECTION_TYPE_DMESG_Z \ - GUID_INIT(0x4f118707, 0x04dd, 0x4055, 0xb5, 0xdd, 0x95, 0x6d, \ - 0x34, 0xdd, 0xfa, 0xc6) -#define CPER_SECTION_TYPE_MCE \ - GUID_INIT(0xfe08ffbe, 0x95e4, 0x4be7, 0xbc, 0x73, 0x40, 0x96, \ - 0x04, 0x4a, 0x38, 0xfc) - -struct cper_pstore_record { - struct cper_record_header hdr; - struct cper_section_descriptor sec_hdr; - char data[]; -} __packed; - static int reader_pos; static int erst_open_pstore(struct pstore_info *psi) diff --git a/include/linux/pstore.h b/include/linux/pstore.h index 638507a3c8ff..ad44b3baf10e 100644 --- a/include/linux/pstore.h +++ b/include/linux/pstore.h @@ -17,6 +17,7 @@ #include #include #include +#include struct module; @@ -210,6 +211,29 @@ struct pstore_info { extern int pstore_register(struct pstore_info *); extern void pstore_unregister(struct pstore_info *); +#define CPER_CREATOR_PSTORE \ + GUID_INIT(0x75a574e3, 0x5052, 0x4b29, 0x8a, 0x8e, 0xbe, 0x2c, \ + 0x64, 0x90, 0xb8, 0x9d) +#define CPER_SECTION_TYPE_DMESG \ + GUID_INIT(0xc197e04e, 0xd545, 0x4a70, 0x9c, 0x17, 0xa5, 0x54, \ + 0x94, 0x19, 0xeb, 0x12) +#define CPER_SECTION_TYPE_DMESG_Z \ + GUID_INIT(0x4f118707, 0x04dd, 0x4055, 0xb5, 0xdd, 0x95, 0x6d, \ + 0x34, 0xdd, 0xfa, 0xc6) +#define CPER_SECTION_TYPE_MCE \ + GUID_INIT(0xfe08ffbe, 0x95e4, 0x4be7, 0xbc, 0x73, 0x40, 0x96, \ + 0x04, 0x4a, 0x38, 0xfc) + +/* + * CPER specification (in UEFI specification 2.3 appendix N) requires + * byte-packed. + */ +struct cper_pstore_record { + struct cper_record_header hdr; + struct cper_section_descriptor sec_hdr; + char data[]; +} __packed; + struct pstore_ftrace_record { unsigned long ip; unsigned long parent_ip; From patchwork Sat Sep 16 13:03:09 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shuai Xue X-Patchwork-Id: 141042 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:172:b0:3f2:4152:657d with SMTP id h50csp1648114vqi; Sat, 16 Sep 2023 06:05:42 -0700 (PDT) X-Google-Smtp-Source: AGHT+IH6ueZbvwkdxTdcu553FHqyP1mQGXB+8Rc1UtLGX4xuO4kjMg23ktlqCMZ7DwZzrwCvq/SZ X-Received: by 2002:a17:90a:5305:b0:267:a859:dfef with SMTP id x5-20020a17090a530500b00267a859dfefmr3659960pjh.27.1694869542088; Sat, 16 Sep 2023 06:05:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694869542; cv=none; d=google.com; s=arc-20160816; b=cme8FLmBAemtPg0uAkdjT5Qam6OhWpJCxkoJ6U0q0QeKuyy4/Hhkl+6BCK1r+8vegB iVPiCoKqdQZUbIOz1zSmPEzcOeRUY277eZmrfnqrj/u7ZnTJLWX0ZmEj6KMbOFMR3eNW 500NQXwk+TfpemHuwMqLhL3zRNvJ/VXpkM1kWT+mbtSlrkDaq+b1ak5dPDA/4MfQ+rNE lBi82aWYwQ9E7wo4LDdQlvCo2pCRARnkoQcgWa86PG9wR2+k9H3JF6NW7NuzPgvcLs7w 2KpAGLrXMTGlr7ueYAiz9Fgg50KqD/hR1+KimjxT7T/7jzUMIN92xhIuur3zDo1sMeMk jO9Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=F7Ri0fT94+4c/hpjL2jDhImHF1gQIQUXHkGzIAbmFv8=; fh=FxxuQyV5zt5uOZlISi71Gibj4pONM7+jzC8ls2GxgWY=; b=UOmKALBPpIxruVYWGdP9jnF4oz5wdKZ++w41U9vB8T5/OSXqhIFwTun5xrQgWCnIeA l4fYXw3AT4JK5gpOU59ZTztlQghCHI7pGnRpDCqCMupfgAaZnbFLAZtirJncP61YdafG pk8QxsNi5xNawsB931Z+sX35rq7NuZrQwhUs0cjyZ+lbnDRGyKUjH+tganke9pJe4LiW KaeEU44IvEyhMLvEzjxd60fY9IITJMb/4gY5fTMJYJkE0sSM2XWctLZ0u8NQ7PcEcBnO fWw0mC6dcgCmd/4Zi753AIt/oe4OHtzUH7XAbACE7LVS8yjdst5XsNgClizs4Wp/s66y 7bRw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Received: from pete.vger.email (pete.vger.email. [23.128.96.36]) by mx.google.com with ESMTPS id q9-20020a17090a178900b00262ee7c6cafsi4901396pja.87.2023.09.16.06.05.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 16 Sep 2023 06:05:42 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) client-ip=23.128.96.36; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by pete.vger.email (Postfix) with ESMTP id C4BB181C4A91; Sat, 16 Sep 2023 06:04:43 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239273AbjIPNDw (ORCPT + 29 others); Sat, 16 Sep 2023 09:03:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55280 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231226AbjIPNDc (ORCPT ); Sat, 16 Sep 2023 09:03:32 -0400 Received: from out30-110.freemail.mail.aliyun.com (out30-110.freemail.mail.aliyun.com [115.124.30.110]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B6B111B2; Sat, 16 Sep 2023 06:03:25 -0700 (PDT) X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R591e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=ay29a033018045176;MF=xueshuai@linux.alibaba.com;NM=1;PH=DS;RN=22;SR=0;TI=SMTPD_---0VsA36tz_1694869402; Received: from localhost.localdomain(mailfrom:xueshuai@linux.alibaba.com fp:SMTPD_---0VsA36tz_1694869402) by smtp.aliyun-inc.com; Sat, 16 Sep 2023 21:03:23 +0800 From: Shuai Xue To: keescook@chromium.org, tony.luck@intel.com, gpiccoli@igalia.com, rafael@kernel.org, lenb@kernel.org, james.morse@arm.com, bp@alien8.de, tglx@linutronix.de, mingo@redhat.com, dave.hansen@linux.intel.com, x86@kernel.org, hpa@zytor.com, ardb@kernel.org, robert.moore@intel.com Cc: linux-hardening@vger.kernel.org, linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org, linux-edac@vger.kernel.org, linux-efi@vger.kernel.org, acpica-devel@lists.linuxfoundation.org, xueshuai@linux.alibaba.com, baolin.wang@linux.alibaba.com Subject: [RFC PATCH 2/9] ACPI: APEI: Use common ERST struct to read/write serialized MCE record Date: Sat, 16 Sep 2023 21:03:09 +0800 Message-Id: <20230916130316.65815-3-xueshuai@linux.alibaba.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230916130316.65815-1-xueshuai@linux.alibaba.com> References: <20230916130316.65815-1-xueshuai@linux.alibaba.com> MIME-Version: 1.0 X-Spam-Status: No, score=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,UNPARSEABLE_RELAY autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on pete.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (pete.vger.email [0.0.0.0]); Sat, 16 Sep 2023 06:04:43 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1777199525256413580 X-GMAIL-MSGID: 1777199525256413580 It is confusing to define two creator IDs with the same GUID number, and unnecessary to define the same data structure twice. Use common ERST struct to read/write MCE record. Signed-off-by: Shuai Xue --- arch/x86/kernel/cpu/mce/apei.c | 82 +++++++++++++++------------------- 1 file changed, 35 insertions(+), 47 deletions(-) diff --git a/arch/x86/kernel/cpu/mce/apei.c b/arch/x86/kernel/cpu/mce/apei.c index 8ed341714686..f5739f13e583 100644 --- a/arch/x86/kernel/cpu/mce/apei.c +++ b/arch/x86/kernel/cpu/mce/apei.c @@ -20,6 +20,7 @@ #include #include #include +#include #include #include #include @@ -124,58 +125,45 @@ int apei_smca_report_x86_error(struct cper_ia_proc_ctx *ctx_info, u64 lapic_id) return 0; } -#define CPER_CREATOR_MCE \ - GUID_INIT(0x75a574e3, 0x5052, 0x4b29, 0x8a, 0x8e, 0xbe, 0x2c, \ - 0x64, 0x90, 0xb8, 0x9d) -#define CPER_SECTION_TYPE_MCE \ - GUID_INIT(0xfe08ffbe, 0x95e4, 0x4be7, 0xbc, 0x73, 0x40, 0x96, \ - 0x04, 0x4a, 0x38, 0xfc) - -/* - * CPER specification (in UEFI specification 2.3 appendix N) requires - * byte-packed. - */ -struct cper_mce_record { - struct cper_record_header hdr; - struct cper_section_descriptor sec_hdr; - struct mce mce; -} __packed; - int apei_write_mce(struct mce *m) { - struct cper_mce_record rcd; - - memset(&rcd, 0, sizeof(rcd)); - memcpy(rcd.hdr.signature, CPER_SIG_RECORD, CPER_SIG_SIZE); - rcd.hdr.revision = CPER_RECORD_REV; - rcd.hdr.signature_end = CPER_SIG_END; - rcd.hdr.section_count = 1; - rcd.hdr.error_severity = CPER_SEV_FATAL; + struct cper_pstore_record *rcd; + int record_len = sizeof(*m) + sizeof(*rcd); + int data_len = sizeof(*m); + + rcd = kmalloc(record_len, GFP_KERNEL); + memset(rcd, 0, sizeof(rcd)); + + memcpy(rcd->hdr.signature, CPER_SIG_RECORD, CPER_SIG_SIZE); + rcd->hdr.revision = CPER_RECORD_REV; + rcd->hdr.signature_end = CPER_SIG_END; + rcd->hdr.section_count = 1; + rcd->hdr.error_severity = CPER_SEV_FATAL; /* timestamp, platform_id, partition_id are all invalid */ - rcd.hdr.validation_bits = 0; - rcd.hdr.record_length = sizeof(rcd); - rcd.hdr.creator_id = CPER_CREATOR_MCE; - rcd.hdr.notification_type = CPER_NOTIFY_MCE; - rcd.hdr.record_id = cper_next_record_id(); - rcd.hdr.flags = CPER_HW_ERROR_FLAGS_PREVERR; - - rcd.sec_hdr.section_offset = (void *)&rcd.mce - (void *)&rcd; - rcd.sec_hdr.section_length = sizeof(rcd.mce); - rcd.sec_hdr.revision = CPER_SEC_REV; - /* fru_id and fru_text is invalid */ - rcd.sec_hdr.validation_bits = 0; - rcd.sec_hdr.flags = CPER_SEC_PRIMARY; - rcd.sec_hdr.section_type = CPER_SECTION_TYPE_MCE; - rcd.sec_hdr.section_severity = CPER_SEV_FATAL; - - memcpy(&rcd.mce, m, sizeof(*m)); - - return erst_write(&rcd.hdr); + rcd->hdr.validation_bits = 0; + rcd->hdr.record_length = record_len; + rcd->hdr.creator_id = CPER_CREATOR_PSTORE; + rcd->hdr.notification_type = CPER_NOTIFY_MCE; + rcd->hdr.record_id = cper_next_record_id(); + rcd->hdr.flags = CPER_HW_ERROR_FLAGS_PREVERR; + + rcd->sec_hdr.section_offset = (void *)&rcd->data - (void *)&rcd; + rcd->sec_hdr.section_length = data_len; + rcd->sec_hdr.revision = CPER_SEC_REV; + /* ->ru_id and fru_text is invalid */ + rcd->sec_hdr.validation_bits = 0; + rcd->sec_hdr.flags = CPER_SEC_PRIMARY; + rcd->sec_hdr.section_type = CPER_SECTION_TYPE_MCE; + rcd->sec_hdr.section_severity = CPER_SEV_FATAL; + + memcpy(rcd->data, m, data_len); + + return erst_write(&rcd->hdr); } ssize_t apei_read_mce(struct mce *m, u64 *record_id) { - struct cper_mce_record rcd; + struct cper_pstore_record rcd; int rc, pos; rc = erst_get_record_id_begin(&pos); @@ -189,14 +177,14 @@ ssize_t apei_read_mce(struct mce *m, u64 *record_id) if (*record_id == APEI_ERST_INVALID_RECORD_ID) goto out; rc = erst_read_record(*record_id, &rcd.hdr, sizeof(rcd), sizeof(rcd), - &CPER_CREATOR_MCE); + &CPER_CREATOR_PSTORE); /* someone else has cleared the record, try next one */ if (rc == -ENOENT) goto retry; else if (rc < 0) goto out; - memcpy(m, &rcd.mce, sizeof(*m)); + memcpy(m, &rcd.data, sizeof(*m)); rc = sizeof(*m); out: erst_get_record_id_end(); From patchwork Sat Sep 16 13:03:10 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shuai Xue X-Patchwork-Id: 141041 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:172:b0:3f2:4152:657d with SMTP id h50csp1647758vqi; Sat, 16 Sep 2023 06:05:11 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFt0AzK0fE8L289AeZUC32OaZqVtv1jiK9QQKTIn0s/YDZjmanzmBE66DfKs4ZkaggX53oo X-Received: by 2002:a17:903:41c4:b0:1c4:13cd:b85f with SMTP id u4-20020a17090341c400b001c413cdb85fmr4539786ple.5.1694869511641; Sat, 16 Sep 2023 06:05:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694869511; cv=none; d=google.com; s=arc-20160816; b=zR8327yC/UW+WOlbm64aZ7gtrFcHrXW8CXwhDi1b3t+8VfwizmcBu2o1ndIKBXfZRT xhSgYuu6vKHZe7Li3GvFPQ0iZTMdfgSAPCq/Tn9NsZCreigHBjuNmWoxZoo7WQYreb07 HVIGi6A4Y3eEaxU8FrhyGjPec6KD1dBiOe88fX5+c5UPYyyLld5VQU1V+vzCo/Ipp7Ed 8pg9TwJ84mgcFjNfkoOG7mpE1sQ34NObAuZP0j3Nb4VXXvuUIbrYOFeHHeJcM4s0rgrY 2Q4r3jeWvMdNECfwqu4gQnd54oV1SEBlQjaRkxxDL2iQzepGz9umoYDoQVsUIuQcmaHf UZug== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=ycA/WcdyNIXzUFgCIgJN6Hxr1gUDxxAMUcKOdRcbflo=; fh=FxxuQyV5zt5uOZlISi71Gibj4pONM7+jzC8ls2GxgWY=; b=bLy8Qm38xzRePkKoFz3mn6lbVKQi6XHE9RpTB/KrVth2EFrIumbjtIE9DLIi7MTQup iZJp6FL0cqW7fz2MJRz51LD+Vv/Y62QNCOvrhNbiPN2Jazmr0/0yaICVu0qyupbZwVl8 Dqa4wSmWdyn62wDfmLo80S7bb7wzs2hUiEA6EEyy22YLAx8x6q0GYKLplCA7cbDE2i9e vcK8AbvNF8+7D7IihvHO7it6XZictF2qinm1BKrCIezff7piViWWV06vwAXXa8Ea1y1A d51/7VN+v0VWK6nLi9Y3hv+6STHkLFY1UyHYvfu1jGKN4ipqcZIgGk5SFVSkhuZC8xdW w+6A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Received: from agentk.vger.email (agentk.vger.email. [23.128.96.32]) by mx.google.com with ESMTPS id e19-20020a170902e0d300b001ab1d1a6802si4893454pla.1.2023.09.16.06.05.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 16 Sep 2023 06:05:11 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) client-ip=23.128.96.32; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id DD7658060018; Sat, 16 Sep 2023 06:05:08 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239317AbjIPNDz (ORCPT + 29 others); Sat, 16 Sep 2023 09:03:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38192 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232621AbjIPNDe (ORCPT ); Sat, 16 Sep 2023 09:03:34 -0400 Received: from out30-130.freemail.mail.aliyun.com (out30-130.freemail.mail.aliyun.com [115.124.30.130]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4D3251B2; Sat, 16 Sep 2023 06:03:28 -0700 (PDT) X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R231e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=ay29a033018046051;MF=xueshuai@linux.alibaba.com;NM=1;PH=DS;RN=22;SR=0;TI=SMTPD_---0VsA36uP_1694869403; Received: from localhost.localdomain(mailfrom:xueshuai@linux.alibaba.com fp:SMTPD_---0VsA36uP_1694869403) by smtp.aliyun-inc.com; Sat, 16 Sep 2023 21:03:24 +0800 From: Shuai Xue To: keescook@chromium.org, tony.luck@intel.com, gpiccoli@igalia.com, rafael@kernel.org, lenb@kernel.org, james.morse@arm.com, bp@alien8.de, tglx@linutronix.de, mingo@redhat.com, dave.hansen@linux.intel.com, x86@kernel.org, hpa@zytor.com, ardb@kernel.org, robert.moore@intel.com Cc: linux-hardening@vger.kernel.org, linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org, linux-edac@vger.kernel.org, linux-efi@vger.kernel.org, acpica-devel@lists.linuxfoundation.org, xueshuai@linux.alibaba.com, baolin.wang@linux.alibaba.com Subject: [RFC PATCH 3/9] ACPI: APEI: ERST: Emit the mce_record tracepoint Date: Sat, 16 Sep 2023 21:03:10 +0800 Message-Id: <20230916130316.65815-4-xueshuai@linux.alibaba.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230916130316.65815-1-xueshuai@linux.alibaba.com> References: <20230916130316.65815-1-xueshuai@linux.alibaba.com> MIME-Version: 1.0 X-Spam-Status: No, score=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,UNPARSEABLE_RELAY autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Sat, 16 Sep 2023 06:05:08 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1777199492702947214 X-GMAIL-MSGID: 1777199492702947214 After /dev/mcelog character device deprecated by commit 5de97c9f6d85 ("x86/mce: Factor out and deprecate the /dev/mcelog driver"), the serialized hardware error log, a.k.a MCE record, of previous boot in persistent storage is not collected via APEI ERST. Emit the mce_record tracepoint so that it can consumed by the new generation rasdaemon. Signed-off-by: Shuai Xue --- drivers/acpi/apei/erst.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/acpi/apei/erst.c b/drivers/acpi/apei/erst.c index 528ac5eb4871..f789e3df73a9 100644 --- a/drivers/acpi/apei/erst.c +++ b/drivers/acpi/apei/erst.c @@ -26,6 +26,8 @@ #include #include /* kvfree() */ #include +/* only define CREATE_TRACE_POINTS once */ +#include #include "apei-internal.h" @@ -1063,8 +1065,10 @@ static ssize_t erst_reader(struct pstore_record *record) record->compressed = true; } else if (guid_equal(&rcd->sec_hdr.section_type, &CPER_SECTION_TYPE_DMESG)) record->type = PSTORE_TYPE_DMESG; - else if (guid_equal(&rcd->sec_hdr.section_type, &CPER_SECTION_TYPE_MCE)) + else if (guid_equal(&rcd->sec_hdr.section_type, &CPER_SECTION_TYPE_MCE)) { + trace_mce_record((struct mce *)rcd->data); record->type = PSTORE_TYPE_MCE; + } else record->type = PSTORE_TYPE_MAX; From patchwork Sat Sep 16 13:03:11 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shuai Xue X-Patchwork-Id: 141047 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:172:b0:3f2:4152:657d with SMTP id h50csp1648701vqi; Sat, 16 Sep 2023 06:06:32 -0700 (PDT) X-Google-Smtp-Source: AGHT+IE/MMXnODKHo+UP0L/crXd4H+dA/CQ/d8PhB9INxsj2/Mzz2jgx4O3PDH3/p2JrnDe/fT+m X-Received: by 2002:a05:6a20:dd9a:b0:14c:512c:c138 with SMTP id kw26-20020a056a20dd9a00b0014c512cc138mr3930110pzb.60.1694869592245; Sat, 16 Sep 2023 06:06:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694869592; cv=none; d=google.com; s=arc-20160816; b=wRdgWR0PT+HBioSCmkfOIXFc9PAQcI38PFXKAnuJRus5ijeRpr92wbGaUYXBreFT1/ HDygUBKbhbt1l2Nc+KbmwvOsrve6EAi1SPzgb/n4h8KizN3B2MretaMGOkzsz5rvWkfD flG07xvHRzzVUvMoPbD0OgBgVC7+TSV9mf7jnZ9L+i30YHZwkQir64uAW5qYpI24GI1X /wGIo8vdHbgc/5fknuGbbLIkrpel0d4+75t3y5Z9y//ZXZ534WZT0RVmgeNJ5r0z2SL2 uD8z+iUf79a4lLZQpwzrVIS+6DMcfAHcXxMMrMCGXT8pozEv0tlAveRQPm0T6/Zlemrw ax2A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=a0ykU0DCtEpSTz+Rb1yKUiw+DgcibIyW0sHVZoEC2JI=; fh=FxxuQyV5zt5uOZlISi71Gibj4pONM7+jzC8ls2GxgWY=; b=niTSqHzr+9C3QNcrpJgu7BJomo1bvzhUK94bsQzMVaK2GW1h7Z6F2OnarlEsLz1ZBM x+3OweEtRPB67e5XKghWUmbdPBk8ybHPzsrfU1A+45eewp9FBNIZm8Rh3Bop3a/AVIHd +tDI7FJKS9N63JBLo8cWBtY4+iBhKAowWu0h1hlFEC2APfrMEeisG0WIOiUtVLoYkp4m 0O+AeAijPsiJoqyOjfCW/S1EH3SHZBXwiil9oeimgR+Lb21wH3E7hLfIMtpgBv5c+IbQ 3nTXEH4MZSChtL8cb+7lhWrN8O9/2BnNe/3LLcfrpwP9nUZJhp/BHs05vFhb9CSzIJzw aCvQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Received: from agentk.vger.email (agentk.vger.email. [2620:137:e000::3:2]) by mx.google.com with ESMTPS id d15-20020a63360f000000b0056952b496efsi4658766pga.366.2023.09.16.06.06.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 16 Sep 2023 06:06:32 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) client-ip=2620:137:e000::3:2; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id C8EED80722E9; Sat, 16 Sep 2023 06:05:15 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239324AbjIPND4 (ORCPT + 29 others); Sat, 16 Sep 2023 09:03:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38202 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232622AbjIPNDj (ORCPT ); Sat, 16 Sep 2023 09:03:39 -0400 Received: from out30-118.freemail.mail.aliyun.com (out30-118.freemail.mail.aliyun.com [115.124.30.118]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A31DC1B2; Sat, 16 Sep 2023 06:03:30 -0700 (PDT) X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R161e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=ay29a033018046059;MF=xueshuai@linux.alibaba.com;NM=1;PH=DS;RN=22;SR=0;TI=SMTPD_---0VsA36ut_1694869405; Received: from localhost.localdomain(mailfrom:xueshuai@linux.alibaba.com fp:SMTPD_---0VsA36ut_1694869405) by smtp.aliyun-inc.com; Sat, 16 Sep 2023 21:03:26 +0800 From: Shuai Xue To: keescook@chromium.org, tony.luck@intel.com, gpiccoli@igalia.com, rafael@kernel.org, lenb@kernel.org, james.morse@arm.com, bp@alien8.de, tglx@linutronix.de, mingo@redhat.com, dave.hansen@linux.intel.com, x86@kernel.org, hpa@zytor.com, ardb@kernel.org, robert.moore@intel.com Cc: linux-hardening@vger.kernel.org, linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org, linux-edac@vger.kernel.org, linux-efi@vger.kernel.org, acpica-devel@lists.linuxfoundation.org, xueshuai@linux.alibaba.com, baolin.wang@linux.alibaba.com Subject: [RFC PATCH 4/9] ACPI: tables: change section_type of generic error data as guid_t Date: Sat, 16 Sep 2023 21:03:11 +0800 Message-Id: <20230916130316.65815-5-xueshuai@linux.alibaba.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230916130316.65815-1-xueshuai@linux.alibaba.com> References: <20230916130316.65815-1-xueshuai@linux.alibaba.com> MIME-Version: 1.0 X-Spam-Status: No, score=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,UNPARSEABLE_RELAY autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Sat, 16 Sep 2023 06:05:15 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1777199577847178445 X-GMAIL-MSGID: 1777199577847178445 The section_type of generic error data is now an array of u8. It is a burden to perform explicit type casting from u8[] to guid_t, and to copy the guid_t values to u8[] using memcpy. To alleviate this issue, change the section_type from an array to the type guid_t, which is also consistent with the cper_section_descriptor. Signed-off-by: Shuai Xue --- drivers/acpi/acpi_extlog.c | 2 +- drivers/acpi/apei/ghes.c | 2 +- drivers/firmware/efi/cper.c | 2 +- include/acpi/actbl1.h | 5 +++-- 4 files changed, 6 insertions(+), 5 deletions(-) diff --git a/drivers/acpi/acpi_extlog.c b/drivers/acpi/acpi_extlog.c index e120a96e1eae..d46435792d64 100644 --- a/drivers/acpi/acpi_extlog.c +++ b/drivers/acpi/acpi_extlog.c @@ -170,7 +170,7 @@ static int extlog_print(struct notifier_block *nb, unsigned long val, fru_text = gdata->fru_text; else fru_text = ""; - sec_type = (guid_t *)gdata->section_type; + sec_type = &gdata->section_type; if (guid_equal(sec_type, &CPER_SEC_PLATFORM_MEM)) { struct cper_sec_mem_err *mem = acpi_hest_get_payload(gdata); diff --git a/drivers/acpi/apei/ghes.c b/drivers/acpi/apei/ghes.c index ef59d6ea16da..d14e00751161 100644 --- a/drivers/acpi/apei/ghes.c +++ b/drivers/acpi/apei/ghes.c @@ -648,7 +648,7 @@ static bool ghes_do_proc(struct ghes *ghes, sev = ghes_severity(estatus->error_severity); apei_estatus_for_each_section(estatus, gdata) { - sec_type = (guid_t *)gdata->section_type; + sec_type = &gdata->section_type; sec_sev = ghes_severity(gdata->error_severity); if (gdata->validation_bits & CPER_SEC_VALID_FRU_ID) fru_id = (guid_t *)gdata->fru_id; diff --git a/drivers/firmware/efi/cper.c b/drivers/firmware/efi/cper.c index 35c37f667781..a2ba70aa928f 100644 --- a/drivers/firmware/efi/cper.c +++ b/drivers/firmware/efi/cper.c @@ -527,7 +527,7 @@ static void cper_estatus_print_section(const char *pfx, struct acpi_hest_generic_data *gdata, int sec_no) { - guid_t *sec_type = (guid_t *)gdata->section_type; + guid_t *sec_type = &gdata->section_type; __u16 severity; char newpfx[64]; diff --git a/include/acpi/actbl1.h b/include/acpi/actbl1.h index 8d5572ad48cb..ab25a8495a43 100644 --- a/include/acpi/actbl1.h +++ b/include/acpi/actbl1.h @@ -19,6 +19,7 @@ * ******************************************************************************/ +#include /* * Values for description table header signatures for tables defined in this * file. Useful because they make it more difficult to inadvertently type in @@ -1637,7 +1638,7 @@ struct acpi_hest_generic_status { /* Generic Error Data entry */ struct acpi_hest_generic_data { - u8 section_type[16]; + guid_t section_type; u32 error_severity; u16 revision; u8 validation_bits; @@ -1650,7 +1651,7 @@ struct acpi_hest_generic_data { /* Extension for revision 0x0300 */ struct acpi_hest_generic_data_v300 { - u8 section_type[16]; + guid_t section_type; u32 error_severity; u16 revision; u8 validation_bits; From patchwork Sat Sep 16 13:03:12 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shuai Xue X-Patchwork-Id: 141044 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:172:b0:3f2:4152:657d with SMTP id h50csp1648218vqi; Sat, 16 Sep 2023 06:05:52 -0700 (PDT) X-Google-Smtp-Source: AGHT+IH+RqfDs34AxsJAFlX281s7+1YENs/NKp2JXhIgJcoShG9n6lwsXO7q/8P43cnNFerXq6VD X-Received: by 2002:a05:6e02:b22:b0:34d:ec00:2ce8 with SMTP id e2-20020a056e020b2200b0034dec002ce8mr6332285ilu.21.1694869552069; Sat, 16 Sep 2023 06:05:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694869552; cv=none; d=google.com; s=arc-20160816; b=IakACgRG3EkBxdZuhzW5JPmf8pZZw5wR8fggvD0wl2TnckneElMVOOPCriK9rYi1Yp TWOqoILT0gOAg8tNZ72OlgkuqJVAlLNzuCIR4MRX3ceczbT9I1q3qv8JS/N2lEL2Mj8v pvXTjt6g7zVzTd8ekuiMBgPJywtxjZOqR9c9xdnuSH61QL72TXaY2NOr5neR8X3RiMeo gFeyuomvFvd+vIFmeN4Pe14km+8DFqwK1BlIettEcKjkXXTZNFsbP+LV+V2DBzDH/7zS MgQ79Yvo/O7EyyjF8ZWGfsk8Ttih73X3RllaZ+0xtT8AbSGMaN61tLnf+X0/rS0oPncY /JGA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=19++vR8OerylIUBCdkXPucDjEPQq7qHru1d4PS1ijhY=; fh=FxxuQyV5zt5uOZlISi71Gibj4pONM7+jzC8ls2GxgWY=; b=hvge34I3i95sPEkaiR3rY4QtoctCJu8P4yLCWCRRAbMAXMl0quhAYtB8dOHAtywV1/ /MTTCjAYIfrqDctU4RGC4iMGg8kbjQrcoSdPxT7KYXyItTjnrIc54u/2mB3ZQ6dm5WIt vU4dGPUHVNy2Jd1KTDggBzj4oPVuu7LV+c65WBXmRjJapjNP8/KojB4lOpaKPjGz1PVT Hkd6nJzYApFKzYmtbg8SHV+L5ayefCqQnoXn81FCcHBPJmzAG9sW0AWWbivnW3Qomi1a Ncm9iSNwHZYIP260Eh9Q8DZ8G5jo1QhrIGkJ+VoiS778M8MMn2hZ9hMFNB81HRBWGLc0 5o8Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Received: from lipwig.vger.email (lipwig.vger.email. [2620:137:e000::3:3]) by mx.google.com with ESMTPS id z185-20020a6333c2000000b00577dd005706si4547559pgz.779.2023.09.16.06.05.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 16 Sep 2023 06:05:52 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) client-ip=2620:137:e000::3:3; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id CBF6A8323BC9; Sat, 16 Sep 2023 06:05:38 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239333AbjIPND5 (ORCPT + 29 others); Sat, 16 Sep 2023 09:03:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38204 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233025AbjIPNDj (ORCPT ); Sat, 16 Sep 2023 09:03:39 -0400 Received: from out30-111.freemail.mail.aliyun.com (out30-111.freemail.mail.aliyun.com [115.124.30.111]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 95FC1CC2; Sat, 16 Sep 2023 06:03:31 -0700 (PDT) X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R111e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=ay29a033018045170;MF=xueshuai@linux.alibaba.com;NM=1;PH=DS;RN=22;SR=0;TI=SMTPD_---0VsA36vM_1694869406; Received: from localhost.localdomain(mailfrom:xueshuai@linux.alibaba.com fp:SMTPD_---0VsA36vM_1694869406) by smtp.aliyun-inc.com; Sat, 16 Sep 2023 21:03:28 +0800 From: Shuai Xue To: keescook@chromium.org, tony.luck@intel.com, gpiccoli@igalia.com, rafael@kernel.org, lenb@kernel.org, james.morse@arm.com, bp@alien8.de, tglx@linutronix.de, mingo@redhat.com, dave.hansen@linux.intel.com, x86@kernel.org, hpa@zytor.com, ardb@kernel.org, robert.moore@intel.com Cc: linux-hardening@vger.kernel.org, linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org, linux-edac@vger.kernel.org, linux-efi@vger.kernel.org, acpica-devel@lists.linuxfoundation.org, xueshuai@linux.alibaba.com, baolin.wang@linux.alibaba.com Subject: [RFC PATCH 5/9] ACPI: APEI: GHES: Use ERST to serialize APEI generic error before panic Date: Sat, 16 Sep 2023 21:03:12 +0800 Message-Id: <20230916130316.65815-6-xueshuai@linux.alibaba.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230916130316.65815-1-xueshuai@linux.alibaba.com> References: <20230916130316.65815-1-xueshuai@linux.alibaba.com> MIME-Version: 1.0 X-Spam-Status: No, score=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,UNPARSEABLE_RELAY autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (lipwig.vger.email [0.0.0.0]); Sat, 16 Sep 2023 06:05:38 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1777199535105829653 X-GMAIL-MSGID: 1777199535105829653 In certain scenarios (ie. hosts/guests with root filesystems on NFS/iSCSI where networking software and/or hardware fails, and thus kdump fails), it is necessary to serialize hardware error information available for post-mortem debugging. Save the hardware error log into flash via ERST before go panic, the hardware error log can be gotten from the flash after system boot successful again, which is very useful in production. Signed-off-by: Shuai Xue --- drivers/acpi/apei/ghes.c | 44 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) diff --git a/drivers/acpi/apei/ghes.c b/drivers/acpi/apei/ghes.c index d14e00751161..16701f889b73 100644 --- a/drivers/acpi/apei/ghes.c +++ b/drivers/acpi/apei/ghes.c @@ -41,6 +41,7 @@ #include #include #include +#include #include #include @@ -636,6 +637,43 @@ static void ghes_defer_non_standard_event(struct acpi_hest_generic_data *gdata, schedule_work(&entry->work); } +static int ghes_serialize_estatus(struct acpi_hest_generic_data *gdata, u8 notify_type) +{ + void *err = acpi_hest_get_payload(gdata); + int data_len = gdata->error_data_length; + struct cper_pstore_record *rcd; + int record_len = data_len + sizeof(*rcd); + + rcd = kmalloc(record_len, GFP_KERNEL); + memset(rcd, 0, sizeof(rcd)); + + memcpy(rcd->hdr.signature, CPER_SIG_RECORD, CPER_SIG_SIZE); + rcd->hdr.revision = CPER_RECORD_REV; + rcd->hdr.signature_end = CPER_SIG_END; + rcd->hdr.section_count = 1; + rcd->hdr.error_severity = CPER_SEV_FATAL; + /* timestamp, platform_id, partition_id are all invalid */ + rcd->hdr.validation_bits = 0; + rcd->hdr.record_length = record_len; + rcd->hdr.creator_id = CPER_CREATOR_PSTORE; + rcd->hdr.notification_type = CPER_NOTIFY_MCE; + rcd->hdr.record_id = cper_next_record_id(); + rcd->hdr.flags = CPER_HW_ERROR_FLAGS_PREVERR; + + rcd->sec_hdr.section_offset = (void *)&rcd->data - (void *)&rcd; + rcd->sec_hdr.section_length = data_len; + rcd->sec_hdr.revision = CPER_SEC_REV; + /* ->ru_id and fru_text is invalid */ + rcd->sec_hdr.validation_bits = 0; + rcd->sec_hdr.flags = CPER_SEC_PRIMARY; + rcd->sec_hdr.section_type = gdata->section_type; + rcd->sec_hdr.section_severity = gdata->error_severity; + + memcpy(&rcd->data, err, data_len); + + return erst_write(&rcd->hdr); +} + static bool ghes_do_proc(struct ghes *ghes, const struct acpi_hest_generic_status *estatus) { @@ -861,10 +899,16 @@ static void __ghes_panic(struct ghes *ghes, struct acpi_hest_generic_status *estatus, u64 buf_paddr, enum fixed_addresses fixmap_idx) { + struct acpi_hest_generic_data *gdata; + u8 notify_type = ghes->generic->notify.type; + __ghes_print_estatus(KERN_EMERG, ghes->generic, estatus); ghes_clear_estatus(ghes, estatus, buf_paddr, fixmap_idx); + apei_estatus_for_each_section(estatus, gdata) + ghes_serialize_estatus(gdata, notify_type); + /* reboot to log the error! */ if (!panic_timeout) panic_timeout = ghes_panic_timeout; From patchwork Sat Sep 16 13:03:13 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shuai Xue X-Patchwork-Id: 141045 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:172:b0:3f2:4152:657d with SMTP id h50csp1648231vqi; Sat, 16 Sep 2023 06:05:53 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHMeNqjiIhml9VrLGn0B9iCTOkOZ/YdyGVEG2HrC2bWuUmjV35UK35+ZQMEInGs7Wt1pZj1 X-Received: by 2002:a17:90a:f196:b0:26b:3751:652a with SMTP id bv22-20020a17090af19600b0026b3751652amr4191417pjb.38.1694869552812; Sat, 16 Sep 2023 06:05:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694869552; cv=none; d=google.com; s=arc-20160816; b=oe2in3/wSYkrsw/mvG+Hqy7NpzMwSx6CDKffsEnP7uTQVXf76drOVON+/yBTUHBz4p k83I2bFQBgqjdMcmEaHAl68qd91Wa0H3R++gZM2hp6xeMOM8OR2SHiE8+/ztsd+pCjaF TVOIP3eb+ph21NuZgJwkrdqwg6ff+5veorOYlB5qoQhdsccx6RfYqcTTpIehVYz97LyV n+5Q0UH9hRBgIbOO6oYeugBKD+4QUkylScSDbGx3O86l/DdtlNRedM9LG5pZcbRuBA9H kBqFzlIUmkzV3ZEG/PG6dYV4CLeRwcw+I12eKDvf0XiyhodymBkBWBxe+Ai6gtudRaAB 5NoA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=T5KxuboV1LYH0PzP/5XReDtQg+eWGkJTJ+T9XjTIvFQ=; fh=FxxuQyV5zt5uOZlISi71Gibj4pONM7+jzC8ls2GxgWY=; b=khsxOMmzKeGabQxgBi5r17QLG5fstjc3WAR68UXNWRwmit4K2T7xMSbfjI3OArMfVT AZ1d4t1gXXitSQyVf5JP0EWjO44xZGHaYF4V0Umd9Y730XltIsMD5U9hXSAXl/5XDd0b TKC5oDVyrzzpxZFMKalC4lKpfag7R/pwDWjcuZJkOdbpVXSwbnQSNFsWl7K8vjtsYCMo HWX0Kuh/KSPnsV9GoJMOCM9irdg0T95DJz1rkHtXSxTbh9p9Hm8kYCcsSc6EhuVoBUwZ 1qtE/yjwPyD1FY6/hCOi2i/KrmWiE4zhoDjNNnXm6P7t43oeuE8nSDWkSG+Z+ENPyvCY 1BbQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Received: from lipwig.vger.email (lipwig.vger.email. [23.128.96.33]) by mx.google.com with ESMTPS id oo17-20020a17090b1c9100b00263c23a5693si5359231pjb.13.2023.09.16.06.05.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 16 Sep 2023 06:05:52 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) client-ip=23.128.96.33; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id 6E4BF8357673; Sat, 16 Sep 2023 06:05:50 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239228AbjIPND7 (ORCPT + 29 others); Sat, 16 Sep 2023 09:03:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38224 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233681AbjIPNDl (ORCPT ); Sat, 16 Sep 2023 09:03:41 -0400 Received: from out30-118.freemail.mail.aliyun.com (out30-118.freemail.mail.aliyun.com [115.124.30.118]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 826B91B2; Sat, 16 Sep 2023 06:03:35 -0700 (PDT) X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R101e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=ay29a033018046050;MF=xueshuai@linux.alibaba.com;NM=1;PH=DS;RN=22;SR=0;TI=SMTPD_---0VsA36vt_1694869408; Received: from localhost.localdomain(mailfrom:xueshuai@linux.alibaba.com fp:SMTPD_---0VsA36vt_1694869408) by smtp.aliyun-inc.com; Sat, 16 Sep 2023 21:03:29 +0800 From: Shuai Xue To: keescook@chromium.org, tony.luck@intel.com, gpiccoli@igalia.com, rafael@kernel.org, lenb@kernel.org, james.morse@arm.com, bp@alien8.de, tglx@linutronix.de, mingo@redhat.com, dave.hansen@linux.intel.com, x86@kernel.org, hpa@zytor.com, ardb@kernel.org, robert.moore@intel.com Cc: linux-hardening@vger.kernel.org, linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org, linux-edac@vger.kernel.org, linux-efi@vger.kernel.org, acpica-devel@lists.linuxfoundation.org, xueshuai@linux.alibaba.com, baolin.wang@linux.alibaba.com Subject: [RFC PATCH 6/9] ACPI: APEI: GHES: export ghes_report_chain Date: Sat, 16 Sep 2023 21:03:13 +0800 Message-Id: <20230916130316.65815-7-xueshuai@linux.alibaba.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230916130316.65815-1-xueshuai@linux.alibaba.com> References: <20230916130316.65815-1-xueshuai@linux.alibaba.com> MIME-Version: 1.0 X-Spam-Status: No, score=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,UNPARSEABLE_RELAY autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (lipwig.vger.email [0.0.0.0]); Sat, 16 Sep 2023 06:05:50 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1777199536415040073 X-GMAIL-MSGID: 1777199536415040073 Export ghes_report_chain so that it can be kicked by other drivers. Signed-off-by: Shuai Xue --- drivers/acpi/apei/ghes.c | 2 +- include/acpi/ghes.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/acpi/apei/ghes.c b/drivers/acpi/apei/ghes.c index 16701f889b73..80aeb06a1f76 100644 --- a/drivers/acpi/apei/ghes.c +++ b/drivers/acpi/apei/ghes.c @@ -95,7 +95,7 @@ #define FIX_APEI_GHES_SDEI_CRITICAL __end_of_fixed_addresses #endif -static ATOMIC_NOTIFIER_HEAD(ghes_report_chain); +ATOMIC_NOTIFIER_HEAD(ghes_report_chain); static inline bool is_hest_type_generic_v2(struct ghes *ghes) { diff --git a/include/acpi/ghes.h b/include/acpi/ghes.h index 3c8bba9f1114..151567353e33 100644 --- a/include/acpi/ghes.h +++ b/include/acpi/ghes.h @@ -126,7 +126,7 @@ int ghes_notify_sea(void); static inline int ghes_notify_sea(void) { return -ENOENT; } #endif -struct notifier_block; +extern struct atomic_notifier_head ghes_report_chain; extern void ghes_register_report_chain(struct notifier_block *nb); extern void ghes_unregister_report_chain(struct notifier_block *nb); #endif /* GHES_H */ From patchwork Sat Sep 16 13:03:14 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shuai Xue X-Patchwork-Id: 141048 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:172:b0:3f2:4152:657d with SMTP id h50csp1648747vqi; Sat, 16 Sep 2023 06:06:38 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFD3TPf9RjWQNen/GzKoKJ3cVNFpEuF4yzc37wdbUfvBycEAUmJuk4Ax1afaNW+xx5rwdY+ X-Received: by 2002:a05:6a00:995:b0:68f:c081:3d5c with SMTP id u21-20020a056a00099500b0068fc0813d5cmr5165942pfg.8.1694869598117; Sat, 16 Sep 2023 06:06:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694869598; cv=none; d=google.com; s=arc-20160816; b=fX7UJadXfHUg9EyGKg5oJbu3aaRvqO4Kx4b8ErC73WcmMYQcRD7wVRPKOgXDgiU0ai AMnOjzTZ7KFZ0ZBbpRqjxHPqx9pNmV/XBQAww/Lp8v60htWfCznfKSgNlh9Dx/jZ8HuG GeFnRoXBcKDJCeR+9d0Et1zGC23ymWIsZbrNyNc5CVdRahGY4Q5OZu3tZPP171+3Khws 1XwwLOTRhcOl9LOtJVkALvXKqe9roKaPnfBXJu1ahJAMwUOUo9bImNS82/h/K8BX2dHV EZf/KqX5i30MxcHu0OBEyJcBjoUA4kHRdkZsxTjAQ6XDpss0Et6W4NMJ/qPDKkNqMofM LB0Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=9ZOHefK1gRf8hl4ujudfAT+TiUjCQqpDUEFWH2isAPY=; fh=FxxuQyV5zt5uOZlISi71Gibj4pONM7+jzC8ls2GxgWY=; b=d3gHTpnga1Mccn1tWc+H1/Qmb7U1ewDUOenGSN+1SsVqZfAla6rKzsAPp7ixltoKNX hlNegbX0b1ZOW1FKcGYCPRvgnoW3VBKdkXp03kYBr4CyP2ef/NIiN/2mFW9afMhmgnjh zLbxBdDJO7m2d1kmMxbmv5HcXVumt+SMpNwQXC501mrYDC/Fm6ccLNrpWQdWKBcNEpLk XvlnvxToAngp3szH29Or7EBLwOvhhOVPXu4n+IJIf/HJxsyMSZmQJXpUFg/OLVpX10NG C8qStEGSra00mh1V/ZKk3ffmuqfoSOWF1mZ+4PTdFvBIRtE2SnyIexSfV6Fv57BaXakG B/6g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Received: from agentk.vger.email (agentk.vger.email. [23.128.96.32]) by mx.google.com with ESMTPS id i189-20020a6387c6000000b0057406f52467si4752187pge.517.2023.09.16.06.06.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 16 Sep 2023 06:06:38 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) client-ip=23.128.96.32; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id 50BD682B97A1; Sat, 16 Sep 2023 06:05:41 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239343AbjIPND6 (ORCPT + 29 others); Sat, 16 Sep 2023 09:03:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38210 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233337AbjIPNDl (ORCPT ); Sat, 16 Sep 2023 09:03:41 -0400 Received: from out30-130.freemail.mail.aliyun.com (out30-130.freemail.mail.aliyun.com [115.124.30.130]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 79287DD; Sat, 16 Sep 2023 06:03:34 -0700 (PDT) X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R131e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=ay29a033018046051;MF=xueshuai@linux.alibaba.com;NM=1;PH=DS;RN=22;SR=0;TI=SMTPD_---0VsA36wZ_1694869410; Received: from localhost.localdomain(mailfrom:xueshuai@linux.alibaba.com fp:SMTPD_---0VsA36wZ_1694869410) by smtp.aliyun-inc.com; Sat, 16 Sep 2023 21:03:31 +0800 From: Shuai Xue To: keescook@chromium.org, tony.luck@intel.com, gpiccoli@igalia.com, rafael@kernel.org, lenb@kernel.org, james.morse@arm.com, bp@alien8.de, tglx@linutronix.de, mingo@redhat.com, dave.hansen@linux.intel.com, x86@kernel.org, hpa@zytor.com, ardb@kernel.org, robert.moore@intel.com Cc: linux-hardening@vger.kernel.org, linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org, linux-edac@vger.kernel.org, linux-efi@vger.kernel.org, acpica-devel@lists.linuxfoundation.org, xueshuai@linux.alibaba.com, baolin.wang@linux.alibaba.com Subject: [RFC PATCH 7/9] ACPI: APEI: ESRT: kick ghes_report_chain notifier to report serialized memory errors Date: Sat, 16 Sep 2023 21:03:14 +0800 Message-Id: <20230916130316.65815-8-xueshuai@linux.alibaba.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230916130316.65815-1-xueshuai@linux.alibaba.com> References: <20230916130316.65815-1-xueshuai@linux.alibaba.com> MIME-Version: 1.0 X-Spam-Status: No, score=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,UNPARSEABLE_RELAY autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Sat, 16 Sep 2023 06:05:41 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1777199583704362568 X-GMAIL-MSGID: 1777199583704362568 Introduce a new pstore_record type, PSTORE_TYPE_CPER_MEM, so that serialized memory errors can be retrieved and saved as a file in pstore file system. While the serialized errors is retrieved from ERST backend, kick ghes_report_chain notifier. Signed-off-by: Shuai Xue --- drivers/acpi/apei/erst.c | 5 +++++ fs/pstore/platform.c | 1 + include/linux/pstore.h | 3 +++ 3 files changed, 9 insertions(+) diff --git a/drivers/acpi/apei/erst.c b/drivers/acpi/apei/erst.c index f789e3df73a9..665b8f93dab3 100644 --- a/drivers/acpi/apei/erst.c +++ b/drivers/acpi/apei/erst.c @@ -26,6 +26,7 @@ #include #include /* kvfree() */ #include +#include /* only define CREATE_TRACE_POINTS once */ #include @@ -1068,6 +1069,10 @@ static ssize_t erst_reader(struct pstore_record *record) else if (guid_equal(&rcd->sec_hdr.section_type, &CPER_SECTION_TYPE_MCE)) { trace_mce_record((struct mce *)rcd->data); record->type = PSTORE_TYPE_MCE; + } else if (guid_equal(&rcd->sec_hdr.section_type, &CPER_SEC_PLATFORM_MEM)) { + record->type = PSTORE_TYPE_CPER_MEM; + arch_apei_report_mem_error(0x2, (struct cper_sec_mem_err *)rcd->data); + atomic_notifier_call_chain(&ghes_report_chain, 0x2, rcd->data); } else record->type = PSTORE_TYPE_MAX; diff --git a/fs/pstore/platform.c b/fs/pstore/platform.c index e5bca9a004cc..4e63ac8be755 100644 --- a/fs/pstore/platform.c +++ b/fs/pstore/platform.c @@ -51,6 +51,7 @@ static const char * const pstore_type_names[] = { "powerpc-common", "pmsg", "powerpc-opal", + "cper-mem", }; static int pstore_new_entry; diff --git a/include/linux/pstore.h b/include/linux/pstore.h index ad44b3baf10e..d18ecaacd1b5 100644 --- a/include/linux/pstore.h +++ b/include/linux/pstore.h @@ -40,6 +40,9 @@ enum pstore_type_id { PSTORE_TYPE_PMSG = 7, PSTORE_TYPE_PPC_OPAL = 8, + /* APEI section */ + PSTORE_TYPE_CPER_MEM = 9, + /* End of the list */ PSTORE_TYPE_MAX }; From patchwork Sat Sep 16 13:03:15 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shuai Xue X-Patchwork-Id: 141046 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:172:b0:3f2:4152:657d with SMTP id h50csp1648380vqi; Sat, 16 Sep 2023 06:06:04 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEeFZ+C3NnaWKl1Hq409Mef+Ipn5qNvcCDnLAQX8pMDVzNKTdrjfOpfayPIDZAQRqA3irMG X-Received: by 2002:a05:6e02:1248:b0:345:d4da:41d with SMTP id j8-20020a056e02124800b00345d4da041dmr5301708ilq.8.1694869564005; Sat, 16 Sep 2023 06:06:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694869563; cv=none; d=google.com; s=arc-20160816; b=mNdakGFUqOPrFAxSjXJWOjwFPxokr0i819c8HsncpYIRU8LvD/dXXyADicUfMybHUv A9yIdAXUVgM10qCqmKFTbpp/LI+JvoW9ury66F8LJ4vao+lIN2qTiUzJeRmQ5Va1nmwE eqwBgsNAN3rEuZV1mWSW3NgK3CetoGMMsBTM1R4T8wSuCtafH8l8+2OESvbrcsqc/zjh dfof1L+X+ckSXMjLxREZp0oFzpR8vAdRAAyoPKCBvdW8P4uzNt6ZWituVAK1DPF3gUtH LvNr9VulVXbbv3mW0ak3qs/eNXL2o37RK4C/KZGvoydBiJmgc/kEa4GzzVv2pRbj03pd nfZQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=fuug96AfYc3cCGcjcf78Yf8e8ROIh3mxs+PR6xIAEgQ=; fh=FxxuQyV5zt5uOZlISi71Gibj4pONM7+jzC8ls2GxgWY=; b=yNZ8bMpbralTeuniECNaxzt5GxHhd1Ju+4Y42bpeMPPImdq+2HnuMmRkVGn4IuQ455 TAjHJYl7HxTu+cYyinDO0ddLG+G1y4AR6csD6nJcIt+MawhMmcfL2FSzZUBFKbAKOvfF TJQfax6Ub8x+Ri31GYkE1zisc/caJw6rg+hyQNwzAfeYG2lDB5pIqkS7Uoq3F0TA9ygX gBBVrZuNweNxu9L7jRgmz4A+b6qCMTSdEQo3GhQ2PYDi7WYSuUDq9dpxoMT41by2wErl aCs6gUKKC59Rqc7AOZK2W0XVceK1jDVJqEQx3++bWGayFr2hyt8MMMDtulhIhD6WqkzO PaLw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Received: from pete.vger.email (pete.vger.email. [2620:137:e000::3:6]) by mx.google.com with ESMTPS id w12-20020a637b0c000000b005641315d956si4851492pgc.147.2023.09.16.06.06.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 16 Sep 2023 06:06:03 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) client-ip=2620:137:e000::3:6; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by pete.vger.email (Postfix) with ESMTP id C8B6981C4A91; Sat, 16 Sep 2023 06:06:00 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239369AbjIPNEA (ORCPT + 29 others); Sat, 16 Sep 2023 09:04:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37448 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235850AbjIPNDn (ORCPT ); Sat, 16 Sep 2023 09:03:43 -0400 Received: from out30-132.freemail.mail.aliyun.com (out30-132.freemail.mail.aliyun.com [115.124.30.132]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D85161B5; Sat, 16 Sep 2023 06:03:36 -0700 (PDT) X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R561e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=ay29a033018046059;MF=xueshuai@linux.alibaba.com;NM=1;PH=DS;RN=22;SR=0;TI=SMTPD_---0VsA36x0_1694869411; Received: from localhost.localdomain(mailfrom:xueshuai@linux.alibaba.com fp:SMTPD_---0VsA36x0_1694869411) by smtp.aliyun-inc.com; Sat, 16 Sep 2023 21:03:32 +0800 From: Shuai Xue To: keescook@chromium.org, tony.luck@intel.com, gpiccoli@igalia.com, rafael@kernel.org, lenb@kernel.org, james.morse@arm.com, bp@alien8.de, tglx@linutronix.de, mingo@redhat.com, dave.hansen@linux.intel.com, x86@kernel.org, hpa@zytor.com, ardb@kernel.org, robert.moore@intel.com Cc: linux-hardening@vger.kernel.org, linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org, linux-edac@vger.kernel.org, linux-efi@vger.kernel.org, acpica-devel@lists.linuxfoundation.org, xueshuai@linux.alibaba.com, baolin.wang@linux.alibaba.com Subject: [RFC PATCH 8/9] ACPI: APEI: ESRT: print AER to report serialized PCIe errors Date: Sat, 16 Sep 2023 21:03:15 +0800 Message-Id: <20230916130316.65815-9-xueshuai@linux.alibaba.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230916130316.65815-1-xueshuai@linux.alibaba.com> References: <20230916130316.65815-1-xueshuai@linux.alibaba.com> MIME-Version: 1.0 X-Spam-Status: No, score=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,UNPARSEABLE_RELAY autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on pete.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (pete.vger.email [0.0.0.0]); Sat, 16 Sep 2023 06:06:00 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1777199548265011955 X-GMAIL-MSGID: 1777199548265011955 Introduce a new pstore_record type, PSTORE_TYPE_CPER_PCIE, so that serialized PCIe errors can be restrived and saved as a file in pstore file system. While the serialized PCIe errors is retrieved from ERST backend, print AER information. Signed-off-by: Shuai Xue --- drivers/acpi/apei/erst.c | 15 +++++++++++++++ fs/pstore/platform.c | 1 + include/linux/pstore.h | 1 + 3 files changed, 17 insertions(+) diff --git a/drivers/acpi/apei/erst.c b/drivers/acpi/apei/erst.c index 665b8f93dab3..4f000cb1433a 100644 --- a/drivers/acpi/apei/erst.c +++ b/drivers/acpi/apei/erst.c @@ -27,6 +27,8 @@ #include /* kvfree() */ #include #include +#include +#include /* only define CREATE_TRACE_POINTS once */ #include @@ -1073,6 +1075,19 @@ static ssize_t erst_reader(struct pstore_record *record) record->type = PSTORE_TYPE_CPER_MEM; arch_apei_report_mem_error(0x2, (struct cper_sec_mem_err *)rcd->data); atomic_notifier_call_chain(&ghes_report_chain, 0x2, rcd->data); + } else if (guid_equal(&rcd->sec_hdr.section_type, &CPER_SEC_PCIE)) { + + struct cper_sec_pcie *pcie_err = (struct cper_sec_pcie *)rcd->data; + unsigned int devfn = PCI_DEVFN(pcie_err->device_id.device, + pcie_err->device_id.function); + struct pci_dev *pdev = pci_get_domain_bus_and_slot( + pcie_err->device_id.segment, pcie_err->device_id.bus, + devfn); + + record->type = PSTORE_TYPE_CPER_PCIE; + cper_print_aer( + pdev, AER_FATAL, + (struct aer_capability_regs *)pcie_err->aer_info); } else record->type = PSTORE_TYPE_MAX; diff --git a/fs/pstore/platform.c b/fs/pstore/platform.c index 4e63ac8be755..40a062546fe4 100644 --- a/fs/pstore/platform.c +++ b/fs/pstore/platform.c @@ -52,6 +52,7 @@ static const char * const pstore_type_names[] = { "pmsg", "powerpc-opal", "cper-mem", + "cper-pcie", }; static int pstore_new_entry; diff --git a/include/linux/pstore.h b/include/linux/pstore.h index d18ecaacd1b5..e63f51e9c22e 100644 --- a/include/linux/pstore.h +++ b/include/linux/pstore.h @@ -42,6 +42,7 @@ enum pstore_type_id { /* APEI section */ PSTORE_TYPE_CPER_MEM = 9, + PSTORE_TYPE_CPER_PCIE = 10, /* End of the list */ PSTORE_TYPE_MAX From patchwork Sat Sep 16 13:03:16 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shuai Xue X-Patchwork-Id: 141049 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:172:b0:3f2:4152:657d with SMTP id h50csp1648829vqi; Sat, 16 Sep 2023 06:06:43 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFb/lghuxcAjEpTm/z2u9kxwT+Nwcxyf0SqULRuz6S3OqES7mF1FgHIbqzk76dj0GML19U4 X-Received: by 2002:a05:6a00:2192:b0:68a:31b2:5219 with SMTP id h18-20020a056a00219200b0068a31b25219mr4762407pfi.22.1694869602924; Sat, 16 Sep 2023 06:06:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694869602; cv=none; d=google.com; s=arc-20160816; b=ENxvTrNJuT70w3BEzCLdi9x9NwWm35o7WuAjnaawe8u8kcY/5uP5reWDwDpwBKeS+4 KHYdujTTnJhtb6KCFEo0KfH0P+QCWMQJzjbPrDVzkq2S62FhGmocuz9necMRt9Gr9gWA FL1w6y6wU8qcYDMBuef+uShfPOmo3+b/fjh+FI04Ivg9ijGaTm0ZuSbdtlJn+2Rt2Zp/ sJmkXd1qS2LVQTur4UTTBK/st8rpSGGT4NoNrte38wTvfYr2rDr06R5lGlHR4DspDR5Z smuDcd5Z3UGuDGFRXHyB2kVBlo9u8C4g5pq8NQz7/KRdq+n5JC/ttm7TjvNxYHMyQa4w xViw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=PBGICBHSOl+9Qr5ggzH7v6YGcz9vdLFeJ9OYWpqtMXs=; fh=FxxuQyV5zt5uOZlISi71Gibj4pONM7+jzC8ls2GxgWY=; b=oBSHwWju/cjcuL7OrqXQsEUZm+PBFNbY01g4hygCIDoGqlcUPaNSzXiVP8m5OgXeFp 37XtaoQo4Nan8A3qgEsfUlVSQ6KVU2g26eX8OdS6BCn3E5aqQbp7a1BViq581c0aDKm8 VtOmPEc8TatuJlu5/+ISJZgVZ0iofN3WBemDxWYgprTBZJi9IAlvWXtSaK+Rx2O1m1ik 9nITa/j0/NXx9h/W4UX/TQBrREfhTkFuBwUXWGjRLBkGocTcNLt8X9FP8atUYONUSvhJ hoLbC2ijSOiTy8zzj+T5V9uWjjOBQn0MybofrKz/qAG0vFc0cNybN2doTow9zy0Kca27 F+BA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Received: from agentk.vger.email (agentk.vger.email. [23.128.96.32]) by mx.google.com with ESMTPS id w71-20020a63824a000000b00569cd6ead3asi4783836pgd.643.2023.09.16.06.06.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 16 Sep 2023 06:06:42 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) client-ip=23.128.96.32; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id CE49E82CFF39; Sat, 16 Sep 2023 06:06:11 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239378AbjIPNEB (ORCPT + 29 others); Sat, 16 Sep 2023 09:04:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37458 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236560AbjIPNDo (ORCPT ); Sat, 16 Sep 2023 09:03:44 -0400 Received: from out30-112.freemail.mail.aliyun.com (out30-112.freemail.mail.aliyun.com [115.124.30.112]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 62208DD; Sat, 16 Sep 2023 06:03:38 -0700 (PDT) X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R201e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=ay29a033018046049;MF=xueshuai@linux.alibaba.com;NM=1;PH=DS;RN=22;SR=0;TI=SMTPD_---0VsA36xg_1694869413; Received: from localhost.localdomain(mailfrom:xueshuai@linux.alibaba.com fp:SMTPD_---0VsA36xg_1694869413) by smtp.aliyun-inc.com; Sat, 16 Sep 2023 21:03:34 +0800 From: Shuai Xue To: keescook@chromium.org, tony.luck@intel.com, gpiccoli@igalia.com, rafael@kernel.org, lenb@kernel.org, james.morse@arm.com, bp@alien8.de, tglx@linutronix.de, mingo@redhat.com, dave.hansen@linux.intel.com, x86@kernel.org, hpa@zytor.com, ardb@kernel.org, robert.moore@intel.com Cc: linux-hardening@vger.kernel.org, linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org, linux-edac@vger.kernel.org, linux-efi@vger.kernel.org, acpica-devel@lists.linuxfoundation.org, xueshuai@linux.alibaba.com, baolin.wang@linux.alibaba.com Subject: [RFC PATCH 9/9] ACPI: APEI: ESRT: log ARM processor error Date: Sat, 16 Sep 2023 21:03:16 +0800 Message-Id: <20230916130316.65815-10-xueshuai@linux.alibaba.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230916130316.65815-1-xueshuai@linux.alibaba.com> References: <20230916130316.65815-1-xueshuai@linux.alibaba.com> MIME-Version: 1.0 X-Spam-Status: No, score=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,UNPARSEABLE_RELAY autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Sat, 16 Sep 2023 06:06:11 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1777199588914379870 X-GMAIL-MSGID: 1777199588914379870 Introduce a new pstore_record type, PSTORE_TYPE_CPER_PROC_ARM, so that serialized ARM processor errors can be retrieved and saved as a file in pstore file system. While the serialized errors is retrieved from ERST backend, log it. Signed-off-by: Shuai Xue --- drivers/acpi/apei/erst.c | 6 ++++++ fs/pstore/platform.c | 1 + include/linux/pstore.h | 1 + 3 files changed, 8 insertions(+) diff --git a/drivers/acpi/apei/erst.c b/drivers/acpi/apei/erst.c index 4f000cb1433a..c92d977d15cd 100644 --- a/drivers/acpi/apei/erst.c +++ b/drivers/acpi/apei/erst.c @@ -29,6 +29,7 @@ #include #include #include +#include /* only define CREATE_TRACE_POINTS once */ #include @@ -1088,6 +1089,11 @@ static ssize_t erst_reader(struct pstore_record *record) cper_print_aer( pdev, AER_FATAL, (struct aer_capability_regs *)pcie_err->aer_info); + } else if (guid_equal(&rcd->sec_hdr.section_type, &CPER_SEC_PROC_ARM)) { + struct cper_sec_proc_arm *err = (struct cper_sec_proc_arm *)rcd->data; + + record->type = PSTORE_TYPE_CPER_PROC_ARM; + log_arm_hw_error(err); } else record->type = PSTORE_TYPE_MAX; diff --git a/fs/pstore/platform.c b/fs/pstore/platform.c index 40a062546fe4..48ad3202284c 100644 --- a/fs/pstore/platform.c +++ b/fs/pstore/platform.c @@ -53,6 +53,7 @@ static const char * const pstore_type_names[] = { "powerpc-opal", "cper-mem", "cper-pcie", + "cper-proc-arm", }; static int pstore_new_entry; diff --git a/include/linux/pstore.h b/include/linux/pstore.h index e63f51e9c22e..83edff5aab0b 100644 --- a/include/linux/pstore.h +++ b/include/linux/pstore.h @@ -43,6 +43,7 @@ enum pstore_type_id { /* APEI section */ PSTORE_TYPE_CPER_MEM = 9, PSTORE_TYPE_CPER_PCIE = 10, + PSTORE_TYPE_CPER_PROC_ARM = 11, /* End of the list */ PSTORE_TYPE_MAX