From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-yb1-f169.google.com (mail-yb1-f169.google.com [209.85.219.169]) by mx.groups.io with SMTP id smtpd.web10.33223.1678109833657755011 for ; Mon, 06 Mar 2023 05:37:13 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20210112 header.b=AF+g7pdn; spf=pass (domain: gmail.com, ip: 209.85.219.169, mailfrom: mike.maslenkin@gmail.com) Received: by mail-yb1-f169.google.com with SMTP id 82so8092128ybn.6 for ; Mon, 06 Mar 2023 05:37:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1678109833; h=content-transfer-encoding:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=juGoOibyFqStQpV8BBGtj9zG/d665LxFEOU8fz/nETE=; b=AF+g7pdn8mlcn21JoyMtsXnO1Fu9DBCpCaLE672fip+oTpwxWT3AyLFFTSXLfqJRVt hLb0dPpgS+IB0vyxlROhkYt2gPv61F+ECvy+rsvOKyBRRm0ZAix0Z0GeTWOqDBYjK2Ae qzErZQLSLyBhkSUlD91ijPP7nKC2Ce2C3s1eI7lnY1uI3mv5gjx5q5wfaGcWBv+eQZQo tsCWMWKjHNiVAswXifw6Hwx3SM7XDX7wYFjXOm7ElRlMsGfbDovDUywhBRSr5lSAhNkB yvnw3n/mveNLdK9f5gSFp4J9HyMlJNgVFxB/ccuqRoQvlomqDqBeUeekjSpPmMbonVNV mcxg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678109833; h=content-transfer-encoding:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=juGoOibyFqStQpV8BBGtj9zG/d665LxFEOU8fz/nETE=; b=0K3FMMj9IsthtF+eaeRYEgO6zTI3wnEfLedJbVDfl/N/EySN7AfhZX5UMIA/YNuCN0 IIE5MS1ZJTvikIMq759MJ2cUwK9TINIh4zmAE5TyD8NFRvNZloUL/+MDuVJHfDX4X+mC uYYHk9jkVUdgPECYNQC0bnm60LKEjaLtHHM91vvoUiQ+yAtFkO6Ohm9sTbCk2tPRvqh9 Xy3dQal8gzqK5uOyyLT5ORVYvQX3rSRTsxvvB+MKNzXRYz+RTogxVdHBZlHM6Cwmsa0C jg5ZugF5gZJDKsezmgp1TVZF5chg5L1+SsMQ8iqqibfZEBqKn+XZbkefJ0JzbAfAjBqK 4Hwg== X-Gm-Message-State: AO0yUKXIxe6Jw8U4gLppzcP0SG2hNviDelJ8qIt0K8EH7xFC8YwPUdg4 BV4foRVaTXe9T3Z8Ff3lroF3Jc2gTs9lzaCOhrxnNDKNWlo20enQnGE= X-Google-Smtp-Source: AK7set/yZwRc39wyapMkp48McWE41t9k8VOJAeaR7RQuAUj53pkv0i2+8fPzuLM7Oiyr0K3yWMoCbyASoM5xeb8n110= X-Received: by 2002:a25:828c:0:b0:9a0:d4d:5d74 with SMTP id r12-20020a25828c000000b009a00d4d5d74mr6432532ybk.3.1678109832757; Mon, 06 Mar 2023 05:37:12 -0800 (PST) MIME-Version: 1.0 References: <20230302012649.1512-1-zhiguang.liu@intel.com> <1749CE106AC7BFA5.3736@groups.io> In-Reply-To: From: "Mike Maslenkin" Date: Mon, 6 Mar 2023 16:36:36 +0300 Message-ID: Subject: Re: [edk2-devel] [PATCH] UefiCpuPkg: Calculate DisplayFamily correctly To: devel@edk2.groups.io, ray.ni@intel.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable There is no problem with current implementation. My proposal was to re-write code in this way: DisplayModel =3D Eax.Bits.Model; if ((Eax.Bits.FamilyId =3D=3D 0x06) || (Eax.Bits.FamilyId =3D=3D 0x0f)) { DisplayModel +=3D (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 =3D 06H or Family_ID =3D 0FH) THEN DisplayModel =3D (Extended_Model_ID =C2=AB 4) + Model_ID; (* Right justify and zero-extend 4-bit field; display Model_ID as HEX field.*) ELSE DisplayModel =3D Model_ID; FI; " " On Mon, Mar 6, 2023 at 2:52=E2=80=AFPM Ni, Ray wrote: > > ExtendedModelId field should use shift. So I believe nothing wrong there. > > > -----Original Message----- > > From: Mike Maslenkin > > Sent: Monday, March 6, 2023 7:14 PM > > To: devel@edk2.groups.io; Zeng, Star > > Cc: Liu, Zhiguang ; Dong, Eric > > ; Ni, Ray ; Kumar, Rahul R > > ; Gerd Hoffmann > > 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=E2=80=AFPM Zeng, Star = wrote: > > > > > > BTW, look like wrong Bugzilla ID is used in commit message, please co= rrect > > it when merging the patch. > > > > > > -----Original Message----- > > > From: devel@edk2.groups.io On Behalf Of Zeng, > > Star > > > Sent: Monday, March 6, 2023 6:35 PM > > > To: devel@edk2.groups.io; Liu, Zhiguang > > > Cc: Dong, Eric ; Ni, Ray ; Kum= ar, > > Rahul R ; Gerd Hoffmann ; > > Zeng, Star > > > Subject: Re: [edk2-devel] [PATCH] UefiCpuPkg: Calculate DisplayFamily > > correctly > > > > > > Reviewed-by: Star Zeng > > > > > > -----Original Message----- > > > From: 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 ; Dong, Eric > > ; Ni, Ray ; Kumar, Rahul R > > ; Gerd Hoffmann > > > Subject: [edk2-devel] [PATCH] UefiCpuPkg: Calculate DisplayFamily > > correctly > > > > > > REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D4238 > > > > > > Per SDM, DisplayFamily =3D Extended_Family_ID + Family_ID. > > > Correct the related code. > > > > > > Cc: Eric Dong > > > Cc: Ray Ni > > > Cc: Rahul Kumar > > > Cc: Gerd Hoffmann > > > Signed-off-by: Zhiguang Liu > > > --- > > > 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.=
> > > + Copyright (c) 2016 - 2023, Intel Corporation. All rights reserved.=
> > > SPDX-License-Identifier: BSD-2-Clause-Patent > > > > > > **/ > > > @@ -217,7 +217,7 @@ CpuidVersionInfo ( > > > > > > DisplayFamily =3D Eax.Bits.FamilyId; > > > if (Eax.Bits.FamilyId =3D=3D 0x0F) { > > > - DisplayFamily |=3D (Eax.Bits.ExtendedFamilyId << 4); > > > + DisplayFamily +=3D Eax.Bits.ExtendedFamilyId; > > > } > > > > > > DisplayModel =3D 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.=
> > > + Copyright (c) 2017 - 2023, Intel Corporation. All rights reserved.=
> > > SPDX-License-Identifier: BSD-2-Clause-Patent > > > > > > **/ > > > @@ -67,7 +67,7 @@ FillProcessorInfo ( > > > > > > DisplayedFamily =3D Eax.Bits.FamilyId; > > > if (Eax.Bits.FamilyId =3D=3D 0x0F) { > > > - DisplayedFamily |=3D (Eax.Bits.ExtendedFamilyId << 4); > > > + DisplayedFamily +=3D Eax.Bits.ExtendedFamilyId; > > > } > > > > > > DisplayedModel =3D Eax.Bits.Model; > > > -- > > > 2.31.1.windows.1 > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > >=20 > >