From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from EUR04-VI1-obe.outbound.protection.outlook.com (EUR04-VI1-obe.outbound.protection.outlook.com [40.107.8.85]) by mx.groups.io with SMTP id smtpd.web09.13680.1633370481075987608 for ; Mon, 04 Oct 2021 11:01:21 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@armh.onmicrosoft.com header.s=selector2-armh-onmicrosoft-com header.b=aEK2JrKw; spf=pass (domain: arm.com, ip: 40.107.8.85, mailfrom: sami.mujawar@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=p8hR59OSIk6PO8MP98rDmFDXjPoU4+nGTOSydfCBWdY=; b=aEK2JrKwykNQ3IVzV7+AbeqdjmG49pTi1K92EwT/hohuUB2XNtJKFaihb6GoHnUzOnzzz9c7rnI8NghijgMmDmzqYPrdF86QT1fkRNS3byoQ185jrQ7BhcWi3ODVJ6TRbC3ouN26jfXjPGOZ3idNt0RHSOz8mzjdluKWTQZAIxo= Received: from DB6PR0501CA0042.eurprd05.prod.outlook.com (2603:10a6:4:67::28) by AM8PR08MB6323.eurprd08.prod.outlook.com (2603:10a6:20b:354::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4566.15; Mon, 4 Oct 2021 18:01:18 +0000 Received: from DB5EUR03FT049.eop-EUR03.prod.protection.outlook.com (2603:10a6:4:67:cafe::b3) by DB6PR0501CA0042.outlook.office365.com (2603:10a6:4:67::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4566.14 via Frontend Transport; Mon, 4 Oct 2021 18:01:18 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; edk2.groups.io; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;edk2.groups.io; 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; Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by DB5EUR03FT049.mail.protection.outlook.com (10.152.20.191) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4566.14 via Frontend Transport; Mon, 4 Oct 2021 18:01:17 +0000 Received: ("Tessian outbound a77cafe56b47:v103"); Mon, 04 Oct 2021 18:01:17 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: 1b374eb4f2a8522a X-CR-MTA-TID: 64aa7808 Received: from baac9c65692d.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 44EA0679-4A2B-4F8A-8E35-E8B697867988.1; Mon, 04 Oct 2021 18:00:44 +0000 Received: from EUR04-HE1-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id baac9c65692d.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Mon, 04 Oct 2021 18:00:44 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=jkQUQ5CsVSfg1dICSGav3w+HwQL2vQd2KdOaMq22HkLhn6jeQXl1KYGwAluYK52xdCrvSYyfgMNEQzB/x9b7Hjb+eRevNAQ+zA8BA4uX5YO2qaSqZpU3OdyDwfYkK/EFKJd+QjnO+JFTltGhVmDw7MHR0D57oLPWaSSovvgJPMn5hYIKCP3Suw5wxsN1PzJJ0zpmOFRP3gLYW9mhpxN9sjymIme7d9qSiBWw6J4lGwy3DfR0icPNl8mmVWEu79ZKH94B8tACAXbfNjRpekzi3ZGF2k8j5txGPsD6Hbd3Ic6hQLah8lKhtZbrDrXBf7mUmcSchwO4wNsBGAUZ1BBwbw== 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=p8hR59OSIk6PO8MP98rDmFDXjPoU4+nGTOSydfCBWdY=; b=WIwRiSiLlsNCoD2BX6IH4/5OpMg6lruZsYjib9XUFr6dVoSKexLriTpxMtSKzXuPsF8cMIfPpaIjNpxrWz5d///ouk2wdsmXsdz7qIq9Gkl2+34/6qOItFNA6H8KFkUBRwsrnKomwdNBwysty0POzck0w1raXlg0ZBgVB62I7JJYA9ueZq6DZTjpMI4lIUJ60SNjS6qQTD6P5IoHloKdLPJYEx5jWgU3vwFMaiMtfeFMGVlUHoxIq8rmisaqE36gahQ/BC+r55CxPHyJBPDLDDVxl8qnN7uASOu7FCK7Ou832OM9kLTC9HK6ZC9aevhWnxDrnKixxCdM6tl8KB8l9Q== 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=p8hR59OSIk6PO8MP98rDmFDXjPoU4+nGTOSydfCBWdY=; b=aEK2JrKwykNQ3IVzV7+AbeqdjmG49pTi1K92EwT/hohuUB2XNtJKFaihb6GoHnUzOnzzz9c7rnI8NghijgMmDmzqYPrdF86QT1fkRNS3byoQ185jrQ7BhcWi3ODVJ6TRbC3ouN26jfXjPGOZ3idNt0RHSOz8mzjdluKWTQZAIxo= Authentication-Results-Original: arm.com; dkim=none (message not signed) header.d=none;arm.com; dmarc=none action=none header.from=arm.com; Received: from AS8PR08MB6806.eurprd08.prod.outlook.com (2603:10a6:20b:39b::12) by AS8PR08MB6216.eurprd08.prod.outlook.com (2603:10a6:20b:29c::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4566.22; Mon, 4 Oct 2021 18:00:43 +0000 Received: from AS8PR08MB6806.eurprd08.prod.outlook.com ([fe80::54b5:239d:9896:ee65]) by AS8PR08MB6806.eurprd08.prod.outlook.com ([fe80::54b5:239d:9896:ee65%4]) with mapi id 15.20.4566.022; Mon, 4 Oct 2021 18:00:42 +0000 Subject: Re: [PATCH 1/1] ArmPkg: SmbiosMiscDxe: Don't populate ExtendedBiosSize when size < 16MB To: Rebecca Cran , devel@edk2.groups.io, Leif Lindholm , Ard Biesheuvel , Nhi Pham , nd References: <20211004162233.30290-1-rebecca@nuviainc.com> From: "Sami Mujawar" Message-ID: <57a31a01-9bd9-a0b4-6485-5a2bb7c8669f@arm.com> Date: Mon, 4 Oct 2021 19:00:46 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.0.1 In-Reply-To: <20211004162233.30290-1-rebecca@nuviainc.com> X-ClientProxiedBy: LNXP265CA0021.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:5e::33) To AS8PR08MB6806.eurprd08.prod.outlook.com (2603:10a6:20b:39b::12) MIME-Version: 1.0 Received: from [10.1.196.43] (217.140.106.52) by LNXP265CA0021.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:5e::33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4566.14 via Frontend Transport; Mon, 4 Oct 2021 18:00:42 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 3038213e-7b37-413b-5e62-08d98760f6e7 X-MS-TrafficTypeDiagnostic: AS8PR08MB6216:|AM8PR08MB6323: X-Microsoft-Antispam-PRVS: x-checkrecipientrouted: true NoDisclaimer: true X-MS-Oob-TLC-OOBClassifiers: OLM:8273;OLM:9508; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: J7GF3fV8+b46C6G47oUCGvQQ6qR7lMKk5+8ORNDdudDMlV8M+LFK8PYBb9LdrTbopI4u19EHxoaUnPYqaAm2s6Zld6+hAPQ4KCqk4xfwQZFR8RAlPWA5FceEwAw+td8Z4rjgsnbJPizB8mz6gJA2mmLiQcUQmAZE4fDm0t2rI1XE2//1aPNf8/tAphBdtl5Ka1x7MLdPy/yYBpcbwZWSO76aLWu10p6GM5w7YfoCHKv0ngEJl6bWvydLQIIXfq8wZ/SFGSKYk2nxU0hmKfuRt3RaQVeP1NYqLU16Wr26XhgPXrOtmF9FsgRqM7yJTrQ3Wtx+r5cdAWH1CytUOSR0WgBuE5mViIyNh3zaUuvtJU0LnTU0QvTp6+pwC9gHq9WaZDKEtxOlheiYNmJ/3bKZ9TPQWe/82CKn98N8BCQ+XEq5vjH8xWeQeHOWhkJBXMiXGGwhulJ37hPOOKzk88+cklzxwzTWK1oBPUpmV/pOtTUskcwocz/D37ySSqoKQLOnJBN5kFZ6tkUyHoi86yglvyXWTBdyOe2WoS/gPbVh1mOqe/Yao7MaERQtDeZW39JunFDfLIk9ys7Nrq08l5ghGx+32cw3iZco3cVGkKKdIYttW+oo/gF4NUtrKfmpgEbyGOG4QPS4B/iE1YT8AvGfRRg9h0uo2FnBuUGeB/CudBXk8EwY3pmL/Tfp1+Z1OWsopnMCVtyjjqKsKGMCyjewUfjjngYELt2B3Mjax9OzpDovTrFLlOxxzorqNTVzlVUE7HD+AOhyR/057zgYTuuFvQ== 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:(4636009)(366004)(38100700002)(110136005)(66556008)(66946007)(66476007)(316002)(36756003)(38350700002)(52116002)(16576012)(83380400001)(26005)(2906002)(6636002)(5660300002)(8936002)(44832011)(2616005)(186003)(53546011)(508600001)(86362001)(31696002)(956004)(8676002)(6486002)(31686004)(19627235002)(43740500002)(45980500001);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-Forked: True X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR08MB6216 Original-Authentication-Results: arm.com; dkim=none (message not signed) header.d=none;arm.com; dmarc=none action=none header.from=arm.com; Return-Path: Sami.Mujawar@arm.com X-EOPAttributedMessage: 0 X-MS-Exchange-Transport-CrossTenantHeadersStripped: DB5EUR03FT049.eop-EUR03.prod.protection.outlook.com X-MS-Office365-Filtering-Correlation-Id-Prvs: d2a04ff1-b51e-4a49-1f4f-08d98760e1d0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: GUT7GxYfvasfZQd6lDugYUqQZ4AfF1gOLf7J+pS7v0QPnRzVHZKHg5lu/jGAUT2KfYlTvGSSWtZ3+ourpU8azZgBFi94fV/+Abz5T34U66LKs9ea7kYnXxUoMI5HeeV7f0TO7FYBjU5bNeoOd5njxqRDkfF5glSOP21lK7oIkei1aw4hR6fjCEi96YikP0MmuBXutVbFOZqLF/2gqZwiE4QF87gZI79etCh/H4+pM8mZhX7xYl135xTh/G6/9yT/oTzcdbrhEXVa5yBQH8V9CIEjFHv6SIXOE43rnfWeVA32GnGYJ0gPHSKX+puw5TrcF/+9j6s7tcI7FYkY4we5IA2jEvOc90N3EurHAkD+HEyimpV6GD1b5ELbd2FVqZRr5QVgROROIF7piSMH3uqw0UFpcUbTRtrHpQgyaS9hhumN1dT3zMzSCqDd8dCzrcMdWEsx3IPLmSAW0MHAigzHmgmiikn8MkJywxZXlKrb1Gl2tnZvyjV1vY4Hre0IKUGGnwC6VKWHHkqNy75bTjZRoAXqGjWTsO0ePCe/inl4Yc4ObiYA16KCermmo2it6f2zMNz0SYcvpj7Wxo+u+Mi83Z1oDiEgycabywC4h9+TpZvcX0mVnsa1oaN7LRUY8L1w12LeDsqzwi85uXUajezSCDHdRd5Ue43Ql+U7g2YH9YtOf0PGOi+Aen8gTQoh7Mn1CABDDw+PydhrPmJddrGjiNJyBl8XVnz05uwyGSiiR1A= 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:(4636009)(36840700001)(46966006)(19627235002)(110136005)(8676002)(83380400001)(6636002)(86362001)(53546011)(16576012)(31686004)(47076005)(316002)(36860700001)(8936002)(186003)(2906002)(36756003)(956004)(81166007)(6486002)(26005)(82310400003)(508600001)(70206006)(70586007)(5660300002)(31696002)(44832011)(2616005)(356005)(336012)(43740500002);DIR:OUT;SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Oct 2021 18:01:17.8534 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 3038213e-7b37-413b-5e62-08d98760f6e7 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: DB5EUR03FT049.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM8PR08MB6323 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: quoted-printable Content-Language: en-GB 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 |= 7 ++++--- > 1 file changed, 4 insertions(+), 3 deletions(-) > > diff --git a/ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type00/MiscBiosVendorF= unction.c b/ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type00/MiscBiosVendorFunc= tion.c > index 5aea32521bd3..5679ebaac8a5 100644 > --- a/ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type00/MiscBiosVendorFunction= .c > +++ b/ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type00/MiscBiosVendorFunction= .c > @@ -240,11 +240,12 @@ SMBIOS_MISC_TABLE_FUNCTION (MiscBiosVendor) > SmbiosRecord->BiosSegment =3D (UINT16)(FixedPcdGet32 (PcdFdBaseAddres= s) / SIZE_64KB); > if (BiosPhysicalSize < SIZE_16MB) { > SmbiosRecord->BiosSize =3D Base2ToByteWith64KUnit (BiosPhysicalSize= ) - 1; > - SmbiosRecord->ExtendedBiosSize.Size =3D BiosPhysicalSize / SIZE_1MB; > - SmbiosRecord->ExtendedBiosSize.Unit =3D 0; // Size is in MB > } else { > SmbiosRecord->BiosSize =3D 0xFF; > - if (BiosPhysicalSize > 0x3FFF) { > + if (BiosPhysicalSize < SIZE_16GB) { > + SmbiosRecord->ExtendedBiosSize.Size =3D BiosPhysicalSize / SIZE_1M= B; > + SmbiosRecord->ExtendedBiosSize.Unit =3D 0; // Size is in MB > + } else { > SmbiosRecord->ExtendedBiosSize.Size =3D BiosPhysicalSize / SIZE_1= GB; > SmbiosRecord->ExtendedBiosSize.Unit =3D 1; // Size is in GB > } IMPORTANT NOTICE: The contents of this email and any attachments are confid= ential and may also be privileged. If you are not the intended recipient, p= lease notify the sender immediately and do not disclose the contents to any= other person, use it for any purpose, or store or copy the information in = any medium. Thank you.