public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [edk2-devel] [PATCH 1/1] ArmPkg/SmbiosMiscDxe: use UINT64 for BiosPhysicalSize
@ 2023-08-30 11:39 Leif Lindholm
  2023-08-30 12:50 ` Ard Biesheuvel
  0 siblings, 1 reply; 3+ messages in thread
From: Leif Lindholm @ 2023-08-30 11:39 UTC (permalink / raw)
  To: devel; +Cc: Ard Biesheuvel, Rebecca Cran

The top two bits of the Extended BIOS ROM Size field indicates the unit
used for the remaining 14 bits. If the size is greater than 16GB, the
unit is gigabytes.
The test for this uses the local BiosPhysicalSize variable, which is a
UINTN, meaning that when building for a 32/bit architecture (ARM) with
CLANGDWARF we have a tautological constant comparison, which the toolchain
flags now we've stopped disabling that warning.
So switch the BiosPhysicalSize variable to UINT64.

Signed-off-by: Leif Lindholm <quic_llindhol@quicinc.com>
Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
Cc: Rebecca Cran <rebecca@bsdio.com>
---

Ultimately, the size is still restricted to 32-bit since it is set
directly from a PcdGet32 (PcdFvSize). This should ideally be broken
out into an OemMiscLib function since PcdFvSize is fundamentally an
ArmPkg concept.

 ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type00/MiscBiosVendorFunction.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type00/MiscBiosVendorFunction.c b/ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type00/MiscBiosVendorFunction.c
index 38f3864b160e..03f9f07cfa29 100644
--- a/ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type00/MiscBiosVendorFunction.c
+++ b/ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type00/MiscBiosVendorFunction.c
@@ -185,7 +185,7 @@ SMBIOS_MISC_TABLE_FUNCTION (MiscBiosVendor) {
   UINTN               VendorStrLen;
   UINTN               VerStrLen;
   UINTN               DateStrLen;
-  UINTN               BiosPhysicalSize;
+  UINT64              BiosPhysicalSize;
   CHAR16              *Vendor;
   CHAR16              *Version;
   CHAR16              *ReleaseDate;
-- 
2.30.2



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#108142): https://edk2.groups.io/g/devel/message/108142
Mute This Topic: https://groups.io/mt/101050018/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/leave/12367111/7686176/1913456212/xyzzy [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-



^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [edk2-devel] [PATCH 1/1] ArmPkg/SmbiosMiscDxe: use UINT64 for BiosPhysicalSize
  2023-08-30 11:39 [edk2-devel] [PATCH 1/1] ArmPkg/SmbiosMiscDxe: use UINT64 for BiosPhysicalSize Leif Lindholm
@ 2023-08-30 12:50 ` Ard Biesheuvel
  2023-08-30 21:15   ` Leif Lindholm
  0 siblings, 1 reply; 3+ messages in thread
From: Ard Biesheuvel @ 2023-08-30 12:50 UTC (permalink / raw)
  To: Leif Lindholm; +Cc: devel, Rebecca Cran

On Wed, 30 Aug 2023 at 13:39, Leif Lindholm <quic_llindhol@quicinc.com> wrote:
>
> The top two bits of the Extended BIOS ROM Size field indicates the unit
> used for the remaining 14 bits. If the size is greater than 16GB, the
> unit is gigabytes.
> The test for this uses the local BiosPhysicalSize variable, which is a
> UINTN, meaning that when building for a 32/bit architecture (ARM) with
> CLANGDWARF we have a tautological constant comparison, which the toolchain
> flags now we've stopped disabling that warning.
> So switch the BiosPhysicalSize variable to UINT64.
>
> Signed-off-by: Leif Lindholm <quic_llindhol@quicinc.com>
> Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
> Cc: Rebecca Cran <rebecca@bsdio.com>

Reviewed-by: Ard BIesheuvel <ardb@kernel.org>

> ---
>
> Ultimately, the size is still restricted to 32-bit since it is set
> directly from a PcdGet32 (PcdFvSize). This should ideally be broken
> out into an OemMiscLib function since PcdFvSize is fundamentally an
> ArmPkg concept.
>
>  ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type00/MiscBiosVendorFunction.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type00/MiscBiosVendorFunction.c b/ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type00/MiscBiosVendorFunction.c
> index 38f3864b160e..03f9f07cfa29 100644
> --- a/ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type00/MiscBiosVendorFunction.c
> +++ b/ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type00/MiscBiosVendorFunction.c
> @@ -185,7 +185,7 @@ SMBIOS_MISC_TABLE_FUNCTION (MiscBiosVendor) {
>    UINTN               VendorStrLen;
>    UINTN               VerStrLen;
>    UINTN               DateStrLen;
> -  UINTN               BiosPhysicalSize;
> +  UINT64              BiosPhysicalSize;
>    CHAR16              *Vendor;
>    CHAR16              *Version;
>    CHAR16              *ReleaseDate;
> --
> 2.30.2
>


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#108143): https://edk2.groups.io/g/devel/message/108143
Mute This Topic: https://groups.io/mt/101050018/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [edk2-devel] [PATCH 1/1] ArmPkg/SmbiosMiscDxe: use UINT64 for BiosPhysicalSize
  2023-08-30 12:50 ` Ard Biesheuvel
