* [PATCH 1/1] ArmPkg/ProcessorSubClassDxe: Fix the format of ProcessorId
@ 2021-09-15 13:55 Nhi Pham
2021-09-16 10:45 ` Rebecca Cran
0 siblings, 1 reply; 3+ messages in thread
From: Nhi Pham @ 2021-09-15 13:55 UTC (permalink / raw)
To: devel; +Cc: patches, Nhi Pham, Leif Lindholm, Ard Biesheuvel, Rebecca Cran
According to SMBIOS 3.4, section 7.5.3.3 ARM64-class CPUs, if
SMCCC_ARCH_SOC_ID is supported, the first DWORD is the JEP-106 code and
the second DWORD is the SoC revision value. But in the current
implementation, they are set in reverse. This patch is to correct it.
Cc: Leif Lindholm <leif@nuviainc.com>
Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
Cc: Rebecca Cran <rebecca@nuviainc.com>
Signed-off-by: Nhi Pham <nhi@os.amperecomputing.com>
---
ArmPkg/Universal/Smbios/ProcessorSubClassDxe/SmbiosProcessorArmCommon.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/ArmPkg/Universal/Smbios/ProcessorSubClassDxe/SmbiosProcessorArmCommon.c b/ArmPkg/Universal/Smbios/ProcessorSubClassDxe/SmbiosProcessorArmCommon.c
index 292f10bf97eb..d644cd33d249 100644
--- a/ArmPkg/Universal/Smbios/ProcessorSubClassDxe/SmbiosProcessorArmCommon.c
+++ b/ArmPkg/Universal/Smbios/ProcessorSubClassDxe/SmbiosProcessorArmCommon.c
@@ -2,6 +2,7 @@
Functions for processor information common to ARM and AARCH64.
Copyright (c) 2021, NUVIA Inc. All rights reserved.<BR>
+ Copyright (c) 2021, Ampere Computing LLC. All rights reserved.<BR>
SPDX-License-Identifier: BSD-2-Clause-Patent
@@ -171,7 +172,7 @@ SmbiosGetProcessorId (
if (HasSmcArm64SocId ()) {
SmbiosGetSmcArm64SocId (&Jep106Code, &SocRevision);
- ProcessorId = ((UINT64)Jep106Code << 32) | SocRevision;
+ ProcessorId = ((UINT64)SocRevision << 32) | Jep106Code;
} else {
ProcessorId = ArmReadMidr ();
}
--
2.17.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH 1/1] ArmPkg/ProcessorSubClassDxe: Fix the format of ProcessorId
2021-09-15 13:55 [PATCH 1/1] ArmPkg/ProcessorSubClassDxe: Fix the format of ProcessorId Nhi Pham
@ 2021-09-16 10:45 ` Rebecca Cran
2021-09-16 14:47 ` Leif Lindholm
0 siblings, 1 reply; 3+ messages in thread
From: Rebecca Cran @ 2021-09-16 10:45 UTC (permalink / raw)
To: Nhi Pham, devel; +Cc: patches, Leif Lindholm, Ard Biesheuvel
Reviewed-by: Rebecca Cran <rebecca@nuviainc.com>
--
Rebecca Cran
On 9/15/21 7:55 AM, Nhi Pham wrote:
> According to SMBIOS 3.4, section 7.5.3.3 ARM64-class CPUs, if
> SMCCC_ARCH_SOC_ID is supported, the first DWORD is the JEP-106 code and
> the second DWORD is the SoC revision value. But in the current
> implementation, they are set in reverse. This patch is to correct it.
>
> Cc: Leif Lindholm <leif@nuviainc.com>
> Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
> Cc: Rebecca Cran <rebecca@nuviainc.com>
> Signed-off-by: Nhi Pham <nhi@os.amperecomputing.com>
> ---
> ArmPkg/Universal/Smbios/ProcessorSubClassDxe/SmbiosProcessorArmCommon.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/ArmPkg/Universal/Smbios/ProcessorSubClassDxe/SmbiosProcessorArmCommon.c b/ArmPkg/Universal/Smbios/ProcessorSubClassDxe/SmbiosProcessorArmCommon.c
> index 292f10bf97eb..d644cd33d249 100644
> --- a/ArmPkg/Universal/Smbios/ProcessorSubClassDxe/SmbiosProcessorArmCommon.c
> +++ b/ArmPkg/Universal/Smbios/ProcessorSubClassDxe/SmbiosProcessorArmCommon.c
> @@ -2,6 +2,7 @@
> Functions for processor information common to ARM and AARCH64.
>
> Copyright (c) 2021, NUVIA Inc. All rights reserved.<BR>
> + Copyright (c) 2021, Ampere Computing LLC. All rights reserved.<BR>
>
> SPDX-License-Identifier: BSD-2-Clause-Patent
>
> @@ -171,7 +172,7 @@ SmbiosGetProcessorId (
>
> if (HasSmcArm64SocId ()) {
> SmbiosGetSmcArm64SocId (&Jep106Code, &SocRevision);
> - ProcessorId = ((UINT64)Jep106Code << 32) | SocRevision;
> + ProcessorId = ((UINT64)SocRevision << 32) | Jep106Code;
> } else {
> ProcessorId = ArmReadMidr ();
> }
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH 1/1] ArmPkg/ProcessorSubClassDxe: Fix the format of ProcessorId
2021-09-16 10:45 ` Rebecca Cran
@ 2021-09-16 14:47 ` Leif Lindholm
0 siblings, 0 replies; 3+ messages in thread
From: Leif Lindholm @ 2021-09-16 14:47 UTC (permalink / raw)
To: Rebecca Cran, Nhi Pham; +Cc: devel, patches, Ard Biesheuvel
On Thu, Sep 16, 2021 at 04:45:29 -0600, Rebecca Cran wrote:
> Reviewed-by: Rebecca Cran <rebecca@nuviainc.com>
>
>
> --
>
> Rebecca Cran
>
>
> On 9/15/21 7:55 AM, Nhi Pham wrote:
> > According to SMBIOS 3.4, section 7.5.3.3 ARM64-class CPUs, if
> > SMCCC_ARCH_SOC_ID is supported, the first DWORD is the JEP-106 code and
> > the second DWORD is the SoC revision value. But in the current
> > implementation, they are set in reverse. This patch is to correct it.
> >
> > Cc: Leif Lindholm <leif@nuviainc.com>
> > Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
> > Cc: Rebecca Cran <rebecca@nuviainc.com>
> > Signed-off-by: Nhi Pham <nhi@os.amperecomputing.com>
Acked-by: Leif Lindholm <leif@nuviainc.com>
Pushed as ac6388add4ad.
Thanks!
> > ---
> > ArmPkg/Universal/Smbios/ProcessorSubClassDxe/SmbiosProcessorArmCommon.c | 3 ++-
> > 1 file changed, 2 insertions(+), 1 deletion(-)
> >
> > diff --git a/ArmPkg/Universal/Smbios/ProcessorSubClassDxe/SmbiosProcessorArmCommon.c b/ArmPkg/Universal/Smbios/ProcessorSubClassDxe/SmbiosProcessorArmCommon.c
> > index 292f10bf97eb..d644cd33d249 100644
> > --- a/ArmPkg/Universal/Smbios/ProcessorSubClassDxe/SmbiosProcessorArmCommon.c
> > +++ b/ArmPkg/Universal/Smbios/ProcessorSubClassDxe/SmbiosProcessorArmCommon.c
> > @@ -2,6 +2,7 @@
> > Functions for processor information common to ARM and AARCH64.
> > Copyright (c) 2021, NUVIA Inc. All rights reserved.<BR>
> > + Copyright (c) 2021, Ampere Computing LLC. All rights reserved.<BR>
> > SPDX-License-Identifier: BSD-2-Clause-Patent
> > @@ -171,7 +172,7 @@ SmbiosGetProcessorId (
> > if (HasSmcArm64SocId ()) {
> > SmbiosGetSmcArm64SocId (&Jep106Code, &SocRevision);
> > - ProcessorId = ((UINT64)Jep106Code << 32) | SocRevision;
> > + ProcessorId = ((UINT64)SocRevision << 32) | Jep106Code;
> > } else {
> > ProcessorId = ArmReadMidr ();
> > }
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2021-09-16 14:47 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-09-15 13:55 [PATCH 1/1] ArmPkg/ProcessorSubClassDxe: Fix the format of ProcessorId Nhi Pham
2021-09-16 10:45 ` Rebecca Cran
2021-09-16 14:47 ` Leif Lindholm
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox