From nobody Tue Apr 23 18:12:13 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+56266+1787277+3901457@groups.io; arc=fail (BodyHash is different from the expected one) Received: from web01.groups.io (web01.groups.io [66.175.222.12]) by mx.zohomail.com with SMTPS id 1585129189642373.7048990104049; Wed, 25 Mar 2020 02:39:49 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id TksFYY1788612xp4jaiMse6c; Wed, 25 Mar 2020 02:39:49 -0700 X-Received: from EUR04-VI1-obe.outbound.protection.outlook.com (EUR04-VI1-obe.outbound.protection.outlook.com [40.107.8.45]) by mx.groups.io with SMTP id smtpd.web11.7819.1585129187912260284 for ; Wed, 25 Mar 2020 02:39:48 -0700 X-Received: from VI1PR08CA0204.eurprd08.prod.outlook.com (2603:10a6:800:d2::34) by AM5PR0802MB2468.eurprd08.prod.outlook.com (2603:10a6:203:a1::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2835.22; Wed, 25 Mar 2020 09:39:45 +0000 X-Received: from VE1EUR03FT060.eop-EUR03.prod.protection.outlook.com (2603:10a6:800:d2:cafe::5d) by VI1PR08CA0204.outlook.office365.com (2603:10a6:800:d2::34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2835.20 via Frontend Transport; Wed, 25 Mar 2020 09:39:45 +0000 Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) client-ip=66.175.222.12; envelope-from=bounce+27952+56266+1787277+3901457@groups.io; helo=web01.groups.io; 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; X-Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by VE1EUR03FT060.mail.protection.outlook.com (10.152.19.187) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2856.17 via Frontend Transport; Wed, 25 Mar 2020 09:39:44 +0000 X-Received: ("Tessian outbound 8f06d475fc37:v48"); Wed, 25 Mar 2020 09:39:44 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: f81a2940ae12d812 X-CR-MTA-TID: 64aa7808 X-Received: from b77a73132834.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id BDA3FE3D-8576-4079-9CE0-4DD5EB6570FC.1; Wed, 25 Mar 2020 09:39:38 +0000 X-Received: from EUR03-DB5-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id b77a73132834.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Wed, 25 Mar 2020 09:39:38 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=GyKse8WDcqiPgl47frQwGuSK8tLj2XBXvg5WJX28Yj61iPLFWbEkLS7kPHQxI3f3MsI6ZBNYcwddRPovo0Hbrey+B6mDwU5D6NYKspmrpFTcZsgb1wYe+kRHbrfJt4kXlgTtGLKDihhj5WL7OVlLrXLtZIOu2SYS5OXrcDFqKWIFcguund5Q8xSaSzUrriOycBOugAEN+n3XNOULRaTdiJ89JwbvL5cFS80bWyCQmhPtTW9vdKjw00B+XSP6p9ZxKFicN7UKUeyHMdWVJZXlDJGARAxCSDV5EwNds1ciu2PdKtVqPiOwkcXyLRg6u9Da8ExYZVUjK65pzGIr2Y8Lfg== 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-SenderADCheck; bh=v+f4nuh0NLUKD7f1Z8JCWoIp9MqCMq7huNpipMq5f+s=; b=NBvH/0v8oofw5c98Z4FFVDruPpHVHwYkDW2jBD2JWGR/h9zgX9omHUBn/zTb17FHfxTk4M+i2/aHWReco8VuNfA4ANwuP8PqQG9Tf+okOTS9XRaGB/Kt2gUdwlD7TCzDQ8oFcDym2BqUWbGwl4y8g3xLiia2eqRtESXO7xglwr6Ed13W6WMcOPJnGtHqDY9Va+pRf0YdsGbUD32rxyo2xN6YmPCWxTf/jrzkUhZKhuHLgSZagU6Ic425D4oqlvSZfDv5BpuVBDqv1YuMZP7YTMthl5bkZYFKqnvc2S0NV1+5ieeVdGOyt/ncUfvxkUvHrN7o227MLaUACUpkUshvvA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 40.67.248.234) smtp.rcpttodomain=edk2.groups.io smtp.mailfrom=arm.com; dmarc=bestguesspass action=none header.from=arm.com; dkim=none (message not signed); arc=none X-Received: from AM0PR10CA0028.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:208:17c::38) by AM6PR08MB3798.eurprd08.prod.outlook.com (2603:10a6:20b:82::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2835.22; Wed, 25 Mar 2020 09:39:36 +0000 X-Received: from VE1EUR03FT055.eop-EUR03.prod.protection.outlook.com (2603:10a6:208:17c:cafe::e8) by AM0PR10CA0028.outlook.office365.com (2603:10a6:208:17c::38) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2835.20 via Frontend Transport; Wed, 25 Mar 2020 09:39:36 +0000 Authentication-Results-Original: spf=pass (sender IP is 40.67.248.234) smtp.mailfrom=arm.com; edk2.groups.io; dkim=none (message not signed) header.d=none;edk2.groups.io; dmarc=bestguesspass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 40.67.248.234 as permitted sender) receiver=protection.outlook.com; client-ip=40.67.248.234; helo=nebula.arm.com; X-Received: from nebula.arm.com (40.67.248.234) by VE1EUR03FT055.mail.protection.outlook.com (10.152.19.158) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.2856.17 via Frontend Transport; Wed, 25 Mar 2020 09:39:36 +0000 X-Received: from AZ-NEU-EX03.Arm.com (10.251.24.31) by AZ-NEU-EX04.Arm.com (10.251.24.32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1415.2; Wed, 25 Mar 2020 09:39:26 +0000 X-Received: from E119924.Arm.com (10.57.55.133) by mail.arm.com (10.251.24.31) with Microsoft SMTP Server id 15.1.1415.2 via Frontend Transport; Wed, 25 Mar 2020 09:39:25 +0000 From: "Krzysztof Koch" To: CC: , , , , , Subject: [edk2-devel] [PATCH v1 1/3] ShellPkg: acpiview: Add -r parameter for table requirements validation Date: Wed, 25 Mar 2020 09:39:22 +0000 Message-ID: <20200325093924.22884-2-krzysztof.koch@arm.com> In-Reply-To: <20200325093924.22884-1-krzysztof.koch@arm.com> References: <20200325093924.22884-1-krzysztof.koch@arm.com> MIME-Version: 1.0 X-EOPAttributedMessage: 1 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report-Untrusted: CIP:40.67.248.234;IPV:;CTRY:IE;EFV:NLI;SFV:NSPM;SFS:(10009020)(4636009)(346002)(136003)(39860400002)(376002)(396003)(46966005)(6916009)(6666004)(36756003)(8936002)(356004)(8676002)(81156014)(81166006)(186003)(26005)(7696005)(478600001)(2616005)(44832011)(336012)(426003)(5660300002)(4326008)(86362001)(54906003)(2906002)(316002)(47076004)(1076003)(70586007)(82740400003)(70206006);DIR:OUT;SFP:1101;SCL:1;SRVR:AM6PR08MB3798;H:nebula.arm.com;FPR:;SPF:Pass;LANG:en;PTR:InfoDomainNonexistent; X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: a7020a11-1f10-4dcf-ee90-08d7d0a07373 X-MS-TrafficTypeDiagnostic: AM6PR08MB3798:|AM5PR0802MB2468: X-Microsoft-Antispam-PRVS: x-checkrecipientrouted: true NoDisclaimer: true X-MS-Oob-TLC-OOBClassifiers: OLM:2331;OLM:2331; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: iP3KPH/8S7EXdceUIxIQUw9LdtY5Tn+cBhLB1ll65ebF/AQZPfrox5SI52Ft6YfzaPTR4b+AxQdHlXtcWIlc23sVeUHQ10ESC86vzjpcIAC124FJy2+GaiDfosTKJa7ypzgMPejaGmylyXD2xOrad+7264kCcezPh4Za+hk0PmwSXH5aphYnahrLKMmpRaP9lte52VVrw/YptJyiwsLsaUdDPGojR724b7nsVF9orGqgP6HvikuZWi51id02Y2dG/4yCl9o2H1hBdIfHcWLRSmUkavG+IuDfAJDiJhGF6TLRR4exA7KLItckAeHrfwpgPUs5KCs/1qEOcvmCEHTh8rQto9mjjueSudEMTtDu5KxbzBDYWiN8tKDZezIEdriz52ykTRFcQnbeeZrXqG1Wa9eoYfOkVMo1WLt2oahf/1Z6UK9c8iBUqr1uqBzMbU4nA/PeLCK1UiDflbagAtienbXZ0crAqlbR5cU5vZrItKBRofjPVH+jVsuzyD0n+RImfhCWvRMIdcvOD7VTRd5mug== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR08MB3798 Original-Authentication-Results: spf=pass (sender IP is 40.67.248.234) smtp.mailfrom=arm.com; edk2.groups.io; dkim=none (message not signed) header.d=none;edk2.groups.io; dmarc=bestguesspass action=none header.from=arm.com; X-MS-Exchange-Transport-CrossTenantHeadersStripped: VE1EUR03FT060.eop-EUR03.prod.protection.outlook.com X-MS-Office365-Filtering-Correlation-Id-Prvs: 187f9a1c-7cd5-4422-f1f6-08d7d0a06e83 X-Microsoft-Antispam-Message-Info: fMLVWH1OT6A1j35S2OjFymdlu95cisZpg4U6IqIrqbEOjiMdXVaCJ9ens6A8sAk/aArYzwqYp1z+sLvbi2ihRAWoHtXf32CUObuJzzggIfNl99jl6b55Utb7bmwZ+KvMBhilPS9HckSu9yOtaUUrizP1tvY/XHHlxNFGeRgXbDpQegM22CgcK7FoWSg2SM8tpVWhXLV2vYWMkGF+2yK3L66wtdY6ZMI9j2pwsrfempX+hCOZcp9Uu/bA9Cx2bxW21atd20LvCBgKlaUT2Ohr3eCZfAI4+oHQuWaBQBZ80Sf7IzsP1YGeYc3O7fg7+iQr2tlU8FVysX10SBaOS5FbXPMigIn7wfgljcH88sZn4/96rEWuC3LotmbsV4amnqDqQsHUbsUq4kLnQ6/n6hyu45Mm9QX5dlkG4JEyP9yfq+qdVjJ3TTmnGP+gEHCwBe3tleMl6wnwmkzscj0WDXk+xFvHz+D90WX6lYNscKm6kUig/MxhKnl+bmoiADB/k0VZClbdo8OzTrvDpITnvblGsw== X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Mar 2020 09:39:44.5115 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: a7020a11-1f10-4dcf-ee90-08d7d0a07373 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-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM5PR0802MB2468 Precedence: Bulk List-Unsubscribe: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,krzysztof.koch@arm.com X-Gm-Message-State: xF5Jc56ur0oxbGJ6SdFNH2wax1787277AA= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1585129189; bh=s4rFHqORs7cwAA4DaDVekzLRyekM0xa1z5R5KzHju5Y=; h=CC:Content-Type:Date:From:Reply-To:Subject:To; b=Ph8VPjpgAZ2DJLn+druGmpJ4VNxFLstu7G613XEiWHr6JFhEtpUoAEUVCN442xenCSj w2M4DkAEGwt0g+kUOMg+c5wHnJ7UMMxpqq6+nY9wwuX4S3n1EcAlFad0ga2wWAakFl+Y5 5smKW/+WdT4fi+p2SMAg4TxaoN1CYarMOGA= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Define a new command line parameter '-r' to enable checking if all mandatory ACPI tables listed in a specification are present. The -r parameter takes an integer value to specify which specification the validation should be performed against. The parameter is used to set two Acpiview variables. An interface to access these variables is implemented in this patch. The new functionality is aimed at Arm-based platforms, however, there are no restriction on extending it to other architectures. For the 32-bit and 64-bit Arm architectures, the possible values for the -r parameter are: 0: Arm Server Base Boot Requirements 1.0, March 2016 1: Arm Server Base Boot Requirements 1.1, May 2018 2: Arm Server Base Boot Requirements 1.2, September 2019 Signed-off-by: Krzysztof Koch Reviewed-by: Sami Mujawar --- Notes: v1: - add '-r' parameter for table requirements validaiton [Krzysztof] ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiView.c = | 82 +++++++++++++++++++- ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiView.h = | 44 ++++++++++- ShellPkg/Library/UefiShellAcpiViewCommandLib/UefiShellAcpiViewCommandLib.u= ni | 14 +++- 3 files changed, 136 insertions(+), 4 deletions(-) diff --git a/ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiView.c b/Shel= lPkg/Library/UefiShellAcpiViewCommandLib/AcpiView.c index de0851dd5fbae51308def95bd4964f792fb9e680..49c2e87c430d7fb57793f6405eb= ee91cb8f6cbaa 100644 --- a/ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiView.c +++ b/ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiView.c @@ -1,6 +1,6 @@ /** @file =20 - Copyright (c) 2016 - 2019, ARM Limited. All rights reserved. + Copyright (c) 2016 - 2020, ARM Limited. All rights reserved. SPDX-License-Identifier: BSD-2-Clause-Patent **/ =20 @@ -27,6 +27,8 @@ STATIC UINT32 mTableCount; STATIC UINT32 mBinTableCount; STATIC BOOLEAN mConsistencyCheck; STATIC BOOLEAN mColourHighlighting; +STATIC BOOLEAN mMandatoryTableValidate; +STATIC UINTN mMandatoryTableSpec; =20 /** An array of acpiview command line parameters. @@ -37,6 +39,7 @@ STATIC CONST SHELL_PARAM_ITEM ParamList[] =3D { {L"-h", TypeFlag}, {L"-l", TypeFlag}, {L"-s", TypeValue}, + {L"-r", TypeValue}, {NULL, TypeMax} }; =20 @@ -94,6 +97,60 @@ SetConsistencyChecking ( mConsistencyCheck =3D ConsistencyChecking; } =20 +/** + This function returns the ACPI table requirements validation flag. + + @retval TRUE if check for mandatory table presence should be performed. +**/ +BOOLEAN +GetMandatoryTableValidate ( + VOID + ) +{ + return mMandatoryTableValidate; +} + +/** + This function sets the ACPI table requirements validation flag. + + @param Validate Enable/Disable ACPI table requirements validation. +**/ +VOID +SetMandatoryTableValidate ( + BOOLEAN Validate + ) +{ + mMandatoryTableValidate =3D Validate; +} + +/** + This function returns the identifier of specification to validate ACPI t= able + requirements against. + + @return ID of specification listing mandatory tables. +**/ +UINTN +GetMandatoryTableSpec ( + VOID + ) +{ + return mMandatoryTableSpec; +} + +/** + This function sets the identifier of specification to validate ACPI table + requirements against. + + @param Spec ID of specification listing mandatory tables. +**/ +VOID +SetMandatoryTableSpec ( + UINTN Spec + ) +{ + mMandatoryTableSpec =3D Spec; +} + /** This function returns the report options. =20 @@ -470,6 +527,7 @@ ShellCommandRunAcpiView ( LIST_ENTRY* Package; CHAR16* ProblemParam; SHELL_FILE_HANDLE TmpDumpFileHandle; + CONST CHAR16* MandatoryTableSpecStr; =20 // Set Defaults mReportType =3D ReportAll; @@ -479,6 +537,8 @@ ShellCommandRunAcpiView ( mSelectedAcpiTableName =3D NULL; mSelectedAcpiTableFound =3D FALSE; mConsistencyCheck =3D TRUE; + mMandatoryTableValidate =3D FALSE; + mMandatoryTableSpec =3D 0; =20 ShellStatus =3D SHELL_SUCCESS; Package =3D NULL; @@ -537,6 +597,18 @@ ShellCommandRunAcpiView ( L"-s" ); ShellStatus =3D SHELL_INVALID_PARAMETER; + } else if (ShellCommandLineGetFlag (Package, L"-r") && + ShellCommandLineGetValue (Package, L"-r") =3D=3D NULL) { + ShellPrintHiiEx ( + -1, + -1, + NULL, + STRING_TOKEN (STR_GEN_NO_VALUE), + gShellAcpiViewHiiHandle, + L"acpiview", + L"-r" + ); + ShellStatus =3D SHELL_INVALID_PARAMETER; } else if ((ShellCommandLineGetFlag (Package, L"-s") && ShellCommandLineGetFlag (Package, L"-l"))) { ShellPrintHiiEx ( @@ -568,6 +640,14 @@ ShellCommandRunAcpiView ( // Surpress consistency checking if requested SetConsistencyChecking (!ShellCommandLineGetFlag (Package, L"-q")); =20 + // Evaluate the parameters for mandatory ACPI table presence checks + SetMandatoryTableValidate (ShellCommandLineGetFlag (Package, L"-r")); + MandatoryTableSpecStr =3D ShellCommandLineGetValue (Package, L"-r"); + + if (MandatoryTableSpecStr !=3D NULL) { + SetMandatoryTableSpec (ShellHexStrToUintn (MandatoryTableSpecStr)); + } + if (ShellCommandLineGetFlag (Package, L"-l")) { mReportType =3D ReportTableList; } else { diff --git a/ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiView.h b/Shel= lPkg/Library/UefiShellAcpiViewCommandLib/AcpiView.h index b5cb274ecbf77f7ccb81d78f852caa0f50854312..be65564c86a67a03e71b11f3b2e= cde7a21016736 100644 --- a/ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiView.h +++ b/ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiView.h @@ -1,7 +1,7 @@ /** @file Header file for AcpiView =20 - Copyright (c) 2016 - 2019, ARM Limited. All rights reserved. + Copyright (c) 2016 - 2020, ARM Limited. All rights reserved. SPDX-License-Identifier: BSD-2-Clause-Patent **/ =20 @@ -112,6 +112,48 @@ SetConsistencyChecking ( BOOLEAN ConsistencyChecking ); =20 +/** + This function returns the ACPI table requirements validation flag. + + @retval TRUE if check for mandatory table presence should be performed. +**/ +BOOLEAN +GetMandatoryTableValidate ( + VOID + ); + +/** + This function sets the ACPI table requirements validation flag. + + @param Validate Enable/Disable ACPI table requirements validation. +**/ +VOID +SetMandatoryTableValidate ( + BOOLEAN Validate + ); + +/** + This function returns the identifier of specification to validate ACPI t= able + requirements against. + + @return ID of specification listing mandatory tables. +**/ +UINTN +GetMandatoryTableSpec ( + VOID + ); + +/** + This function sets the identifier of specification to validate ACPI table + requirements against. + + @param Spec ID of specification listing mandatory tables. +**/ +VOID +SetMandatoryTableSpec ( + UINTN Spec + ); + /** This function processes the table reporting options for the ACPI table. =20 diff --git a/ShellPkg/Library/UefiShellAcpiViewCommandLib/UefiShellAcpiView= CommandLib.uni b/ShellPkg/Library/UefiShellAcpiViewCommandLib/UefiShellAcpi= ViewCommandLib.uni index 1f07b7ae20d474be67a433ff3774a508a5289318..7cd43d0518fd0a23dc547a5cab0= d08b62602a113 100644 --- a/ShellPkg/Library/UefiShellAcpiViewCommandLib/UefiShellAcpiViewCommand= Lib.uni +++ b/ShellPkg/Library/UefiShellAcpiViewCommandLib/UefiShellAcpiViewCommand= Lib.uni @@ -1,6 +1,6 @@ // /** // -// Copyright (c) 2016 - 2019, ARM Limited. All rights reserved.
+// Copyright (c) 2016 - 2020, ARM Limited. All rights reserved.
// SPDX-License-Identifier: BSD-2-Clause-Patent // // Module Name: @@ -30,7 +30,7 @@ "Display ACPI Table information.\r\n" ".SH SYNOPSIS\r\n" " \r\n" -"ACPIVIEW [[-?] | [[-l] | [-s AcpiTable [-d]]] [-q] [-h]]\r\n" +"ACPIVIEW [[-?] | [[[[-l] | [-s AcpiTable [-d]]] [-q] [-h]] [-r Spec]]]\r\= n" " \r\n" ".SH OPTIONS\r\n" " \r\n" @@ -41,6 +41,12 @@ " -d - Generate a binary file dump of the specified AcpiTable.\r\n" " -q - Quiet. Suppress errors and warnings. Disables consistency checks.\= r\n" " -h - Enable colour highlighting.\r\n" +" -r - Validate that all required ACPI tables are installed\r\n" +" Spec : Specification to validate against.\r\n" +" For Arm, the possible values are:\r\n" +" 0 - Server Base Boot Requirements v1.0\r\n" +" 1 - Server Base Boot Requirements v1.1\r\n" +" 2 - Server Base Boot Requirements v1.2\r\n" " -? - Show help.\r\n" " \r\n" ".SH DESCRIPTION\r\n" @@ -118,6 +124,10 @@ " * To display contents of all ACPI tables:\r\n" " fs0:\> acpiview\r\n" " \r\n" +" * To check if all Server Base Boot Requirements (SBBR) v1.2 mandatory\r= \n" +" ACPI tables are installed (Arm only):\r\n" +" fs0:\> acpiview -r 2\r\n" +" \r\n" ".SH RETURNVALUES\r\n" " \r\n" "RETURN VALUES:\r\n" -- 'Guid(CE165669-3EF3-493F-B85D-6190EE5B9759)' -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#56266): https://edk2.groups.io/g/devel/message/56266 Mute This Topic: https://groups.io/mt/72537309/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- From nobody Tue Apr 23 18:12:13 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+56267+1787277+3901457@groups.io; arc=fail (BodyHash is different from the expected one) Received: from web01.groups.io (web01.groups.io [66.175.222.12]) by mx.zohomail.com with SMTPS id 1585129190479548.887990636358; Wed, 25 Mar 2020 02:39:50 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id 2caLYY1788612xu9PlvVnP8M; Wed, 25 Mar 2020 02:39:50 -0700 X-Received: from EUR04-VI1-obe.outbound.protection.outlook.com (EUR04-VI1-obe.outbound.protection.outlook.com [40.107.8.73]) by mx.groups.io with SMTP id smtpd.web12.7975.1585129188977107444 for ; Wed, 25 Mar 2020 02:39:49 -0700 X-Received: from AM6P193CA0093.EURP193.PROD.OUTLOOK.COM (2603:10a6:209:88::34) by DB8PR08MB5324.eurprd08.prod.outlook.com (2603:10a6:10:11e::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2835.18; Wed, 25 Mar 2020 09:39:46 +0000 X-Received: from VE1EUR03FT037.eop-EUR03.prod.protection.outlook.com (2603:10a6:209:88:cafe::f0) by AM6P193CA0093.outlook.office365.com (2603:10a6:209:88::34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2835.20 via Frontend Transport; Wed, 25 Mar 2020 09:39:45 +0000 Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) client-ip=66.175.222.12; envelope-from=bounce+27952+56267+1787277+3901457@groups.io; helo=web01.groups.io; 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; X-Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by VE1EUR03FT037.mail.protection.outlook.com (10.152.19.70) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2856.17 via Frontend Transport; Wed, 25 Mar 2020 09:39:45 +0000 X-Received: ("Tessian outbound fb361fb66447:v48"); Wed, 25 Mar 2020 09:39:45 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: 67a1aeb606d7ea16 X-CR-MTA-TID: 64aa7808 X-Received: from 003d1da8a047.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 2D89B320-7AC1-40D4-8664-DC44A0AC6715.1; Wed, 25 Mar 2020 09:39:39 +0000 X-Received: from EUR01-HE1-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 003d1da8a047.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Wed, 25 Mar 2020 09:39:39 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=QuTd7GeMRbp4BWlv58NrhrO8StOg7PvBvDI0XXx5hcTInaMpnUxxuYmRd5JaoLo7ktIKTO5bmwd2DQt178Fw4UejD0vpLNETzN1Pvz6/CX/j5cwFFY+3xSbspttP4b8Si3e87R39peGnjA88dLuGdTxDOMrJC9dK9Wak6MF7f9M8a1gbav79FKf+B3vYWedFM2AMsASwzMieTAbwAm+ljL6ZbXEOwVnpnIpSJaL7AihmSaX9Ie/fiQ4v6DZJrJUt3Kxa/qNzU+3Iakvr6GxWepWI6gMMjpy5ElOn/Lw7Ml+TywVat3RqRX3IxAKk0KXKJDWXaeW6wYXlnKEurHOsGg== 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-SenderADCheck; bh=PLvy6rozeAPtZ+p++hql4Km1dT3ZQURhHPbDxBRWvcY=; b=RpsKpa5uBWLqe2Z4TPEtI8WTz1WQBMM+RRNZxgCB+ITOwUll6qP3IPQgS0+ouB0JwN8rRa/ymtzZiXI4AdmdyC1hRQ/8T4MC6DRmrkc2y5eDiKyUfXt1uTowqzQ8eZ0kc+wfbTja+gPkn7DBqrFi0ap8DoB5RFNU/ztGGxVMy2Up+BuHgzM8qwLoy8WQyik4fLIxqCAQmWvQoZ+Q/XEV1ZpOVDwsuXoGjqMUx9Ca/DxmOmg+KNPvvxOhvQBqXvzm+StODbI4vVE8lhECtll7Dma7rTN2L7KU1j/i2k1uqEfizHisc8I+bBhHXp9I4gWG10/GOGc2v4slGvrfZuUADw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 40.67.248.234) smtp.rcpttodomain=edk2.groups.io smtp.mailfrom=arm.com; dmarc=bestguesspass action=none header.from=arm.com; dkim=none (message not signed); arc=none X-Received: from VI1PR07CA0202.eurprd07.prod.outlook.com (2603:10a6:802:3f::26) by AM0PR08MB5187.eurprd08.prod.outlook.com (2603:10a6:208:15d::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2835.20; Wed, 25 Mar 2020 09:39:37 +0000 X-Received: from VE1EUR03FT046.eop-EUR03.prod.protection.outlook.com (2603:10a6:802:3f:cafe::6d) by VI1PR07CA0202.outlook.office365.com (2603:10a6:802:3f::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2856.12 via Frontend Transport; Wed, 25 Mar 2020 09:39:37 +0000 Authentication-Results-Original: spf=pass (sender IP is 40.67.248.234) smtp.mailfrom=arm.com; edk2.groups.io; dkim=none (message not signed) header.d=none;edk2.groups.io; dmarc=bestguesspass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 40.67.248.234 as permitted sender) receiver=protection.outlook.com; client-ip=40.67.248.234; helo=nebula.arm.com; X-Received: from nebula.arm.com (40.67.248.234) by VE1EUR03FT046.mail.protection.outlook.com (10.152.19.226) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.2856.17 via Frontend Transport; Wed, 25 Mar 2020 09:39:37 +0000 X-Received: from AZ-NEU-EX03.Arm.com (10.251.24.31) by AZ-NEU-EX04.Arm.com (10.251.24.32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1415.2; Wed, 25 Mar 2020 09:39:26 +0000 X-Received: from E119924.Arm.com (10.57.55.133) by mail.arm.com (10.251.24.31) with Microsoft SMTP Server id 15.1.1415.2 via Frontend Transport; Wed, 25 Mar 2020 09:39:26 +0000 From: "Krzysztof Koch" To: CC: , , , , , Subject: [edk2-devel] [PATCH v1 2/3] ShellPkg: acpiview: Add library for SBBR ACPI requirements validation Date: Wed, 25 Mar 2020 09:39:23 +0000 Message-ID: <20200325093924.22884-3-krzysztof.koch@arm.com> In-Reply-To: <20200325093924.22884-1-krzysztof.koch@arm.com> References: <20200325093924.22884-1-krzysztof.koch@arm.com> MIME-Version: 1.0 X-EOPAttributedMessage: 1 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report-Untrusted: CIP:40.67.248.234;IPV:;CTRY:IE;EFV:NLI;SFV:NSPM;SFS:(10009020)(4636009)(396003)(136003)(39860400002)(376002)(346002)(46966005)(81166006)(26005)(47076004)(44832011)(81156014)(82740400003)(2616005)(86362001)(8676002)(186003)(478600001)(70206006)(2906002)(8936002)(316002)(54906003)(70586007)(6666004)(36756003)(356004)(7696005)(19627235002)(4326008)(336012)(1076003)(426003)(5660300002)(30864003)(6916009);DIR:OUT;SFP:1101;SCL:1;SRVR:AM0PR08MB5187;H:nebula.arm.com;FPR:;SPF:Pass;LANG:en;PTR:InfoDomainNonexistent; X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: f71a874c-5cee-4949-94ed-08d7d0a073dd X-MS-TrafficTypeDiagnostic: AM0PR08MB5187:|DB8PR08MB5324: X-Microsoft-Antispam-PRVS: x-checkrecipientrouted: true NoDisclaimer: true X-MS-Oob-TLC-OOBClassifiers: OLM:962;OLM:962; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: WyxvhcRUaV2/WMoqwbPyMfNJy5ZdMligziJbsP93Y/gu5JHe9yx/ui9/xCBZO+FDUjfCyAml536g4awmtBRb3UVXqmyiQwh6KFpe0mAMAaU3Ze1IpWmxXPJe+2gAiASR+3JCpIkWopfzjPUAhr8yvwq04wFiPpz23Femt84zEScCPOCzF1+ExQhBvEKxlacjNUvUNADaifjQQUJRmudJ0eRCap/TD0KGGXx+i1CVmcK+GCTLXHRV9+ON6Jy2hlcuBdeg3lww+bI0KLLPUugxlq/6UZhTaZz31AuJ6BvbrjNA1aXgoJKUqN23ZzFu1TOjJHbu/Kut88niOWLKkvNnQb2rk7fOtG+tTpZMinjXlWSXL7sWAGC7xAcSUN33ZojetNuvu2MEsmOYZZUBRX8debY0UCBYoCpX4CrsFYEmeDrXk7d62qFURKjeyAnffbN6nB7GP3zwd+bDzWhItwLQB3Pax6yh0XpId3L4bOVt4jied4wQKfTX50CfnG7BQyYR837/B5Lk34pKq+MQXrV3vA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR08MB5187 Original-Authentication-Results: spf=pass (sender IP is 40.67.248.234) smtp.mailfrom=arm.com; edk2.groups.io; dkim=none (message not signed) header.d=none;edk2.groups.io; dmarc=bestguesspass action=none header.from=arm.com; X-MS-Exchange-Transport-CrossTenantHeadersStripped: VE1EUR03FT037.eop-EUR03.prod.protection.outlook.com X-MS-Office365-Filtering-Correlation-Id-Prvs: c4d85a38-414f-4f2c-bae9-08d7d0a06f1d X-Microsoft-Antispam-Message-Info: +12rZ0b9sKwMkPrTLJnk28gUQH2xG8HERQcAcOJENhB1hljcxIrQIda6web6Q7L0Nzz3sUr0fxl7fXyACQ2vnsE7lX5C8Ebz/qDKwRaaFkRIuyx3rqUg5N5HwJrLPp87akdFQLl4bluoC6jB1wv6AMb5E7BZ7ugr2Gn8UfmYKS0elHEDP/uyW1G1qtI4481nTFAghctBDEmQBGAQK9PQuYXOp33QC8YOqZauVUC+X/EnkVKXd8z9bfbl8xBc85kUMV0ie2kUhFfiXNrjeRgmCy/kNEoK0qrbrfOk7iSAZXGs6doGCGxIwCpmizfXjEs5TEWkVmlPjZWiLxFNk5wT7eO1y4EoryeHYWyHr54WP9C57xLTf0jRy3GXOm8HWbE4BTkLbmqMq4QokThuXrLWcmwaiYTk56RJzFhq5djetn+Uf/W2n540NIBMr6qynBf451pKGfeVrN3i4KTRqecDRpH/hGh7bvKYZ57DaAwqLgwD9/ivKScZCQ22Y9fd/AfQQrPRxcghQk/+kVzRIHzXyQ== X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Mar 2020 09:39:45.2089 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: f71a874c-5cee-4949-94ed-08d7d0a073dd 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-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB8PR08MB5324 Precedence: Bulk List-Unsubscribe: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,krzysztof.koch@arm.com X-Gm-Message-State: OdKMr9nuSVghfMBiHJycgyQ4x1787277AA= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1585129190; bh=zUGxal7YyTosHQsGBHVjY7/AqL08rmIg8/Uo4yAqHSI=; h=CC:Content-Type:Date:From:Reply-To:Subject:To; b=pkGkKrklyfSQShU4meW5GOx/71CXgbbsgv/26obH0/dgFH7rCElT4HRkn6kkh5tGwuW /GW+13gQd6jLLRI/TquTNpVR6chRFeiG6dN0iK/l9iPIytXMWBazuRXYFACffbOt48Oml iMF83sJEQyX5G/u43DVUJ0YmIHtAHGH6GxY= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" For Arm-based platforms, define and implement an interface for Server Base Boot Requirements (SBBR) compliance checks. The library is responsible for validating that all mandatory ACPI tables are installed on the platform. Internally, the library maintains a data structure which tracks instance counts for ACPI tables which are labeled as 'mandatory' in any SBBR specification version. The provided interface allows: - resetting all instance counts to 0 - incremementing the instance count for a table with a given signature - validating the instance counts against the requirements in SBBR The ACPI table requirements for each SBBR spec version are represented internally as a list of table signatures. Every missing mandatory table (for the input SBBR version) is reported to the user as a separate error. If all requirements are met, an info message is displayed. Reference(s): - Arm Server Base Boot Requirements 1.2, September 2019 - Arm Server Base Boot Requirements 1.1, May 2018 - Arm Server Base Boot Requirements 1.0, March 2016 Signed-off-by: Krzysztof Koch Reviewed-by: Sami Mujawar --- Notes: v1: - add library for SBBR ACPI requirements validation [Krzysztof] ShellPkg/Library/UefiShellAcpiViewCommandLib/Arm/SbbrValidator.c = | 222 ++++++++++++++++++++ ShellPkg/Library/UefiShellAcpiViewCommandLib/Arm/SbbrValidator.h = | 91 ++++++++ ShellPkg/Library/UefiShellAcpiViewCommandLib/UefiShellAcpiViewCommandLib.i= nf | 6 +- 3 files changed, 318 insertions(+), 1 deletion(-) diff --git a/ShellPkg/Library/UefiShellAcpiViewCommandLib/Arm/SbbrValidator= .c b/ShellPkg/Library/UefiShellAcpiViewCommandLib/Arm/SbbrValidator.c new file mode 100644 index 0000000000000000000000000000000000000000..d3284417fa5f4da1c29ba56b858= 7f1119c776278 --- /dev/null +++ b/ShellPkg/Library/UefiShellAcpiViewCommandLib/Arm/SbbrValidator.c @@ -0,0 +1,222 @@ +/** @file + Arm Server Base Boot Requirements ACPI table requirement validator. + + Copyright (c) 2020, ARM Limited. All rights reserved. + SPDX-License-Identifier: BSD-2-Clause-Patent + + @par Glossary: + - Sbbr or SBBR - Server Base Boot Requirements + - Sbsa or SBSA - Server Base System Architecture + + @par Reference(s): + - Arm Server Base Boot Requirements 1.2, September 2019 + - Arm Server Base Boot Requirements 1.1, May 2018 + - Arm Server Base Boot Requirements 1.0, March 2016 + - Arm Server Base System Architecture 6.0 +**/ + +#include +#include +#include "AcpiParser.h" +#include "Arm/SbbrValidator.h" + +/** + SBBR specification version strings +**/ +STATIC CONST CHAR8* ArmSbbrVersions[ArmSbbrVersionMax] =3D { + "1.0", // ArmSbbrVersion_1_0 + "1.1", // ArmSbbrVersion_1_1 + "1.2" // ArmSbbrVersion_1_2 +}; + +/** + SBBR 1.0 mandatory ACPI tables +**/ +STATIC CONST UINT32 ArmSbbr10Mandatory[] =3D { + EFI_ACPI_6_3_EXTENDED_SYSTEM_DESCRIPTION_TABLE_SIGNATURE, + EFI_ACPI_6_3_FIXED_ACPI_DESCRIPTION_TABLE_SIGNATURE, + EFI_ACPI_6_3_DIFFERENTIATED_SYSTEM_DESCRIPTION_TABLE_SIGNATURE, + EFI_ACPI_6_3_MULTIPLE_APIC_DESCRIPTION_TABLE_SIGNATURE, + EFI_ACPI_6_3_GENERIC_TIMER_DESCRIPTION_TABLE_SIGNATURE, + EFI_ACPI_6_3_DEBUG_PORT_2_TABLE_SIGNATURE, + EFI_ACPI_6_3_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE_SIGNATURE +}; + +/** + SBBR 1.1 mandatory ACPI tables +**/ +STATIC CONST UINT32 ArmSbbr11Mandatory[] =3D { + EFI_ACPI_6_3_EXTENDED_SYSTEM_DESCRIPTION_TABLE_SIGNATURE, + EFI_ACPI_6_3_FIXED_ACPI_DESCRIPTION_TABLE_SIGNATURE, + EFI_ACPI_6_3_DIFFERENTIATED_SYSTEM_DESCRIPTION_TABLE_SIGNATURE, + EFI_ACPI_6_3_MULTIPLE_APIC_DESCRIPTION_TABLE_SIGNATURE, + EFI_ACPI_6_3_GENERIC_TIMER_DESCRIPTION_TABLE_SIGNATURE, + EFI_ACPI_6_3_DEBUG_PORT_2_TABLE_SIGNATURE, + EFI_ACPI_6_3_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE_SIGNATURE, + EFI_ACPI_6_3_PCI_EXPRESS_MEMORY_MAPPED_CONFIGURATION_SPACE_BASE_ADDRESS_= DESCRIPTION_TABLE_SIGNATURE +}; + +/** + SBBR 1.2 mandatory ACPI tables +**/ +STATIC CONST UINT32 ArmSbbr12Mandatory[] =3D { + EFI_ACPI_6_3_EXTENDED_SYSTEM_DESCRIPTION_TABLE_SIGNATURE, + EFI_ACPI_6_3_FIXED_ACPI_DESCRIPTION_TABLE_SIGNATURE, + EFI_ACPI_6_3_DIFFERENTIATED_SYSTEM_DESCRIPTION_TABLE_SIGNATURE, + EFI_ACPI_6_3_MULTIPLE_APIC_DESCRIPTION_TABLE_SIGNATURE, + EFI_ACPI_6_3_GENERIC_TIMER_DESCRIPTION_TABLE_SIGNATURE, + EFI_ACPI_6_3_DEBUG_PORT_2_TABLE_SIGNATURE, + EFI_ACPI_6_3_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE_SIGNATURE, + EFI_ACPI_6_3_PCI_EXPRESS_MEMORY_MAPPED_CONFIGURATION_SPACE_BASE_ADDRESS_= DESCRIPTION_TABLE_SIGNATURE, + EFI_ACPI_6_3_PROCESSOR_PROPERTIES_TOPOLOGY_TABLE_STRUCTURE_SIGNATURE +}; + +/** + Mandatory ACPI tables for every SBBR specification version. +**/ +STATIC CONST ACPI_SBBR_REQ ArmSbbrReqs[ArmSbbrVersionMax] =3D { + { ArmSbbr10Mandatory, ARRAY_SIZE (ArmSbbr10Mandatory) }, // SBBR v1.0 + { ArmSbbr11Mandatory, ARRAY_SIZE (ArmSbbr11Mandatory) }, // SBBR v1.1 + { ArmSbbr12Mandatory, ARRAY_SIZE (ArmSbbr12Mandatory) } // SBBR v1.2 +}; + +/** + Data structure to track instance counts for all ACPI tables which are + defined as 'mandatory' in any SBBR version. +**/ +STATIC ACPI_TABLE_COUNTER ArmSbbrTableCounts[] =3D { + {EFI_ACPI_6_3_EXTENDED_SYSTEM_DESCRIPTION_TABLE_SIGNATURE, 0}, + {EFI_ACPI_6_3_FIXED_ACPI_DESCRIPTION_TABLE_SIGNATURE, 0}, + {EFI_ACPI_6_3_DIFFERENTIATED_SYSTEM_DESCRIPTION_TABLE_SIGNATURE, 0}, + {EFI_ACPI_6_3_MULTIPLE_APIC_DESCRIPTION_TABLE_SIGNATURE, 0}, + {EFI_ACPI_6_3_GENERIC_TIMER_DESCRIPTION_TABLE_SIGNATURE, 0}, + {EFI_ACPI_6_3_DEBUG_PORT_2_TABLE_SIGNATURE, 0}, + {EFI_ACPI_6_3_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE_SIGNATURE, 0}, + {EFI_ACPI_6_3_PCI_EXPRESS_MEMORY_MAPPED_CONFIGURATION_SPACE_BASE_ADDRESS= _DESCRIPTION_TABLE_SIGNATURE, 0}, + {EFI_ACPI_6_3_PROCESSOR_PROPERTIES_TOPOLOGY_TABLE_STRUCTURE_SIGNATURE, 0} +}; + +/** + Reset the platform ACPI table instance count for all SBBR-mandatory tabl= es. +**/ +VOID +EFIAPI +ArmSbbrResetTableCounts ( + VOID + ) +{ + UINT32 Table; + + for (Table =3D 0; Table < ARRAY_SIZE (ArmSbbrTableCounts); Table++) { + ArmSbbrTableCounts[Table].Count =3D 0; + } +} + +/** + Increment instance count for SBBR-mandatory ACPI table with the given + signature. + + @param [in] Signature ACPI table signature. + + @retval TRUE Count incremented successfully. + @retval FALSE Table with the input signature not found. +**/ +BOOLEAN +EFIAPI +ArmSbbrIncrementTableCount ( + UINT32 Signature + ) +{ + UINT32 Table; + + for (Table =3D 0; Table < ARRAY_SIZE (ArmSbbrTableCounts); Table++) { + if (Signature =3D=3D ArmSbbrTableCounts[Table].Signature) { + ArmSbbrTableCounts[Table].Count++; + return TRUE; + } + } + + return FALSE; +} + +/** + Validate that all ACPI tables required by the given SBBR specification + version are installed on the platform. + + @param [in] Version SBBR spec version to validate against. + + @retval EFI_SUCCESS All required tables are present. + @retval EFI_INVALID_PARAMETER Invalid SBBR version. + @retval EFI_NOT_FOUND One or more mandatory tables are missing. + @retval EFI_UNSUPPORTED Mandatory ACPI table does not have its + instance count tracked. +**/ +EFI_STATUS +EFIAPI +ArmSbbrReqsValidate ( + ARM_SBBR_VERSION Version + ) +{ + UINT32 Table; + UINT32 Index; + UINT32 MandatoryTable; + CONST UINT8* SignaturePtr; + BOOLEAN IsArmSbbrViolated; + + if (Version >=3D ArmSbbrVersionMax) { + return EFI_INVALID_PARAMETER; + } + + IsArmSbbrViolated =3D FALSE; + + // Go through the list of mandatory tables for the input SBBR version + for (Table =3D 0; Table < ArmSbbrReqs[Version].TableCount; Table++) { + MandatoryTable =3D ArmSbbrReqs[Version].Tables[Table]; + SignaturePtr =3D (CONST UINT8*)(UINTN)&MandatoryTable; + + // Locate the instance count for the table with the given signature + Index =3D 0; + while ((Index < ARRAY_SIZE (ArmSbbrTableCounts)) && + (ArmSbbrTableCounts[Index].Signature !=3D MandatoryTable)) { + Index++; + } + + if (Index >=3D ARRAY_SIZE (ArmSbbrTableCounts)) { + IncrementErrorCount (); + Print ( + L"\nERROR: SBBR v%a: Mandatory %c%c%c%c table's instance count not= " \ + L"found\n", + ArmSbbrVersions[Version], + SignaturePtr[0], + SignaturePtr[1], + SignaturePtr[2], + SignaturePtr[3] + ); + return EFI_UNSUPPORTED; + } + + if (ArmSbbrTableCounts[Index].Count =3D=3D 0) { + IsArmSbbrViolated =3D TRUE; + IncrementErrorCount (); + Print ( + L"\nERROR: SBBR v%a: Mandatory %c%c%c%c table is missing", + ArmSbbrVersions[Version], + SignaturePtr[0], + SignaturePtr[1], + SignaturePtr[2], + SignaturePtr[3] + ); + } + } + + if (!IsArmSbbrViolated) { + Print ( + L"\nINFO: SBBR v%a: All mandatory ACPI tables are installed", + ArmSbbrVersions[Version] + ); + } + + Print (L"\n"); + + return IsArmSbbrViolated ? EFI_NOT_FOUND : EFI_SUCCESS; +} diff --git a/ShellPkg/Library/UefiShellAcpiViewCommandLib/Arm/SbbrValidator= .h b/ShellPkg/Library/UefiShellAcpiViewCommandLib/Arm/SbbrValidator.h new file mode 100644 index 0000000000000000000000000000000000000000..3135f74fcb6c2d41d8abccc6067= c0d6d40f3d089 --- /dev/null +++ b/ShellPkg/Library/UefiShellAcpiViewCommandLib/Arm/SbbrValidator.h @@ -0,0 +1,91 @@ +/** @file + Header file for SbbrValidator.c + + Copyright (c) 2020, ARM Limited. All rights reserved. + SPDX-License-Identifier: BSD-2-Clause-Patent + + @par Glossary: + - Sbbr or SBBR - Server Base Boot Requirements + - Sbsa or SBSA - Server Base System Architecture + + @par Reference(s): + - Arm Server Base Boot Requirements 1.2, September 2019 + - Arm Server Base Boot Requirements 1.1, May 2018 + - Arm Server Base Boot Requirements 1.0, March 2016 + - Arm Server Base System Architecture 6.0 +**/ + +#ifndef SBBR_VALIDATOR_H_ +#define SBBR_VALIDATOR_H_ + +#include + +/** + Arm SBBR specification versions. +**/ +typedef enum { + ArmSbbrVersion_1_0 =3D 0, + ArmSbbrVersion_1_1 =3D 1, + ArmSbbrVersion_1_2 =3D 2, + ArmSbbrVersionMax =3D 3 +} ARM_SBBR_VERSION; + +/** + The ACPI table instance counter. +**/ +typedef struct AcpiTableCounter { + CONST UINT32 Signature; /// ACPI table signature + UINT32 Count; /// Instance count +} ACPI_TABLE_COUNTER; + +/** + ACPI table SBBR requirements. +**/ +typedef struct AcpiSbbrReq { + CONST UINT32* Tables; /// List of required tables + CONST UINT32 TableCount; /// Number of elements in Tables +} ACPI_SBBR_REQ; + +/** + Reset the platform ACPI table instance count for all SBBR-mandatory tabl= es. +**/ +VOID +EFIAPI +ArmSbbrResetTableCounts ( + VOID + ); + +/** + Increment instance count for SBBR-mandatory ACPI table with the given + signature. + + @param [in] Signature ACPI table signature. + + @retval TRUE Count incremented successfully. + @retval FALSE Table with the input signature not found. +**/ +BOOLEAN +EFIAPI +ArmSbbrIncrementTableCount ( + UINT32 Signature + ); + +/** + Validate that all ACPI tables required by the given SBBR specification + version are installed on the platform. + + @param [in] Version SBBR spec version to validate against. + + @retval EFI_SUCCESS All required tables are present. + @retval EFI_INVALID_PARAMETER Invalid SBBR version. + @retval EFI_NOT_FOUND One or more mandatory tables are missing. + @retval EFI_UNSUPPORTED Mandatory ACPI table does not have its + instance count tracked. +**/ +EFI_STATUS +EFIAPI +ArmSbbrReqsValidate ( + ARM_SBBR_VERSION Version + ); + +#endif // SBBR_VALIDATOR_H_ diff --git a/ShellPkg/Library/UefiShellAcpiViewCommandLib/UefiShellAcpiView= CommandLib.inf b/ShellPkg/Library/UefiShellAcpiViewCommandLib/UefiShellAcpi= ViewCommandLib.inf index ea504c934aeebaa452a380e6ea169586e467642a..d21ecd40a8cf8f2d99613fde2dd= b2a66702e6ad3 100644 --- a/ShellPkg/Library/UefiShellAcpiViewCommandLib/UefiShellAcpiViewCommand= Lib.inf +++ b/ShellPkg/Library/UefiShellAcpiViewCommandLib/UefiShellAcpiViewCommand= Lib.inf @@ -1,7 +1,7 @@ ## @file # Provides Shell 'acpiview' command functions # -# Copyright (c) 2016 - 2019, ARM Limited. All rights reserved.
+# Copyright (c) 2016 - 2020, ARM Limited. All rights reserved.
# # SPDX-License-Identifier: BSD-2-Clause-Patent # @@ -47,6 +47,10 @@ [Sources.common] Parsers/Madt/MadtParser.h Parsers/Pptt/PpttParser.h =20 +[Sources.ARM, Sources.AARCH64] + Arm/SbbrValidator.h + Arm/SbbrValidator.c + [Packages] MdePkg/MdePkg.dec ShellPkg/ShellPkg.dec -- 'Guid(CE165669-3EF3-493F-B85D-6190EE5B9759)' -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#56267): https://edk2.groups.io/g/devel/message/56267 Mute This Topic: https://groups.io/mt/72537311/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- From nobody Tue Apr 23 18:12:13 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+56268+1787277+3901457@groups.io; arc=fail (BodyHash is different from the expected one) Received: from web01.groups.io (web01.groups.io [66.175.222.12]) by mx.zohomail.com with SMTPS id 1585129226246829.0661157649914; Wed, 25 Mar 2020 02:40:26 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id eFdrYY1788612xZhy9Q4PD2r; Wed, 25 Mar 2020 02:40:25 -0700 X-Received: from EUR02-AM5-obe.outbound.protection.outlook.com (EUR02-AM5-obe.outbound.protection.outlook.com [40.107.0.54]) by mx.groups.io with SMTP id smtpd.web10.7866.1585129224818344124 for ; Wed, 25 Mar 2020 02:40:25 -0700 X-Received: from AM0PR06CA0092.eurprd06.prod.outlook.com (2603:10a6:208:fa::33) by VI1PR08MB3247.eurprd08.prod.outlook.com (2603:10a6:803:3d::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2835.22; Wed, 25 Mar 2020 09:40:21 +0000 X-Received: from VE1EUR03FT043.eop-EUR03.prod.protection.outlook.com (2603:10a6:208:fa:cafe::15) by AM0PR06CA0092.outlook.office365.com (2603:10a6:208:fa::33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2835.18 via Frontend Transport; Wed, 25 Mar 2020 09:40:21 +0000 Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) client-ip=66.175.222.12; envelope-from=bounce+27952+56268+1787277+3901457@groups.io; helo=web01.groups.io; 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; X-Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by VE1EUR03FT043.mail.protection.outlook.com (10.152.19.122) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2856.17 via Frontend Transport; Wed, 25 Mar 2020 09:40:21 +0000 X-Received: ("Tessian outbound 60d769d68364:v48"); Wed, 25 Mar 2020 09:40:21 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: d4e71ce7bb38bb23 X-CR-MTA-TID: 64aa7808 X-Received: from 096b2561b28f.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id CC3048EA-5612-4B4C-B91F-611534AA2B5F.1; Wed, 25 Mar 2020 09:40:15 +0000 X-Received: from EUR05-VI1-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 096b2561b28f.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Wed, 25 Mar 2020 09:40:15 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Ngyt9Bc1PGjXzjNbGohOWN18H41JjePyb7IUtRJXEuVedq9n+cwnm2+diYyKVvyV+yURVFQ+b2ZkWkF7ltUnrR7h5/aelqqObm6VP7gc72PD/nqF8Pin3vqOGIbEwpbxPLG2Vi7mvvZYeES0Nt1mZ9SLqq1GFVCu19dmu7clWIL80LTHHcqI860qbutSgFDiz67rbcevyc8Hmhh1nfpuwidU071LKw23wEAnLqMpWFwSvKX0muIImXPK5lsrBSCQ+f6lv2K1OccfSDndSHi7Qq0JTK63yW+qoUrl7+UbLftGzdYvmeGn0Kf1B0pt7hmsowarNYHR4XhmJFEJhJ+lVw== 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-SenderADCheck; bh=SyFsxom62A7ErGG7hIEMJqEe+YV/mm2FkPa8P+ezyjA=; b=IA1p2SC4gUD+4ijiDYdNe/He1BRMCa6dewpj2VXevKmEPuadI3b5RwuOdV8WlJssIr9T+dikrE9OhOfeFO0d4vavo8Ux0cYvl2eiP+7OpeV4kYWomz53WN9+RBgESyI+AdfX/jG2iWBmWiN25Kqo8eptAGVnx7zs0dTllVPpvIu1CfOvcT1slVOsaVXqBcbPxjccC6+v7jqR2Sl+IBMqQobYdyafyRu6NqVPe6hAQ5Pq7bAwgrhiOHSHcV//lP9aM+oLh3DVSYQwzPa2mlSO7ly3DG9MlJgec1/qW8OVoplbabQ7K2ESZbQK4Q8TwRGZhh0jAmnVMEdQPGOACqaRNQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 40.67.248.234) smtp.rcpttodomain=edk2.groups.io smtp.mailfrom=arm.com; dmarc=bestguesspass action=none header.from=arm.com; dkim=none (message not signed); arc=none X-Received: from AM4PR05CA0008.eurprd05.prod.outlook.com (2603:10a6:205::21) by HE1PR0801MB1722.eurprd08.prod.outlook.com (2603:10a6:3:87::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2835.20; Wed, 25 Mar 2020 09:40:12 +0000 X-Received: from VE1EUR03FT047.eop-EUR03.prod.protection.outlook.com (2603:10a6:205:0:cafe::a7) by AM4PR05CA0008.outlook.office365.com (2603:10a6:205::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2835.19 via Frontend Transport; Wed, 25 Mar 2020 09:40:12 +0000 Authentication-Results-Original: spf=pass (sender IP is 40.67.248.234) smtp.mailfrom=arm.com; edk2.groups.io; dkim=none (message not signed) header.d=none;edk2.groups.io; dmarc=bestguesspass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 40.67.248.234 as permitted sender) receiver=protection.outlook.com; client-ip=40.67.248.234; helo=nebula.arm.com; X-Received: from nebula.arm.com (40.67.248.234) by VE1EUR03FT047.mail.protection.outlook.com (10.152.19.218) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.2856.17 via Frontend Transport; Wed, 25 Mar 2020 09:40:12 +0000 X-Received: from AZ-NEU-EX03.Arm.com (10.251.24.31) by AZ-NEU-EX04.Arm.com (10.251.24.32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1415.2; Wed, 25 Mar 2020 09:39:27 +0000 X-Received: from E119924.Arm.com (10.57.55.133) by mail.arm.com (10.251.24.31) with Microsoft SMTP Server id 15.1.1415.2 via Frontend Transport; Wed, 25 Mar 2020 09:39:26 +0000 From: "Krzysztof Koch" To: CC: , , , , , Subject: [edk2-devel] [PATCH v1 3/3] ShellPkg: acpiview: Check if SBBR mandatory ACPI tables are installed Date: Wed, 25 Mar 2020 09:39:24 +0000 Message-ID: <20200325093924.22884-4-krzysztof.koch@arm.com> In-Reply-To: <20200325093924.22884-1-krzysztof.koch@arm.com> References: <20200325093924.22884-1-krzysztof.koch@arm.com> MIME-Version: 1.0 X-EOPAttributedMessage: 1 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report-Untrusted: CIP:40.67.248.234;IPV:;CTRY:IE;EFV:NLI;SFV:NSPM;SFS:(10009020)(4636009)(376002)(39860400002)(396003)(346002)(136003)(46966005)(70586007)(70206006)(186003)(336012)(2906002)(82740400003)(2616005)(26005)(316002)(54906003)(426003)(4326008)(356004)(86362001)(44832011)(36756003)(81166006)(478600001)(47076004)(8936002)(6916009)(7696005)(8676002)(5660300002)(1076003)(81156014);DIR:OUT;SFP:1101;SCL:1;SRVR:HE1PR0801MB1722;H:nebula.arm.com;FPR:;SPF:Pass;LANG:en;PTR:InfoDomainNonexistent; X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 4c61b08e-2db3-4387-9745-08d7d0a0894b X-MS-TrafficTypeDiagnostic: HE1PR0801MB1722:|VI1PR08MB3247: X-Microsoft-Antispam-PRVS: x-checkrecipientrouted: true NoDisclaimer: true X-MS-Oob-TLC-OOBClassifiers: OLM:1186;OLM:1186; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: 0BVJIe9VWs25BOv7acUgEaaTkl0vINJTfy6/nDPgzo0vciF2tLACbO2HfOx4mEu/YUZeHI8pmkaZ5XUEtSTu9+sfBE+rQzl39k9eEb8im+wnA3a3fSKwE44zpmjmDgllBRaHOto1aRGAtq4TnV1evfWWzyH59x8cEmmz1I4rEbT3XqboKDrwhxSUepZFS58p4JEvelN7hFCp3ejQsmryv7aNiakPyjQnjKGzFhIZ+DOVpMBXVU+uPL6PzlBAH8H/0pAXKtMTwSbs+a/CD1aHtx1hitHLNCQQO4hgehbBzNR7Byjt5RpApl46rdIB6AInEmTy66hByHGZJChWeGP2x2HzeQtlATjKiFr3OstVecWpGlDJwArWDsqKlYQ5XSnhBbxpSUTXK3s3zq5qvK4AFTEkCkzlyf8GQPiKgVuZdsgvq+UmS65tfm3CUkI94jflWgpvy3jojhK5LpiDQmiJkbf5EyWADAPooevTIw+o5h9r3+KuP0tefvEdZDKe1lLkku5tp6Rt/FsbXV1KDWU4yQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: HE1PR0801MB1722 Original-Authentication-Results: spf=pass (sender IP is 40.67.248.234) smtp.mailfrom=arm.com; edk2.groups.io; dkim=none (message not signed) header.d=none;edk2.groups.io; dmarc=bestguesspass action=none header.from=arm.com; X-MS-Exchange-Transport-CrossTenantHeadersStripped: VE1EUR03FT043.eop-EUR03.prod.protection.outlook.com X-MS-Office365-Filtering-Correlation-Id-Prvs: ce1385fa-3987-4e77-5dca-08d7d0a083f8 X-Microsoft-Antispam-Message-Info: GrLpFmnzrl6PTpxrq7RGgCIixAruGEfFJu97ldw5EQHBc7j2x7DhuNRm2xX7ManCcP60bys7SKoJS2udQvCKp2+yrzdkcymwuZ4eG4uNwNJARkefjYVXtLpk6s5LvhAkMQVuBYsOQ1VOl57Rfy/ugl3QtjhatM1Rx75qUq5/LceGLP9hx6Pzp5/kN31Z+IXPNDHjy6ElpR+66toTbku1ViFbvPZTqe/UQ4SNXUGJa7bYYJwohVnZxg2LGBp7w7FK4b/2nPgslK55zg/3wD/cAzfpMP1iLE+3dZ8YiLUEW1OaNPgPGaR/NHB4On6bwfwNExnl1IS5I6Q1zg4/mfvpL3eV15Njs5H/i+ZRCs2MH9JLTqqZ72wQ88gmfYl0lTwLjIiC/BocNzCqJ+lznP1wFfXW0Z2H+1gljKac4DqEsqZLnKN0P83Ai8Lw67G5hbclilLmEU6+Eo0XQ3dUZn3mUm5XPOK9KDn98SGtutzrMvL7O100qTHfn4Cnpwj7zCUMVUj5XDCDfJsXrC1MX/yeeA== X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Mar 2020 09:40:21.1910 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 4c61b08e-2db3-4387-9745-08d7d0a0894b 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-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR08MB3247 Precedence: Bulk List-Unsubscribe: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,krzysztof.koch@arm.com X-Gm-Message-State: DjYTQTNGCiWM1brR7paVrw7hx1787277AA= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1585129225; bh=wtIMkDAjc4fQHjD+OrDfzqN2kiqWs2wpMYg8ubfs9vg=; h=CC:Content-Type:Date:From:Reply-To:Subject:To; b=WOSuFJIaH8aB+TlzjQd5aH4N+A2hap9hQCzuiwiHafD77DOAUKUTGBc13ayVtN7I8mL YgLJ6bYtDT/14T8OISU02Clo7GlRB8MMMj8x+jcKRKXQGPlexD3SyeV6/JcVsNu3nSnf+ rk2+hxiA16B+bdL9NbLq8HvxDBb6DTVu4Os= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" For Arm-based platforms, count the instances of installed tables for each ACPI table listed as 'mandatory' in any Server Base Boot Requirements (SBBR) specification. Validate that the all the mandatory SBBR tables present. Report an error for each missing table. This new feature is optional and can be enabled with the -r command line parameter. Reference(s): - Arm Server Base Boot Requirements 1.2, September 2019 - Arm Server Base Boot Requirements 1.1, May 2018 - Arm Server Base Boot Requirements 1.0, March 2016 Signed-off-by: Krzysztof Koch Reviewed-by: Sami Mujawar --- Notes: v1: - check if SBBR mandatory ACPI tables are installed [Krzysztof] ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiTableParser.c | 16 ++++++= ++++++++ ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiView.c | 22 ++++++= ++++++++++++++ 2 files changed, 38 insertions(+) diff --git a/ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiTableParser.c= b/ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiTableParser.c index 501967c4dde680809c56e5d79ed744a1013a69e1..d5b9eee5232399c4df50d0f9598= 810413759fed6 100644 --- a/ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiTableParser.c +++ b/ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiTableParser.c @@ -3,6 +3,12 @@ =20 Copyright (c) 2016 - 2020, ARM Limited. All rights reserved. SPDX-License-Identifier: BSD-2-Clause-Patent + + @par Glossary: + - Sbbr or SBBR - Server Base Boot Requirements + + @par Reference(s): + - Arm Server Base Boot Requirements 1.2, September 2019 **/ =20 #include @@ -12,6 +18,10 @@ #include "AcpiTableParser.h" #include "AcpiView.h" =20 +#if defined(MDE_CPU_ARM) || defined (MDE_CPU_AARCH64) +#include "Arm/SbbrValidator.h" +#endif + /** A list of registered ACPI table parsers. **/ @@ -216,6 +226,12 @@ ProcessAcpiTable ( } } =20 +#if defined(MDE_CPU_ARM) || defined (MDE_CPU_AARCH64) + if (GetMandatoryTableValidate ()) { + ArmSbbrIncrementTableCount (*AcpiTableSignature); + } +#endif + Status =3D GetParser (*AcpiTableSignature, &ParserProc); if (EFI_ERROR (Status)) { // No registered parser found, do default handling. diff --git a/ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiView.c b/Shel= lPkg/Library/UefiShellAcpiViewCommandLib/AcpiView.c index 49c2e87c430d7fb57793f6405ebee91cb8f6cbaa..84ffb3595750a3e7d65fdb82c0f= 90bc2d76c659e 100644 --- a/ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiView.c +++ b/ShellPkg/Library/UefiShellAcpiViewCommandLib/AcpiView.c @@ -2,6 +2,12 @@ =20 Copyright (c) 2016 - 2020, ARM Limited. All rights reserved. SPDX-License-Identifier: BSD-2-Clause-Patent + + @par Glossary: + - Sbbr or SBBR - Server Base Boot Requirements + + @par Reference(s): + - Arm Server Base Boot Requirements 1.2, September 2019 **/ =20 #include @@ -16,6 +22,10 @@ #include "AcpiView.h" #include "UefiShellAcpiViewCommandLib.h" =20 +#if defined(MDE_CPU_ARM) || defined (MDE_CPU_AARCH64) +#include "Arm/SbbrValidator.h" +#endif + EFI_HII_HANDLE gShellAcpiViewHiiHandle =3D NULL; =20 // Report variables @@ -438,6 +448,12 @@ AcpiView ( return EFI_UNSUPPORTED; } =20 +#if defined(MDE_CPU_ARM) || defined (MDE_CPU_AARCH64) + if (GetMandatoryTableValidate ()) { + ArmSbbrResetTableCounts (); + } +#endif + // The RSDP length is 4 bytes starting at offset 20 RsdpLength =3D *(UINT32*)(RsdpPtr + RSDP_LENGTH_OFFSET); =20 @@ -466,6 +482,12 @@ AcpiView ( return EFI_NOT_FOUND; } =20 +#if defined(MDE_CPU_ARM) || defined (MDE_CPU_AARCH64) + if (GetMandatoryTableValidate ()) { + ArmSbbrReqsValidate ((ARM_SBBR_VERSION)GetMandatoryTableSpec ()); + } +#endif + ReportOption =3D GetReportOption (); if (ReportTableList !=3D ReportOption) { if (((ReportSelected =3D=3D ReportOption) || -- 'Guid(CE165669-3EF3-493F-B85D-6190EE5B9759)' -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#56268): https://edk2.groups.io/g/devel/message/56268 Mute This Topic: https://groups.io/mt/72537314/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-