From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from EUR05-DB8-obe.outbound.protection.outlook.com (EUR05-DB8-obe.outbound.protection.outlook.com [40.107.20.67]) by mx.groups.io with SMTP id smtpd.web12.51648.1658307605551331878 for ; Wed, 20 Jul 2022 02:00:06 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@armh.onmicrosoft.com header.s=selector2-armh-onmicrosoft-com header.b=LXVMMWuU; spf=pass (domain: arm.com, ip: 40.107.20.67, mailfrom: edward.pickup@arm.com) ARC-Seal: i=2; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=pass; b=DCDfpa3mOMhT9x11j9ZoTdV1qb9+wkgwaf43lvoiBHSXGLHajJ+drRFPsDSY/WC5UBCBN0eb8HxWiq/T8LUfXhuFyhNxo6WH5fHon0EQ8EBkJAr5RFMHiDl/m5iaxXhIYPQYMn8C9W727rBsdnOJr+9cYs2RusT/my8ZCSxHl6/Ij4fo9dFFy/WhR7DP3u45xjnqA49wIBm+8C41bpdxTc7akgncTMl2Mb1sCYc0ZliainHjVSS20cP816o/uS2ilZn0vbrd6AAK3ha1uqHQUB8zKn0U9dNxVbbkqrORLvZcsmT7hXbqLA3znWFyr603SmizDHvWZpnYBpVRo2BP5w== 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=o/yt3/UUwAd9mAKt814Lf+q4WeR7tqUHbFLrrYJ9BSM=; b=H56euxr1fweoPhOpd0N++0JcvZEhUePs5XfWyssXPUhXz2TaXRs/sHClsDJd5XzNXvlqBiOTe2dy9dXF1VAVsbnYhFPx9Y+mvKFHUAWW5/1d066K/gx9TGfxkv2VurdbaXWSJBwg2/8AsMx7zsiDS8+K7d1tpzk8IWP6XaRE+Rg0CE7/RTyjUgVfHF0p8dH9dK6JMe9m1Dt0aStch2EiBqTMnDN0m3U1ZvB1OXsf0xzxTBQJsd3b1t+o3eRwkGYWWUqJDUt7Sv6rKpf1pTT0+9NgmovPAKNHUpeXtEpzXWsYfz0NWpi6DpWRPTbztcJ5jGy7ufjl3E5y82EPM9qx5A== 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] 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=o/yt3/UUwAd9mAKt814Lf+q4WeR7tqUHbFLrrYJ9BSM=; b=LXVMMWuU8OXeHnlt9+tdnyrR2QA+4Jofrwwb+aWOpyODkZBwvKf4/LJyszaCMuQq2V9PNBdSjURaPDA+soOryEy/n9B++T460B0XsqXqnx4qAZjcTg7CHsgk7SjWREyFmSuIpyaE6gmQLV+Xujlbj7zjMrADTuvm9bPV7vMmeZw= Received: from DB6PR0201CA0033.eurprd02.prod.outlook.com (2603:10a6:4:3f::43) by DBAPR08MB5687.eurprd08.prod.outlook.com (2603:10a6:10:1b1::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5438.17; Wed, 20 Jul 2022 08:59:59 +0000 Received: from DBAEUR03FT008.eop-EUR03.prod.protection.outlook.com (2603:10a6:4:3f:cafe::73) by DB6PR0201CA0033.outlook.office365.com (2603:10a6:4:3f::43) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5438.24 via Frontend Transport; Wed, 20 Jul 2022 08:59:59 +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 DBAEUR03FT008.mail.protection.outlook.com (100.127.142.107) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5458.17 via Frontend Transport; Wed, 20 Jul 2022 08:59:58 +0000 Received: ("Tessian outbound 63c09d5d38ac:v123"); Wed, 20 Jul 2022 08:59:58 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: ad18ee083bb6e67d X-CR-MTA-TID: 64aa7808 Received: from 267495a97b06.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id BCC3950E-A1E2-4BBA-BABA-C43688FDF959.1; Wed, 20 Jul 2022 08:59:52 +0000 Received: from EUR03-DBA-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 267495a97b06.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Wed, 20 Jul 2022 08:59:52 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ha0EE14TVn6KL6XEWaEThs9o2aKxaqTHSnt6P7/F3BkMsvVSFjGR60k4TCmlnmrv7dkQldpBMgSABr1RZpSB19VHWBRQBz08AcTWfkfCZjl1F6ccfG+GwP4j3o8fXY7oA4Y2djr93lOvVOpenawiReH5OpudeBk5Ua+mhsbTQ6E/QfWoh3OkAHi+06bOhnWG0cqAf52tBiEQ8BhEC3sro/kADN44LUTbnWL4Ivkx5t6xNpgXv7HSWrVsoRDz5vkXyAiPzw1ROZJ4Zs3xhlJ6xiR6JUKXoXDgUa0YXpMnoWJsbNF2ucf2ijR7lhkfc+Tn1gEochq8EptFiT4LKn/4gQ== 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=o/yt3/UUwAd9mAKt814Lf+q4WeR7tqUHbFLrrYJ9BSM=; b=KTtyrrXlv9rzJpr7fA5jqEaVV4+uamTwMm6X35UfOK02Ds/wMpLpwieFvV+9Ax4ppGTOd4b/iXKCMps1WgU8l8KOb2PHxGNsJSiu54Y2soB+jfuPPl2pbZWijiasNf3cM3dvn0bmg/8Dcd0O/Ek0VeOKJo88i/6itsxSugCnwp8XYvIC1AkaSHSXRzaj8ietz3owKrPKzCt1wjUUFdnUoi/ym7QoiTWw9G01js3OiVFvHibe+zLn/JT7K18r5fupa62jYdbS3nniySNlcC8yJpon/pHS8T7xObZmW30taAN83VlmlOgn+0V3UU8OanKn3yK7h6soEgbxLkdlYCIHtA== 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=pass (p=none sp=none pct=100) action=none header.from=arm.com; dkim=none (message not signed); 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=o/yt3/UUwAd9mAKt814Lf+q4WeR7tqUHbFLrrYJ9BSM=; b=LXVMMWuU8OXeHnlt9+tdnyrR2QA+4Jofrwwb+aWOpyODkZBwvKf4/LJyszaCMuQq2V9PNBdSjURaPDA+soOryEy/n9B++T460B0XsqXqnx4qAZjcTg7CHsgk7SjWREyFmSuIpyaE6gmQLV+Xujlbj7zjMrADTuvm9bPV7vMmeZw= Received: from DB7PR02CA0018.eurprd02.prod.outlook.com (2603:10a6:10:52::31) by DBAPR08MB5733.eurprd08.prod.outlook.com (2603:10a6:10:1b3::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5438.15; Wed, 20 Jul 2022 08:59:50 +0000 Received: from DBAEUR03FT025.eop-EUR03.prod.protection.outlook.com (2603:10a6:10:52:cafe::bd) by DB7PR02CA0018.outlook.office365.com (2603:10a6:10:52::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5458.18 via Frontend Transport; Wed, 20 Jul 2022 08:59:50 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 40.67.248.234) smtp.mailfrom=arm.com; dkim=none (message not signed) header.d=none;dmarc=pass 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; pr=C Received: from nebula.arm.com (40.67.248.234) by DBAEUR03FT025.mail.protection.outlook.com (100.127.142.226) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5438.12 via Frontend Transport; Wed, 20 Jul 2022 08:59:50 +0000 Received: from AZ-NEU-EX01.Emea.Arm.com (10.251.26.4) by AZ-NEU-EX03.Arm.com (10.251.24.31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.1.2507.9; Wed, 20 Jul 2022 08:59:50 +0000 Received: from AZ-NEU-EX04.Arm.com (10.251.24.32) by AZ-NEU-EX01.Emea.Arm.com (10.251.26.4) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.9; Wed, 20 Jul 2022 08:59:49 +0000 Received: from e125545.cambridge.arm.com (10.1.38.142) by mail.arm.com (10.251.24.32) with Microsoft SMTP Server id 15.1.2507.9 via Frontend Transport; Wed, 20 Jul 2022 08:59:49 +0000 From: "Edward Pickup" To: CC: , , , Subject: [PATCH v1-resend 1/1] ShellPkg: Add revision check for DSDT Header on Arm Date: Wed, 20 Jul 2022 09:59:49 +0100 Message-ID: <20220720085949.11532-1-edward.pickup@arm.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-EOPAttributedMessage: 1 X-MS-Office365-Filtering-Correlation-Id: c1bbfcd9-d530-4615-6976-08da6a2e3959 X-MS-TrafficTypeDiagnostic: DBAPR08MB5733:EE_|DBAEUR03FT008:EE_|DBAPR08MB5687: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: w3kaL+K0VGnC3tIPeA1J0y1NIXOnf2g6trpsg13fH8Oi8y3QPnaVrr0+xkIr4EAgd+lMegWHcafsjNIPVflFWPCwedcncNHsdkQlBidb2tNIvBI5UazUMob90gEYgAkwVL2D8TNxJe0UZqc1Pq3LE9eUUvuteQTgncSW0+G2abnbh7LkLhKHRST/6BbfCoJIgP/2+iCWicZUItp269ZFMNR2s3HcFSlGkj2ZFhJtya/TdZW33DMATngRkOpobswiKavf1XWmXf8Q4IGFyI3pKnBfEMAQZt7PTCK1DjaXhUMd04diwfXSoJwvT0BZOrtp3vZj4XaRcEDeg0NUehYSudzmK6kzbwQQ8ZkkcFi5YRqERc2AhGvELvjAfFyIGyP8wMFdgveqFMFEYpV4W6+3mgg3iG11yy+n9P3DflpMgPRWK/QkImVOkk+t3TpDt4DeM+CRJ9yjMNZtoUhcnUhWSaYBCQXhaF5pAWWOBUeUmNtQBKYnIGFTIgo7umUHaLVDvBB/2gymFYtVl/KFKmCoL1PSBvEs18jAgVHpwtf1CTM6BIfKnJ4Hz2Dvd1O2yLtXnIY8bUAna8eHUpfOg37j6wxx/C7vijl7x/lcKmtwlw9T6r2Gca1jC5OyQfhlHztGVdDWE3sWWJQ7Ag4Tnu08byZ8vDWICa3+qUVy5K07BFZSYPzRJXMVsC7A0Y00j0rqMf07x6GWK2BdLiVxIB8C9umPdpFFB6K5uRIULAx3RLpmkGUiJcHZUEMK/OAITnvc8erDbLek2+HvthSA475LVgdyIcUQaMqTsGnhkfOZYU/RtyG28BkR1D9gPf4kqvWmQD6lkn5OWr9H2JSXbEUPNYXCrM6J7KUqDPtPLJfka/VXDh7aax/V9x6elsMd2VGIKMzFlssa7zk4P4L3iIw6dw== X-Forefront-Antispam-Report-Untrusted: CIP:40.67.248.234;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:nebula.arm.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230016)(4636009)(346002)(396003)(136003)(39860400002)(376002)(46966006)(40470700004)(36840700001)(7696005)(40480700001)(966005)(47076005)(41300700001)(5660300002)(26005)(1076003)(82310400005)(83380400001)(186003)(336012)(478600001)(44832011)(2616005)(40460700003)(426003)(70586007)(6916009)(8936002)(4326008)(8676002)(70206006)(316002)(54906003)(2906002)(82740400003)(81166007)(86362001)(36860700001)(36756003)(356005)(36900700001);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: DBAPR08MB5733 Return-Path: Edward.Pickup@arm.com X-MS-Exchange-Transport-CrossTenantHeadersStripped: DBAEUR03FT008.eop-EUR03.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: 29c186a9-825d-4ce7-f8fe-08da6a2e3444 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: R1uyitX30qKc+wUX1OBZntrJrPK2t07GpIjQcpQemna2euNezo3W1R+cdYPON9tdKoi6u450u0K7Wodv0uizpEza8Dn6MJQCxlyc1arWw622HNdPKfXPBJJubL5zg+dkpIKqHzINUj+A2kKaKoYaJOHkBKYOAjcqNtBFXTXWZ0bS7CUhB0hbpFP9pn1LeVHhBBVBBpGn5ASb7drZZ/XIT6O7iSJNmi62O+DCbeSenBZqA1jNBgsjPLrKKmi4dbYYXFp2X6N1I89jP6XMgiJ1MrojNqxpQV8qEg5nXFDSdePzboTOjpOtbLNKg0KnF89XDhgFU+WlSrUVm/b+6xtIdInJyQ1qUICHhcCndi/U2HC1XGfem9TUT0CuvUMc2NIqaURWbmOkJQu4hS2+QWsViUE70oKRwv2J1s+vzKX3uVxQyO4YAd4sErTc38a8M9EMivZj4EDeu9KTkyyRXH6NhNmwbTDgAbS6yfvOUu6fblRcq6lbaPouWkznQm+FI3p/hN1OphXbMcj2MhRqAlx5BFeF0Z4ouNlLn++9/YTm5Somf9ZY94W+JxeE/NT0UZipQXDT1uyv0nTNHsnj28kOaxl2xAAq9I/8d96+wGJPY4UU15i81e4nOkRfCr4YzMf00gqtXugbfGINNVYmvQb40vkVFMeF/CKVn5J/ftqm5Mt0vHkMFPhsyG/PFGTFX0gmnIRPRr6yZ5o551Ye1TiqVkOgiTmK8qARCCwwpvzOoEwB8YvEKzokKnA0kzcCrbkaSpggTIFal6V+UldJCT3YJRLEF2JKNwoICGFiXf9CTpQUANPX8xEFqyGfePJMGQey6BOU5ysJu7T1E4Qyq/m2r8beRsqMusNxxUrBBPocXKKkjUZtSdzZarehDixyYTVK 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)(376002)(39860400002)(346002)(136003)(40470700004)(46966006)(36840700001)(40480700001)(81166007)(47076005)(8676002)(4326008)(86362001)(70206006)(186003)(2616005)(1076003)(5660300002)(44832011)(70586007)(82740400003)(8936002)(336012)(426003)(478600001)(41300700001)(83380400001)(54906003)(6916009)(966005)(316002)(7696005)(36860700001)(40460700003)(36756003)(2906002)(26005)(82310400005);DIR:OUT;SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Jul 2022 08:59:58.9547 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: c1bbfcd9-d530-4615-6976-08da6a2e3959 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: DBAEUR03FT008.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DBAPR08MB5687 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain Bugzilla: 3995 (https://bugzilla.tianocore.org/show_bug.cgi?id=3D3995) ACPI 6.4 spec states that if the revision field in the DSDT header is less than 2, then all integers are restricted in width to 32 bits, including in SSDTs. Arm Base boot requirements state that platforms must conform to ACPI 6.3 or later, and that legacy tables are not supported. Adds a check for this field and raise warning if revision is less than 2 on arm. Signed-off-by: Edward Pickup --- The changes can be seen at https://github.com/edpickup/edk2/tree/2073_add_D= SDT_revision_check_v1_resend Notes: v1: - Resending with rebase and bugzilla id - No code changes since previous submit. Ref: https://edk2.groups.io/g/devel/message/89378 ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Dsdt/DsdtParser.c | 1= 8 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Dsdt/Dsdt= Parser.c b/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Dsdt/DsdtPa= rser.c index e75e4622239ed03b171adc92d32b5eeb75a8edef..7f30a8409bb711d4edf77ed0431= 9c628ef8aea73 100644 --- a/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Dsdt/DsdtParser.c +++ b/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Dsdt/DsdtParser.c @@ -1,7 +1,7 @@ /** @file=0D DSDT table parser=0D =0D - Copyright (c) 2016 - 2018, ARM Limited. All rights reserved.=0D + Copyright (c) 2016 - 2022, ARM Limited. All rights reserved.=0D SPDX-License-Identifier: BSD-2-Clause-Patent=0D =0D @par Reference(s):=0D @@ -39,4 +39,20 @@ ParseAcpiDsdt ( }=0D =0D DumpAcpiHeader (Ptr);=0D +=0D + // As per 19.6.29 in the version 6.4 of the ACPI spec, a revision less t= han 2=0D + // restricts integers to 32 bit width. This may not be intended, raise a= =0D + // warning=0D + #if defined (MDE_CPU_AARCH64) || defined (MDE_CPU_ARM)=0D + if (AcpiTableRevision < 2) {=0D + IncrementWarningCount ();=0D + Print (=0D + L"WARNING: DSDT Table Revision less than 2. Integer width restricted= to "=0D + L"32 bits. Table Revision =3D %d.\n",=0D + AcpiTableRevision=0D + );=0D + return;=0D + }=0D +=0D + #endif=0D }=0D --=20 Guid("CE165669-3EF3-493F-B85D-6190EE5B9759")