From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pl1-f178.google.com (mail-pl1-f178.google.com [209.85.214.178]) by mx.groups.io with SMTP id smtpd.web09.12047.1633364561748469210 for ; Mon, 04 Oct 2021 09:22:41 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@nuviainc-com.20210112.gappssmtp.com header.s=20210112 header.b=Wd1tjRsV; spf=pass (domain: nuviainc.com, ip: 209.85.214.178, mailfrom: rebecca@nuviainc.com) Received: by mail-pl1-f178.google.com with SMTP id b22so263516pls.1 for ; Mon, 04 Oct 2021 09:22:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nuviainc-com.20210112.gappssmtp.com; s=20210112; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=RRiEzab9VNU5nHbkmSMi0NPSESPqG99Y3d+R7fcSVkY=; b=Wd1tjRsVYcxqdS78AQU/+sl3HDIX0hCZunPoh1V9eWa9OC8LkC9qjJeQokXZ0Pwork Jf6Bih3z7rirIRRLpkreheTvl1RSp82gOI9k/2Z8D7XMvHgYGuF6ryizgyTFbiEusqaE xPONki7JGznEQK4yu3uYYU5mgynEPJIi6V7T+i1M9GCfVOiJDQu/jovoc2Y2fNNTHnXx c2HfWcRKm4AeDLNz1DbkRswh4PTweZ3MepjzZiX4MltrE0cl15eESVp66utzUDEGymoR 6CGKO37Jf+OR30vH7E1l+eC5qnqzPsO58xoRCd1t2GWKhX0iR12UpMYHsBLe9Km8GMFk a4Wg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=RRiEzab9VNU5nHbkmSMi0NPSESPqG99Y3d+R7fcSVkY=; b=Xst+jxI+gcEMDSx/BpiswH70DCmboNi/0OXr3gmjZ0xYgJWsNYprN1+7sTN3MWvzF6 i4866EyOzOjcZKgLI8S9vYVvwNdXA7BDxEnjHsAkV+lIbHxq51LdJqeuyrz0SofPrhFm pZN01o5gghr1SInbtPJ2NcCS4aYkcUdnbTy2kqZBkWRKbVVU+2LfVnEPqmuNE1LWyG5h 8q+WboIgF80wEvF0KgNtIGaqlVnJdTfEWkiLz8oi6IBSJIkTyPgWkR5IBCYn8xTFrzWf /ZdWQyBr4bn2Uwk4T1OliKRBmglGtoBCE3ogTYVfxp/Aq6mweFl+ffPO69vjmVHGUNWN mqzw== X-Gm-Message-State: AOAM532rmGlaTWjzMHuVYH9X57EBolguqxDavXKK4ycxrumoshkdBXPx TeJ2eBBWId6Jn+LRLeCvGa6FHN8205B4qPw4Kw1xuQnYbteCHDp5RgyKy3P3ATmdfDiaMWBtNWM SFd7Z1NH4ooucJS6Xjhr7HlizHBzFO5XdJmpljhuCsNT+w2yjrqVi0zDq04pbmholANACEP5M X-Google-Smtp-Source: ABdhPJxbfEJoQqHKYNaffNaI0g0vkNgrpMWMuPhfi1Zdeabm4gGmzikOjWzCYW2SrGdnEgG8kKzrGw== X-Received: by 2002:a17:90b:1a85:: with SMTP id ng5mr4509121pjb.45.1633364560921; Mon, 04 Oct 2021 09:22:40 -0700 (PDT) Return-Path: Received: from linbox.int.bluestop.org.com (c-174-52-16-57.hsd1.ut.comcast.net. [174.52.16.57]) by smtp.gmail.com with ESMTPSA id k201sm2927614pfd.133.2021.10.04.09.22.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 04 Oct 2021 09:22:40 -0700 (PDT) From: "Rebecca Cran" To: devel@edk2.groups.io, Sami Mujawar , Leif Lindholm , Ard Biesheuvel , Nhi Pham Cc: Rebecca Cran Subject: [PATCH 1/1] ArmPkg: SmbiosMiscDxe: Don't populate ExtendedBiosSize when size < 16MB Date: Mon, 4 Oct 2021 10:22:33 -0600 Message-Id: <20211004162233.30290-1-rebecca@nuviainc.com> X-Mailer: git-send-email 2.31.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 } -- 2.31.1