@ 2023-08-30 21:15   ` Leif Lindholm
  0 siblings, 0 replies; 3+ messages in thread
From: Leif Lindholm @ 2023-08-30 21:15 UTC (permalink / raw)
  To: devel, ardb; +Cc: Rebecca Cran

On Wed, Aug 30, 2023 at 14:50:33 +0200, Ard Biesheuvel wrote:
> On Wed, 30 Aug 2023 at 13:39, Leif Lindholm <quic_llindhol@quicinc.com> wrote:
> >
> > The top two bits of the Extended BIOS ROM Size field indicates the unit
> > used for the remaining 14 bits. If the size is greater than 16GB, the
> > unit is gigabytes.
> > The test for this uses the local BiosPhysicalSize variable, which is a
> > UINTN, meaning that when building for a 32/bit architecture (ARM) with
> > CLANGDWARF we have a tautological constant comparison, which the toolchain
> > flags now we've stopped disabling that warning.
> > So switch the BiosPhysicalSize variable to UINT64.
> >
> > Signed-off-by: Leif Lindholm <quic_llindhol@quicinc.com>
> > Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
> > Cc: Rebecca Cran <rebecca@bsdio.com>
> 
> Reviewed-by: Ard BIesheuvel <ardb@kernel.org>

Thanks!
Pushed as c5753c3e38f3.

/
    Leif

> > ---
> >
> > Ultimately, the size is still restricted to 32-bit since it is set
> > directly from a PcdGet32 (PcdFvSize). This should ideally be broken
> > out into an OemMiscLib function since PcdFvSize is fundamentally an
> > ArmPkg concept.
> >
> >  ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type00/MiscBiosVendorFunction.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type00/MiscBiosVendorFunction.c b/ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type00/MiscBiosVendorFunction.c
> > index 38f3864b160e..03f9f07cfa29 100644
> > --- a/ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type00/MiscBiosVendorFunction.c
> > +++ b/ArmPkg/Universal/Smbios/SmbiosMiscDxe/Type00/MiscBiosVendorFunction.c
> > @@ -185,7 +185,7 @@ SMBIOS_MISC_TABLE_FUNCTION (MiscBiosVendor) {
> >    UINTN               VendorStrLen;
> >    UINTN               VerStrLen;
> >    UINTN               DateStrLen;
> > -  UINTN               BiosPhysicalSize;
> > +  UINT64              BiosPhysicalSize;
> >    CHAR16              *Vendor;
> >    CHAR16              *Version;
> >    CHAR16              *ReleaseDate;
> > --
> > 2.30.2
> >
> 
> 
> 
> 
> 


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#108153): https://edk2.groups.io/g/devel/message/108153
Mute This Topic: https://groups.io/mt/101050018/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/leave/12367111/7686176/1913456212/xyzzy [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-08-30 21:15 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-08-30 11:39 [edk2-devel] [PATCH 1/1] ArmPkg/SmbiosMiscDxe: use UINT64 for BiosPhysicalSize Leif Lindholm
2023-08-30 12:50 ` Ard Biesheuvel
2023-08-30 21:15   ` Leif Lindholm

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox