From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from EUR05-AM6-obe.outbound.protection.outlook.com (EUR05-AM6-obe.outbound.protection.outlook.com [40.107.22.67]) by mx.groups.io with SMTP id smtpd.web08.24962.1659963955773000421 for ; Mon, 08 Aug 2022 06:05:57 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@armh.onmicrosoft.com header.s=selector2-armh-onmicrosoft-com header.b=ckanEaog; spf=pass (domain: arm.com, ip: 40.107.22.67, mailfrom: sami.mujawar@arm.com) ARC-Seal: i=2; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=pass; b=Gy0uc67jdWa5lR9tCvC4c4lFVBlrVbF0GLuUB459b1b1MRA57dzaiILxdDFLRzCJFEgHK05k8zlfl26mrA0zwC5Kbm4PimY4tROpISSgY3Ihmx0LC0DYuwwSbXpUHvoOUL7qNCPGJcvgztA6cQFKfHRslXtH3YJHwGULMjMi0YyRvO8EpMfwSe6aIwi9+76t9RLwrtSoDoamM/e8SeI+kLJicePCdmf5ZagtAiDyt4R8oEgC7kYhFvnG9bOSSmmpn/UtDJyj/F+ch9o/6G29g88EBzGIeaoDvGLxSX2HgWGLYkuowBvxmu0OdmS8tpl14wIjhs4LCxGsUqhCBr5XrA== ARC-Message-Signature: i=2; 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=FeNw/to09/dlPH7d/oxxftB/B7aW3bNWPvQY9x5Omyw=; b=bPZnt6A9lsoOpitiTstX1hIYfLWpR814TWypIEHo6200iVbUjq44Zqimy5YjgBKov7Ylfb+NtK0znSLrQxSZV5mNobozH/9wVAKkgwvYpuZouWxpRH8/OOSrUhugio1PHNQga/mJ1qHuisr6uMWU3jpu6wSUneUUNPAD5e7kN8Up5BhKskWaw9pECQCAT+V+BaU7ntNyWtISI3PeeR54MxTAUJ3T34TJxdjXy9l3y4HkxXaDZfuHdu6QWO8By3oxQCKpSv+jspEPVUEKgBmAc9mkxSWFODMHQa5s7A6uOn68m2IMzAXLCF6jXqIA6X5QE4WzejEKsmNA8Coy4Aekxw== ARC-Authentication-Results: i=2; mx.microsoft.com 1; spf=pass (sender ip is 63.35.35.123) smtp.rcpttodomain=edk2.groups.io smtp.mailfrom=arm.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=arm.com; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com; arc=pass (0 oda=1 ltdi=1 spf=[1,1,smtp.mailfrom=arm.com] dkim=[1,1,header.d=arm.com] dmarc=[1,1,header.from=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=FeNw/to09/dlPH7d/oxxftB/B7aW3bNWPvQY9x5Omyw=; b=ckanEaogUDRw73ToaEruckl8Rj/bcjXybVkf/aUgdJd+5KtfyJ28yISGFGYrbYNdJQS0fUM/wOsPrS9ZJmb+0zLYiTOCQqh7dM1NpTt6DdJfzLCdcjiVfaN1snKSVYCVT+A5EJc2JHh9enfL6iG/8RKTEbTqK/DfqFKrfIBWTXY= Received: from FR3P281CA0008.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:1d::14) by AS8PR08MB6648.eurprd08.prod.outlook.com (2603:10a6:20b:39f::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5504.14; Mon, 8 Aug 2022 13:05:51 +0000 Received: from VE1EUR03FT031.eop-EUR03.prod.protection.outlook.com (2603:10a6:d10:1d:cafe::b7) by FR3P281CA0008.outlook.office365.com (2603:10a6:d10:1d::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5525.9 via Frontend Transport; Mon, 8 Aug 2022 13:05:51 +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; pr=C Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by VE1EUR03FT031.mail.protection.outlook.com (10.152.18.69) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5504.16 via Frontend Transport; Mon, 8 Aug 2022 13:05:51 +0000 Received: ("Tessian outbound cc6a8ab50b6b:v123"); Mon, 08 Aug 2022 13:05:50 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: 26d029f30ef5107e X-CR-MTA-TID: 64aa7808 Received: from ea17da52a544.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id E10CADFA-7083-48DB-8EE6-0484D24D516C.1; Mon, 08 Aug 2022 13:05:43 +0000 Received: from EUR04-DB3-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id ea17da52a544.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Mon, 08 Aug 2022 13:05:43 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=gQh6fpIIldgkcvennlzIjC7l7ClnI4dOA4IlUld9N36nCiLSfqdVwVpceaiTZffegjjbEcVCOmmXg6ZS7F5mKKWT01Mzs4kxbNwQTzSw1XSbD9+pv+zuQugXOiyPWOBJ5KUBd8h5C8OuO5ltzqAotQtPTnV7nIm+4wQvV3+M0voe+vDwGxEQtTpLEIFtzVTcWf0mWxcQVa/R+RfuBSIz+eC8jTzI2UwNJKpjnZxC7AbahNvXGuNKFtYMLq2GHFrAjP2VQyRnsv0rESJq8fax7I3ioLdOder33/dLFgorkQ4aW89Yr0PfvXkYyo0vJku9xqfjQAHMHN3Jwoke2/4ktQ== 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=FeNw/to09/dlPH7d/oxxftB/B7aW3bNWPvQY9x5Omyw=; b=HFidrsTthrBXN375M2grXsl3grkb+2RGqGjBUJ1FGY6KkcDP6XUJW2M08z1asxwEhyM0luJNKjDgF9Mb2dXcSiYHoRcDLsdl6TgKPhlHcCPtsliny5GuYNSvst3DKM4nqVI6JJ+Q9S33Kin30GKM9eayMQy/rTs8jgDvwo42LN0cfQ9pIere1BlvgJ4Lz9zpVDP/vXkB/yC515ORrCHcecvXwESZKMZlYrFp1C7WyW7fDd7of63a9yfOUx266Ch0VdlAbSPSCuCXaFMzjf2Nu8kuOzywn9xk74AykDl+032+p5ZR7Oppfd7RQ8Dy3kQTvZnr+lS5Vbe/xtPG6YtOcQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.com; 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=FeNw/to09/dlPH7d/oxxftB/B7aW3bNWPvQY9x5Omyw=; b=ckanEaogUDRw73ToaEruckl8Rj/bcjXybVkf/aUgdJd+5KtfyJ28yISGFGYrbYNdJQS0fUM/wOsPrS9ZJmb+0zLYiTOCQqh7dM1NpTt6DdJfzLCdcjiVfaN1snKSVYCVT+A5EJc2JHh9enfL6iG/8RKTEbTqK/DfqFKrfIBWTXY= 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 AS8PR08MB8444.eurprd08.prod.outlook.com (2603:10a6:20b:566::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5504.14; Mon, 8 Aug 2022 13:05:41 +0000 Received: from AS8PR08MB6806.eurprd08.prod.outlook.com ([fe80::d562:5a52:f638:7fe9]) by AS8PR08MB6806.eurprd08.prod.outlook.com ([fe80::d562:5a52:f638:7fe9%4]) with mapi id 15.20.5504.020; Mon, 8 Aug 2022 13:05:41 +0000 Message-ID: Date: Mon, 8 Aug 2022 14:05:40 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.11.0 Subject: Re: [PATCH v3 4/6] DynamicTablesPkg: DynamicTableManagerDxe: Added check for installed tables To: Kun Qin , devel@edk2.groups.io Cc: Alexei Fedorov , Joe Lopez , Pierre Gondois , "nd@arm.com" References: <20220731053727.536-1-kuqin12@gmail.com> <20220731053727.536-5-kuqin12@gmail.com> From: "Sami Mujawar" In-Reply-To: <20220731053727.536-5-kuqin12@gmail.com> X-ClientProxiedBy: LO4P123CA0201.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:1a5::8) To AS8PR08MB6806.eurprd08.prod.outlook.com (2603:10a6:20b:39b::12) MIME-Version: 1.0 X-MS-Office365-Filtering-Correlation-Id: ec7b9ecb-1d7e-4c8e-ae9d-08da793eb845 X-MS-TrafficTypeDiagnostic: AS8PR08MB8444:EE_|VE1EUR03FT031:EE_|AS8PR08MB6648:EE_ x-checkrecipientrouted: true NoDisclaimer: true X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: oLiWDFR0u6T19QLU3DutX7Xa4AbvTAipg7gUv9tgwbgJ+N6DniegY5YRwcKYkMpycRunlAInjS3HorjQbMs6HKGuVtt4MG/6Z1orrfwHRwqqB8IQOYXq81OmrjbFUruTAnX1EymuX+IKBx39T5rtcxH7AOtR7n1UIWj7FJkrIihaGcdgRv307G1F2/66nfStgJxcyFg6EGQUwz5kad/0I3h+p59Ys169xbTWRP6gwHCaHyUSxfFKioM8co80BjRx+O+hpHdFMfZdt/0kZm7gQUmp5X/bi3ELkFcLg8/T2uaiXD2+Z2/t7+d29vzzKn7s5SIIxnOI9vd5psl5fI3CCnpf/o+GzbjkOSCy+rSDzJqVLaC34xCUxS6KETF9IJg76uiYeSYoAsr4N+cw5eu+CEU4yO51DQwicGbQOCX4Fx/M/aCijVfF9LtCFE4ao6ny7kYByzP66eqSZalc+kiJw+U/RonDOx1ZaHrBYpb7NFEqwWcCcnlkLpC1uqmvCn5PaPVmCrBhLZLzag8EQiIWRYCfisraYAU/Ywt+gq8tx5dolw3//HlCn0WxSzB1LK8A1P32lBQnch0kO1Z3fiJ1+CJVkhFx8cgaNb7aZZuWoDDoLtcbKaMowRjNXh/tRlMVjw6VWIaLz/a0tABPmGwTP1iMfRUltwM5ftEhM54AFRpycKQ+2ALxf/ma8r2uL45c9m8PzkRFqdknsYZiDWwweCQIA12yKKheXgfBVM5wAKugyYqAv8ypIAd4ICQ/CpGQffY0U2FIldsw6+9QOhYdE7vpMRplynbBOc0hXZG+LG/W8ml6kG1jx17DYW5f3ME30tf+pUmyKdf8ZA0uXU3nwQs2AEGkabOBmTAFLKURKY0= 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:(13230016)(4636009)(346002)(396003)(39860400002)(136003)(366004)(376002)(2906002)(54906003)(8936002)(83380400001)(38100700002)(44832011)(30864003)(5660300002)(31686004)(36756003)(8676002)(186003)(53546011)(6512007)(41300700001)(66556008)(66476007)(66946007)(4326008)(26005)(31696002)(45080400002)(86362001)(2616005)(966005)(316002)(478600001)(6486002)(6506007)(43740500002)(45980500001);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR08MB8444 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: VE1EUR03FT031.eop-EUR03.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: 6185a827-82f9-474c-9e06-08da793eb235 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: sayIfOl9aaX1CRBrO5JTHj8MPDu0tlR/7uXd4AQ5Gaep/iAVKLboMSVskK96jR905J/fIg8F2Kd+8nUNHPUB2jzxNr5kYxgDmp13qIyOFJJXcoF72V6NvJ4+1QxvhKnRbN3/Ra6Cn76tHV8AuXasbUQRbZBPKjGlORYNNM18e79bmYmhz/2GrpGnZ94QpRNGNV07v9cS6u7ztMatgtCDKWUvzchjlQDqSlw2cR0DbBB/VNmFLLYr2Pzi4zG1RoBFstwBtzVSm+R5u18RAzWEJCD37tyBScusfita8oxQAr6KASIfBiaMuMyyoSxjF1+ZxmUgg6dtKKfYatwbaQ/IifJSGI4NsPtPZq+kr+GpbSNi0SnNtm1KGZge7woXuDxW1LuxgV2pfgwRrTNpUSZhifCWTR4+ejW6sDBMr68jeFCzoBjMpMRdtihyZ84bZT1+yjVLR9G0QwnRyZzg3eNYYHETrpnwXrsnLkEzxjXeKi07wwolYqPMW51CG2IvvrH8BON7ZdKq+Fw2E6FU1FTGw9O+bHW3NpRpiwdJLbXKKss1OBZlU3VQJYS6G/FTMYMIFLH9mJNsFAXZiINKf9q/4T7T9ail1ts1FkeZniN9ZDLPJIk4F2A6/C7iCq+cinu96FLBXVswhdz8YSAqlxnRdSp9KeKhKXQMlgULwkGHsAb45IucarZXAcKrzHk5Jk4cQuQYqjNQ6vYMlC9guW2MAfVF+TPM4nkGlhQcCpfpM78RDopyaxwsPItpMzLz73+9DBocB2ITnDnb9C4mxHdqEKT9kXzsjXodvldDHOV8PK0K7VSynP+GaKDc9FmX/xXMPWrGbsU3kYv7jIeZ0r2mITL1Ne7nPxIdSkq1Npu1XzzTVbMvFNdwFyUqlAIblXv5 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:(13230016)(4636009)(396003)(39860400002)(376002)(136003)(346002)(36840700001)(40470700004)(46966006)(45080400002)(8936002)(8676002)(70586007)(70206006)(36756003)(4326008)(966005)(336012)(186003)(478600001)(40460700003)(6486002)(54906003)(316002)(31696002)(5660300002)(44832011)(31686004)(30864003)(86362001)(41300700001)(6512007)(26005)(83380400001)(6506007)(53546011)(81166007)(2906002)(356005)(2616005)(82740400003)(82310400005)(47076005)(36860700001)(40480700001)(43740500002);DIR:OUT;SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Aug 2022 13:05:51.1447 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: ec7b9ecb-1d7e-4c8e-ae9d-08da793eb845 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: VE1EUR03FT031.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR08MB6648 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Hi Kun, Thank you for this patch. Please find my response inline marked [SAMI]. Regards, Sami Mujawar On 31/07/2022 06:37 am, Kun Qin wrote: > REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3997 > > This change added an extra step to allow check for installed ACPI tables. > > For FADT, MADT, GTDT, DSDT, DBG2 and SPCR tables, either pre-installed or > supplied through AcpiTableInfo can be accepted. > > An extra check for FADT ACPI table existence during installation step is > also added. > > Cc: Sami Mujawar > Cc: Alexei Fedorov > > Co-authored-by: Joe Lopez > Signed-off-by: Kun Qin > Reviewed-by: Pierre Gondois > --- > > Notes: > v2: > - Function description updates [Sami] > - Refactorized the table verification [Pierre] > > v3: > - Added descriptions for new structures [Pierre] > - Added check for SDT protocol PCD before using it [Pierre] > > DynamicTablesPkg/Drivers/DynamicTableManagerDxe/DynamicTableManagerDxe.c | 214 ++++++++++++-------- > DynamicTablesPkg/Drivers/DynamicTableManagerDxe/DynamicTableManagerDxe.inf | 4 + > 2 files changed, 138 insertions(+), 80 deletions(-) > > diff --git a/DynamicTablesPkg/Drivers/DynamicTableManagerDxe/DynamicTableManagerDxe.c b/DynamicTablesPkg/Drivers/DynamicTableManagerDxe/DynamicTableManagerDxe.c > index ed62299f9bbd..7f3deef08a66 100644 > --- a/DynamicTablesPkg/Drivers/DynamicTableManagerDxe/DynamicTableManagerDxe.c > +++ b/DynamicTablesPkg/Drivers/DynamicTableManagerDxe/DynamicTableManagerDxe.c > @@ -10,6 +10,7 @@ > #include > > #include > > #include > > +#include > > #include > > > > // Module specific include files. > > @@ -22,6 +23,58 @@ > #include > > #include > > > > +/// > > +/// Bit definitions for acceptable ACPI table presence formats. > > +/// Currently only ACPI tables present in the ACPI info list and > > +/// already installed will count towards "Table Present" during > > +/// verification routine. > > +/// > > +#define ACPI_TABLE_PRESENT_INFO_LIST BIT0 > > +#define ACPI_TABLE_PRESENT_INSTALLED BIT1 > > + > > +/// > > +/// Order of ACPI table being verified during presence inspection. > > +/// > > +#define ACPI_TABLE_VERIFY_FADT 0 > > +#define ACPI_TABLE_VERIFY_MADT 1 > > +#define ACPI_TABLE_VERIFY_GTDT 2 > > +#define ACPI_TABLE_VERIFY_DSDT 3 > > +#define ACPI_TABLE_VERIFY_DBG2 4 > > +#define ACPI_TABLE_VERIFY_SPCR 5 > > +#define ACPI_TABLE_VERIFY_COUNT 6 > > + > > +/// > > +/// Private data structure to verify the presence of mandatory > > +/// or optional ACPI tables. > > +/// > > +typedef struct { > > + /// ESTD ID for the ACPI table of interest. > > + ESTD_ACPI_TABLE_ID EstdTableId; > > + /// Standard UINT32 ACPI signature. > > + UINT32 AcpiTableSignature; > > + /// 4 character ACPI table name (the 5th char8 is for null terminator). > > + CHAR8 AcpiTableName[sizeof (UINT32) + 1]; > > + /// Indicator on whether the ACPI table is required. > > + BOOLEAN IsMandatory; > > + /// Formats of verified presences, as defined by ACPI_TABLE_PRESENT_* > > + /// This field should be initialized to 0 and will be populated during > > + /// verification routine. > > + UINT16 Presence; > > +} ACPI_TABLE_PRESENCE_INFO; > > + > > +/// > > +/// We require the FADT, MADT, GTDT and the DSDT tables to boot. > > +/// This list also include optional ACPI tables: DBG2, SPCR. > > +/// > > +ACPI_TABLE_PRESENCE_INFO mAcpiVerifyTables[ACPI_TABLE_VERIFY_COUNT] = { > > + { EStdAcpiTableIdFadt, EFI_ACPI_6_2_FIXED_ACPI_DESCRIPTION_TABLE_SIGNATURE, "FADT", TRUE, 0 }, > > + { EStdAcpiTableIdMadt, EFI_ACPI_6_2_MULTIPLE_APIC_DESCRIPTION_TABLE_SIGNATURE, "MADT", TRUE, 0 }, > > + { EStdAcpiTableIdGtdt, EFI_ACPI_6_2_GENERIC_TIMER_DESCRIPTION_TABLE_SIGNATURE, "GTDT", TRUE, 0 }, > > + { EStdAcpiTableIdDsdt, EFI_ACPI_6_2_DIFFERENTIATED_SYSTEM_DESCRIPTION_TABLE_SIGNATURE, "DSDT", TRUE, 0 }, > > + { EStdAcpiTableIdDbg2, EFI_ACPI_6_2_DEBUG_PORT_2_TABLE_SIGNATURE, "DBG2", FALSE, 0 }, > > + { EStdAcpiTableIdSpcr, EFI_ACPI_6_2_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE_SIGNATURE, "SPCR", FALSE, 0 }, > > +}; > > + > > /** This macro expands to a function that retrieves the ACPI Table > > List from the Configuration Manager. > > */ > > @@ -395,6 +448,7 @@ BuildAndInstallAcpiTable ( > > > @retval EFI_SUCCESS Success. > > @retval EFI_NOT_FOUND If mandatory table is not found. > > + @retval EFI_ALREADY_STARTED If mandatory table found in AcpiTableInfo is already installed. > > **/ > > STATIC > > EFI_STATUS > > @@ -404,75 +458,71 @@ VerifyMandatoryTablesArePresent ( > IN UINT32 AcpiTableCount > > ) > > { > > - EFI_STATUS Status; > > - BOOLEAN FadtFound; > > - BOOLEAN MadtFound; > > - BOOLEAN GtdtFound; > > - BOOLEAN DsdtFound; > > - BOOLEAN Dbg2Found; > > - BOOLEAN SpcrFound; > > + EFI_STATUS Status; > > + UINTN Handle; > > + UINTN Index; > > + UINTN InstalledTableIndex; > > + EFI_ACPI_DESCRIPTION_HEADER *DescHeader; > > + EFI_ACPI_TABLE_VERSION Version; > > + EFI_ACPI_SDT_PROTOCOL *AcpiSdt; > > > > - Status = EFI_SUCCESS; > > - FadtFound = FALSE; > > - MadtFound = FALSE; > > - GtdtFound = FALSE; > > - DsdtFound = FALSE; > > - Dbg2Found = FALSE; > > - SpcrFound = FALSE; > > ASSERT (AcpiTableInfo != NULL); > > > > + Status = EFI_SUCCESS; > > + > > + // Check against the statically initialized ACPI tables to see if they are in ACPI info list > > while (AcpiTableCount-- != 0) { > > - switch (AcpiTableInfo[AcpiTableCount].AcpiTableSignature) { > > - case EFI_ACPI_6_2_FIXED_ACPI_DESCRIPTION_TABLE_SIGNATURE: > > - FadtFound = TRUE; > > - break; > > - case EFI_ACPI_6_2_MULTIPLE_APIC_DESCRIPTION_TABLE_SIGNATURE: > > - MadtFound = TRUE; > > - break; > > - case EFI_ACPI_6_2_GENERIC_TIMER_DESCRIPTION_TABLE_SIGNATURE: > > - GtdtFound = TRUE; > > - break; > > - case EFI_ACPI_6_2_DIFFERENTIATED_SYSTEM_DESCRIPTION_TABLE_SIGNATURE: > > - DsdtFound = TRUE; > > - break; > > - case EFI_ACPI_6_2_DEBUG_PORT_2_TABLE_SIGNATURE: > > - Dbg2Found = TRUE; > > - break; > > - case EFI_ACPI_6_2_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE_SIGNATURE: > > - SpcrFound = TRUE; > > - break; > > - default: > > + for (Index = 0; Index < ACPI_TABLE_VERIFY_COUNT; Index++) { > > + if (AcpiTableInfo[AcpiTableCount].AcpiTableSignature == mAcpiVerifyTables[Index].AcpiTableSignature) { > > + mAcpiVerifyTables[Index].Presence |= ACPI_TABLE_PRESENT_INFO_LIST; > > + // Found this table, skip the rest. > > break; > > + } > > } > > } > > > > - // We need at least the FADT, MADT, GTDT and the DSDT tables to boot > > - if (!FadtFound) { > > - DEBUG ((DEBUG_ERROR, "ERROR: FADT Table not found\n")); > > - Status = EFI_NOT_FOUND; > > - } > > + // They also might be published already, so we can search from there > > + if (FeaturePcdGet (PcdInstallAcpiSdtProtocol)) { > > + AcpiSdt = NULL; > > + Status = gBS->LocateProtocol (&gEfiAcpiSdtProtocolGuid, NULL, (VOID **)&AcpiSdt); > > > > - if (!MadtFound) { > > - DEBUG ((DEBUG_ERROR, "ERROR: MADT Table not found.\n")); > > - Status = EFI_NOT_FOUND; > > - } > > + if (EFI_ERROR (Status) || (AcpiSdt == NULL)) { > > + DEBUG ((DEBUG_ERROR, "ERROR: Failed to locate ACPI SDT protocol (0x%p) - %r\n", AcpiSdt, Status)); > > + return Status; > > + } > > > > - if (!GtdtFound) { > > - DEBUG ((DEBUG_ERROR, "ERROR: GTDT Table not found.\n")); > > - Status = EFI_NOT_FOUND; > > - } > > + for (Index = 0; Index < ACPI_TABLE_VERIFY_COUNT; Index++) { > > + Handle = 0; > > + InstalledTableIndex = 0; > > + do { > > + Status = AcpiSdt->GetAcpiTable (InstalledTableIndex, (EFI_ACPI_SDT_HEADER **)&DescHeader, &Version, &Handle); > > + if (EFI_ERROR (Status)) { > > + break; > > + } > > > > - if (!DsdtFound) { > > - DEBUG ((DEBUG_ERROR, "ERROR: DSDT Table not found.\n")); > > - Status = EFI_NOT_FOUND; > > - } > > + InstalledTableIndex++; > > + } while (DescHeader->Signature != mAcpiVerifyTables[Index].AcpiTableSignature); > > > > - if (!Dbg2Found) { > > - DEBUG ((DEBUG_WARN, "WARNING: DBG2 Table not found.\n")); > > + if (!EFI_ERROR (Status)) { > > + mAcpiVerifyTables[Index].Presence |= ACPI_TABLE_PRESENT_INSTALLED; > > + } > > + } > > } > > > > - if (!SpcrFound) { > > - DEBUG ((DEBUG_WARN, "WARNING: SPCR Table not found.\n")); > > + for (Index = 0; Index < ACPI_TABLE_VERIFY_COUNT; Index++) { > > + if (mAcpiVerifyTables[Index].Presence == 0) { > > + if (mAcpiVerifyTables[Index].IsMandatory) { > > + DEBUG ((DEBUG_ERROR, "ERROR: %a Table not found.\n", mAcpiVerifyTables[Index].AcpiTableName)); > > + Status = EFI_NOT_FOUND; > > + } else { > > + DEBUG ((DEBUG_WARN, "WARNING: %a Table not found.\n", mAcpiVerifyTables[Index].AcpiTableName)); > > + } > > + } else if (mAcpiVerifyTables[Index].Presence == > > + (ACPI_TABLE_PRESENT_INFO_LIST | ACPI_TABLE_PRESENT_INSTALLED)) > > + { > > + DEBUG ((DEBUG_ERROR, "ERROR: %a Table found while already published.\n", mAcpiVerifyTables[Index].AcpiTableName)); > > + Status = EFI_ALREADY_STARTED; > > + } > > } > > > > return Status; > > @@ -489,8 +539,9 @@ VerifyMandatoryTablesArePresent ( > @param [in] CfgMgrProtocol Pointer to the Configuration Manager > > Protocol Interface. > > > > - @retval EFI_SUCCESS Success. > > - @retval EFI_NOT_FOUND If a mandatory table or a generator is not found. > > + @retval EFI_SUCCESS Success. > > + @retval EFI_NOT_FOUND If a mandatory table or a generator is not found. > > + @retval EFI_ALREADY_STARTED If mandatory table found in AcpiTableInfo is already installed. > > **/ > > STATIC > > EFI_STATUS > > @@ -562,7 +613,7 @@ ProcessAcpiTables ( > if (EFI_ERROR (Status)) { > > DEBUG (( > > DEBUG_ERROR, > > - "ERROR: Failed to find mandatory ACPI Table(s)." > > + "ERROR: Failed to verify mandatory ACPI Table(s) presence." > > " Status = %r\n", > > Status > > )); > > @@ -570,29 +621,32 @@ ProcessAcpiTables ( > } > > > > // Add the FADT Table first. > > - for (Idx = 0; Idx < AcpiTableCount; Idx++) { > > - if (CREATE_STD_ACPI_TABLE_GEN_ID (EStdAcpiTableIdFadt) == > > - AcpiTableInfo[Idx].TableGeneratorId) > > - { > > - Status = BuildAndInstallAcpiTable ( > > - TableFactoryProtocol, > > - CfgMgrProtocol, > > - AcpiTableProtocol, > > - &AcpiTableInfo[Idx] > > - ); > > - if (EFI_ERROR (Status)) { > > - DEBUG (( > > - DEBUG_ERROR, > > - "ERROR: Failed to find build and install ACPI FADT Table." \ > > - " Status = %r\n", > > - Status > > - )); > > - return Status; > > - } > > + if ((mAcpiVerifyTables[ACPI_TABLE_VERIFY_FADT].Presence & ACPI_TABLE_PRESENT_INSTALLED) == 0) { [SAMI] If I understand correctly, the mAcpiVerifyTables[x].Presence filed cannot be ACPI_TABLE_PRESENT_INFO_LIST and ACPI_TABLE_PRESENT_INSTALLED at the same time. Otherwise we would have returned EFI_ALREADY_STARTED from VerifyMandatoryTablesArePresent(). Since FADT is mandatory, the only valid conditions are: 1. ACPI_TABLE_PRESENT_INFO_LIST and !ACPI_TABLE_PRESENT_INSTALLED 2. !ACPI_TABLE_PRESENT_INFO_LIST & ACPI_TABLE_PRESENT_INSTALLED Therefore, I think the above check is not required. What do you think? [/SAMI] > > + // FADT is not yet installed > > + for (Idx = 0; Idx < AcpiTableCount; Idx++) { > > + if (CREATE_STD_ACPI_TABLE_GEN_ID (EStdAcpiTableIdFadt) == > > + AcpiTableInfo[Idx].TableGeneratorId) > > + { > > + Status = BuildAndInstallAcpiTable ( > > + TableFactoryProtocol, > > + CfgMgrProtocol, > > + AcpiTableProtocol, > > + &AcpiTableInfo[Idx] > > + ); > > + if (EFI_ERROR (Status)) { > > + DEBUG (( > > + DEBUG_ERROR, > > + "ERROR: Failed to find build and install ACPI FADT Table." \ > > + " Status = %r\n", > > + Status > > + )); > > + return Status; > > + } > > > > - break; > > - } > > - } // for > > + break; > > + } > > + } // for > > + } > > > > // Add remaining ACPI Tables > > for (Idx = 0; Idx < AcpiTableCount; Idx++) { > > diff --git a/DynamicTablesPkg/Drivers/DynamicTableManagerDxe/DynamicTableManagerDxe.inf b/DynamicTablesPkg/Drivers/DynamicTableManagerDxe/DynamicTableManagerDxe.inf > index 028c3d413cf8..ad8b3d037c16 100644 > --- a/DynamicTablesPkg/Drivers/DynamicTableManagerDxe/DynamicTableManagerDxe.inf > +++ b/DynamicTablesPkg/Drivers/DynamicTableManagerDxe/DynamicTableManagerDxe.inf > @@ -34,8 +34,12 @@ [LibraryClasses] > UefiBootServicesTableLib > > UefiDriverEntryPoint > > > > +[FeaturePcd] > > + gEfiMdeModulePkgTokenSpaceGuid.PcdInstallAcpiSdtProtocol ## CONSUMES > > + > > [Protocols] > > gEfiAcpiTableProtocolGuid # PROTOCOL ALWAYS_CONSUMED > > + gEfiAcpiSdtProtocolGuid # PROTOCOL ALWAYS_CONSUMED > > > > gEdkiiConfigurationManagerProtocolGuid # PROTOCOL ALWAYS_CONSUMED > > gEdkiiDynamicTableFactoryProtocolGuid # PROTOCOL ALWAYS_CONSUMED >