From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from NAM12-MW2-obe.outbound.protection.outlook.com (NAM12-MW2-obe.outbound.protection.outlook.com [40.107.244.106]) by mx.groups.io with SMTP id smtpd.web08.20457.1633403108701914565 for ; Mon, 04 Oct 2021 20:05:09 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="body hash did not verify" header.i=@os.amperecomputing.com header.s=selector2 header.b=CrPogT0M; spf=pass (domain: os.amperecomputing.com, ip: 40.107.244.106, mailfrom: nhi@os.amperecomputing.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=JmKTPrutZb4eeopaYWQ6p5tdZNn7yseEHBLpivQA2mw6xWnqO+zQk95thKIzhrdQjYKdBhveCVLowrHAP4xYeZuDp+blHC24QQQBgVFU/wHOHjesPTD28i/mciS1zWUiSnYcIryMHRQOA5AgZm87pfY/NZy5B5KK/s0j5/wExFE/qkMWkkg0WBcCzi/VtfMsfJM1DH+4S/+kE/SDqvziNERAjWzoQ+hjpL7bcQn++9Q+a5Ky06tx3a4P5ZrFCFJM58vCb5oCMyb7cXnXus/57fF+yHvASBIrQEoDPYCXOphF/lPhUYEmWWaeqolVqK9FyEmwBYik574kx9tLBtKjyg== 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=PR+FT3EFpY2S5DWaV/Q5ut40GyDB/FQbXz9AIhNx9ck=; b=Hs6fY4XYaRr09DXoveL/mEnifhy/Em7piBBA87vprc60J9L5d+T1DJ7egOV8/YGpuR/mPVrwLGEEIv5J+CzP6K9/vmyfNQUrin6TVZBRtP/1YZR9RvyneUnA/36ULEi2gnj1CRPhiuoCIDjFLKIq9wGU+PMr2YHaZ0sIbhSMGACAkqBP5uFbYav749UmucMHZrlhih38FowwJ1JRlPd1wsZF1oFkvu/Aeem2kwMWA37a2YZSCnHTYqvE//rhUWkiCv3BtF1QlpSWi5KymCwnF2yecCKfmGPYqDJ+5P1Aiq3LLeA2F3GUf7Mpz/CKE6aQNmV+2a9U9AE29+kyYMW3yQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=os.amperecomputing.com; dmarc=pass action=none header.from=os.amperecomputing.com; dkim=pass header.d=os.amperecomputing.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=os.amperecomputing.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=PR+FT3EFpY2S5DWaV/Q5ut40GyDB/FQbXz9AIhNx9ck=; b=CrPogT0MCMCq+FkLluOyybiEEhy2S4oOwF1C0HEuId2LTKnHB8f9mPUx/JZB6ZN6EJ55cgKk1UK1Jdplx1BMiEuTKxDN1oxrYxPXVpvCP0UBAl8kJFkXmO0Dd1+FDNGP1pKZSpHmmwIiic6BYKeIsmc/ebOGxgtPSqBrMa4GZlA= Authentication-Results: arm.com; dkim=none (message not signed) header.d=none;arm.com; dmarc=none action=none header.from=os.amperecomputing.com; Received: from PH0PR01MB7287.prod.exchangelabs.com (2603:10b6:510:10a::21) by PH0PR01MB6587.prod.exchangelabs.com (2603:10b6:510:75::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4566.14; Tue, 5 Oct 2021 03:05:06 +0000 Received: from PH0PR01MB7287.prod.exchangelabs.com ([fe80::c5cb:7b53:cd09:f0ad]) by PH0PR01MB7287.prod.exchangelabs.com ([fe80::c5cb:7b53:cd09:f0ad%7]) with mapi id 15.20.4566.022; Tue, 5 Oct 2021 03:04:59 +0000 Subject: Re: [PATCH 1/1] ArmPkg: SmbiosMiscDxe: Don't populate ExtendedBiosSize when size < 16MB To: Rebecca Cran References: <20211004162233.30290-1-rebecca@nuviainc.com> <57a31a01-9bd9-a0b4-6485-5a2bb7c8669f@arm.com> CC: Sami Mujawar , devel@edk2.groups.io, Leif Lindholm , Ard Biesheuvel , nd From: "Nhi Pham" Message-ID: <256423b6-d873-e647-a596-45bb309add97@os.amperecomputing.com> Date: Tue, 5 Oct 2021 10:04:50 +0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:78.0) Gecko/20100101 Thunderbird/78.14.0 In-Reply-To: <57a31a01-9bd9-a0b4-6485-5a2bb7c8669f@arm.com> X-ClientProxiedBy: HK2PR0401CA0001.apcprd04.prod.outlook.com (2603:1096:202:2::11) To PH0PR01MB7287.prod.exchangelabs.com (2603:10b6:510:10a::21) Return-Path: nhi@os.amperecomputing.com MIME-Version: 1.0 Received: from [IPv6:2405:4802:91b7:33b0:80c7:9273:25d0:f2c3] (2405:4802:91b7:33b0:80c7:9273:25d0:f2c3) by HK2PR0401CA0001.apcprd04.prod.outlook.com (2603:1096:202:2::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4566.19 via Frontend Transport; Tue, 5 Oct 2021 03:04:57 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 051d5cd2-3fb2-444e-6bcb-08d987aceaea X-MS-TrafficTypeDiagnostic: PH0PR01MB6587: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:9508; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Qmjzmenwx0OqoMIMl7JxaOmQBgJ4tRPuGQlXjsr9TK48zKXucazcYtA0xvD1tTKNBXqWd8rRxYDcmO9mHO9LWe1Ut8vd4ld16yhv7N3F/U9Et3qiqQ7m02+IvPUU/lTj8IRJY1lB3lTHIuLQRelRy0lc7JeRroc8J8bRkLue00WOX+YdeIhZPd2iUZA39Y5aKve5pwDYEsfaN46oiuOZFiiXCEbbyzWNucdZS0YdFTRZJFx8mWBrpxd+ZEYjZ1dEtUKrbplGnbu/jn9467SF3VrjPp8IH5NHulGHq3VKEAkXkBbUBBhc4W+zDrsmX6QlnDKHdUf+N8gUP/XI7/lHm8Kq3udYo/W8jdp5p6mHrSbK2T7kQhxHOkLcDiBR/IbHemmduhzXlnpfsPf7wNFVSUgiuZ9wDESoGdAvG/QyXFmEhQP5FwuFTtQAPiUEv8a4b+GpnlXE3kt9j1g6O4B6uhK39wGWoeQ13Y8SpYtOe4UuMfZvZDF1PURj7p1tj67yrnYgf5lA4a/5lHUwY5LpqFTXEmNtaTdhTHCDXwXrVe66bg2Tidyf5+6nkCZ4eRBBanPLg1HjTiEgZRGsEbSZ5iCWlqrV57acah1yFdCpp8kQf5EPg4KNaDcgUur52bcUghwux6lIJ/myZGXQFkNma5fN8JKKNBcqaaMaheXLrpiaiImSM+Y2aOajKYFo09DYQXPoEwOHak+vczwze9yEHSCjbYfVUSWSNBewpb7Wifk= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PH0PR01MB7287.prod.exchangelabs.com;PTR:;CAT:NONE;SFS:(4636009)(366004)(8676002)(31696002)(508600001)(6666004)(66946007)(52116002)(66556008)(66476007)(316002)(4326008)(2906002)(5660300002)(54906003)(2616005)(186003)(38100700002)(86362001)(6486002)(83380400001)(53546011)(19627235002)(6916009)(8936002)(31686004)(43740500002)(45980500001);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?luAWUu7V/uGD99ALf8BGx+V9geZHEBmGd0N/S3dMDbopOSy1hVNzV6mvh4xT?= =?us-ascii?Q?O0uS0XqJMtMxKTISB90ORE5hoLYaXO+LHFSTfwyhuT51CEZGAAzv86HYdcLR?= =?us-ascii?Q?310FIjJHENC6YgP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ascii?Q?pId1D00J8755M0JVp7Tstfqwh85KFe4HHQtyDLEx9Xta6na3dI41BdaNfyni?= =?us-ascii?Q?2+HdphhBo60LhkyAWTulVTnuZ0fD0w7Fo3D+f7uLDpgm79LygP9ktpZKR1g9?= =?us-ascii?Q?3jC4LNcE96KJq8V481zc4wTIJv/s46vMHsFajO7p8R9j6fY150fgYhQE17LW?= =?us-ascii?Q?wJ3HkNsTjdQHoj0XGjRpEkEvE6KzO4HtHqJFZiFW+tRjybP4wPUZbsBNxC8T?= =?us-ascii?Q?YX+raNrnLf/ehNCvpihoq/5zGz5awNGoNsKGgZZz5xfTo/Rty99iSwD7osMD?= =?us-ascii?Q?wbaPw8ng28w9A5C6lPfml6otNo+cvQrHmLd2/+e3gZ13gvKlJbcM4Dwk7eZj?= =?us-ascii?Q?5WP1+s2cZFGKvO/bZkDn6aLoOell?= X-OriginatorOrg: os.amperecomputing.com X-MS-Exchange-CrossTenant-Network-Message-Id: 051d5cd2-3fb2-444e-6bcb-08d987aceaea X-MS-Exchange-CrossTenant-AuthSource: PH0PR01MB7287.prod.exchangelabs.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Oct 2021 03:04:59.6515 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3bc2b170-fd94-476d-b0ce-4229bdc904a7 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: C2kK3pl2v8KF7eBEVk4q7s7jQlNZyHc3X6800fVatv4nmsUG5z+TSuQS3SY4oo45aegg2x34P/EKWvKvjwO5tFBHmMOaYWT0MT1eet/5b90= X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR01MB6587 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: quoted-printable Content-Language: en-US Thanks, Rebecca for the patch. Acked-by: Nhi Pham Best regards, Nhi On 05/10/2021 01:00, Sami Mujawar wrote: > Hi Rebecca, > > Thank you for this patch. These changes look good to me. > > Reviewed-by: Sami Mujawar > > Regards, > > Sami Mujawar > > On 04/10/2021 05:22 PM, Rebecca Cran wrote: >> According to the SMBIOS specification, the ExtendedBiosSize field should >> be zero when the BIOS size is less than 16MB: >> >> "Size (n) where 64K * (n+1) is the size of the >> physical device containing the BIOS, in >> bytes. >> FFh - size is 16MB or greater, see Extended >> BIOS ROM Size for actual size." >> >> Fix the code in MiscBiosVendorFunction.c to only populate the >> ExtendedBiosSize field if the BIOS size is greater than 16MB. >> >> Fix the code to correctly populate the ExtendedBiosSize field with the >> unit bits set to MB if the size is between 16MB and 16GB. >> >> Signed-off-by: Rebecca Cran >> --- >> ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type00/MiscBiosVendorFunction.c=20 >> | 7 ++++--- >> =C2=A0 1 file changed, 4 insertions(+), 3 deletions(-) >> >> diff --git=20 >> a/ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type00/MiscBiosVendorFunction.c= =20 >> b/ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type00/MiscBiosVendorFunction.c >> index 5aea32521bd3..5679ebaac8a5 100644 >> ---=20 >> a/ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type00/MiscBiosVendorFunction.c >> +++=20 >> b/ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type00/MiscBiosVendorFunction.c >> @@ -240,11 +240,12 @@ SMBIOS_MISC_TABLE_FUNCTION (MiscBiosVendor) >> =C2=A0=C2=A0=C2=A0 SmbiosRecord->BiosSegment =3D (UINT16)(FixedPcdGet32= =20 >> (PcdFdBaseAddress) / SIZE_64KB); >> =C2=A0=C2=A0=C2=A0 if (BiosPhysicalSize < SIZE_16MB) { >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 SmbiosRecord->BiosSize =3D Base2ToByteWit= h64KUnit=20 >> (BiosPhysicalSize) - 1; >> -=C2=A0=C2=A0=C2=A0 SmbiosRecord->ExtendedBiosSize.Size =3D BiosPhysical= Size / SIZE_1MB; >> -=C2=A0=C2=A0=C2=A0 SmbiosRecord->ExtendedBiosSize.Unit =3D 0; // Size i= s in MB >> =C2=A0=C2=A0=C2=A0 } else { >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 SmbiosRecord->BiosSize =3D 0xFF; >> -=C2=A0=C2=A0=C2=A0 if (BiosPhysicalSize > 0x3FFF) { >> +=C2=A0=C2=A0=C2=A0 if (BiosPhysicalSize < SIZE_16GB) { >> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 SmbiosRecord->ExtendedBiosSize.Size =3D = BiosPhysicalSize /=20 >> SIZE_1MB; >> +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 SmbiosRecord->ExtendedBiosSize.Unit =3D = 0; // Size is in MB >> +=C2=A0=C2=A0=C2=A0 } else { >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 SmbiosRecord->ExtendedBiosSiz= e.Size =3D BiosPhysicalSize /=20 >> SIZE_1GB; >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 SmbiosRecord->ExtendedBiosSiz= e.Unit =3D 1; // Size is in GB >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 } > > IMPORTANT NOTICE: The contents of this email and any attachments are=20 > confidential and may also be privileged. If you are not the intended=20 > recipient, please notify the sender immediately and do not disclose=20 > the contents to any other person, use it for any purpose, or store or=20 > copy the information in any medium. Thank you.