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