Received: by 2002:a05:7412:2a8c:b0:e2:908c:2ebd with SMTP id u12csp1044245rdh; Mon, 25 Sep 2023 01:08:15 -0700 (PDT) X-Google-Smtp-Source: AGHT+IF4KzyknA0BFcHv0Fh0JCxjR4I/uMfL6bmwxO1JGxgdj8yuZ6AFRxpi28iacZQ3KBpRZYjx X-Received: by 2002:a05:6a20:3d8b:b0:158:7fdf:66df with SMTP id s11-20020a056a203d8b00b001587fdf66dfmr7973470pzi.18.1695629294851; Mon, 25 Sep 2023 01:08:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695629294; cv=none; d=google.com; s=arc-20160816; b=lQnX4EHUEri4hSyTKBM0sQtQCar4Ybl3GHSITw1vBtPaHqH5mJ6KA81w8bfKx0Ske4 C1gNplSQtzOwddE6WQFFjtCTvC9xIwR7Z7J+bDmvNteErSMBvIb8Nwn+5XWigQfIDpci zYAKt/1RrxH0ysYS6/lh2APg9v329ZnzO751ElPf/3REbEy3UX8b0MeQiO28R+98l8Xt V6YxsvCh6JFz8NGSjAJAHuXC/GzYH5fdPi3+SmE1SCShO9deQD/B+sYkWS0nZFWucgUE yFOzNe212thjV9+b5o+JefepNMFhMQBIpepr9JClpOse9ii9uKLc4d2HYWyKUbMDLPMO HoCA== 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=vsdPBur5VT6S/O686cCIpjhlt8QnoI7PIa/U13O7rIE=; fh=FxxuQyV5zt5uOZlISi71Gibj4pONM7+jzC8ls2GxgWY=; b=AjA0UkdoVZAF2tMriScIyWMIcn8Yl+mUbksncz2eCoF9rhdCi9vcCh7y2vZxTCSxgg 6wv+ddMkVoSz3E09LvK0eAMlsYX/sIv15Til+5TLUEw8yHX33K7KrL4WCbpaf3XeU4kd 5RWFONVojN4BTYlpdsTjVhl+s8wu/Fq4ESvPyRSj8nYDSSABamTMuaInw3JMoMzKD4YE 3X7jtu2SCRsonJI8yRxE98IYaMZ05aD7OsiByELTqGuKZW82df5dI1V6dVzVYDGWnPs2 YGxgYFsbuJUTvPg1Yk7eJkGORJaINMfEt6PBaXimEehxW/Tn9j4cGmjnvJVBTNqEZ8qr Olag== 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 Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [23.128.96.33]) by mx.google.com with ESMTPS id cu8-20020a17090afa8800b0026b31ed4895si11821536pjb.29.2023.09.25.01.08.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Sep 2023 01:08:14 -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 F423A8082A5F; Mon, 25 Sep 2023 00:45:43 -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 S232563AbjIYHpa (ORCPT + 99 others); Mon, 25 Sep 2023 03:45:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49520 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232496AbjIYHpS (ORCPT ); Mon, 25 Sep 2023 03:45:18 -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 95DABCC4; Mon, 25 Sep 2023 00:44:53 -0700 (PDT) X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R211e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=ay29a033018045192;MF=xueshuai@linux.alibaba.com;NM=1;PH=DS;RN=22;SR=0;TI=SMTPD_---0Vsmvt44_1695627888; Received: from localhost.localdomain(mailfrom:xueshuai@linux.alibaba.com fp:SMTPD_---0Vsmvt44_1695627888) by smtp.aliyun-inc.com; Mon, 25 Sep 2023 15:44:49 +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 v2 9/9] ACPI: APEI: ESRT: log ARM processor error Date: Mon, 25 Sep 2023 15:44:26 +0800 Message-Id: <20230925074426.97856-10-xueshuai@linux.alibaba.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230925074426.97856-1-xueshuai@linux.alibaba.com> References: <20230925074426.97856-1-xueshuai@linux.alibaba.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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]); Mon, 25 Sep 2023 00:45:44 -0700 (PDT) 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 e0c44ea46acc..2b99573d1d5d 100644 --- a/drivers/acpi/apei/erst.c +++ b/drivers/acpi/apei/erst.c @@ -29,6 +29,7 @@ #include #include #include +#include #ifdef CONFIG_X86_MCE /* only define CREATE_TRACE_POINTS once */ #include @@ -1092,6 +1093,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 -- 2.41.0