From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from EUR01-HE1-obe.outbound.protection.outlook.com (EUR01-HE1-obe.outbound.protection.outlook.com [40.107.13.44]) by mx.groups.io with SMTP id smtpd.web11.9456.1644496102668259121 for ; Thu, 10 Feb 2022 04:28:23 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@armh.onmicrosoft.com header.s=selector2-armh-onmicrosoft-com header.b=IucACs+i; spf=pass (domain: arm.com, ip: 40.107.13.44, mailfrom: sami.mujawar@arm.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=njDU30SJA/IJnawAnDCxWIa5smfqpjtjrS+pXTRTnUI=; b=IucACs+iu1MYN5al+fvRtRG678ecdyQ6Q//Sw4UH3fwaLMAqnhJAE+LondA/uZKwXnSqqt1h8EwOr339s8TDCRIU6Qhs+iW33b7Us2L8ss2++51iRIrwnvFd3O7rVHNlI3k7TfPmGFeOo8bFFBojCSFve+3Km70H5K5as8RJGMU= Received: from DBBPR09CA0046.eurprd09.prod.outlook.com (2603:10a6:10:d4::34) by AS8PR08MB6501.eurprd08.prod.outlook.com (2603:10a6:20b:338::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4975.11; Thu, 10 Feb 2022 12:28:16 +0000 Received: from DB5EUR03FT015.eop-EUR03.prod.protection.outlook.com (2603:10a6:10:d4:cafe::d1) by DBBPR09CA0046.outlook.office365.com (2603:10a6:10:d4::34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4975.11 via Frontend Transport; Thu, 10 Feb 2022 12:28:16 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 63.35.35.123 as permitted sender) receiver=protection.outlook.com; client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com; Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by DB5EUR03FT015.mail.protection.outlook.com (10.152.20.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4975.11 via Frontend Transport; Thu, 10 Feb 2022 12:28:16 +0000 Received: ("Tessian outbound 63bb5eb69ee8:v113"); Thu, 10 Feb 2022 12:28:16 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: 31fac33097342c1b X-CR-MTA-TID: 64aa7808 Received: from d12e8ed66798.2 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 8234BEB9-F13D-4A61-976D-69EE00C26B78.1; Thu, 10 Feb 2022 12:28:09 +0000 Received: from EUR02-VE1-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id d12e8ed66798.2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Thu, 10 Feb 2022 12:28:09 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=AXTzZbMybjjQBHBa6r2kNNZKzrRjcpB3baDHWzQzJ/j88HpjSRHM0GOdvH1ysjL533vQG8Rx3on5JfXyVeLY7sJSJRDGwM3PahqX0rgImXr6NO2Med813FJ3Sd7yV2Tcoi1YzX4iobFfSdLgHnLEurKg3VXpoKClsG8XQBbtdEsvmaXhuaRY3ONhPV/tNYSNmQy+o5cPgFcfQGXbYBZSAlNg/9DtoIc7UgLLhopHCVRhtNJdvcP69n7D5klLGHqfbJK1D4jll3OvWIKMdXEV6jLxB8HzDuaqmU4VVGnnCNBW7pZ097LHJrVF9iWBSEKWPmcWKvQY/XKnHUO3ZJFG9w== 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=njDU30SJA/IJnawAnDCxWIa5smfqpjtjrS+pXTRTnUI=; b=cTAm//X+9OlthWfoZ9HCXEu87Zy48BhaYowSNy8kOAFt3gUVXojW0OJuiI5+tbetRXOWDNIXJEwZE2e7+1uuaEgQzhDH+X2GEqOnyxh22NdizQB1mgScScV+ivZfUanGglz3w0eNVs1TemPzUXLHK8iyoGWFWM5CQ0p6nojXQyrWN2eh2lxfvVKIcArmP6W9a3/HpzDcx9yj0stjolBVXqk+uxM0618WIGj5DR9naNrA/aAXZQavsSNdTvHRIEHrNwrHass8TM+oPP4t8eQ0SsmM8l30x2vICir6du3aNhiWyEedzbbZfNg3aemLKmjA9ImKTzsfplv1zDRbwT4FYQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=njDU30SJA/IJnawAnDCxWIa5smfqpjtjrS+pXTRTnUI=; b=IucACs+iu1MYN5al+fvRtRG678ecdyQ6Q//Sw4UH3fwaLMAqnhJAE+LondA/uZKwXnSqqt1h8EwOr339s8TDCRIU6Qhs+iW33b7Us2L8ss2++51iRIrwnvFd3O7rVHNlI3k7TfPmGFeOo8bFFBojCSFve+3Km70H5K5as8RJGMU= Authentication-Results-Original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com; Received: from AS8PR08MB6806.eurprd08.prod.outlook.com (2603:10a6:20b:39b::12) by AM6PR08MB4456.eurprd08.prod.outlook.com (2603:10a6:20b:b3::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4951.12; Thu, 10 Feb 2022 12:28:06 +0000 Received: from AS8PR08MB6806.eurprd08.prod.outlook.com ([fe80::34b6:4579:9e43:6b95]) by AS8PR08MB6806.eurprd08.prod.outlook.com ([fe80::34b6:4579:9e43:6b95%7]) with mapi id 15.20.4975.011; Thu, 10 Feb 2022 12:28:05 +0000 Subject: Re: [PATCH v2 1/1] MdePkg/Include: Add ARM specific definitions for CPER To: Ming Huang , devel@edk2.groups.io, ardb+tianocore@kernel.org, jiewen.yao@intel.com, supreeth.venkatesh@arm.com Cc: ming.huang-@outlook.com, nd References: <20220209015445.87073-1-huangming@linux.alibaba.com> From: "Sami Mujawar" Message-ID: <7845daf4-ce1e-e230-d4f9-a0b93d756f0a@arm.com> Date: Thu, 10 Feb 2022 12:28:09 +0000 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.0.1 In-Reply-To: <20220209015445.87073-1-huangming@linux.alibaba.com> X-ClientProxiedBy: LO2P265CA0224.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:b::20) To AS8PR08MB6806.eurprd08.prod.outlook.com (2603:10a6:20b:39b::12) MIME-Version: 1.0 X-MS-Office365-Filtering-Correlation-Id: ab9772a9-934f-49cc-593a-08d9ec90d020 X-MS-TrafficTypeDiagnostic: AM6PR08MB4456:EE_|DB5EUR03FT015:EE_|AS8PR08MB6501:EE_ X-Microsoft-Antispam-PRVS: x-checkrecipientrouted: true NoDisclaimer: true X-MS-Oob-TLC-OOBClassifiers: OLM:10000;OLM:10000; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: rfzvU+/jzCPRE6qp1C/mywbje4NxJtCJ1iwi7r9ZRoQRTilG4Cs/SYmfZHOBCq5FujAEyx50NstORW4O0Jv49yJ9GX2haU09dKS12dWCLDstEDz0uHUNC83QlDUs6VxBMynX86Al/+d5xZDy1NRfyrjgWlVpQMDRpWa64HhcegbCgntzjBG6xRn69EES6S3+3Tr7SxdK6+faxbhMbX6I5xpYM6Pyb9u+Ub5sylgkiiCCcLcANFwOwWznYXOzxDvJ+rH7oLAjThWDoUS5tsQZTSe8mxTnVTA0S9eMtvlz5jRr7oDBg5TXOmsZ5+UDMCs8FDbgsfpuErw2wL/eEbFijzAwt6MK/IotzDKog6snzPHNkGNLWScDr7uEH+ehwdgrkvKYA7FqtpFq7W0D3P5MR1zTUiQ9SpKp3nG4pjn9RKod6DLQXrsbelov/phcS/qZO1TsT9VsXnnIsRPIT23VU9LoJ2gaQkqlre8OxFovB75zpkrC/FAjxgDHSVIImQGUW8GdSiMjoCZ1tAkLLNk5q62Ou2RGZOrIFqRTaGjcrPeyFu1A6NHRBwFzU2y7Av54JbB1w1qNXxI/16eb6zCw47JaGdTZfY4Fza3vS0aJ4ekeiqZUbTa68PeG86gc1K7wAEz1o7mUXg6awT0YnkyLQQ4Vh7EOri0OcE/p3zRd8DyAzrSzt/UH03peQ9FD/0c6v73zwDncMqBWDtcy0RvNl8WeC6+ABURkXIAzC2ZAF5zDbwzb5jPZD00uoLNea7YiloVHe01jGed3vxszbZkPhatH5t77RNZeH6yCEFzNWekNYAO7S5upwsbDqMSkWEq0DwO5ZMhQUB/K6RJprhU0kjxVm2YDiXQOCyApApPqomo= X-Forefront-Antispam-Report-Untrusted: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AS8PR08MB6806.eurprd08.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230001)(4636009)(366004)(30864003)(66946007)(316002)(6512007)(36756003)(8936002)(5660300002)(38350700002)(26005)(83380400001)(31686004)(38100700002)(186003)(44832011)(2906002)(508600001)(4326008)(2616005)(6636002)(6506007)(31696002)(86362001)(966005)(52116002)(6486002)(53546011)(8676002)(66556008)(66476007)(45980500001)(43740500002);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR08MB4456 Original-Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com; Return-Path: Sami.Mujawar@arm.com X-EOPAttributedMessage: 0 X-MS-Exchange-Transport-CrossTenantHeadersStripped: DB5EUR03FT015.eop-EUR03.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: db3e7790-58dd-45c2-ef35-08d9ec90c9f1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: o1PfdaCnBDv7UJ4QlAG1I0jf5EN4p9cAfHIaidd6OUGjdnYSfzW5QBEDIJsKejeb0NLxeEsus9rUFJgPnm0yoTRjcgmB3XO778EixvElgEAyAUl6Oq/b9aC2M0/Fe2npWvPe/EUO+lsYW9AszUQUJLU+PmHWWbsWUoyBi9sEZxKBNPbW3gzKhc8rekLcUvCAOxzmHAzGiAE4HhYyIVio/W03YS3bU+yiaQzFb30W4OYgXAeYW1ByhmyOLNOMBfLtzUgVKbMoRqsuFqQ5VG2MZudnsEdyITbYEoJHP90/AjQDTFiAdUmsjWZlfNrNZ1bTL7B1LvxQ3wqkQo7KGZREdYztqehOOS7Wio8nEDsNXY7X97f3oEaNXCIpwaJGRhFXYgITDy1CFTyzAn3it9kXNF8Yv7q7Q/SePfAKYVj3+VqmVdADTQBvgdvGA0LZjTXKi93Ds74c51lz13IxaAIn6hzoPb6UQ+x/6DUu8ZD519+a8tnUiwBLa9Me+k1bIEAmHMbXwgXBx55kME7CWNh2YE7eNPqd+ho/di6pcvTHXqech30o2/PM7YegWOg1YL9Mom6ZRtWDFIAlsE8ModG2Tsa373ydExO/YTVDMleqSYaXD9AwvH1knHjIj9pKZACRc72pxoFPVFWfcVnhE1DBSMqSzkGed4LQPyeTZrCPknehKXfiu2UDBTUDAR/dIIBZwLbHyX0QKF0RJfvZIgPs4o47NstY52g/+ExHtxRCmUxajohQNK8ZzbKKltgUsMtbbblnZdf/JNfcLZ1cnZx6Fn5UetZgQIBBjGpDnixCn4I= X-Forefront-Antispam-Report: CIP:63.35.35.123;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:64aa7808-outbound-1.mta.getcheckrecipient.com;PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com;CAT:NONE;SFS:(13230001)(4636009)(36840700001)(40470700004)(46966006)(31686004)(186003)(5660300002)(356005)(6506007)(81166007)(47076005)(36860700001)(316002)(6636002)(70586007)(70206006)(2906002)(8676002)(508600001)(8936002)(31696002)(86362001)(40460700003)(82310400004)(30864003)(36756003)(83380400001)(336012)(44832011)(6512007)(26005)(53546011)(966005)(4326008)(6486002)(2616005)(43740500002);DIR:OUT;SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Feb 2022 12:28:16.0862 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: ab9772a9-934f-49cc-593a-08d9ec90d020 X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d;Ip=[63.35.35.123];Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com] X-MS-Exchange-CrossTenant-AuthSource: DB5EUR03FT015.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR08MB6501 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-GB Hi Ming, Thank you for this patch. I have a few comments, marked inline as [SAMI]. With those addressed, Reviewed-by: Sami Mujawar Regards, Sami Mujawar On 09/02/2022 01:54 AM, Ming Huang wrote: > These definitions are added according UEFI spec. > > Signed-off-by: Ming Huang > --- > MdePkg/Include/Guid/Cper.h | 522 ++++++++++++++++++++ > 1 file changed, 522 insertions(+) > > diff --git a/MdePkg/Include/Guid/Cper.h b/MdePkg/Include/Guid/Cper.h > index deb96d4af9..eef584de03 100644 > --- a/MdePkg/Include/Guid/Cper.h > +++ b/MdePkg/Include/Guid/Cper.h > @@ -736,6 +736,528 @@ typedef struct { > > #endif > > +#if defined (MDE_CPU_ARM) || defined (MDE_CPU_AARCH64) > +/// > +/// ARM and AARCH64 Specific definitions. > +/// > + > +/// > +/// The validation bit mask indicates which fields in the processor error > +/// structure are valid. > +///@{ > +#define EFI_ERROR_SECTION_MPIDR_VALID BIT0 > +#define EFI_ERROR_SECTION_AFFINITY_LEVEL_VALID BIT1 > +#define EFI_ERROR_SECTION_RUNNING_STATE_VALID BIT2 > +#define EFI_ERROR_SECTION_VENDOR_SPEC_VALID BIT3 > +///@} > + > +// > +// ARM Processor Error Section > +// > +typedef struct { > + UINT32 ValidFields; > + UINT16 ErrorInfoNum; > + UINT16 ContextInfoNum; > + UINT32 SectionLength; > + UINT8 AffinityLevel; > + UINT8 Reserved[3]; > + UINT64 Mpidr; > + UINT64 Midr; > + UINT32 RunningState; > + UINT32 PsciState; > +} EFI_ARM_PROCESSOR_ERROR_SECTION; > + > +/// > +/// The validation bit mask indicates which fields in the processor error data > +/// structure are valid. > +///@{ > +#define EFI_ERROR_DATA_MULTIPLE_ERROR_VALID BIT0 > +#define EFI_ERROR_DATA_FLAGS_VALID BIT1 > +#define EFI_ERROR_DATA_ERROR_INFO_VALID BIT2 > +#define EFI_ERROR_DATA_VIRTUAL_ADDRESS_VALID BIT3 > +#define EFI_ERROR_DATA_PHYSICAL_ADDRESS_VALID BIT3 > +///@} > + > +/// > +/// The Type error in the processor error data structure. > +///@{ > +#define EFI_ERROR_DATA_TYPE_CACHE 0 > +#define EFI_ERROR_DATA_TYPE_TLB 1 > +#define EFI_ERROR_DATA_TYPE_BUS 2 > +#define EFI_ERROR_DATA_TYPE_VENDOR_SPEC 3 [SAMI] The UEFI specification version 2.9 is not clear about the values for the Type fields. However, I have raised this concern so that the specification can be updated. [/SAMI] > +///@} > + > +/// > +/// The options of multiple error in the processor error data structure. > +///@{ > +#define EFI_ERROR_DATA_ERROR_SINGLE 0 > +#define EFI_ERROR_DATA_ERROR_MULTIPLE 1 > +///@} > + > +/// > +/// The options of flags in the processor error data structure. > +///@{ > +#define EFI_ERROR_DATA_FLAG_FIRST_ERROR BIT0 > +#define EFI_ERROR_DATA_FLAG_LAST_ERROR BIT1 > +#define EFI_ERROR_DATA_FLAG_PROPAGATED BIT2 > +#define EFI_ERROR_DATA_FLAG_OVERFLOW BIT3 > +///@} > + > +// > +// ARM Processor Error Information Structure > +// > +typedef struct { > + UINT8 Version; > + UINT8 Length; > + UINT16 ValidFields; > + UINT8 Type; > + UINT16 MultipleError; > + UINT8 Flags; > + UINT64 ErrorInfo; > + UINT64 VirtualFaultAddress; > + UINT64 PhysicalFaultAddress; > +} EFI_ARM_PROCESSOR_ERROR_DATA; > + > +// > +/// > +/// The validation bit mask indicates which fields in the Cache info structure > +/// are valid. > +///@{ > +#define EFI_CACHE_INFO_TRANSACTION_TYPE_VALID BIT0 > +#define EFI_CACHE_INFO_OPERATION_VALID BIT1 > +#define EFI_CACHE_INFO_LEVEL_VALID BIT2 > +#define EFI_CACHE_INFO_CONTEXT_CORRUPT_VALID BIT3 > +#define EFI_CACHE_INFO_CORRECTED_VALID BIT4 > +#define EFI_CACHE_INFO_PRECISE_PC_VALID BIT5 > +#define EFI_CACHE_INFO_RESTARTABLE_PC_VALID BIT6 > +///@} > + > +/// > +/// Type of cache error in the Cache info structure > +///@{ > +#define EFI_CACHE_INFO_ERROR_TYPE_INSTRUCTION 0 > +#define EFI_CACHE_INFO_ERROR_TYPE_DATA_ACCESS 1 > +#define EFI_CACHE_INFO_ERROR_TYPE_GENERIC 2 > +///@} > + > +/// > +/// Type of cache operation that caused the error in the Cache info structure > +///@{ > +#define EFI_CACHE_INFO_OPERATION_TYPE_GENERIC 0 > +#define EFI_CACHE_INFO_OPERATION_TYPE_GENERIC_READ 1 > +#define EFI_CACHE_INFO_OPERATION_TYPE_GENERIC_WRITE 2 > +#define EFI_CACHE_INFO_OPERATION_TYPE_DATA_READ 3 > +#define EFI_CACHE_INFO_OPERATION_TYPE_DATA_WRITE 4 > +#define EFI_CACHE_INFO_OPERATION_TYPE_INSTRUCTION_FETCH 5 > +#define EFI_CACHE_INFO_OPERATION_TYPE_PREFETCH 6 > +#define EFI_CACHE_INFO_OPERATION_TYPE_EVICTION 7 > +#define EFI_CACHE_INFO_OPERATION_TYPE_SNOOPING 8 > +#define EFI_CACHE_INFO_OPERATION_TYPE_SNOOPED 9 > +#define EFI_CACHE_INFO_OPERATION_TYPE_MANAGEMENT 10 > +///@} > + > +/// > +/// Options of Processor context in the Cache info structure > +///@{ > +#define EFI_CACHE_INFO_CONTEXT_NOT_CORRUPTED 0 > +#define EFI_CACHE_INFO_CONTEXT_CORRUPTED 1 > +///@} > + > +/// > +/// Error severity in the Cache info structure > +///@{ > +#define EFI_CACHE_INFO_ERROR_SEVERITY_UnCORRECTED 0 [SAMI] Minor, the macros should all be in capital letter, see https://edk2-docs.gitbook.io/edk-ii-c-coding-standards-specification/4_naming_conventions/43_identifiers#4.3.5-type-and-macro-names. I am not sure if this will be caught in the CI, but it will be good to fix this. [/SAMI] > +#define EFI_CACHE_INFO_ERROR_SEVERITY_CORRECTED 1 > +///@} > + > +// > +// ARM Processor Cache Error Structure > +// > +typedef struct { > + UINT64 ValidBit:16; > + UINT64 CacheType:2; > + UINT64 Operation:4; > + UINT64 CacheLevel:3; > + UINT64 ContextCorrupt:1; > + UINT64 Corrected:1; > + UINT64 PrecisePc:1; > + UINT64 RestartablePc:1; > + UINT64 Reserved:35; > +} EFI_ARM_PROCESSOR_CACHE_ERROR_INFO; > + > +/// > +/// The validation bit mask indicates which fields in the tlb info structure > +/// are valid. > +///@{ > +#define EFI_TLB_INFO_TRANSACTION_TYPE_VALID BIT0 > +#define EFI_TLB_INFO_OPERATION_VALID BIT1 > +#define EFI_TLB_INFO_LEVEL_VALID BIT2 > +#define EFI_TLB_INFO_CONTEXT_CORRUPT_VALID BIT3 > +#define EFI_TLB_INFO_CORRECTED_VALID BIT4 > +#define EFI_TLB_INFO_PRECISE_PC_VALID BIT5 > +#define EFI_TLB_INFO_RESTARTABLE_PC_VALID BIT6 > +///@} > + > +/// > +/// Type of cache error in the tlb info structure > +///@{ > +#define EFI_TLB_INFO_ERROR_TYPE_INSTRUCTION 0 > +#define EFI_TLB_INFO_ERROR_TYPE_DATA_ACCESS 1 > +#define EFI_TLB_INFO_ERROR_TYPE_GENERIC 2 > +///@} > + > +/// > +/// Type of cache operation that caused the error in the tlb info structure > +///@{ > +#define EFI_TLB_INFO_OPERATION_TYPE_GENERIC 0 > +#define EFI_TLB_INFO_OPERATION_TYPE_GENERIC_READ 1 > +#define EFI_TLB_INFO_OPERATION_TYPE_GENERIC_WRITE 2 > +#define EFI_TLB_INFO_OPERATION_TYPE_DATA_READ 3 > +#define EFI_TLB_INFO_OPERATION_TYPE_DATA_WRITE 4 > +#define EFI_TLB_INFO_OPERATION_TYPE_INSTRUCTION_FETCH 5 > +#define EFI_TLB_INFO_OPERATION_TYPE_PREFETCH 6 > +#define EFI_TLB_INFO_OPERATION_TYPE_LOCAL_MO 7 > +#define EFI_TLB_INFO_OPERATION_TYPE_EXTERNAL_MO 8 > +///@} > + > +/// > +/// Options of Processor context in the tlb info structure > +///@{ > +#define EFI_TLB_INFO_CONTEXT_NOT_CORRUPTED 0 > +#define EFI_TLB_INFO_CONTEXT_CORRUPTED 1 > +///@} > + > +/// > +/// Error severity in the tlb info structure > +///@{ > +#define EFI_TLB_INFO_ERROR_SEVERITY_UnCORRECTED 0 [SAMI] Same comment as above. Macro names should all be in capital letters. > +#define EFI_TLB_INFO_ERROR_SEVERITY_CORRECTED 1 > +///@} > + > +// > +// ARM Processor tlb Error Structure > +// > +typedef struct { > + UINT64 ValidBit:16; > + UINT64 TlbType:2; > + UINT64 Operation:4; > + UINT64 TlbLevel:3; > + UINT64 ContextCorrupt:1; > + UINT64 Corrected:1; > + UINT64 PrecisePc:1; > + UINT64 RestartablePc:1; > + UINT64 Reserved:35; > +} EFI_ARM_PROCESSOR_TLB_ERROR_INFO; > + > +/// > +/// The validation bit mask indicates which fields in the Bus info structure > +/// are valid. > +///@{ > +#define EFI_BUS_INFO_TRANSACTION_TYPE_VALID BIT0 > +#define EFI_BUS_INFO_OPERATION_VALID BIT1 > +#define EFI_BUS_INFO_LEVEL_VALID BIT2 > +#define EFI_BUS_INFO_CONTEXT_CORRUPT_VALID BIT3 > +#define EFI_BUS_INFO_CORRECTED_VALID BIT4 > +#define EFI_BUS_INFO_PRECISE_PC_VALID BIT5 > +#define EFI_BUS_INFO_RESTARTABLE_PC_VALID BIT6 > +#define EFI_BUS_INFO_PARTICIPATION_TYPE_VALID BIT7 > +#define EFI_BUS_INFO_TIMEOUT_VALID BIT8 > +#define EFI_BUS_INFO_ADDRESS_SPACE_VALID BIT9 > +#define EFI_BUS_INFO_MEMORY_ATTRIBUTES_VALID BIT10 > +#define EFI_BUS_INFO_ACCESS_MODE_VALID BIT11 > +///@} > + > +/// > +/// Type of cache error in the BUS info structure > +///@{ > +#define EFI_BUS_INFO_ERROR_TYPE_INSTRUCTION 0 > +#define EFI_BUS_INFO_ERROR_TYPE_DATA_ACCESS 1 > +#define EFI_BUS_INFO_ERROR_TYPE_GENERIC 2 > +///@} > + > +/// > +/// Type of cache operation that caused the error in the BUS info structure > +///@{ > +#define EFI_BUS_INFO_OPERATION_TYPE_GENERIC 0 > +#define EFI_BUS_INFO_OPERATION_TYPE_GENERIC_READ 1 > +#define EFI_BUS_INFO_OPERATION_TYPE_GENERIC_WRITE 2 > +#define EFI_BUS_INFO_OPERATION_TYPE_DATA_READ 3 > +#define EFI_BUS_INFO_OPERATION_TYPE_DATA_WRITE 4 > +#define EFI_BUS_INFO_OPERATION_TYPE_INSTRUCTION_FETCH 5 > +#define EFI_BUS_INFO_OPERATION_TYPE_PREFETCH 6 > +///@} > + > +/// > +/// Options of Processor context in the BUS info structure > +///@{ > +#define EFI_BUS_INFO_CONTEXT_NOT_CORRUPTED 0 > +#define EFI_BUS_INFO_CONTEXT_CORRUPTED 1 > +///@} > + > +/// > +/// Error severity in the BUS info structure > +///@{ > +#define EFI_BUS_INFO_ERROR_SEVERITY_CORRECTED 0 > +#define EFI_BUS_INFO_ERROR_SEVERITY_UnCORRECTED 1 [SAMI] It appears the values for Corrected and Uncorrected are swapped, can you check please? Also, please fix the macro name. > +///@} > + > +/// > +/// Type of participation in the BUS info structure > +///@{ > +#define EFI_BUS_INFO_PARTICIPATION_ORIGINATED 0 > +#define EFI_BUS_INFO_PARTICIPATION_RESPONDED 1 > +#define EFI_BUS_INFO_PARTICIPATION_OBSERVED 2 > +#define EFI_BUS_INFO_PARTICIPATION_GENERIC 3 > +///@} > + > +/// > +/// Address space in the BUS info structure > +///@{ > +#define EFI_BUS_INFO_EXTERNAL_MEMORY_ACCESS 0 > +#define EFI_BUS_INFO_INTERNAL_MEMORY_ACCESS 1 > +#define EFI_BUS_INFO_DEVICE_MEMORY_ACCESS 2 > +///@} > + > +/// > +/// Address mode in the BUS info structure > +///@{ > +#define EFI_BUS_INFO_ACCESS_MODE_SECURE 0 > +#define EFI_BUS_INFO_ACCESS_MODE_NORMAL 1 > +///@} > + > +// > +// ARM Processor Bus Error Structure > +// > +typedef struct { > + UINT64 ValidBit:16; > + UINT64 BusType:2; > + UINT64 Operation:4; > + UINT64 Level:3; > + UINT64 ContextCorrupt:1; > + UINT64 Corrected:1; > + UINT64 PrecisePc:1; > + UINT64 RestartablePc:1; > + UINT64 ParticipationType:2; > + UINT64 Timeout:1; > + UINT64 AddressSpace:2; > + UINT64 MemAccessAttributes:9; > + UINT64 AccessMode:1; > + UINT64 Reserved:20; > +} EFI_ARM_PROCESSOR_BUS_ERROR_INFO; > + > +/// > +/// Register context type in the processor context data structure > +///@{ > +#define EFI_CONTEXT_DATA_TYPE_AARCH32_GPRS 0 > +#define EFI_CONTEXT_DATA_TYPE_AARCH32_EL1 1 > +#define EFI_CONTEXT_DATA_TYPE_AARCH32_EL2 2 > +#define EFI_CONTEXT_DATA_TYPE_AARCH32_SECURE 3 > +#define EFI_CONTEXT_DATA_TYPE_AARCH64_GPRS 4 > +#define EFI_CONTEXT_DATA_TYPE_AARCH64_EL1 5 > +#define EFI_CONTEXT_DATA_TYPE_AARCH64_EL2 6 > +#define EFI_CONTEXT_DATA_TYPE_AARCH64_EL3 7 > +#define EFI_CONTEXT_DATA_TYPE_MISC 8 > +///@} > + > +// > +// ARM Processor Context Information Structure, UEFI v2.7 sec N.2.4.4.2 > +// > +typedef struct { > + UINT16 Version; > + UINT16 ContextType; > + UINT32 Size; > +} EFI_ARM_PROCESSOR_CONTEXT_DATA; > + > +// > +// ARMv8 AArch32 GPRs(Generic Purpose Registers) (Type 0) > +// > +typedef struct { > + UINT32 R0; > + UINT32 R1; > + UINT32 R2; > + UINT32 R3; > + UINT32 R4; > + UINT32 R5; > + UINT32 R6; > + UINT32 R7; > + UINT32 R8; > + UINT32 R9; > + UINT32 R10; > + UINT32 R11; > + UINT32 R12; > + UINT32 R13; > + UINT32 R14; > + UINT32 R15; > +} EFI_CONTEXT_ARMV8_AARCH32_GPRS; > + > +// > +// ARM AArch32 EL1 Context system registers(Type 1) > +// > +typedef struct { > + UINT32 DFAR; > + UINT32 DFSR; > + UINT32 IFAR; > + UINT32 ISR; > + UINT32 MAIR0; > + UINT32 MAIR1; > + UINT32 MIDR; > + UINT32 MPIDR; > + UINT32 NMRR; > + UINT32 PRRR; > + UINT32 SCTLR; > + UINT32 SPSR; > + UINT32 SPSR_ABT; > + UINT32 SPSR_FIQ; > + UINT32 SPSR_IRQ; > + UINT32 SPSR_SVC; > + UINT32 SPSR_UND; > + UINT32 TPIDRPRW; > + UINT32 TPIDRURO; > + UINT32 TPIDRURW; > + UINT32 TTBCR; > + UINT32 TTBR0; > + UINT32 TTBR1; > + UINT32 DACR; > +} EFI_CONTEXT_ARM_AARCH32_EL1; > + > +// > +// ARM AArch32 EL2 Context system registers(Type 2) > +// > +typedef struct { > + UINT32 ELR_HYP; > + UINT32 HAMAIR0; > + UINT32 HAMAIR1; > + UINT32 HCR; > + UINT32 HCR2; > + UINT32 HDF_AR; > + UINT32 HIF_AR; > + UINT32 HPF_AR; [SAMI] I would prefer to retain the names of the above 3 registers as defined in the UEFI specification. This is also similar to the register names in Arm ARM, see https://developer.arm.com/documentation/ddi0595/2021-09/AArch32-Registers/HDFAR--Hyp-Data-Fault-Address-Register. > + UINT32 HSR; > + UINT32 HTCR; > + UINT32 HTPIDR; > + UINT32 HTTBR; > + UINT32 SPSR_HYP; > + UINT32 VTCR; > + UINT32 VTTBR; > + UINT32 DACR32_EL2; > +} EFI_CONTEXT_ARM_AARCH32_EL2; > + > +// > +// ARM AArch32 secure Context system registers(Type 3) > +// > +typedef struct { > + UINT32 SCTLR; > + UINT32 SPSR_MON; > +} EFI_CONTEXT_ARM_AARCH32_SECURE; > + > +// > +// ARMv8 AArch64 GPRs(Generic Purpose Registers) (Type 4) > +// > +typedef struct { > + UINT64 X0; > + UINT64 X1; > + UINT64 X2; > + UINT64 X3; > + UINT64 X4; > + UINT64 X5; > + UINT64 X6; > + UINT64 X7; > + UINT64 X8; > + UINT64 X9; > + UINT64 X10; > + UINT64 X11; > + UINT64 X12; > + UINT64 X13; > + UINT64 X14; > + UINT64 X15; > + UINT64 X16; > + UINT64 X17; > + UINT64 X18; > + UINT64 X19; > + UINT64 X20; > + UINT64 X21; > + UINT64 X22; > + UINT64 X23; > + UINT64 X24; > + UINT64 X25; > + UINT64 X26; > + UINT64 X27; > + UINT64 X28; > + UINT64 X29; > + UINT64 X30; > + UINT64 SP; > +} EFI_CONTEXT_ARMV8_AARCH64_GPRS; > + > +// > +// ARM AArch64 EL1 (Type 5) > +// > +typedef struct { > + UINT64 ELR_EL1; > + UINT64 ESR_EL1; > + UINT64 FAR_EL1; > + UINT64 ISR_EL1; > + UINT64 MAIR_EL1; > + UINT64 MDIR_EL1; [SAMI] I believe the above regiser name should be MIDR_EL1. > + UINT64 MPIDR_EL1; > + UINT64 SCTLR_EL1; > + UINT64 SP_EL0; > + UINT64 SP_EL1; > + UINT64 SPSR_EL1; > + UINT64 TCR_EL1; > + UINT64 TPIDR_EL0; > + UINT64 TPIDR_EL1; > + UINT64 TPIDRRO_EL0; > + UINT64 TTBR0_EL1; > + UINT64 TTBR1_EL1; > +} EFI_CONTEXT_ARM_AARCH64_EL1; > + > +// > +// ARM AArch64 EL2 (Type 6) > +// > +typedef struct { > + UINT64 ELR_EL2; > + UINT64 ESR_EL2; > + UINT64 FAR_EL2; > + UINT64 HACR_EL2; > + UINT64 HCR_EL2; > + UINT64 HPFAR_EL2; > + UINT64 MAIR_EL2; > + UINT64 SCTLR_EL2; > + UINT64 SP_EL2; > + UINT64 SPSR_EL2; > + UINT64 TCR_EL2; > + UINT64 TPIDR_EL2; > + UINT64 TTBR0_EL2; > + UINT64 VTCR_EL2; > + UINT64 VTTBR_EL2; > +} EFI_CONTEXT_ARM_AARCH64_EL2; > + > +// > +// ARM AArch64 EL3 (Type 7) > +// > +typedef struct { > + UINT64 ELR_EL3; > + UINT64 ESR_EL3; > + UINT64 FAR_EL3; > + UINT64 MAIR_EL3; > + UINT64 SCTLR_EL3; > + UINT64 SP_EL3; > + UINT64 SPSR_EL3; > + UINT64 TCR_EL3; > + UINT64 TPIDR_EL3; > + UINT64 TTBR0_EL3; > +} EFI_CONTEXT_ARM_AARCH64_EL3; > + > +// > +// ARM Misc context system register (Type 8) > +// > +typedef struct { > + UINT16 MRSEncoding; > + UINT64 Value; > +} EFI_CONTEXT_ARM_MISC; > + > +#endif > + > /// > /// Error Status Fields > ///