Received: by 2002:a05:7412:31a9:b0:e2:908c:2ebd with SMTP id et41csp5173506rdb; Sat, 16 Sep 2023 06:05:51 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGuwOxN6TPOcqNuiPa0inEkhT6i9FnWLO/K3p4JWCpA9IedhsCPwxOVu1xlklMx7gzz1lRF X-Received: by 2002:a05:6a21:4881:b0:159:b7ba:74bd with SMTP id av1-20020a056a21488100b00159b7ba74bdmr3548648pzc.50.1694869550951; Sat, 16 Sep 2023 06:05:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694869550; cv=none; d=google.com; s=arc-20160816; b=oiV8rwPPmWnZyvRx5YRUBokn5jq45IQetr4O/nGygWChX3nKVKPRx2I7dnp/YfIHWG lPlKV+se7sLDnj1/gi69tPSVZXW/tBfZvHpN0pCyjYrnnTdZTLMI/nwQwFielJ+i6XJx /H4hLh6VtqOvBjX30XJ8QWVd4MntlmrACHVeIIEUjFtZSKUtAoBUrJ3h4nTWaBzf+CSZ beuEXBbvZKl25Q6XetMBMQBodVRv1M75pmVOunRz4X4Qnb3yh2Wr4dwjqVX0C4UZGUNT N2jbDDXUVArGejrXNH4k7jso/ToTLCiLDvMEleAJuOUFLJkunCHwln/LyLZ8kr0Key5u dheA== 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 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 Return-Path: Received: from pete.vger.email (pete.vger.email. [2620:137:e000::3:6]) by mx.google.com with ESMTPS id k24-20020a63ff18000000b00563f8ccc097si4629087pgi.780.2023.09.16.06.05.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 16 Sep 2023 06:05:50 -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 38B3382E108F; Sat, 16 Sep 2023 06:05:12 -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 S239316AbjIPNDz (ORCPT + 99 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 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 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:05:12 -0700 (PDT) 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; -- 2.41.0