From patchwork Mon Feb 26 20:15:20 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Ferguson X-Patchwork-Id: 206908 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:a81b:b0:108:e6aa:91d0 with SMTP id bq27csp2319778dyb; Mon, 26 Feb 2024 12:35:22 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCVzlbVNaKWvQzlgIsUOxkE/u85/Zvvasuda55oNXdANn6ljIk6sNN9MH2mVIVnd+olEg3PvXZeK7jU77LHRUi2pE0R4hQ== X-Google-Smtp-Source: AGHT+IHugXFCsbWh4bmuuVbV6EsPwnR6H9sl5qdYYMewoHPYvuHSSCjlYaMFVSXpJIgwlCExygcm X-Received: by 2002:a05:6e02:522:b0:363:bb5a:3329 with SMTP id h2-20020a056e02052200b00363bb5a3329mr8961607ils.1.1708979722111; Mon, 26 Feb 2024 12:35:22 -0800 (PST) Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id a9-20020a634d09000000b005dc6d16be5csi4178355pgb.439.2024.02.26.12.35.21 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 26 Feb 2024 12:35:22 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-82285-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@os.amperecomputing.com header.s=selector2 header.b=Q+7MLUsS; arc=fail (signature failed); spf=pass (google.com: domain of linux-kernel+bounces-82285-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-82285-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amperecomputing.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 8B3A7B24E28 for ; Mon, 26 Feb 2024 20:17:11 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id F28B313173A; Mon, 26 Feb 2024 20:16:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=os.amperecomputing.com header.i=@os.amperecomputing.com header.b="Q+7MLUsS" Received: from NAM10-MW2-obe.outbound.protection.outlook.com (mail-mw2nam10on2094.outbound.protection.outlook.com [40.107.94.94]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0BCCD130E3E; Mon, 26 Feb 2024 20:16:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.94.94 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708978589; cv=fail; b=qrroN635ETx6yhYtSf7z2Zi/IoMpXLSwXLQBdjE+dvZaXd1RYMncqeEVWDvDJwB5b3Zp57lDZD3cu2JE+R3hdpoT7IoG8DNr4UPrkrDEbTbA2dfucAMGJ7WZNZVxuEsesStBEW95UCbSIsAU/FATy2IWtSyRDdNSGiRU8OAlD/A= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708978589; c=relaxed/simple; bh=O4tT15hQZqEmnMO1qud9rxu2FlM8XIIrLhInZ2/CdNA=; h=From:Date:Subject:Content-Type:Message-Id:References:In-Reply-To: To:Cc:MIME-Version; b=Y113PR2MhLWrUc+8o9yEUrqBQWVHch7E0IXrGkytgCfYKBxg7dhSosXuYi4WSW9TEfibLU/wOe6Mn3orr6w1zicAltkgUEtczWqAZk2PXzCkSrfIGuqBfS+jOs95WQk0yfEkVDUypc7cRSgJafypvD+gkvTJ+UL+XKsPPIpjmw8= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=os.amperecomputing.com; spf=pass smtp.mailfrom=os.amperecomputing.com; dkim=pass (1024-bit key) header.d=os.amperecomputing.com header.i=@os.amperecomputing.com header.b=Q+7MLUsS; arc=fail smtp.client-ip=40.107.94.94 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=os.amperecomputing.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=os.amperecomputing.com ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ag6QbwUun3iXibzl+udcXz9qT0QO8FKxRRfnGXfIXM6n1FOmECbQliAa2F7d2BoVS3QOyQj3QCihh2vNfu+8hCiOoKpbKpQ/5/ibqqP3PpZyiBSkRvvGyYXHrK+axeaBBShO5MVewti1pV0gKrEisk2xzQExCecsrTpC+bWcff4clvvWljzvjqMikrNtM+nFrsqWMNVzW9yAjL0gN2V/dlZtYO11Y9UrOH+0U37ztmTdklFUAKKc12TCrTegag9fjr/yEw0RVH5arFSvmOpkS/8UKNJSPA3/vjjaMjBPxnrv9/88pKGSU9OuUoshdtEyxtd99FuxnNi/ARAdKfyWpg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=c+TaA0r2xgJJz7zagwym1yatxqvMpiIus63+CrSkTTQ=; b=jX0eHcIsYo8CdMz0BBbYCzc7APPgds8FkZpcuuLVyikhhapZP1psZ0KRIbs9gtLSyvAGWD8K6ZWP9eHpO7I2210eON77C+VW4kvQgw6w2lTh7xiLolCx4PheZuqSs8/kOCVXYLf4ivWVjAwS3N8VHNrHrqkvRjosfR+uJLFV3AzadHlE/19C5PrLqCDpXfWdkRT4rup3I1Pw+PoUR07n63I/drvYLt6pYrvCs+d+rBH1XI8gVrJUtAQ5kDcCnuFOTcE/A2FLpHbl1aZv6JVMq17J+8BOnT1HWH++Z1FQ4/fKX+uPo1vP+JWaGTtxr4ZhwLFM78tW1yEnHpYk3RQCLw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=os.amperecomputing.com; dmarc=pass action=none header.from=os.amperecomputing.com; dkim=pass header.d=os.amperecomputing.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=os.amperecomputing.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=c+TaA0r2xgJJz7zagwym1yatxqvMpiIus63+CrSkTTQ=; b=Q+7MLUsS544UxGJQUxGeJ/MEya+1NAiEPLQg7x1K/Af5dvz5DY04R5Z28tVE7G1RFB1+iuDeHLdAmJXLxth+N5yEbE7ZESkpXUmHLTe8qMJTYebNgXMS2P6HgNijr1mp++gQOtOlpU6Gbci+Eo6nVzr9ux+SE6GdbKW/xlCCyHQ= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=os.amperecomputing.com; Received: from CO1PR01MB7370.prod.exchangelabs.com (2603:10b6:303:159::16) by CO1PR01MB6629.prod.exchangelabs.com (2603:10b6:303:d6::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7316.36; Mon, 26 Feb 2024 20:16:21 +0000 Received: from CO1PR01MB7370.prod.exchangelabs.com ([fe80::28bb:f135:bd95:a21d]) by CO1PR01MB7370.prod.exchangelabs.com ([fe80::28bb:f135:bd95:a21d%7]) with mapi id 15.20.7316.034; Mon, 26 Feb 2024 20:16:21 +0000 From: Daniel Ferguson Date: Mon, 26 Feb 2024 12:15:20 -0800 Subject: [PATCH v4 2/2] RAS: Report ARM processor information to userspace Message-Id: <20240226-b4-arm-ras-error-vendor-info-v4-rc3-v4-2-08e0f168fec1@os.amperecomputing.com> References: <20240226-b4-arm-ras-error-vendor-info-v4-rc3-v4-0-08e0f168fec1@os.amperecomputing.com> In-Reply-To: <20240226-b4-arm-ras-error-vendor-info-v4-rc3-v4-0-08e0f168fec1@os.amperecomputing.com> To: "Rafael J. Wysocki" , Len Brown , James Morse , Tony Luck , Borislav Petkov Cc: linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org, linux-edac@vger.kernel.org, Daniel Ferguson , Shengwei Luo , Jason Tian X-Mailer: b4 0.13.0 X-ClientProxiedBy: PH7PR17CA0037.namprd17.prod.outlook.com (2603:10b6:510:323::28) To CO1PR01MB7370.prod.exchangelabs.com (2603:10b6:303:159::16) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CO1PR01MB7370:EE_|CO1PR01MB6629:EE_ X-MS-Office365-Filtering-Correlation-Id: 5075147d-3440-4181-8cc4-08dc3707cc82 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 9sfwCsDgmRVMQFocvpc36v0xKNmzF/01OaaXPIQShMIAcwHsabojdKlDvgtP+llVAY/PKiDnPXSqrAj2tGdMcRiYboKjQMYgS1ZDkhjVION6JmLQqDgQW9rCuwyQMPQJ7r2qIj7MneOuIyxLGBz2FisHbSFjEICZIy5TwbmV4h8WY2Eik1ilEK04Cf5oC+7F7OYQgE8V/Rod/iMIlTbvxJbpVQyIXuOkxaFsYDdyYuTkd+40fPbIO/qW82pCv8hHAEL2g7xspa23z+Tut+MwfPYMw32xwi2KRuXKccWuttXGk2tPQTXR6fVEBQQ/vOw8N7/A9z6vcqaVEEJMp2LRoyZncLi8dSSWUJP7DXkjgD01mXyiAvckUB+nz6HisT3mtdiQmWUnZjm3xkBeP4kzmxH22JoCwTekJk8rSWkj9Ub3IK2jly8urjDNclfJM5L6acUSqVI/x2fQpDHcohT25S/I2gWiZZtAKphICgzEJhT+oICw6M2SYe7j4qgGFIAxbHkt4ieQ/6YfNyRmvW1gOmZQp6/z/ZjhR6Ufa7Wev4kaSsuV5esOStxWyKNMCtSeBXRskG5vPlk448HY0OI/QMGgTvG4gOY/9a8X0KhwEQ5Yng7aVqvy1YlnmLVNLraIy/tvD6knRzRjy8HrZgrApjPk+ODdLv8G2Nrwmjh5Q1Ue6V0r4qU4xgvILWPdaLsvPpvId+s8fDDrJj4XbP9WWBbD28ci7GJKe8sL9ohUTbY= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:CO1PR01MB7370.prod.exchangelabs.com;PTR:;CAT:NONE;SFS:(13230031)(38350700005);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?ALz3Lov2ntyFRj12UOqhf7Evw7MC?= =?utf-8?q?Csx040jPUoCWm9YUSr2wc7Q0SXgs3p1GygxJ19p3BKe58j4f6vnI+eGsK0jjPKGLc?= =?utf-8?q?0QV6tpMmwoBjG8A2wuiR1GT8PFo1y8VvwZucnLWCJFLqFN/XjsT/7cnUIzUegomjt?= =?utf-8?q?jJyd2bkyXD2bO6GD9ozob8rRoD5sLm/AUW9ucWjRkFnFH8F2qlQcsfmb74r2fQOBF?= =?utf-8?q?/8YiDR7JvmvJwk3NqKke/q6djVbciYnyc4dmrutn80ZtU2/viH43Ajgy27nIpvgW8?= =?utf-8?q?DR3tByuyXooN79WOEdIZCBPsxJ/aMXQa3tCIZtXgMLwn2rJw2w17xTizrciTvz2iV?= =?utf-8?q?vJH8UhBVx3gZY8Pi+RVUxZ3+q9ZkJmnDSDGF+nNFCk4FMFduWpJoecvZPTP7iW3o2?= =?utf-8?q?lNTMWvub/u5xGSJ1gk6fDyWSkYGKtdDnOf6No33q0AJEElg4UP0+AAqtnlYMHxZqQ?= =?utf-8?q?00Lf1XRBdpCgc8Gf/YkV2Wi3ZQgNx5KICdwP+vWRXbkXH1fW6sxHd/7GD8OaC3rk+?= =?utf-8?q?K/1yw0bsLDH+IAvVA1h6gWlsUvKg0qzTD69H4054YDPVUSGJ/1bS32IMXupIofNi/?= =?utf-8?q?gHdRzWF2Fcpg9K5TbCKt+UBHv1eAl1y5Od87q5lVPyCv7T9wt0AzUq5zyBvaqfEhh?= =?utf-8?q?FnlyBkU/X+ZysJCj47GQ2gYusc1YU6+hQ5VioWNu/4a9eZa5RxygwnM4zper9BPuG?= =?utf-8?q?EhFC3rxYSVKuQijv58n1RhwY0AT8eOMBP5+ZbgiCaONVGn+j/ld8jtfbsAeM84Tmi?= =?utf-8?q?dSRDs9d228WlL7two26KC4GQfZRdq0eZf70SlErpEZfFuXSM5eDJDSrM69T6aYN/6?= =?utf-8?q?1WO0lMnBqTpRW+EcbPW70d+u1y0vB2x7acolQLyje6eXDJIaRCN4/pgml/zj34sbQ?= =?utf-8?q?cyiBo+5krRMwkRYHAQUtZ0kMWTkspZWdWylc2Elzt1n13lVH+mLpbHKJqavucj3eO?= =?utf-8?q?OMfziIUOZn7nkUFbeeElX1cbW5xJbKUjxq4IznODJfK1+DMWkaKIugPQslKyiTEca?= =?utf-8?q?Ms+x2TQvfl9RK9Zc4shBA20JX3R4lIvO/vbMlBC7sehmZo4+IyKS+KId0RxxVny9C?= =?utf-8?q?669//eJhMuPuwY55cWBzOCC4cyGaFA3D8vLJXpaB8VPf5QK2MeabEnJkmZ7Al6zyg?= =?utf-8?q?EM5bxCJeMA9dxa7o0+70nCxZp2SjI0Dm69wq1yAK+KmYhwSGlIvtmbLPBL1+YJFeV?= =?utf-8?q?KDNHpotbg6kayUIO54VWUX5kyjlEcqbOqsuwXDsHlR6QV2pP2WY+Ktcjxs9e6ZXL0?= =?utf-8?q?rRFV+XmdaeNaz2yXbbpTqj8fV+KCE/xfUUk2kMha/zlJKkjhSagwTrcM+OyInjtSL?= =?utf-8?q?7kyxg3Jo1Zz0gcyR6gfGvZclLQed02ers8LvJIfG3KFWlGrEEq9/RTcqdIYvAMZii?= =?utf-8?q?Zkg4iAb6RUlJ6IevG9QYYXAyYiFZu2oVzRGkORUhoQvbNhtbCV+Yjz9L4wSCkbxPf?= =?utf-8?q?TMK41Qq30u4Wub/05kFymu0Wx+wSTcWagqKn5eCGWKvqQda+5D/pdiXoryMKs62bS?= =?utf-8?q?XtVfz3mPc6HdSl4FtUhpjXqX2d5MXyoWq2mkyX+eaIQmS8YRX4/0A+0=3D?= X-OriginatorOrg: os.amperecomputing.com X-MS-Exchange-CrossTenant-Network-Message-Id: 5075147d-3440-4181-8cc4-08dc3707cc82 X-MS-Exchange-CrossTenant-AuthSource: CO1PR01MB7370.prod.exchangelabs.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Feb 2024 20:16:21.7571 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3bc2b170-fd94-476d-b0ce-4229bdc904a7 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: aMniQCPlEmmnCTUWZyxf51GoZ1teLv/u7U+9NgmFN3Eqw63zBiTezscVZtuJ7vkS2QuUXbFZxOIaa71Zw1w5GnScuOpcrZnez0edcndq9TSRRlvcluyND1sLyGovO87a X-MS-Exchange-Transport-CrossTenantHeadersStamped: CO1PR01MB6629 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1791995120915527587 X-GMAIL-MSGID: 1791995120915527587 From: Shengwei Luo The original arm_event trace code only traces out ARM processor error information data. It's not enough for user to take appropriate action. According to UEFI_2_9 specification chapter N2.4.4, the ARM processor error section includes several ARM processor error information, several ARM processor context information and several vendor specific error information structures. In addition to these info, there are error severity and cpu logical index about the event. Report all of these information to userspace via perf i/f. So that the user can do cpu core isolation according to error severity and other info. Signed-off-by: Shengwei Luo Signed-off-by: Jason Tian Signed-off-by: Daniel Ferguson --- drivers/acpi/apei/ghes.c | 3 +-- drivers/ras/ras.c | 46 ++++++++++++++++++++++++++++++++++++++++++++-- include/linux/ras.h | 15 +++++++++++++-- include/ras/ras_event.h | 48 +++++++++++++++++++++++++++++++++++++++++++----- 4 files changed, 101 insertions(+), 11 deletions(-) diff --git a/drivers/acpi/apei/ghes.c b/drivers/acpi/apei/ghes.c index 5980f70ca0e4..8265d85801aa 100644 --- a/drivers/acpi/apei/ghes.c +++ b/drivers/acpi/apei/ghes.c @@ -536,9 +536,8 @@ static bool ghes_handle_arm_hw_error(struct acpi_hest_generic_data *gdata, int sec_sev, i; char *p; - log_arm_hw_error(err); - sec_sev = ghes_severity(gdata->error_severity); + log_arm_hw_error(err, sec_sev); if (sev != GHES_SEV_RECOVERABLE || sec_sev != GHES_SEV_RECOVERABLE) return false; diff --git a/drivers/ras/ras.c b/drivers/ras/ras.c index 355c0d78bd50..cfeedd66c607 100644 --- a/drivers/ras/ras.c +++ b/drivers/ras/ras.c @@ -22,9 +22,51 @@ void log_non_standard_event(const guid_t *sec_type, const guid_t *fru_id, } #if defined(CONFIG_ARM) || defined(CONFIG_ARM64) -void log_arm_hw_error(struct cper_sec_proc_arm *err) +void log_arm_hw_error(struct cper_sec_proc_arm *err, const u8 sev) { - trace_arm_event(err); + u32 pei_len; + u32 ctx_len = 0; + s32 vsei_len; + u8 *pei_err; + u8 *ctx_err; + u8 *ven_err_data; + struct cper_arm_err_info *err_info; + struct cper_arm_ctx_info *ctx_info; + int n, sz; + int cpu; + + pei_len = sizeof(struct cper_arm_err_info) * err->err_info_num; + pei_err = (u8 *)err + sizeof(struct cper_sec_proc_arm); + + err_info = (struct cper_arm_err_info *)(err + 1); + ctx_info = (struct cper_arm_ctx_info *)(err_info + err->err_info_num); + ctx_err = (u8 *)ctx_info; + for (n = 0; n < err->context_info_num; n++) { + sz = sizeof(struct cper_arm_ctx_info) + ctx_info->size; + ctx_info = (struct cper_arm_ctx_info *)((long)ctx_info + sz); + ctx_len += sz; + } + + vsei_len = err->section_length - (sizeof(struct cper_sec_proc_arm) + + pei_len + ctx_len); + if (vsei_len < 0) { + pr_warn(FW_BUG + "section length: %d\n", err->section_length); + pr_warn(FW_BUG + "section length is too small\n"); + pr_warn(FW_BUG + "firmware-generated error record is incorrect\n"); + vsei_len = 0; + } + ven_err_data = (u8 *)ctx_info; + + cpu = GET_LOGICAL_INDEX(err->mpidr); + /* when return value is invalid, set cpu index to -1 */ + if (cpu < 0) + cpu = -1; + + trace_arm_event(err, pei_err, pei_len, ctx_err, ctx_len, + ven_err_data, (u32)vsei_len, sev, cpu); } #endif diff --git a/include/linux/ras.h b/include/linux/ras.h index bded04044d33..fbb74ecde984 100644 --- a/include/linux/ras.h +++ b/include/linux/ras.h @@ -25,7 +25,7 @@ void log_non_standard_event(const guid_t *sec_type, const guid_t *fru_id, const char *fru_text, const u8 sev, const u8 *err, const u32 len); #if defined(CONFIG_ARM) || defined(CONFIG_ARM64) -void log_arm_hw_error(struct cper_sec_proc_arm *err); +void log_arm_hw_error(struct cper_sec_proc_arm *err, const u8 sev); #endif #else static inline void @@ -35,8 +35,19 @@ log_non_standard_event(const guid_t *sec_type, { return; } #if defined(CONFIG_ARM) || defined(CONFIG_ARM64) static inline void -log_arm_hw_error(struct cper_sec_proc_arm *err) { return; } +log_arm_hw_error(struct cper_sec_proc_arm *err, const u8 sev) { return; } #endif #endif +#if defined(CONFIG_ARM) || defined(CONFIG_ARM64) +#include +/* + * Include ARM specific SMP header which provides a function mapping mpidr to + * cpu logical index. + */ +#define GET_LOGICAL_INDEX(mpidr) get_logical_index(mpidr & MPIDR_HWID_BITMASK) +#else +#define GET_LOGICAL_INDEX(mpidr) -EINVAL +#endif /* CONFIG_ARM || CONFIG_ARM64 */ + #endif /* __RAS_H__ */ diff --git a/include/ras/ras_event.h b/include/ras/ras_event.h index cbd3ddd7c33d..0dac67d1cad4 100644 --- a/include/ras/ras_event.h +++ b/include/ras/ras_event.h @@ -168,11 +168,24 @@ TRACE_EVENT(mc_event, * This event is generated when hardware detects an ARM processor error * has occurred. UEFI 2.6 spec section N.2.4.4. */ +#define APEIL "ARM Processor Err Info data len" +#define APEID "ARM Processor Err Info raw data" +#define APECIL "ARM Processor Err Context Info data len" +#define APECID "ARM Processor Err Context Info raw data" +#define VSEIL "Vendor Specific Err Info data len" +#define VSEID "Vendor Specific Err Info raw data" TRACE_EVENT(arm_event, - TP_PROTO(const struct cper_sec_proc_arm *proc), + TP_PROTO(const struct cper_sec_proc_arm *proc, const u8 *pei_err, + const u32 pei_len, + const u8 *ctx_err, + const u32 ctx_len, + const u8 *oem, + const u32 oem_len, + u8 sev, + int cpu), - TP_ARGS(proc), + TP_ARGS(proc, pei_err, pei_len, ctx_err, ctx_len, oem, oem_len, sev, cpu), TP_STRUCT__entry( __field(u64, mpidr) @@ -180,6 +193,14 @@ TRACE_EVENT(arm_event, __field(u32, running_state) __field(u32, psci_state) __field(u8, affinity) + __field(u32, pei_len) + __dynamic_array(u8, buf, pei_len) + __field(u32, ctx_len) + __dynamic_array(u8, buf1, ctx_len) + __field(u32, oem_len) + __dynamic_array(u8, buf2, oem_len) + __field(u8, sev) + __field(int, cpu) ), TP_fast_assign( @@ -199,12 +220,29 @@ TRACE_EVENT(arm_event, __entry->running_state = ~0; __entry->psci_state = ~0; } + __entry->pei_len = pei_len; + memcpy(__get_dynamic_array(buf), pei_err, pei_len); + __entry->ctx_len = ctx_len; + memcpy(__get_dynamic_array(buf1), ctx_err, ctx_len); + __entry->oem_len = oem_len; + memcpy(__get_dynamic_array(buf2), oem, oem_len); + __entry->sev = sev; + __entry->cpu = cpu; ), - TP_printk("affinity level: %d; MPIDR: %016llx; MIDR: %016llx; " - "running state: %d; PSCI state: %d", + TP_printk("cpu: %d; error: %d; affinity level: %d; MPIDR: %016llx; MIDR: %016llx; " + "running state: %d; PSCI state: %d; " + "%s: %d; %s: %s; %s: %d; %s: %s; %s: %d; %s: %s", + __entry->cpu, + __entry->sev, __entry->affinity, __entry->mpidr, __entry->midr, - __entry->running_state, __entry->psci_state) + __entry->running_state, __entry->psci_state, + APEIL, __entry->pei_len, APEID, + __print_hex(__get_dynamic_array(buf), __entry->pei_len), + APECIL, __entry->ctx_len, APECID, + __print_hex(__get_dynamic_array(buf1), __entry->ctx_len), + VSEIL, __entry->oem_len, VSEID, + __print_hex(__get_dynamic_array(buf2), __entry->oem_len)) ); /*