From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from NAM11-CO1-obe.outbound.protection.outlook.com (NAM11-CO1-obe.outbound.protection.outlook.com [40.107.220.80]) by mx.groups.io with SMTP id smtpd.web10.8910.1660027786620034739 for ; Mon, 08 Aug 2022 23:49:46 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@amd.com header.s=selector1 header.b=pj46Q0Yu; spf=permerror, err=parse error for token &{10 18 %{i}._ip.%{h}._ehlo.%{d}._spf.vali.email}: invalid domain name (domain: amd.com, ip: 40.107.220.80, mailfrom: abdullateef.attar@amd.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=l/SeUEOBlxNoHr3Sngi2vtChJZTTHidIFo8tU6q1BBnn9N6w1uU2jOY7IC9rbMxZq1Etvm0eroqzLfwqCn62QByfCjtc2X3mpaS9sUSIuEE7MYlGUfXeO6c30Zhdp/HwB6XUma4ZAqx6W14k+YTPH6MFdNykPV/D3x+9uFC8VuIUjJf3P4n3+fWVWbzjuMx0c86YHxphdLseIziaseHHPXx+9tY+Q6oKZxYQc3xzoy4fqi1khNi5LrZ+DaeQSlWVEcK2vOmme9MN/bmepkXIbVlbmxya+9AwNRF8jkNjNETyY+olqX4f5mKhbky1UGUPOxG1A8b3eIcxC2GRzIpBYw== 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=BUdVqzkOdIa285t0O45fCeHClXDj/4aCR1pYtWVeLJ4=; b=kBOXG0kZXvlJahC6PZSPL832pYtSyWvX+MJpfPT51qNbZPzEDH5WKDtwLQab1wReEI0o9kNRjoLD4S7SuN2k3ZW04kWaa+rO+ot/DkCi6i2MreH9LF4twKeGz2M+IQC1OklYYhnr6GDC6/mMdC8GLnKu+J43SUwvdw2EeCz3QCc4uwoEzEvLappfpvd97vTepOzH464Ax6Cj1OL4kVtNUxlEzNMlVZOKio/AkEH8mhVMuLRPayDEpr7CbKKBPSyHE9OsMPY9TmskchEGvNODNsXHw/pm2o1n/ODQxQm1sAtpyVKbaTBtZisbsB8tLVFEnzLHPkA1jbgEGdglEV1wGw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=edk2.groups.io smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=BUdVqzkOdIa285t0O45fCeHClXDj/4aCR1pYtWVeLJ4=; b=pj46Q0Yu4G0JNRO8YIIUa5lM4xtamLa0GkhQOboLvYY2RdwgBr7omLlYpyYloS7NrOPNOencr+RM/Qv/IwH54rMy1ogv9p1rn032DVTXOSCVy401HvDcpposDXuHrlaZ9fQnOMTkhRe10BO7v3wSjwXLW3fJYl3UbXdCI7+LpSo= Received: from DS7PR03CA0013.namprd03.prod.outlook.com (2603:10b6:5:3b8::18) by MN0PR12MB6173.namprd12.prod.outlook.com (2603:10b6:208:3c6::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5504.14; Tue, 9 Aug 2022 06:49:44 +0000 Received: from DM6NAM11FT031.eop-nam11.prod.protection.outlook.com (2603:10b6:5:3b8:cafe::f2) by DS7PR03CA0013.outlook.office365.com (2603:10b6:5:3b8::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5504.16 via Frontend Transport; Tue, 9 Aug 2022 06:49:44 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB03.amd.com; pr=C Received: from SATLEXMB03.amd.com (165.204.84.17) by DM6NAM11FT031.mail.protection.outlook.com (10.13.172.203) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5504.14 via Frontend Transport; Tue, 9 Aug 2022 06:49:43 +0000 Received: from SATLEXMB08.amd.com (10.181.40.132) by SATLEXMB03.amd.com (10.181.40.144) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.28; Tue, 9 Aug 2022 01:49:43 -0500 Received: from SATLEXMB04.amd.com (10.181.40.145) by SATLEXMB08.amd.com (10.181.40.132) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.28; Mon, 8 Aug 2022 23:49:42 -0700 Received: from BLR-LAB-SFW01.amd.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server id 15.1.2375.28 via Frontend Transport; Tue, 9 Aug 2022 01:49:41 -0500 From: "Abdul Lateef Attar" To: CC: Ray Ni , Zhichao Gao Subject: [PATCH v1 1/1] ShellPkg: Adds Local APIC parser to AcpiView Date: Tue, 9 Aug 2022 12:19:10 +0530 Message-ID: <20220809064910.4350-2-abdattar@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220809064910.4350-1-abdattar@amd.com> References: <20220809064910.4350-1-abdattar@amd.com> MIME-Version: 1.0 Return-Path: AbdulLateef.Attar@amd.com X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: d681b0c3-4fb2-4540-b60d-08da79d35779 X-MS-TrafficTypeDiagnostic: MN0PR12MB6173:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: i/RgNRoDjpDUEl5cPkSlZi6UJSlzHbsMf/l5v+0txF8ab2ktm2wwmwDMNRq3vTZfg3oKQ4/5R6Apc5yqYN3KkOUOru3KWGU87rAs/m18FI63+Go/COmUkHoeoo3RHsfuK4/B0TtTMB7T/hW/tmO2K3pOggZRQcjGSrJUfYl1G3sZ0AjvDxeW7bK6IRqphFmm7DMjE8/NrRXyOu/+FqUogZcXAqiDsJtvpCs/rl018gbAxkPHqI4ezVwpRPW7FxZOSWf0w8p/VfsfjGQ9MY/kKvdLfAX5bgDhPbCsU06mSZhgwd4kEXB5JKy4Qv4Cg1EImQd+BsMZMDiaLA5/Yccbpu5KKjyYs1nOm1ucEt4SoBIoewO4N1TrqdwGyKsTjDKs007yZcF4fg5PT0dhT5DDBIOJDYCzguSiNsIHvRYt7wCqIjllO2qSsJGh5lCNDkfb5Q43CTNMxCq4lDF/mT6773ap+dswLpbCVck86OJKhYu5UzBjBtp7OsIUX1SVauspqjsgTnRljuAwij62iZ2qFcbcRM0qcTKIuVLxlqdPZXVq3ydWn4ueRpEbcJyklKtS33fKU8A+ujNKPUMzcIfTIDAvD7CRAfiAATZbdIaly3w/2/lHatDjZDeLOa+ESzsh0Wrht/KnAna2YxtKUbznoH3pIOH4QlPXWwlrGafX8fQY4b/1Jc3OpXbrXrwpeL4KJBLkO1vY3KLnnn9pgjARUvaupKljIjFyEToLBgS+QFvzBX/8DjQTEqvICUwa59M0arrZWkka/mc1qQEAaHb1y1J0EAyUN6e5d5lMbvZCvionwiloiLP+Gnp4kPrUrx/cMVez0QT+mSw2HmtBEUiAjQ== X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB03.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230016)(4636009)(39860400002)(346002)(376002)(396003)(136003)(46966006)(40470700004)(36840700001)(26005)(40480700001)(47076005)(426003)(6666004)(5660300002)(41300700001)(82310400005)(336012)(1076003)(2906002)(356005)(2616005)(7696005)(186003)(83380400001)(8676002)(54906003)(6916009)(40460700003)(36860700001)(70586007)(478600001)(316002)(70206006)(81166007)(4326008)(8936002)(36756003)(82740400003)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Aug 2022 06:49:43.8063 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: d681b0c3-4fb2-4540-b60d-08da79d35779 X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB03.amd.com] X-MS-Exchange-CrossTenant-AuthSource: DM6NAM11FT031.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN0PR12MB6173 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain Parse Type 0 or Local APIC structure. Also parse the Local APIC Flags as bitfields. Cc: Ray Ni Cc: Zhichao Gao Signed-off-by: Abdul Lateef Attar --- ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Madt/MadtParser.c | 7= 4 ++++++++++++++++++-- 1 file changed, 67 insertions(+), 7 deletions(-) diff --git a/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Madt/Madt= Parser.c b/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Madt/MadtPa= rser.c index aaa68c99f514..41edcb9ffd1d 100644 --- a/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Madt/MadtParser.c +++ b/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Madt/MadtParser.c @@ -2,6 +2,7 @@ MADT table parser=0D =0D Copyright (c) 2016 - 2020, ARM Limited. All rights reserved.=0D + Copyright (c) 2022, AMD Incorporated. All rights reserved.=0D SPDX-License-Identifier: BSD-2-Clause-Patent=0D =0D @par Reference(s):=0D @@ -206,17 +207,65 @@ STATIC CONST ACPI_PARSER InterruptSourceOverride[] = =3D { { L"Flags", 2, 8, L"0x%x", NULL, NULL, NULL, NULL }=0D };=0D =0D +STATIC CONST ACPI_PARSER LocalApicFlags[] =3D {=0D + { L"Enabled", 1, 0, L"%d", NULL, NULL, NULL, NULL },=0D + { L"Online Capable", 1, 1, L"%d", NULL, NULL, NULL, NULL },=0D + { L"Reserved", 30, 2, L"%d", NULL, NULL, NULL, NULL }=0D +};=0D +=0D +/**=0D + This function traces Bit Flags fields.=0D + If no format string is specified the Format must be NULL.=0D +=0D + @param [in] Format Optional format string for tracing the data.=0D + @param [in] Ptr Pointer to the start of the buffer.=0D +**/=0D +VOID=0D +EFIAPI=0D +DumpLocalApicBitFlags (=0D + IN CONST CHAR16 *Format OPTIONAL,=0D + IN UINT8 *Ptr=0D + )=0D +{=0D + if (Format !=3D NULL) {=0D + Print (Format, *(UINT32 *)Ptr);=0D + return;=0D + }=0D +=0D + Print (L"0x%X\n", *(UINT32 *)Ptr);=0D + ParseAcpiBitFields (=0D + TRUE,=0D + 2,=0D + NULL,=0D + Ptr,=0D + 4,=0D + PARSER_PARAMS (LocalApicFlags)=0D + );=0D +}=0D +=0D +/**=0D + An ACPI_PARSER array describing the Processor Local APIC Structure.=0D + **/=0D +STATIC CONST ACPI_PARSER ProcessorLocalApic[] =3D {=0D + { L"Type", 1, 0, L"0x%x", NULL, NULL, NUL= L, NULL },=0D + { L"Length", 1, 1, L"%d", NULL, NULL, NUL= L, NULL },=0D +=0D + { L"ACPI Processor UID", 1, 2, L"0x%x", NULL, NULL, NUL= L, NULL },=0D + { L"APIC ID", 1, 3, L"0x%x", NULL, NULL, NUL= L, NULL },=0D + { L"Flags", 4, 4, NULL, DumpLocalApicBitFlags, NULL, NUL= L, NULL }=0D +};=0D +=0D /**=0D An ACPI_PARSER array describing the Processor Local x2APIC Structure.=0D **/=0D STATIC CONST ACPI_PARSER ProcessorLocalX2Apic[] =3D {=0D - { L"Type", 1, 0, L"0x%x", NULL, NULL, NULL, NULL },=0D - { L"Length", 1, 1, L"%d", NULL, NULL, NULL, NULL },=0D - { L"Reserved", 2, 2, L"0x%x", NULL, NULL, NULL, NULL },=0D + { L"Type", 1, 0, L"0x%x", NULL, NULL, NU= LL, NULL },=0D + { L"Length", 1, 1, L"%d", NULL, NULL, NU= LL, NULL },=0D + { L"Reserved", 2, 2, L"0x%x", NULL, NULL, NU= LL, NULL },=0D =0D - { L"X2APIC ID", 4, 4, L"0x%x", NULL, NULL, NULL, NULL },=0D - { L"Flags", 4, 8, L"0x%x", NULL, NULL, NULL, NULL },=0D - { L"ACPI Processor UID", 4, 12, L"0x%x", NULL, NULL, NULL, NULL }=0D + { L"X2APIC ID", 4, 4, L"0x%x", NULL, NULL, NU= LL, NULL },=0D + { L"Flags", 4, 8, NULL, DumpLocalApicBitFlags, NULL, NU= LL, NULL },=0D + { L"ACPI Processor UID", 4, 12, L"0x%x", NULL, NULL, NU= LL, NULL }=0D };=0D =0D /**=0D @@ -441,7 +490,18 @@ ParseAcpiMadt ( );=0D break;=0D }=0D -=0D + case EFI_ACPI_6_3_PROCESSOR_LOCAL_APIC:=0D + {=0D + ParseAcpi (=0D + TRUE,=0D + 2,=0D + "PROCESSOR LOCAL APIC",=0D + InterruptContollerPtr,=0D + *MadtInterruptControllerLength,=0D + PARSER_PARAMS (ProcessorLocalApic)=0D + );=0D + break;=0D + }=0D case EFI_ACPI_6_3_PROCESSOR_LOCAL_X2APIC:=0D {=0D ParseAcpi (=0D --=20 2.25.1