From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by mx.groups.io with SMTP id smtpd.web12.23217.1633426295404230652 for ; Tue, 05 Oct 2021 02:31:35 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=ZjckRRaR; spf=pass (domain: kernel.org, ip: 198.145.29.99, mailfrom: ardb@kernel.org) Received: by mail.kernel.org (Postfix) with ESMTPSA id 710B0610C9 for ; Tue, 5 Oct 2021 09:31:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1633426292; bh=7QGG+cI/KxgNsscj+R6BrGKhJdtxgR2GKPd2xxxECzw=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=ZjckRRaRo7gmnHoSZDAr5h2GeMBgux3fvuWC5p3e8n70LqUBmFhUVLGNhDQzo7CZA CA5EkBqdTB/tOghjKvyecrCoEGJCKBGkKUr8xMlkT736NCmDrR+Kb8JOrJQDmQIiHV eQVK3VNvOqX7uzGwwCAYMY7CoW/x3XluM3A57WPiQDdGEw+Ni6z9dM7M3yrDQe/ZoG H3FOCnnx7P1AV3Sf6Ei80T/6pSbLWO89vWXeGCCFsURnOn/GDJ0EFzf7x5XZ/rzTRH nqf3lmUZcLHRtI/ZeMSDGiRh5t9R1qTpZOoSTbtFs22J7pEyMPuHkV1fTj+vUpO8Bc iESPA2VMyHPog== Received: by mail-ot1-f53.google.com with SMTP id 5-20020a9d0685000000b0054706d7b8e5so25117285otx.3 for ; Tue, 05 Oct 2021 02:31:32 -0700 (PDT) X-Gm-Message-State: AOAM532fZa1oBCGnXkfPBxMo4aF1puJ2Du1EyvaxD0ZgiAaAi2/OFMv+ HCLwUcYqvFnOtpR2ejA8qV+f0q/lYlojtsiADJw= X-Google-Smtp-Source: ABdhPJwJ1kMBdBHVDrpIPqXs0JmQAUPsHr7elwFSR7qJp0Kl/AnhrMJrMZFa17PtqGGuen9XapfVmEOa9qvN5YWU1lM= X-Received: by 2002:a9d:7b48:: with SMTP id f8mr13709751oto.112.1633426291822; Tue, 05 Oct 2021 02:31:31 -0700 (PDT) MIME-Version: 1.0 References: <20211004162233.30290-1-rebecca@nuviainc.com> <57a31a01-9bd9-a0b4-6485-5a2bb7c8669f@arm.com> <256423b6-d873-e647-a596-45bb309add97@os.amperecomputing.com> In-Reply-To: <256423b6-d873-e647-a596-45bb309add97@os.amperecomputing.com> From: "Ard Biesheuvel" Date: Tue, 5 Oct 2021 11:31:20 +0200 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH 1/1] ArmPkg: SmbiosMiscDxe: Don't populate ExtendedBiosSize when size < 16MB To: Nhi Pham Cc: Rebecca Cran , Sami Mujawar , edk2-devel-groups-io , Leif Lindholm , Ard Biesheuvel , nd Content-Type: text/plain; charset="UTF-8" On Tue, 5 Oct 2021 at 05:05, Nhi Pham wrote: > > Thanks, Rebecca for the patch. > > Acked-by: Nhi Pham > Merged as #2040 Thanks, > 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 > >> | 7 ++++--- > >> 1 file changed, 4 insertions(+), 3 deletions(-) > >> > >> diff --git > >> a/ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type00/MiscBiosVendorFunction.c > >> b/ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type00/MiscBiosVendorFunction.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 = (UINT16)(FixedPcdGet32 > >> (PcdFdBaseAddress) / SIZE_64KB); > >> if (BiosPhysicalSize < SIZE_16MB) { > >> SmbiosRecord->BiosSize = Base2ToByteWith64KUnit > >> (BiosPhysicalSize) - 1; > >> - SmbiosRecord->ExtendedBiosSize.Size = BiosPhysicalSize / SIZE_1MB; > >> - SmbiosRecord->ExtendedBiosSize.Unit = 0; // Size is in MB > >> } else { > >> SmbiosRecord->BiosSize = 0xFF; > >> - if (BiosPhysicalSize > 0x3FFF) { > >> + if (BiosPhysicalSize < SIZE_16GB) { > >> + SmbiosRecord->ExtendedBiosSize.Size = BiosPhysicalSize / > >> SIZE_1MB; > >> + SmbiosRecord->ExtendedBiosSize.Unit = 0; // Size is in MB > >> + } else { > >> SmbiosRecord->ExtendedBiosSize.Size = BiosPhysicalSize / > >> SIZE_1GB; > >> SmbiosRecord->ExtendedBiosSize.Unit = 1; // Size is in GB > >> } > > > > IMPORTANT NOTICE: The contents of this email and any attachments are > > confidential and may also be privileged. If you are not the intended > > recipient, please 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.