* [PATCH] UefiCpuPkg: Calculate DisplayFamily correctly @ 2023-03-02 1:26 Zhiguang Liu 2023-03-02 1:58 ` Ni, Ray ` (3 more replies) 0 siblings, 4 replies; 12+ messages in thread From: Zhiguang Liu @ 2023-03-02 1:26 UTC (permalink / raw) To: devel; +Cc: Zhiguang Liu, Eric Dong, Ray Ni, Rahul Kumar, Gerd Hoffmann REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4238 Per SDM, DisplayFamily = Extended_Family_ID + Family_ID. Correct the related code. Cc: Eric Dong <eric.dong@intel.com> Cc: Ray Ni <ray.ni@intel.com> Cc: Rahul Kumar <rahul1.kumar@intel.com> Cc: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Zhiguang Liu <zhiguang.liu@intel.com> --- UefiCpuPkg/Application/Cpuid/Cpuid.c | 4 ++-- .../Library/RegisterCpuFeaturesLib/CpuFeaturesInitialize.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/UefiCpuPkg/Application/Cpuid/Cpuid.c b/UefiCpuPkg/Application/Cpuid/Cpuid.c index 372c6ef87d..51c463fb10 100644 --- a/UefiCpuPkg/Application/Cpuid/Cpuid.c +++ b/UefiCpuPkg/Application/Cpuid/Cpuid.c @@ -1,7 +1,7 @@ /** @file UEFI Application to display CPUID leaf information. - Copyright (c) 2016 - 2019, Intel Corporation. All rights reserved.<BR> + Copyright (c) 2016 - 2023, Intel Corporation. All rights reserved.<BR> SPDX-License-Identifier: BSD-2-Clause-Patent **/ @@ -217,7 +217,7 @@ CpuidVersionInfo ( DisplayFamily = Eax.Bits.FamilyId; if (Eax.Bits.FamilyId == 0x0F) { - DisplayFamily |= (Eax.Bits.ExtendedFamilyId << 4); + DisplayFamily += Eax.Bits.ExtendedFamilyId; } DisplayModel = Eax.Bits.Model; diff --git a/UefiCpuPkg/Library/RegisterCpuFeaturesLib/CpuFeaturesInitialize.c b/UefiCpuPkg/Library/RegisterCpuFeaturesLib/CpuFeaturesInitialize.c index a8e4f920fc..25b8958252 100644 --- a/UefiCpuPkg/Library/RegisterCpuFeaturesLib/CpuFeaturesInitialize.c +++ b/UefiCpuPkg/Library/RegisterCpuFeaturesLib/CpuFeaturesInitialize.c @@ -1,7 +1,7 @@ /** @file CPU Features Initialize functions. - Copyright (c) 2017 - 2021, Intel Corporation. All rights reserved.<BR> + Copyright (c) 2017 - 2023, Intel Corporation. All rights reserved.<BR> SPDX-License-Identifier: BSD-2-Clause-Patent **/ @@ -67,7 +67,7 @@ FillProcessorInfo ( DisplayedFamily = Eax.Bits.FamilyId; if (Eax.Bits.FamilyId == 0x0F) { - DisplayedFamily |= (Eax.Bits.ExtendedFamilyId << 4); + DisplayedFamily += Eax.Bits.ExtendedFamilyId; } DisplayedModel = Eax.Bits.Model; -- 2.31.1.windows.1 ^ permalink raw reply related [flat|nested] 12+ messages in thread
* Re: [PATCH] UefiCpuPkg: Calculate DisplayFamily correctly 2023-03-02 1:26 [PATCH] UefiCpuPkg: Calculate DisplayFamily correctly Zhiguang Liu @ 2023-03-02 1:58 ` Ni, Ray 2023-03-02 7:13 ` Gerd Hoffmann ` (2 subsequent siblings) 3 siblings, 0 replies; 12+ messages in thread From: Ni, Ray @ 2023-03-02 1:58 UTC (permalink / raw) To: Liu, Zhiguang, devel@edk2.groups.io Cc: Dong, Eric, Kumar, Rahul R, Gerd Hoffmann Reviewed-by: Ray Ni <ray.ni@intel.com> > -----Original Message----- > From: Liu, Zhiguang <zhiguang.liu@intel.com> > Sent: Thursday, March 2, 2023 9:27 AM > To: devel@edk2.groups.io > Cc: Liu, Zhiguang <zhiguang.liu@intel.com>; Dong, Eric > <eric.dong@intel.com>; Ni, Ray <ray.ni@intel.com>; Kumar, Rahul R > <rahul.r.kumar@intel.com>; Gerd Hoffmann <kraxel@redhat.com> > Subject: [PATCH] UefiCpuPkg: Calculate DisplayFamily correctly > > REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4238 > > Per SDM, DisplayFamily = Extended_Family_ID + Family_ID. > Correct the related code. > > Cc: Eric Dong <eric.dong@intel.com> > Cc: Ray Ni <ray.ni@intel.com> > Cc: Rahul Kumar <rahul1.kumar@intel.com> > Cc: Gerd Hoffmann <kraxel@redhat.com> > Signed-off-by: Zhiguang Liu <zhiguang.liu@intel.com> > --- > UefiCpuPkg/Application/Cpuid/Cpuid.c | 4 ++-- > .../Library/RegisterCpuFeaturesLib/CpuFeaturesInitialize.c | 4 ++-- > 2 files changed, 4 insertions(+), 4 deletions(-) > > diff --git a/UefiCpuPkg/Application/Cpuid/Cpuid.c > b/UefiCpuPkg/Application/Cpuid/Cpuid.c > index 372c6ef87d..51c463fb10 100644 > --- a/UefiCpuPkg/Application/Cpuid/Cpuid.c > +++ b/UefiCpuPkg/Application/Cpuid/Cpuid.c > @@ -1,7 +1,7 @@ > /** @file > UEFI Application to display CPUID leaf information. > > - Copyright (c) 2016 - 2019, Intel Corporation. All rights reserved.<BR> > + Copyright (c) 2016 - 2023, Intel Corporation. All rights reserved.<BR> > SPDX-License-Identifier: BSD-2-Clause-Patent > > **/ > @@ -217,7 +217,7 @@ CpuidVersionInfo ( > > DisplayFamily = Eax.Bits.FamilyId; > if (Eax.Bits.FamilyId == 0x0F) { > - DisplayFamily |= (Eax.Bits.ExtendedFamilyId << 4); > + DisplayFamily += Eax.Bits.ExtendedFamilyId; > } > > DisplayModel = Eax.Bits.Model; > diff --git > a/UefiCpuPkg/Library/RegisterCpuFeaturesLib/CpuFeaturesInitialize.c > b/UefiCpuPkg/Library/RegisterCpuFeaturesLib/CpuFeaturesInitialize.c > index a8e4f920fc..25b8958252 100644 > --- a/UefiCpuPkg/Library/RegisterCpuFeaturesLib/CpuFeaturesInitialize.c > +++ b/UefiCpuPkg/Library/RegisterCpuFeaturesLib/CpuFeaturesInitialize.c > @@ -1,7 +1,7 @@ > /** @file > CPU Features Initialize functions. > > - Copyright (c) 2017 - 2021, Intel Corporation. All rights reserved.<BR> > + Copyright (c) 2017 - 2023, Intel Corporation. All rights reserved.<BR> > SPDX-License-Identifier: BSD-2-Clause-Patent > > **/ > @@ -67,7 +67,7 @@ FillProcessorInfo ( > > DisplayedFamily = Eax.Bits.FamilyId; > if (Eax.Bits.FamilyId == 0x0F) { > - DisplayedFamily |= (Eax.Bits.ExtendedFamilyId << 4); > + DisplayedFamily += Eax.Bits.ExtendedFamilyId; > } > > DisplayedModel = Eax.Bits.Model; > -- > 2.31.1.windows.1 ^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH] UefiCpuPkg: Calculate DisplayFamily correctly 2023-03-02 1:26 [PATCH] UefiCpuPkg: Calculate DisplayFamily correctly Zhiguang Liu 2023-03-02 1:58 ` Ni, Ray @ 2023-03-02 7:13 ` Gerd Hoffmann 2023-03-06 10:34 ` [edk2-devel] " Zeng, Star [not found] ` <1749CE106AC7BFA5.3736@groups.io> 3 siblings, 0 replies; 12+ messages in thread From: Gerd Hoffmann @ 2023-03-02 7:13 UTC (permalink / raw) To: Zhiguang Liu; +Cc: devel, Eric Dong, Ray Ni, Rahul Kumar On Thu, Mar 02, 2023 at 09:26:49AM +0800, Zhiguang Liu wrote: > REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4238 > > Per SDM, DisplayFamily = Extended_Family_ID + Family_ID. > Correct the related code. Acked-by: Gerd Hoffmann <kraxel@redhat.com> take care, Gerd ^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [edk2-devel] [PATCH] UefiCpuPkg: Calculate DisplayFamily correctly 2023-03-02 1:26 [PATCH] UefiCpuPkg: Calculate DisplayFamily correctly Zhiguang Liu 2023-03-02 1:58 ` Ni, Ray 2023-03-02 7:13 ` Gerd Hoffmann @ 2023-03-06 10:34 ` Zeng, Star [not found] ` <1749CE106AC7BFA5.3736@groups.io> 3 siblings, 0 replies; 12+ messages in thread From: Zeng, Star @ 2023-03-06 10:34 UTC (permalink / raw) To: devel@edk2.groups.io, Liu, Zhiguang Cc: Dong, Eric, Ni, Ray, Kumar, Rahul R, Gerd Hoffmann, Zeng, Star Reviewed-by: Star Zeng <star.zeng@intel.com> -----Original Message----- From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of Zhiguang Liu Sent: Thursday, March 2, 2023 9:27 AM To: devel@edk2.groups.io Cc: Liu, Zhiguang <zhiguang.liu@intel.com>; Dong, Eric <eric.dong@intel.com>; Ni, Ray <ray.ni@intel.com>; Kumar, Rahul R <rahul.r.kumar@intel.com>; Gerd Hoffmann <kraxel@redhat.com> Subject: [edk2-devel] [PATCH] UefiCpuPkg: Calculate DisplayFamily correctly REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4238 Per SDM, DisplayFamily = Extended_Family_ID + Family_ID. Correct the related code. Cc: Eric Dong <eric.dong@intel.com> Cc: Ray Ni <ray.ni@intel.com> Cc: Rahul Kumar <rahul1.kumar@intel.com> Cc: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Zhiguang Liu <zhiguang.liu@intel.com> --- UefiCpuPkg/Application/Cpuid/Cpuid.c | 4 ++-- .../Library/RegisterCpuFeaturesLib/CpuFeaturesInitialize.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/UefiCpuPkg/Application/Cpuid/Cpuid.c b/UefiCpuPkg/Application/Cpuid/Cpuid.c index 372c6ef87d..51c463fb10 100644 --- a/UefiCpuPkg/Application/Cpuid/Cpuid.c +++ b/UefiCpuPkg/Application/Cpuid/Cpuid.c @@ -1,7 +1,7 @@ /** @file UEFI Application to display CPUID leaf information. - Copyright (c) 2016 - 2019, Intel Corporation. All rights reserved.<BR> + Copyright (c) 2016 - 2023, Intel Corporation. All rights reserved.<BR> SPDX-License-Identifier: BSD-2-Clause-Patent **/ @@ -217,7 +217,7 @@ CpuidVersionInfo ( DisplayFamily = Eax.Bits.FamilyId; if (Eax.Bits.FamilyId == 0x0F) { - DisplayFamily |= (Eax.Bits.ExtendedFamilyId << 4); + DisplayFamily += Eax.Bits.ExtendedFamilyId; } DisplayModel = Eax.Bits.Model; diff --git a/UefiCpuPkg/Library/RegisterCpuFeaturesLib/CpuFeaturesInitialize.c b/UefiCpuPkg/Library/RegisterCpuFeaturesLib/CpuFeaturesInitialize.c index a8e4f920fc..25b8958252 100644 --- a/UefiCpuPkg/Library/RegisterCpuFeaturesLib/CpuFeaturesInitialize.c +++ b/UefiCpuPkg/Library/RegisterCpuFeaturesLib/CpuFeaturesInitialize.c @@ -1,7 +1,7 @@ /** @file CPU Features Initialize functions. - Copyright (c) 2017 - 2021, Intel Corporation. All rights reserved.<BR> + Copyright (c) 2017 - 2023, Intel Corporation. All rights reserved.<BR> SPDX-License-Identifier: BSD-2-Clause-Patent **/ @@ -67,7 +67,7 @@ FillProcessorInfo ( DisplayedFamily = Eax.Bits.FamilyId; if (Eax.Bits.FamilyId == 0x0F) { - DisplayedFamily |= (Eax.Bits.ExtendedFamilyId << 4); + DisplayedFamily += Eax.Bits.ExtendedFamilyId; } DisplayedModel = Eax.Bits.Model; -- 2.31.1.windows.1 ^ permalink raw reply related [flat|nested] 12+ messages in thread
[parent not found: <1749CE106AC7BFA5.3736@groups.io>]
* Re: [edk2-devel] [PATCH] UefiCpuPkg: Calculate DisplayFamily correctly [not found] ` <1749CE106AC7BFA5.3736@groups.io> @ 2023-03-06 10:37 ` Zeng, Star 2023-03-06 11:13 ` Mike Maslenkin 2023-03-07 1:23 ` Zhiguang Liu 0 siblings, 2 replies; 12+ messages in thread From: Zeng, Star @ 2023-03-06 10:37 UTC (permalink / raw) To: devel@edk2.groups.io, Zeng, Star, Liu, Zhiguang Cc: Dong, Eric, Ni, Ray, Kumar, Rahul R, Gerd Hoffmann, Zeng, Star BTW, look like wrong Bugzilla ID is used in commit message, please correct it when merging the patch. -----Original Message----- From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of Zeng, Star Sent: Monday, March 6, 2023 6:35 PM To: devel@edk2.groups.io; Liu, Zhiguang <zhiguang.liu@intel.com> Cc: Dong, Eric <eric.dong@intel.com>; Ni, Ray <ray.ni@intel.com>; Kumar, Rahul R <rahul.r.kumar@intel.com>; Gerd Hoffmann <kraxel@redhat.com>; Zeng, Star <star.zeng@intel.com> Subject: Re: [edk2-devel] [PATCH] UefiCpuPkg: Calculate DisplayFamily correctly Reviewed-by: Star Zeng <star.zeng@intel.com> -----Original Message----- From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of Zhiguang Liu Sent: Thursday, March 2, 2023 9:27 AM To: devel@edk2.groups.io Cc: Liu, Zhiguang <zhiguang.liu@intel.com>; Dong, Eric <eric.dong@intel.com>; Ni, Ray <ray.ni@intel.com>; Kumar, Rahul R <rahul.r.kumar@intel.com>; Gerd Hoffmann <kraxel@redhat.com> Subject: [edk2-devel] [PATCH] UefiCpuPkg: Calculate DisplayFamily correctly REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4238 Per SDM, DisplayFamily = Extended_Family_ID + Family_ID. Correct the related code. Cc: Eric Dong <eric.dong@intel.com> Cc: Ray Ni <ray.ni@intel.com> Cc: Rahul Kumar <rahul1.kumar@intel.com> Cc: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Zhiguang Liu <zhiguang.liu@intel.com> --- UefiCpuPkg/Application/Cpuid/Cpuid.c | 4 ++-- .../Library/RegisterCpuFeaturesLib/CpuFeaturesInitialize.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/UefiCpuPkg/Application/Cpuid/Cpuid.c b/UefiCpuPkg/Application/Cpuid/Cpuid.c index 372c6ef87d..51c463fb10 100644 --- a/UefiCpuPkg/Application/Cpuid/Cpuid.c +++ b/UefiCpuPkg/Application/Cpuid/Cpuid.c @@ -1,7 +1,7 @@ /** @file UEFI Application to display CPUID leaf information. - Copyright (c) 2016 - 2019, Intel Corporation. All rights reserved.<BR> + Copyright (c) 2016 - 2023, Intel Corporation. All rights reserved.<BR> SPDX-License-Identifier: BSD-2-Clause-Patent **/ @@ -217,7 +217,7 @@ CpuidVersionInfo ( DisplayFamily = Eax.Bits.FamilyId; if (Eax.Bits.FamilyId == 0x0F) { - DisplayFamily |= (Eax.Bits.ExtendedFamilyId << 4); + DisplayFamily += Eax.Bits.ExtendedFamilyId; } DisplayModel = Eax.Bits.Model; diff --git a/UefiCpuPkg/Library/RegisterCpuFeaturesLib/CpuFeaturesInitialize.c b/UefiCpuPkg/Library/RegisterCpuFeaturesLib/CpuFeaturesInitialize.c index a8e4f920fc..25b8958252 100644 --- a/UefiCpuPkg/Library/RegisterCpuFeaturesLib/CpuFeaturesInitialize.c +++ b/UefiCpuPkg/Library/RegisterCpuFeaturesLib/CpuFeaturesInitialize.c @@ -1,7 +1,7 @@ /** @file CPU Features Initialize functions. - Copyright (c) 2017 - 2021, Intel Corporation. All rights reserved.<BR> + Copyright (c) 2017 - 2023, Intel Corporation. All rights reserved.<BR> SPDX-License-Identifier: BSD-2-Clause-Patent **/ @@ -67,7 +67,7 @@ FillProcessorInfo ( DisplayedFamily = Eax.Bits.FamilyId; if (Eax.Bits.FamilyId == 0x0F) { - DisplayedFamily |= (Eax.Bits.ExtendedFamilyId << 4); + DisplayedFamily += Eax.Bits.ExtendedFamilyId; } DisplayedModel = Eax.Bits.Model; -- 2.31.1.windows.1 ^ permalink raw reply related [flat|nested] 12+ messages in thread
* Re: [edk2-devel] [PATCH] UefiCpuPkg: Calculate DisplayFamily correctly 2023-03-06 10:37 ` Zeng, Star @ 2023-03-06 11:13 ` Mike Maslenkin 2023-03-06 11:52 ` Ni, Ray 2023-03-07 1:23 ` Zhiguang Liu 1 sibling, 1 reply; 12+ messages in thread From: Mike Maslenkin @ 2023-03-06 11:13 UTC (permalink / raw) To: devel, star.zeng Cc: Liu, Zhiguang, Dong, Eric, Ni, Ray, Kumar, Rahul R, Gerd Hoffmann Handling of ExtendedModelId field has the same problem. This patch could be improved to fix that too. On Mon, Mar 6, 2023 at 1:37 PM Zeng, Star <star.zeng@intel.com> wrote: > > BTW, look like wrong Bugzilla ID is used in commit message, please correct it when merging the patch. > > -----Original Message----- > From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of Zeng, Star > Sent: Monday, March 6, 2023 6:35 PM > To: devel@edk2.groups.io; Liu, Zhiguang <zhiguang.liu@intel.com> > Cc: Dong, Eric <eric.dong@intel.com>; Ni, Ray <ray.ni@intel.com>; Kumar, Rahul R <rahul.r.kumar@intel.com>; Gerd Hoffmann <kraxel@redhat.com>; Zeng, Star <star.zeng@intel.com> > Subject: Re: [edk2-devel] [PATCH] UefiCpuPkg: Calculate DisplayFamily correctly > > Reviewed-by: Star Zeng <star.zeng@intel.com> > > -----Original Message----- > From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of Zhiguang Liu > Sent: Thursday, March 2, 2023 9:27 AM > To: devel@edk2.groups.io > Cc: Liu, Zhiguang <zhiguang.liu@intel.com>; Dong, Eric <eric.dong@intel.com>; Ni, Ray <ray.ni@intel.com>; Kumar, Rahul R <rahul.r.kumar@intel.com>; Gerd Hoffmann <kraxel@redhat.com> > Subject: [edk2-devel] [PATCH] UefiCpuPkg: Calculate DisplayFamily correctly > > REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4238 > > Per SDM, DisplayFamily = Extended_Family_ID + Family_ID. > Correct the related code. > > Cc: Eric Dong <eric.dong@intel.com> > Cc: Ray Ni <ray.ni@intel.com> > Cc: Rahul Kumar <rahul1.kumar@intel.com> > Cc: Gerd Hoffmann <kraxel@redhat.com> > Signed-off-by: Zhiguang Liu <zhiguang.liu@intel.com> > --- > UefiCpuPkg/Application/Cpuid/Cpuid.c | 4 ++-- > .../Library/RegisterCpuFeaturesLib/CpuFeaturesInitialize.c | 4 ++-- > 2 files changed, 4 insertions(+), 4 deletions(-) > > diff --git a/UefiCpuPkg/Application/Cpuid/Cpuid.c b/UefiCpuPkg/Application/Cpuid/Cpuid.c > index 372c6ef87d..51c463fb10 100644 > --- a/UefiCpuPkg/Application/Cpuid/Cpuid.c > +++ b/UefiCpuPkg/Application/Cpuid/Cpuid.c > @@ -1,7 +1,7 @@ > /** @file > UEFI Application to display CPUID leaf information. > > - Copyright (c) 2016 - 2019, Intel Corporation. All rights reserved.<BR> > + Copyright (c) 2016 - 2023, Intel Corporation. All rights reserved.<BR> > SPDX-License-Identifier: BSD-2-Clause-Patent > > **/ > @@ -217,7 +217,7 @@ CpuidVersionInfo ( > > DisplayFamily = Eax.Bits.FamilyId; > if (Eax.Bits.FamilyId == 0x0F) { > - DisplayFamily |= (Eax.Bits.ExtendedFamilyId << 4); > + DisplayFamily += Eax.Bits.ExtendedFamilyId; > } > > DisplayModel = Eax.Bits.Model; > diff --git a/UefiCpuPkg/Library/RegisterCpuFeaturesLib/CpuFeaturesInitialize.c b/UefiCpuPkg/Library/RegisterCpuFeaturesLib/CpuFeaturesInitialize.c > index a8e4f920fc..25b8958252 100644 > --- a/UefiCpuPkg/Library/RegisterCpuFeaturesLib/CpuFeaturesInitialize.c > +++ b/UefiCpuPkg/Library/RegisterCpuFeaturesLib/CpuFeaturesInitialize.c > @@ -1,7 +1,7 @@ > /** @file > CPU Features Initialize functions. > > - Copyright (c) 2017 - 2021, Intel Corporation. All rights reserved.<BR> > + Copyright (c) 2017 - 2023, Intel Corporation. All rights reserved.<BR> > SPDX-License-Identifier: BSD-2-Clause-Patent > > **/ > @@ -67,7 +67,7 @@ FillProcessorInfo ( > > DisplayedFamily = Eax.Bits.FamilyId; > if (Eax.Bits.FamilyId == 0x0F) { > - DisplayedFamily |= (Eax.Bits.ExtendedFamilyId << 4); > + DisplayedFamily += Eax.Bits.ExtendedFamilyId; > } > > DisplayedModel = Eax.Bits.Model; > -- > 2.31.1.windows.1 > > > > > > > > > > > > > > > > ^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [edk2-devel] [PATCH] UefiCpuPkg: Calculate DisplayFamily correctly 2023-03-06 11:13 ` Mike Maslenkin @ 2023-03-06 11:52 ` Ni, Ray 2023-03-06 13:36 ` Mike Maslenkin 0 siblings, 1 reply; 12+ messages in thread From: Ni, Ray @ 2023-03-06 11:52 UTC (permalink / raw) To: Mike Maslenkin, devel@edk2.groups.io, Zeng, Star Cc: Liu, Zhiguang, Dong, Eric, Kumar, Rahul R, Gerd Hoffmann ExtendedModelId field should use shift. So I believe nothing wrong there. > -----Original Message----- > From: Mike Maslenkin <mike.maslenkin@gmail.com> > Sent: Monday, March 6, 2023 7:14 PM > To: devel@edk2.groups.io; Zeng, Star <star.zeng@intel.com> > Cc: Liu, Zhiguang <zhiguang.liu@intel.com>; Dong, Eric > <eric.dong@intel.com>; Ni, Ray <ray.ni@intel.com>; Kumar, Rahul R > <rahul.r.kumar@intel.com>; Gerd Hoffmann <kraxel@redhat.com> > Subject: Re: [edk2-devel] [PATCH] UefiCpuPkg: Calculate DisplayFamily > correctly > > Handling of ExtendedModelId field has the same problem. > This patch could be improved to fix that too. > > On Mon, Mar 6, 2023 at 1:37 PM Zeng, Star <star.zeng@intel.com> wrote: > > > > BTW, look like wrong Bugzilla ID is used in commit message, please correct > it when merging the patch. > > > > -----Original Message----- > > From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of Zeng, > Star > > Sent: Monday, March 6, 2023 6:35 PM > > To: devel@edk2.groups.io; Liu, Zhiguang <zhiguang.liu@intel.com> > > Cc: Dong, Eric <eric.dong@intel.com>; Ni, Ray <ray.ni@intel.com>; Kumar, > Rahul R <rahul.r.kumar@intel.com>; Gerd Hoffmann <kraxel@redhat.com>; > Zeng, Star <star.zeng@intel.com> > > Subject: Re: [edk2-devel] [PATCH] UefiCpuPkg: Calculate DisplayFamily > correctly > > > > Reviewed-by: Star Zeng <star.zeng@intel.com> > > > > -----Original Message----- > > From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of > Zhiguang Liu > > Sent: Thursday, March 2, 2023 9:27 AM > > To: devel@edk2.groups.io > > Cc: Liu, Zhiguang <zhiguang.liu@intel.com>; Dong, Eric > <eric.dong@intel.com>; Ni, Ray <ray.ni@intel.com>; Kumar, Rahul R > <rahul.r.kumar@intel.com>; Gerd Hoffmann <kraxel@redhat.com> > > Subject: [edk2-devel] [PATCH] UefiCpuPkg: Calculate DisplayFamily > correctly > > > > REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4238 > > > > Per SDM, DisplayFamily = Extended_Family_ID + Family_ID. > > Correct the related code. > > > > Cc: Eric Dong <eric.dong@intel.com> > > Cc: Ray Ni <ray.ni@intel.com> > > Cc: Rahul Kumar <rahul1.kumar@intel.com> > > Cc: Gerd Hoffmann <kraxel@redhat.com> > > Signed-off-by: Zhiguang Liu <zhiguang.liu@intel.com> > > --- > > UefiCpuPkg/Application/Cpuid/Cpuid.c | 4 ++-- > > .../Library/RegisterCpuFeaturesLib/CpuFeaturesInitialize.c | 4 ++-- > > 2 files changed, 4 insertions(+), 4 deletions(-) > > > > diff --git a/UefiCpuPkg/Application/Cpuid/Cpuid.c > b/UefiCpuPkg/Application/Cpuid/Cpuid.c > > index 372c6ef87d..51c463fb10 100644 > > --- a/UefiCpuPkg/Application/Cpuid/Cpuid.c > > +++ b/UefiCpuPkg/Application/Cpuid/Cpuid.c > > @@ -1,7 +1,7 @@ > > /** @file > > UEFI Application to display CPUID leaf information. > > > > - Copyright (c) 2016 - 2019, Intel Corporation. All rights reserved.<BR> > > + Copyright (c) 2016 - 2023, Intel Corporation. All rights reserved.<BR> > > SPDX-License-Identifier: BSD-2-Clause-Patent > > > > **/ > > @@ -217,7 +217,7 @@ CpuidVersionInfo ( > > > > DisplayFamily = Eax.Bits.FamilyId; > > if (Eax.Bits.FamilyId == 0x0F) { > > - DisplayFamily |= (Eax.Bits.ExtendedFamilyId << 4); > > + DisplayFamily += Eax.Bits.ExtendedFamilyId; > > } > > > > DisplayModel = Eax.Bits.Model; > > diff --git > a/UefiCpuPkg/Library/RegisterCpuFeaturesLib/CpuFeaturesInitialize.c > b/UefiCpuPkg/Library/RegisterCpuFeaturesLib/CpuFeaturesInitialize.c > > index a8e4f920fc..25b8958252 100644 > > --- a/UefiCpuPkg/Library/RegisterCpuFeaturesLib/CpuFeaturesInitialize.c > > +++ b/UefiCpuPkg/Library/RegisterCpuFeaturesLib/CpuFeaturesInitialize.c > > @@ -1,7 +1,7 @@ > > /** @file > > CPU Features Initialize functions. > > > > - Copyright (c) 2017 - 2021, Intel Corporation. All rights reserved.<BR> > > + Copyright (c) 2017 - 2023, Intel Corporation. All rights reserved.<BR> > > SPDX-License-Identifier: BSD-2-Clause-Patent > > > > **/ > > @@ -67,7 +67,7 @@ FillProcessorInfo ( > > > > DisplayedFamily = Eax.Bits.FamilyId; > > if (Eax.Bits.FamilyId == 0x0F) { > > - DisplayedFamily |= (Eax.Bits.ExtendedFamilyId << 4); > > + DisplayedFamily += Eax.Bits.ExtendedFamilyId; > > } > > > > DisplayedModel = Eax.Bits.Model; > > -- > > 2.31.1.windows.1 > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > ^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [edk2-devel] [PATCH] UefiCpuPkg: Calculate DisplayFamily correctly 2023-03-06 11:52 ` Ni, Ray @ 2023-03-06 13:36 ` Mike Maslenkin 2023-03-06 15:28 ` Chang, Abner 2023-03-07 1:50 ` Ni, Ray 0 siblings, 2 replies; 12+ messages in thread From: Mike Maslenkin @ 2023-03-06 13:36 UTC (permalink / raw) To: devel, ray.ni There is no problem with current implementation. My proposal was to re-write code in this way: DisplayModel = Eax.Bits.Model; if ((Eax.Bits.FamilyId == 0x06) || (Eax.Bits.FamilyId == 0x0f)) { DisplayModel += (Eax.Bits.ExtendedModelId << 4); } This is exactly matches spec without knowledge about Model_ID width and makes code consistent. There is no 'OR" operation in rules defined by SDM: " IF (Family_ID = 06H or Family_ID = 0FH) THEN DisplayModel = (Extended_Model_ID « 4) + Model_ID; (* Right justify and zero-extend 4-bit field; display Model_ID as HEX field.*) ELSE DisplayModel = Model_ID; FI; " " On Mon, Mar 6, 2023 at 2:52 PM Ni, Ray <ray.ni@intel.com> wrote: > > ExtendedModelId field should use shift. So I believe nothing wrong there. > > > -----Original Message----- > > From: Mike Maslenkin <mike.maslenkin@gmail.com> > > Sent: Monday, March 6, 2023 7:14 PM > > To: devel@edk2.groups.io; Zeng, Star <star.zeng@intel.com> > > Cc: Liu, Zhiguang <zhiguang.liu@intel.com>; Dong, Eric > > <eric.dong@intel.com>; Ni, Ray <ray.ni@intel.com>; Kumar, Rahul R > > <rahul.r.kumar@intel.com>; Gerd Hoffmann <kraxel@redhat.com> > > Subject: Re: [edk2-devel] [PATCH] UefiCpuPkg: Calculate DisplayFamily > > correctly > > > > Handling of ExtendedModelId field has the same problem. > > This patch could be improved to fix that too. > > > > On Mon, Mar 6, 2023 at 1:37 PM Zeng, Star <star.zeng@intel.com> wrote: > > > > > > BTW, look like wrong Bugzilla ID is used in commit message, please correct > > it when merging the patch. > > > > > > -----Original Message----- > > > From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of Zeng, > > Star > > > Sent: Monday, March 6, 2023 6:35 PM > > > To: devel@edk2.groups.io; Liu, Zhiguang <zhiguang.liu@intel.com> > > > Cc: Dong, Eric <eric.dong@intel.com>; Ni, Ray <ray.ni@intel.com>; Kumar, > > Rahul R <rahul.r.kumar@intel.com>; Gerd Hoffmann <kraxel@redhat.com>; > > Zeng, Star <star.zeng@intel.com> > > > Subject: Re: [edk2-devel] [PATCH] UefiCpuPkg: Calculate DisplayFamily > > correctly > > > > > > Reviewed-by: Star Zeng <star.zeng@intel.com> > > > > > > -----Original Message----- > > > From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of > > Zhiguang Liu > > > Sent: Thursday, March 2, 2023 9:27 AM > > > To: devel@edk2.groups.io > > > Cc: Liu, Zhiguang <zhiguang.liu@intel.com>; Dong, Eric > > <eric.dong@intel.com>; Ni, Ray <ray.ni@intel.com>; Kumar, Rahul R > > <rahul.r.kumar@intel.com>; Gerd Hoffmann <kraxel@redhat.com> > > > Subject: [edk2-devel] [PATCH] UefiCpuPkg: Calculate DisplayFamily > > correctly > > > > > > REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4238 > > > > > > Per SDM, DisplayFamily = Extended_Family_ID + Family_ID. > > > Correct the related code. > > > > > > Cc: Eric Dong <eric.dong@intel.com> > > > Cc: Ray Ni <ray.ni@intel.com> > > > Cc: Rahul Kumar <rahul1.kumar@intel.com> > > > Cc: Gerd Hoffmann <kraxel@redhat.com> > > > Signed-off-by: Zhiguang Liu <zhiguang.liu@intel.com> > > > --- > > > UefiCpuPkg/Application/Cpuid/Cpuid.c | 4 ++-- > > > .../Library/RegisterCpuFeaturesLib/CpuFeaturesInitialize.c | 4 ++-- > > > 2 files changed, 4 insertions(+), 4 deletions(-) > > > > > > diff --git a/UefiCpuPkg/Application/Cpuid/Cpuid.c > > b/UefiCpuPkg/Application/Cpuid/Cpuid.c > > > index 372c6ef87d..51c463fb10 100644 > > > --- a/UefiCpuPkg/Application/Cpuid/Cpuid.c > > > +++ b/UefiCpuPkg/Application/Cpuid/Cpuid.c > > > @@ -1,7 +1,7 @@ > > > /** @file > > > UEFI Application to display CPUID leaf information. > > > > > > - Copyright (c) 2016 - 2019, Intel Corporation. All rights reserved.<BR> > > > + Copyright (c) 2016 - 2023, Intel Corporation. All rights reserved.<BR> > > > SPDX-License-Identifier: BSD-2-Clause-Patent > > > > > > **/ > > > @@ -217,7 +217,7 @@ CpuidVersionInfo ( > > > > > > DisplayFamily = Eax.Bits.FamilyId; > > > if (Eax.Bits.FamilyId == 0x0F) { > > > - DisplayFamily |= (Eax.Bits.ExtendedFamilyId << 4); > > > + DisplayFamily += Eax.Bits.ExtendedFamilyId; > > > } > > > > > > DisplayModel = Eax.Bits.Model; > > > diff --git > > a/UefiCpuPkg/Library/RegisterCpuFeaturesLib/CpuFeaturesInitialize.c > > b/UefiCpuPkg/Library/RegisterCpuFeaturesLib/CpuFeaturesInitialize.c > > > index a8e4f920fc..25b8958252 100644 > > > --- a/UefiCpuPkg/Library/RegisterCpuFeaturesLib/CpuFeaturesInitialize.c > > > +++ b/UefiCpuPkg/Library/RegisterCpuFeaturesLib/CpuFeaturesInitialize.c > > > @@ -1,7 +1,7 @@ > > > /** @file > > > CPU Features Initialize functions. > > > > > > - Copyright (c) 2017 - 2021, Intel Corporation. All rights reserved.<BR> > > > + Copyright (c) 2017 - 2023, Intel Corporation. All rights reserved.<BR> > > > SPDX-License-Identifier: BSD-2-Clause-Patent > > > > > > **/ > > > @@ -67,7 +67,7 @@ FillProcessorInfo ( > > > > > > DisplayedFamily = Eax.Bits.FamilyId; > > > if (Eax.Bits.FamilyId == 0x0F) { > > > - DisplayedFamily |= (Eax.Bits.ExtendedFamilyId << 4); > > > + DisplayedFamily += Eax.Bits.ExtendedFamilyId; > > > } > > > > > > DisplayedModel = Eax.Bits.Model; > > > -- > > > 2.31.1.windows.1 > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > ^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [edk2-devel] [PATCH] UefiCpuPkg: Calculate DisplayFamily correctly 2023-03-06 13:36 ` Mike Maslenkin @ 2023-03-06 15:28 ` Chang, Abner 2023-03-07 1:50 ` Ni, Ray 1 sibling, 0 replies; 12+ messages in thread From: Chang, Abner @ 2023-03-06 15:28 UTC (permalink / raw) To: devel@edk2.groups.io, mike.maslenkin@gmail.com, ray.ni@intel.com [AMD Official Use Only - General] We don’t have that pseudo code in AMD APM, so either way is ok. Acked-by: Abner Chang <abner.chang@amd.com> > -----Original Message----- > From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of Mike > Maslenkin via groups.io > Sent: Monday, March 6, 2023 9:37 PM > To: devel@edk2.groups.io; ray.ni@intel.com > Subject: Re: [edk2-devel] [PATCH] UefiCpuPkg: Calculate DisplayFamily > correctly > > Caution: This message originated from an External Source. Use proper > caution when opening attachments, clicking links, or responding. > > > There is no problem with current implementation. > My proposal was to re-write code in this way: > > DisplayModel = Eax.Bits.Model; > if ((Eax.Bits.FamilyId == 0x06) || (Eax.Bits.FamilyId == 0x0f)) { > DisplayModel += (Eax.Bits.ExtendedModelId << 4); > } > > This is exactly matches spec without knowledge about Model_ID width and > makes code consistent. > > There is no 'OR" operation in rules defined by SDM: > " > IF (Family_ID = 06H or Family_ID = 0FH) > THEN DisplayModel = (Extended_Model_ID « 4) + Model_ID; > (* Right justify and zero-extend 4-bit field; display Model_ID as HEX field.*) > ELSE DisplayModel = Model_ID; FI; " > > > " > > On Mon, Mar 6, 2023 at 2:52 PM Ni, Ray <ray.ni@intel.com> wrote: > > > > ExtendedModelId field should use shift. So I believe nothing wrong there. > > > > > -----Original Message----- > > > From: Mike Maslenkin <mike.maslenkin@gmail.com> > > > Sent: Monday, March 6, 2023 7:14 PM > > > To: devel@edk2.groups.io; Zeng, Star <star.zeng@intel.com> > > > Cc: Liu, Zhiguang <zhiguang.liu@intel.com>; Dong, Eric > > > <eric.dong@intel.com>; Ni, Ray <ray.ni@intel.com>; Kumar, Rahul R > > > <rahul.r.kumar@intel.com>; Gerd Hoffmann <kraxel@redhat.com> > > > Subject: Re: [edk2-devel] [PATCH] UefiCpuPkg: Calculate > > > DisplayFamily correctly > > > > > > Handling of ExtendedModelId field has the same problem. > > > This patch could be improved to fix that too. > > > > > > On Mon, Mar 6, 2023 at 1:37 PM Zeng, Star <star.zeng@intel.com> wrote: > > > > > > > > BTW, look like wrong Bugzilla ID is used in commit message, please > > > > correct > > > it when merging the patch. > > > > > > > > -----Original Message----- > > > > From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of > > > > Zeng, > > > Star > > > > Sent: Monday, March 6, 2023 6:35 PM > > > > To: devel@edk2.groups.io; Liu, Zhiguang <zhiguang.liu@intel.com> > > > > Cc: Dong, Eric <eric.dong@intel.com>; Ni, Ray <ray.ni@intel.com>; > > > > Kumar, > > > Rahul R <rahul.r.kumar@intel.com>; Gerd Hoffmann > > > <kraxel@redhat.com>; Zeng, Star <star.zeng@intel.com> > > > > Subject: Re: [edk2-devel] [PATCH] UefiCpuPkg: Calculate > > > > DisplayFamily > > > correctly > > > > > > > > Reviewed-by: Star Zeng <star.zeng@intel.com> > > > > > > > > -----Original Message----- > > > > From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of > > > Zhiguang Liu > > > > Sent: Thursday, March 2, 2023 9:27 AM > > > > To: devel@edk2.groups.io > > > > Cc: Liu, Zhiguang <zhiguang.liu@intel.com>; Dong, Eric > > > <eric.dong@intel.com>; Ni, Ray <ray.ni@intel.com>; Kumar, Rahul R > > > <rahul.r.kumar@intel.com>; Gerd Hoffmann <kraxel@redhat.com> > > > > Subject: [edk2-devel] [PATCH] UefiCpuPkg: Calculate DisplayFamily > > > correctly > > > > > > > > REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4238 > > > > > > > > Per SDM, DisplayFamily = Extended_Family_ID + Family_ID. > > > > Correct the related code. > > > > > > > > Cc: Eric Dong <eric.dong@intel.com> > > > > Cc: Ray Ni <ray.ni@intel.com> > > > > Cc: Rahul Kumar <rahul1.kumar@intel.com> > > > > Cc: Gerd Hoffmann <kraxel@redhat.com> > > > > Signed-off-by: Zhiguang Liu <zhiguang.liu@intel.com> > > > > --- > > > > UefiCpuPkg/Application/Cpuid/Cpuid.c | 4 ++-- > > > > .../Library/RegisterCpuFeaturesLib/CpuFeaturesInitialize.c | 4 ++-- > > > > 2 files changed, 4 insertions(+), 4 deletions(-) > > > > > > > > diff --git a/UefiCpuPkg/Application/Cpuid/Cpuid.c > > > b/UefiCpuPkg/Application/Cpuid/Cpuid.c > > > > index 372c6ef87d..51c463fb10 100644 > > > > --- a/UefiCpuPkg/Application/Cpuid/Cpuid.c > > > > +++ b/UefiCpuPkg/Application/Cpuid/Cpuid.c > > > > @@ -1,7 +1,7 @@ > > > > /** @file > > > > UEFI Application to display CPUID leaf information. > > > > > > > > - Copyright (c) 2016 - 2019, Intel Corporation. All rights > > > > reserved.<BR> > > > > + Copyright (c) 2016 - 2023, Intel Corporation. All rights > > > > + reserved.<BR> > > > > SPDX-License-Identifier: BSD-2-Clause-Patent > > > > > > > > **/ > > > > @@ -217,7 +217,7 @@ CpuidVersionInfo ( > > > > > > > > DisplayFamily = Eax.Bits.FamilyId; > > > > if (Eax.Bits.FamilyId == 0x0F) { > > > > - DisplayFamily |= (Eax.Bits.ExtendedFamilyId << 4); > > > > + DisplayFamily += Eax.Bits.ExtendedFamilyId; > > > > } > > > > > > > > DisplayModel = Eax.Bits.Model; > > > > diff --git > > > a/UefiCpuPkg/Library/RegisterCpuFeaturesLib/CpuFeaturesInitialize.c > > > b/UefiCpuPkg/Library/RegisterCpuFeaturesLib/CpuFeaturesInitialize.c > > > > index a8e4f920fc..25b8958252 100644 > > > > --- > > > > a/UefiCpuPkg/Library/RegisterCpuFeaturesLib/CpuFeaturesInitialize. > > > > c > > > > +++ b/UefiCpuPkg/Library/RegisterCpuFeaturesLib/CpuFeaturesInitial > > > > +++ ize.c > > > > @@ -1,7 +1,7 @@ > > > > /** @file > > > > CPU Features Initialize functions. > > > > > > > > - Copyright (c) 2017 - 2021, Intel Corporation. All rights > > > > reserved.<BR> > > > > + Copyright (c) 2017 - 2023, Intel Corporation. All rights > > > > + reserved.<BR> > > > > SPDX-License-Identifier: BSD-2-Clause-Patent > > > > > > > > **/ > > > > @@ -67,7 +67,7 @@ FillProcessorInfo ( > > > > > > > > DisplayedFamily = Eax.Bits.FamilyId; > > > > if (Eax.Bits.FamilyId == 0x0F) { > > > > - DisplayedFamily |= (Eax.Bits.ExtendedFamilyId << 4); > > > > + DisplayedFamily += Eax.Bits.ExtendedFamilyId; > > > > } > > > > > > > > DisplayedModel = Eax.Bits.Model; > > > > -- > > > > 2.31.1.windows.1 > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > ^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [edk2-devel] [PATCH] UefiCpuPkg: Calculate DisplayFamily correctly 2023-03-06 13:36 ` Mike Maslenkin 2023-03-06 15:28 ` Chang, Abner @ 2023-03-07 1:50 ` Ni, Ray 2023-03-07 2:44 ` Zhiguang Liu 1 sibling, 1 reply; 12+ messages in thread From: Ni, Ray @ 2023-03-07 1:50 UTC (permalink / raw) To: Mike Maslenkin, devel@edk2.groups.io, Liu, Zhiguang @Liu, Zhiguang, can you check if Mike's suggestion "+" instead of "|" is more matching to SDM? If yes, we can create another code patch. > -----Original Message----- > From: Mike Maslenkin <mike.maslenkin@gmail.com> > Sent: Monday, March 6, 2023 9:37 PM > To: devel@edk2.groups.io; Ni, Ray <ray.ni@intel.com> > Subject: Re: [edk2-devel] [PATCH] UefiCpuPkg: Calculate DisplayFamily > correctly > > There is no problem with current implementation. > My proposal was to re-write code in this way: > > DisplayModel = Eax.Bits.Model; > if ((Eax.Bits.FamilyId == 0x06) || (Eax.Bits.FamilyId == 0x0f)) { > DisplayModel += (Eax.Bits.ExtendedModelId << 4); > } > > This is exactly matches spec without knowledge about Model_ID width > and makes code consistent. > > There is no 'OR" operation in rules defined by SDM: > " > IF (Family_ID = 06H or Family_ID = 0FH) > THEN DisplayModel = (Extended_Model_ID « 4) + Model_ID; > (* Right justify and zero-extend 4-bit field; display Model_ID as > HEX field.*) ELSE DisplayModel = Model_ID; > FI; > " > > > " > > On Mon, Mar 6, 2023 at 2:52 PM Ni, Ray <ray.ni@intel.com> wrote: > > > > ExtendedModelId field should use shift. So I believe nothing wrong there. > > > > > -----Original Message----- > > > From: Mike Maslenkin <mike.maslenkin@gmail.com> > > > Sent: Monday, March 6, 2023 7:14 PM > > > To: devel@edk2.groups.io; Zeng, Star <star.zeng@intel.com> > > > Cc: Liu, Zhiguang <zhiguang.liu@intel.com>; Dong, Eric > > > <eric.dong@intel.com>; Ni, Ray <ray.ni@intel.com>; Kumar, Rahul R > > > <rahul.r.kumar@intel.com>; Gerd Hoffmann <kraxel@redhat.com> > > > Subject: Re: [edk2-devel] [PATCH] UefiCpuPkg: Calculate DisplayFamily > > > correctly > > > > > > Handling of ExtendedModelId field has the same problem. > > > This patch could be improved to fix that too. > > > > > > On Mon, Mar 6, 2023 at 1:37 PM Zeng, Star <star.zeng@intel.com> wrote: > > > > > > > > BTW, look like wrong Bugzilla ID is used in commit message, please > correct > > > it when merging the patch. > > > > > > > > -----Original Message----- > > > > From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of > Zeng, > > > Star > > > > Sent: Monday, March 6, 2023 6:35 PM > > > > To: devel@edk2.groups.io; Liu, Zhiguang <zhiguang.liu@intel.com> > > > > Cc: Dong, Eric <eric.dong@intel.com>; Ni, Ray <ray.ni@intel.com>; > Kumar, > > > Rahul R <rahul.r.kumar@intel.com>; Gerd Hoffmann > <kraxel@redhat.com>; > > > Zeng, Star <star.zeng@intel.com> > > > > Subject: Re: [edk2-devel] [PATCH] UefiCpuPkg: Calculate DisplayFamily > > > correctly > > > > > > > > Reviewed-by: Star Zeng <star.zeng@intel.com> > > > > > > > > -----Original Message----- > > > > From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of > > > Zhiguang Liu > > > > Sent: Thursday, March 2, 2023 9:27 AM > > > > To: devel@edk2.groups.io > > > > Cc: Liu, Zhiguang <zhiguang.liu@intel.com>; Dong, Eric > > > <eric.dong@intel.com>; Ni, Ray <ray.ni@intel.com>; Kumar, Rahul R > > > <rahul.r.kumar@intel.com>; Gerd Hoffmann <kraxel@redhat.com> > > > > Subject: [edk2-devel] [PATCH] UefiCpuPkg: Calculate DisplayFamily > > > correctly > > > > > > > > REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4238 > > > > > > > > Per SDM, DisplayFamily = Extended_Family_ID + Family_ID. > > > > Correct the related code. > > > > > > > > Cc: Eric Dong <eric.dong@intel.com> > > > > Cc: Ray Ni <ray.ni@intel.com> > > > > Cc: Rahul Kumar <rahul1.kumar@intel.com> > > > > Cc: Gerd Hoffmann <kraxel@redhat.com> > > > > Signed-off-by: Zhiguang Liu <zhiguang.liu@intel.com> > > > > --- > > > > UefiCpuPkg/Application/Cpuid/Cpuid.c | 4 ++-- > > > > .../Library/RegisterCpuFeaturesLib/CpuFeaturesInitialize.c | 4 ++-- > > > > 2 files changed, 4 insertions(+), 4 deletions(-) > > > > > > > > diff --git a/UefiCpuPkg/Application/Cpuid/Cpuid.c > > > b/UefiCpuPkg/Application/Cpuid/Cpuid.c > > > > index 372c6ef87d..51c463fb10 100644 > > > > --- a/UefiCpuPkg/Application/Cpuid/Cpuid.c > > > > +++ b/UefiCpuPkg/Application/Cpuid/Cpuid.c > > > > @@ -1,7 +1,7 @@ > > > > /** @file > > > > UEFI Application to display CPUID leaf information. > > > > > > > > - Copyright (c) 2016 - 2019, Intel Corporation. All rights reserved.<BR> > > > > + Copyright (c) 2016 - 2023, Intel Corporation. All rights reserved.<BR> > > > > SPDX-License-Identifier: BSD-2-Clause-Patent > > > > > > > > **/ > > > > @@ -217,7 +217,7 @@ CpuidVersionInfo ( > > > > > > > > DisplayFamily = Eax.Bits.FamilyId; > > > > if (Eax.Bits.FamilyId == 0x0F) { > > > > - DisplayFamily |= (Eax.Bits.ExtendedFamilyId << 4); > > > > + DisplayFamily += Eax.Bits.ExtendedFamilyId; > > > > } > > > > > > > > DisplayModel = Eax.Bits.Model; > > > > diff --git > > > a/UefiCpuPkg/Library/RegisterCpuFeaturesLib/CpuFeaturesInitialize.c > > > b/UefiCpuPkg/Library/RegisterCpuFeaturesLib/CpuFeaturesInitialize.c > > > > index a8e4f920fc..25b8958252 100644 > > > > --- > a/UefiCpuPkg/Library/RegisterCpuFeaturesLib/CpuFeaturesInitialize.c > > > > +++ > b/UefiCpuPkg/Library/RegisterCpuFeaturesLib/CpuFeaturesInitialize.c > > > > @@ -1,7 +1,7 @@ > > > > /** @file > > > > CPU Features Initialize functions. > > > > > > > > - Copyright (c) 2017 - 2021, Intel Corporation. All rights reserved.<BR> > > > > + Copyright (c) 2017 - 2023, Intel Corporation. All rights reserved.<BR> > > > > SPDX-License-Identifier: BSD-2-Clause-Patent > > > > > > > > **/ > > > > @@ -67,7 +67,7 @@ FillProcessorInfo ( > > > > > > > > DisplayedFamily = Eax.Bits.FamilyId; > > > > if (Eax.Bits.FamilyId == 0x0F) { > > > > - DisplayedFamily |= (Eax.Bits.ExtendedFamilyId << 4); > > > > + DisplayedFamily += Eax.Bits.ExtendedFamilyId; > > > > } > > > > > > > > DisplayedModel = Eax.Bits.Model; > > > > -- > > > > 2.31.1.windows.1 > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > ^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [edk2-devel] [PATCH] UefiCpuPkg: Calculate DisplayFamily correctly 2023-03-07 1:50 ` Ni, Ray @ 2023-03-07 2:44 ` Zhiguang Liu 0 siblings, 0 replies; 12+ messages in thread From: Zhiguang Liu @ 2023-03-07 2:44 UTC (permalink / raw) To: Ni, Ray, Mike Maslenkin, devel@edk2.groups.io Yes, I think Mike's comment is good and more align with SDM. Will send another version of patch. Thanks Zhiguang > -----Original Message----- > From: Ni, Ray <ray.ni@intel.com> > Sent: Tuesday, March 7, 2023 9:51 AM > To: Mike Maslenkin <mike.maslenkin@gmail.com>; devel@edk2.groups.io; > Liu, Zhiguang <zhiguang.liu@intel.com> > Subject: RE: [edk2-devel] [PATCH] UefiCpuPkg: Calculate DisplayFamily > correctly > > @Liu, Zhiguang, can you check if Mike's suggestion "+" instead of "|" is more > matching to SDM? > > If yes, we can create another code patch. > > > -----Original Message----- > > From: Mike Maslenkin <mike.maslenkin@gmail.com> > > Sent: Monday, March 6, 2023 9:37 PM > > To: devel@edk2.groups.io; Ni, Ray <ray.ni@intel.com> > > Subject: Re: [edk2-devel] [PATCH] UefiCpuPkg: Calculate DisplayFamily > > correctly > > > > There is no problem with current implementation. > > My proposal was to re-write code in this way: > > > > DisplayModel = Eax.Bits.Model; > > if ((Eax.Bits.FamilyId == 0x06) || (Eax.Bits.FamilyId == 0x0f)) { > > DisplayModel += (Eax.Bits.ExtendedModelId << 4); > > } > > > > This is exactly matches spec without knowledge about Model_ID width > > and makes code consistent. > > > > There is no 'OR" operation in rules defined by SDM: > > " > > IF (Family_ID = 06H or Family_ID = 0FH) > > THEN DisplayModel = (Extended_Model_ID « 4) + Model_ID; > > (* Right justify and zero-extend 4-bit field; display Model_ID as > > HEX field.*) ELSE DisplayModel = Model_ID; FI; " > > > > > > " > > > > On Mon, Mar 6, 2023 at 2:52 PM Ni, Ray <ray.ni@intel.com> wrote: > > > > > > ExtendedModelId field should use shift. So I believe nothing wrong there. > > > > > > > -----Original Message----- > > > > From: Mike Maslenkin <mike.maslenkin@gmail.com> > > > > Sent: Monday, March 6, 2023 7:14 PM > > > > To: devel@edk2.groups.io; Zeng, Star <star.zeng@intel.com> > > > > Cc: Liu, Zhiguang <zhiguang.liu@intel.com>; Dong, Eric > > > > <eric.dong@intel.com>; Ni, Ray <ray.ni@intel.com>; Kumar, Rahul R > > > > <rahul.r.kumar@intel.com>; Gerd Hoffmann <kraxel@redhat.com> > > > > Subject: Re: [edk2-devel] [PATCH] UefiCpuPkg: Calculate DisplayFamily > > > > correctly > > > > > > > > Handling of ExtendedModelId field has the same problem. > > > > This patch could be improved to fix that too. > > > > > > > > On Mon, Mar 6, 2023 at 1:37 PM Zeng, Star <star.zeng@intel.com> > wrote: > > > > > > > > > > BTW, look like wrong Bugzilla ID is used in commit message, please > > correct > > > > it when merging the patch. > > > > > > > > > > -----Original Message----- > > > > > From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of > > Zeng, > > > > Star > > > > > Sent: Monday, March 6, 2023 6:35 PM > > > > > To: devel@edk2.groups.io; Liu, Zhiguang <zhiguang.liu@intel.com> > > > > > Cc: Dong, Eric <eric.dong@intel.com>; Ni, Ray <ray.ni@intel.com>; > > Kumar, > > > > Rahul R <rahul.r.kumar@intel.com>; Gerd Hoffmann > > <kraxel@redhat.com>; > > > > Zeng, Star <star.zeng@intel.com> > > > > > Subject: Re: [edk2-devel] [PATCH] UefiCpuPkg: Calculate > DisplayFamily > > > > correctly > > > > > > > > > > Reviewed-by: Star Zeng <star.zeng@intel.com> > > > > > > > > > > -----Original Message----- > > > > > From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of > > > > Zhiguang Liu > > > > > Sent: Thursday, March 2, 2023 9:27 AM > > > > > To: devel@edk2.groups.io > > > > > Cc: Liu, Zhiguang <zhiguang.liu@intel.com>; Dong, Eric > > > > <eric.dong@intel.com>; Ni, Ray <ray.ni@intel.com>; Kumar, Rahul R > > > > <rahul.r.kumar@intel.com>; Gerd Hoffmann <kraxel@redhat.com> > > > > > Subject: [edk2-devel] [PATCH] UefiCpuPkg: Calculate DisplayFamily > > > > correctly > > > > > > > > > > REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4238 > > > > > > > > > > Per SDM, DisplayFamily = Extended_Family_ID + Family_ID. > > > > > Correct the related code. > > > > > > > > > > Cc: Eric Dong <eric.dong@intel.com> > > > > > Cc: Ray Ni <ray.ni@intel.com> > > > > > Cc: Rahul Kumar <rahul1.kumar@intel.com> > > > > > Cc: Gerd Hoffmann <kraxel@redhat.com> > > > > > Signed-off-by: Zhiguang Liu <zhiguang.liu@intel.com> > > > > > --- > > > > > UefiCpuPkg/Application/Cpuid/Cpuid.c | 4 ++-- > > > > > .../Library/RegisterCpuFeaturesLib/CpuFeaturesInitialize.c | 4 ++-- > > > > > 2 files changed, 4 insertions(+), 4 deletions(-) > > > > > > > > > > diff --git a/UefiCpuPkg/Application/Cpuid/Cpuid.c > > > > b/UefiCpuPkg/Application/Cpuid/Cpuid.c > > > > > index 372c6ef87d..51c463fb10 100644 > > > > > --- a/UefiCpuPkg/Application/Cpuid/Cpuid.c > > > > > +++ b/UefiCpuPkg/Application/Cpuid/Cpuid.c > > > > > @@ -1,7 +1,7 @@ > > > > > /** @file > > > > > UEFI Application to display CPUID leaf information. > > > > > > > > > > - Copyright (c) 2016 - 2019, Intel Corporation. All rights reserved.<BR> > > > > > + Copyright (c) 2016 - 2023, Intel Corporation. All rights reserved.<BR> > > > > > SPDX-License-Identifier: BSD-2-Clause-Patent > > > > > > > > > > **/ > > > > > @@ -217,7 +217,7 @@ CpuidVersionInfo ( > > > > > > > > > > DisplayFamily = Eax.Bits.FamilyId; > > > > > if (Eax.Bits.FamilyId == 0x0F) { > > > > > - DisplayFamily |= (Eax.Bits.ExtendedFamilyId << 4); > > > > > + DisplayFamily += Eax.Bits.ExtendedFamilyId; > > > > > } > > > > > > > > > > DisplayModel = Eax.Bits.Model; > > > > > diff --git > > > > a/UefiCpuPkg/Library/RegisterCpuFeaturesLib/CpuFeaturesInitialize.c > > > > b/UefiCpuPkg/Library/RegisterCpuFeaturesLib/CpuFeaturesInitialize.c > > > > > index a8e4f920fc..25b8958252 100644 > > > > > --- > > a/UefiCpuPkg/Library/RegisterCpuFeaturesLib/CpuFeaturesInitialize.c > > > > > +++ > > b/UefiCpuPkg/Library/RegisterCpuFeaturesLib/CpuFeaturesInitialize.c > > > > > @@ -1,7 +1,7 @@ > > > > > /** @file > > > > > CPU Features Initialize functions. > > > > > > > > > > - Copyright (c) 2017 - 2021, Intel Corporation. All rights reserved.<BR> > > > > > + Copyright (c) 2017 - 2023, Intel Corporation. All rights reserved.<BR> > > > > > SPDX-License-Identifier: BSD-2-Clause-Patent > > > > > > > > > > **/ > > > > > @@ -67,7 +67,7 @@ FillProcessorInfo ( > > > > > > > > > > DisplayedFamily = Eax.Bits.FamilyId; > > > > > if (Eax.Bits.FamilyId == 0x0F) { > > > > > - DisplayedFamily |= (Eax.Bits.ExtendedFamilyId << 4); > > > > > + DisplayedFamily += Eax.Bits.ExtendedFamilyId; > > > > > } > > > > > > > > > > DisplayedModel = Eax.Bits.Model; > > > > > -- > > > > > 2.31.1.windows.1 > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > ^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [edk2-devel] [PATCH] UefiCpuPkg: Calculate DisplayFamily correctly 2023-03-06 10:37 ` Zeng, Star 2023-03-06 11:13 ` Mike Maslenkin @ 2023-03-07 1:23 ` Zhiguang Liu 1 sibling, 0 replies; 12+ messages in thread From: Zhiguang Liu @ 2023-03-07 1:23 UTC (permalink / raw) To: Zeng, Star, devel@edk2.groups.io Cc: Dong, Eric, Ni, Ray, Kumar, Rahul R, Gerd Hoffmann Yes, the bugzilla link should be https://bugzilla.tianocore.org/show_bug.cgi?id=4348 Will correct it when merge the patch. Thanks Star for catching this Thanks Zhiguang > -----Original Message----- > From: Zeng, Star <star.zeng@intel.com> > Sent: Monday, March 6, 2023 6:37 PM > To: devel@edk2.groups.io; Zeng, Star <star.zeng@intel.com>; Liu, Zhiguang > <zhiguang.liu@intel.com> > Cc: Dong, Eric <eric.dong@intel.com>; Ni, Ray <ray.ni@intel.com>; Kumar, > Rahul R <rahul.r.kumar@intel.com>; Gerd Hoffmann <kraxel@redhat.com>; > Zeng, Star <star.zeng@intel.com> > Subject: RE: [edk2-devel] [PATCH] UefiCpuPkg: Calculate DisplayFamily > correctly > > BTW, look like wrong Bugzilla ID is used in commit message, please correct it > when merging the patch. > > -----Original Message----- > From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of Zeng, > Star > Sent: Monday, March 6, 2023 6:35 PM > To: devel@edk2.groups.io; Liu, Zhiguang <zhiguang.liu@intel.com> > Cc: Dong, Eric <eric.dong@intel.com>; Ni, Ray <ray.ni@intel.com>; Kumar, > Rahul R <rahul.r.kumar@intel.com>; Gerd Hoffmann <kraxel@redhat.com>; > Zeng, Star <star.zeng@intel.com> > Subject: Re: [edk2-devel] [PATCH] UefiCpuPkg: Calculate DisplayFamily > correctly > > Reviewed-by: Star Zeng <star.zeng@intel.com> > > -----Original Message----- > From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of > Zhiguang Liu > Sent: Thursday, March 2, 2023 9:27 AM > To: devel@edk2.groups.io > Cc: Liu, Zhiguang <zhiguang.liu@intel.com>; Dong, Eric > <eric.dong@intel.com>; Ni, Ray <ray.ni@intel.com>; Kumar, Rahul R > <rahul.r.kumar@intel.com>; Gerd Hoffmann <kraxel@redhat.com> > Subject: [edk2-devel] [PATCH] UefiCpuPkg: Calculate DisplayFamily correctly > > REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4238 > > Per SDM, DisplayFamily = Extended_Family_ID + Family_ID. > Correct the related code. > > Cc: Eric Dong <eric.dong@intel.com> > Cc: Ray Ni <ray.ni@intel.com> > Cc: Rahul Kumar <rahul1.kumar@intel.com> > Cc: Gerd Hoffmann <kraxel@redhat.com> > Signed-off-by: Zhiguang Liu <zhiguang.liu@intel.com> > --- > UefiCpuPkg/Application/Cpuid/Cpuid.c | 4 ++-- > .../Library/RegisterCpuFeaturesLib/CpuFeaturesInitialize.c | 4 ++-- > 2 files changed, 4 insertions(+), 4 deletions(-) > > diff --git a/UefiCpuPkg/Application/Cpuid/Cpuid.c > b/UefiCpuPkg/Application/Cpuid/Cpuid.c > index 372c6ef87d..51c463fb10 100644 > --- a/UefiCpuPkg/Application/Cpuid/Cpuid.c > +++ b/UefiCpuPkg/Application/Cpuid/Cpuid.c > @@ -1,7 +1,7 @@ > /** @file > UEFI Application to display CPUID leaf information. > > - Copyright (c) 2016 - 2019, Intel Corporation. All rights reserved.<BR> > + Copyright (c) 2016 - 2023, Intel Corporation. All rights reserved.<BR> > SPDX-License-Identifier: BSD-2-Clause-Patent > > **/ > @@ -217,7 +217,7 @@ CpuidVersionInfo ( > > DisplayFamily = Eax.Bits.FamilyId; > if (Eax.Bits.FamilyId == 0x0F) { > - DisplayFamily |= (Eax.Bits.ExtendedFamilyId << 4); > + DisplayFamily += Eax.Bits.ExtendedFamilyId; > } > > DisplayModel = Eax.Bits.Model; > diff --git > a/UefiCpuPkg/Library/RegisterCpuFeaturesLib/CpuFeaturesInitialize.c > b/UefiCpuPkg/Library/RegisterCpuFeaturesLib/CpuFeaturesInitialize.c > index a8e4f920fc..25b8958252 100644 > --- a/UefiCpuPkg/Library/RegisterCpuFeaturesLib/CpuFeaturesInitialize.c > +++ b/UefiCpuPkg/Library/RegisterCpuFeaturesLib/CpuFeaturesInitialize.c > @@ -1,7 +1,7 @@ > /** @file > CPU Features Initialize functions. > > - Copyright (c) 2017 - 2021, Intel Corporation. All rights reserved.<BR> > + Copyright (c) 2017 - 2023, Intel Corporation. All rights reserved.<BR> > SPDX-License-Identifier: BSD-2-Clause-Patent > > **/ > @@ -67,7 +67,7 @@ FillProcessorInfo ( > > DisplayedFamily = Eax.Bits.FamilyId; > if (Eax.Bits.FamilyId == 0x0F) { > - DisplayedFamily |= (Eax.Bits.ExtendedFamilyId << 4); > + DisplayedFamily += Eax.Bits.ExtendedFamilyId; > } > > DisplayedModel = Eax.Bits.Model; > -- > 2.31.1.windows.1 > > > > > > > > > > ^ permalink raw reply [flat|nested] 12+ messages in thread
end of thread, other threads:[~2023-03-07 2:44 UTC | newest] Thread overview: 12+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2023-03-02 1:26 [PATCH] UefiCpuPkg: Calculate DisplayFamily correctly Zhiguang Liu 2023-03-02 1:58 ` Ni, Ray 2023-03-02 7:13 ` Gerd Hoffmann 2023-03-06 10:34 ` [edk2-devel] " Zeng, Star [not found] ` <1749CE106AC7BFA5.3736@groups.io> 2023-03-06 10:37 ` Zeng, Star 2023-03-06 11:13 ` Mike Maslenkin 2023-03-06 11:52 ` Ni, Ray 2023-03-06 13:36 ` Mike Maslenkin 2023-03-06 15:28 ` Chang, Abner 2023-03-07 1:50 ` Ni, Ray 2023-03-07 2:44 ` Zhiguang Liu 2023-03-07 1:23 ` Zhiguang Liu
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox