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.42]) by mx.groups.io with SMTP id smtpd.web12.29393.1661247866318516745 for ; Tue, 23 Aug 2022 02:44:26 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@armh.onmicrosoft.com header.s=selector2-armh-onmicrosoft-com header.b=9DBygxXd; spf=pass (domain: arm.com, ip: 40.107.22.42, mailfrom: edward.pickup@arm.com) ARC-Seal: i=2; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=pass; b=beKA4l72kzdSi/KL3xrvoK2O72an1z3kNG5z+E9sfS2H42FFEIkRcv6L+dJM1nlwC5bcmgzXLBu6P3XdGRwkdFSrJnlSjOiL+F4SQRsgoNIahPgdiC+p1CD7dT2u7B/frqpS75FTfwtchY9hrKny8nn98ke2/rG82DwP0boanPOClNdJ7kqKf9PzKX5RBKcyrlIyUuWLB78EGWyg+0HCgCMYA0VJYnV4doJbNEb5s7ZuHKdWIHXdBYAhx3uqrqyYo1rDSUYf89r55prbTaasqBT3j3KvPGDZxTil+7jxc9Kl03eYjGFT7ysRKJ+BWvo3//sJ0nY0qAK55oVFC6/QTw== 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=E6bBxzThHbLFwKnxXWH04qNIl8VRXmLQrlFBg0jEjvU=; b=ChWnwr/5Trr1jltTYXrk2lPwEmZ42fPYaP1i2DhXBYSpkx1r4zY7HV3TtM5tqbBz+VRG+QZhBVcvbwlLMjKEszFyv+CBGsgyklGJRZIJx5WuIne3x5uXPPq7SdFUQQBpgy6GwYy10wSUa8txJFJBXUwMrU/qKYpitUNZu2Wa+34NYU6raaOC8Aye1KZS1WtINHWPgm2zVCHCf9AGctOVSXu92LIejTkTloXJGvwijN7jWpKDo2584bq1yEGANwqqQOOPlvSzCITHMlFVa5EcuM+n7pcyJ/6gjCU0GKvTw3Z8Wv1Wf4JZYEQ54Q9/nFlALw8QmAVGupLTBTjEDgA4hQ== 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=E6bBxzThHbLFwKnxXWH04qNIl8VRXmLQrlFBg0jEjvU=; b=9DBygxXdjNynE+79FU2Vt1io8Dk7IT3v8qs1kVmwpzjUh6QN5Dpv4VDhP9McyUlodNqcC3kV0FePWmabhxiZlbjUczIR1Z0b8DSIvNBhDPno5snQVhkWFdgug19pWsTqzCwqRd8PEFPnp1XzPl9T/kEErbOqev1L24dxtbDvc4Q= Received: from DU2PR04CA0077.eurprd04.prod.outlook.com (2603:10a6:10:232::22) by VI1PR08MB2912.eurprd08.prod.outlook.com (2603:10a6:802:1a::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5546.21; Tue, 23 Aug 2022 09:44:21 +0000 Received: from DBAEUR03FT035.eop-EUR03.prod.protection.outlook.com (2603:10a6:10:232:cafe::2a) by DU2PR04CA0077.outlook.office365.com (2603:10a6:10:232::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5566.14 via Frontend Transport; Tue, 23 Aug 2022 09:44:21 +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 DBAEUR03FT035.mail.protection.outlook.com (100.127.142.136) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5546.15 via Frontend Transport; Tue, 23 Aug 2022 09:44:21 +0000 Received: ("Tessian outbound cc6a8ab50b6b:v123"); Tue, 23 Aug 2022 09:44:21 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: b7a1bf2812109958 X-CR-MTA-TID: 64aa7808 Received: from d2422cc0218e.2 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 41DBD0ED-BD5B-4696-A493-C647E0252814.1; Tue, 23 Aug 2022 09:44:10 +0000 Received: from EUR04-VI1-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id d2422cc0218e.2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Tue, 23 Aug 2022 09:44:10 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=hGbtgiaew27mgsHraWk+BpnPxf9ghzsQrGL/QO5cilmtkREfd75Cu1peWr3ivjWRzNFCi0mx0nBKw0xb7zOG4DpB/nNKtCkjBykg7lFS1mHKrFB5vyrwFabiE7QLFE6g3VKJ1mahrWMg2mquM/LbQ+atc6EKhmFsHSX1Hl8LbVFST1K/sMyzSMABCQR7YD59ZsXX3tQUjoqbHSIa5BW5seF2sC/3bQyvIOVTw/3pupvUuhMH61pbEfAbTrFoM64vGA/eRbFXluxD08YnX614zxAEFC0uKrzamFW7ZQoGuHomayp9d29WhqFp9IZAckxOiUUOVinJYuWc/1CsjZVyfQ== 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=E6bBxzThHbLFwKnxXWH04qNIl8VRXmLQrlFBg0jEjvU=; b=Vy9iBboogTzJU3nmQbO4FfK3xYEjEqp+Ej6tSijQkVhuN7izZqqjXEyBXLubK6zF8Vujl2WAi4V6TIgGDkYJR9OBhL1oobR9LEAIAsb8L7OEynHdk4ilBqK84ehO7dIgZ/PDo8ZLlvsmHR+TUBiO0DA+UORQrBBNnt2I84dDc1s7pga15/b1hV34Q7iQq/sJojXy7v+b5OZ2l02ZZ2xinRCOYhOxrPxf4axsQwDa5OICkD7gOK9NElDWpS3oMvk0YfhukIuFEry6RTGFCZj4NPm9g7PfXXpjzg8fUHt4ERLe5xxDa6aRBqZP893xrKF80s6dDDKffZ1FOhnVe86x0Q== 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=E6bBxzThHbLFwKnxXWH04qNIl8VRXmLQrlFBg0jEjvU=; b=9DBygxXdjNynE+79FU2Vt1io8Dk7IT3v8qs1kVmwpzjUh6QN5Dpv4VDhP9McyUlodNqcC3kV0FePWmabhxiZlbjUczIR1Z0b8DSIvNBhDPno5snQVhkWFdgug19pWsTqzCwqRd8PEFPnp1XzPl9T/kEErbOqev1L24dxtbDvc4Q= Authentication-Results-Original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com; Received: from DB8PR08MB4153.eurprd08.prod.outlook.com (2603:10a6:10:a2::10) by PA4PR08MB5997.eurprd08.prod.outlook.com (2603:10a6:102:f0::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5546.16; Tue, 23 Aug 2022 09:44:08 +0000 Received: from DB8PR08MB4153.eurprd08.prod.outlook.com ([fe80::edcd:c87b:a8fb:931a]) by DB8PR08MB4153.eurprd08.prod.outlook.com ([fe80::edcd:c87b:a8fb:931a%4]) with mapi id 15.20.5546.022; Tue, 23 Aug 2022 09:44:08 +0000 Message-ID: <000ed4cf-8ddd-dc0a-a01e-c8ee4ee833a1@arm.com> Date: Tue, 23 Aug 2022 10:44:06 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.11.0 Subject: Re: [edk2-devel] [PATCH v1-resend 1/1] ShellPkg: Add revision check for DSDT Header on Arm To: devel@edk2.groups.io, zhichao.gao@intel.com Cc: ray.ni@intel.com, sami.mujawar@arm.com, nd@arm.com References: <17037DFB6DE2D1A9.18444@groups.io> From: "Edward Pickup" In-Reply-To: <17037DFB6DE2D1A9.18444@groups.io> X-ClientProxiedBy: LO4P265CA0200.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:318::15) To DB8PR08MB4153.eurprd08.prod.outlook.com (2603:10a6:10:a2::10) MIME-Version: 1.0 X-MS-Office365-Filtering-Correlation-Id: cea824eb-48b7-4f4f-6549-08da84ec0e4e X-MS-TrafficTypeDiagnostic: PA4PR08MB5997:EE_|DBAEUR03FT035:EE_|VI1PR08MB2912: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: d/l/rephSwT9icOWYJkpZFtXoG7kNWUV6WFLzaxaZ7TY5IRg4jnQ1TpIprapxW+5tia1XQC+ZyOk05FF7CcAF4k2lIBiJZjw6eB6m+YrRn2sOuf9TVxxVN6qGgsA7EiDeTUSFOuhOQo4H34ggTTSPzqwwj8Twl729iYs/1BQpbz8VXbMYdVcfUTcpW7ZQAieLO/t9lhkImKLr74lhRMZstaKy/DMV7r/AxBkuNFFPhZrxg8/oMlVJtNLLs/4oKseTJbEzQZtASo4Fcl3/+6aGWN6F0pJ5p6wJac0TDdg3Z3B6VfhsOkeuN5PNiClVRjv2/vxnCUh3QiSU0bmDGetBdGqEZfrZzb92z3dRc79UEsinlJ5xAw00exYAAGVymO5E4gH1UeQH9ONtH9oY0Qq7NTRp76zGI6fZn0LtOQWWc3BlHV7uiIbeWi1jl67yNnsZ53hG9CqdBT4DnkATBaQLyQtcMUC0Xr8UN71s7VEXIXI1bk9QnTKC/pahebeviQmT8aPmJvajHOQqoKFV4K6BiVHjrNhgom/pgP5YsjHeNhupfq2ZiluUtuohOhGVK7wU/GYntkmqn31zZzWcWD1rBzR+ZBrYjiVtZr8EQ0p/oLQE/NzhjFyai+jaJ5kSGeAaf7pKDRa8GTr5CL6Se4uXoe/ynmpm8FyJjn7jOxiHLtEA7aoJyruzuLhI16BtwWm97FfC/QVj9yauw5RhENhOoxJ8N3WnUNFCkz+1wEOg/nEAVDjlNdPSbzkajdW6L6hqbZIOfx1TRsKHHpuzcdVEb/HCA/uqnJzeVGqpSreXLkkh98uDfHut0O2O2wgE1QYr7oLaZZC4SxMFAfASzt4ZPUxzwAWDCMVSlBJVqhkDTU= X-Forefront-Antispam-Report-Untrusted: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DB8PR08MB4153.eurprd08.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230016)(4636009)(346002)(376002)(136003)(396003)(39860400002)(366004)(36756003)(2906002)(44832011)(66556008)(8676002)(66476007)(8936002)(31686004)(4326008)(66946007)(316002)(53546011)(6506007)(41300700001)(478600001)(6486002)(966005)(26005)(6512007)(86362001)(31696002)(38100700002)(5660300002)(2616005)(83380400001)(186003)(43740500002)(45980500001);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: PA4PR08MB5997 Original-Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com; Return-Path: Edward.Pickup@arm.com X-EOPAttributedMessage: 0 X-MS-Exchange-Transport-CrossTenantHeadersStripped: DBAEUR03FT035.eop-EUR03.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: e151ce1d-89fd-46bb-e22c-08da84ec0638 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: STG6ZjEFfMNdVsCbHdBP/ft/YpN7x2YGPZ30jFDgrMqa1bwDVOUIalxxtzmE9NYo4BAwxKgDTNuV4UHwCRivvZbkQFjkvEQAv1tDfqOdndGFX/Z9upUHDHl9ZVZAolI3ILv0oxb1vxuFugBLqlk+j/wyO3kzmbuTCItRVQzoALFqvhFyvrY2K7munQLuIUV7qgWmzuDMRVEK03m68ZaOOASBaQN2h8eZHHGiUCRndOnhTDWgbHGJ7dnwneZ8CQuMBq/+xENQG+hc+fI+0kVip+NvvOQZY274wg3qqkeCwyjvF60EI+e7MXkVvN5lR4o+D6WWw3PswFaGXdlxRbg9VZIvqwFAPYiMjCfmSHNzLD2VkEumGL8tCAhqgdRvlyhwvTqXK7ThHIcllu2IxQA36J1jfVz5/BKtdG4qP+ngPTMGROiVEJKKy3wQ6pNLmHqVaG/M29Rmoi42900Jc42WH3W0CoM95oG682W+YrXKvzdbNGjAH+XfJKQlSk2iU9N6VysXb5xhyQvLw+ooa4vIB5+SINgMGQxKnYM9i6LDTaF6Rj+3PNpw7/0zEe/qOUPeh7Vo/CtYKsFYumsb/0XHW2Rd3KNKeEF8Z1N6A8K0V6BctGGMdx179x6i0k8Vd1usiShNgPTBTw+mAPams1K5TonL53EiJtaHzAUDRw1h2x73ABF/nZY5KgQEZ6q9AJJPjgRHuM9kJ+nzIcqbEJW4LttKHFrykJuun4e18DWy7O1gKK3lU2J7Pgi0S/3dD3xM5Sy1BV2DVO2RBnUCxgrMSgjNZBaxzLC9e0mtLmYdLUewQwH+xhvOQ1mJakqd06KujKAn1FbtRQROBXEf7VlhWItdvot/IIJ1LAlVLCPArsiyI5p1vAjbHlKTdSkSic0B8Ywy1j82K6yJ5gw2bPhNUgDCVr67GZ1YuAjbB980JgQ= 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)(346002)(396003)(39860400002)(376002)(136003)(36840700001)(46966006)(40470700004)(5660300002)(41300700001)(8936002)(966005)(478600001)(6486002)(2906002)(31696002)(53546011)(6506007)(6512007)(26005)(40460700003)(44832011)(86362001)(82740400003)(356005)(81166007)(40480700001)(82310400005)(36756003)(186003)(36860700001)(336012)(47076005)(2616005)(83380400001)(70586007)(70206006)(31686004)(316002)(4326008)(8676002)(43740500002);DIR:OUT;SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Aug 2022 09:44:21.3513 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: cea824eb-48b7-4f4f-6549-08da84ec0e4e 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: DBAEUR03FT035.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR08MB2912 Content-Language: en-US Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Hi Zhichao, Would it be possible to get some feedback on this patch? Regards, Edward On 20/07/2022 09:59, Edward Pickup via groups.io wrote: > Bugzilla: 3995 (https://bugzilla.tianocore.org/show_bug.cgi?id=3995) > > 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_DSDT_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 | 18 +++++++++++++++++- > 1 file changed, 17 insertions(+), 1 deletion(-) > > diff --git a/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Dsdt/DsdtParser.c b/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Dsdt/DsdtParser.c > index e75e4622239ed03b171adc92d32b5eeb75a8edef..7f30a8409bb711d4edf77ed04319c628ef8aea73 100644 > --- a/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Dsdt/DsdtParser.c > +++ b/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Dsdt/DsdtParser.c > @@ -1,7 +1,7 @@ > /** @file > > DSDT table parser > > > > - Copyright (c) 2016 - 2018, ARM Limited. All rights reserved. > > + Copyright (c) 2016 - 2022, ARM Limited. All rights reserved. > > SPDX-License-Identifier: BSD-2-Clause-Patent > > > > @par Reference(s): > > @@ -39,4 +39,20 @@ ParseAcpiDsdt ( > } > > > > DumpAcpiHeader (Ptr); > > + > > + // As per 19.6.29 in the version 6.4 of the ACPI spec, a revision less than 2 > > + // restricts integers to 32 bit width. This may not be intended, raise a > > + // warning > > + #if defined (MDE_CPU_AARCH64) || defined (MDE_CPU_ARM) > > + if (AcpiTableRevision < 2) { > > + IncrementWarningCount (); > > + Print ( > > + L"WARNING: DSDT Table Revision less than 2. Integer width restricted to " > > + L"32 bits. Table Revision = %d.\n", > > + AcpiTableRevision > > + ); > > + return; > > + } > > + > > + #endif > > } >