From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by mx.groups.io with SMTP id smtpd.web10.3813.1582693552869725681 for ; Tue, 25 Feb 2020 21:05:53 -0800 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: intel.com, ip: 192.55.52.151, mailfrom: eric.dong@intel.com) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga006.jf.intel.com ([10.7.209.51]) by fmsmga107.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 25 Feb 2020 21:05:50 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.70,486,1574150400"; d="scan'208";a="241549835" Received: from fmsmsx106.amr.corp.intel.com ([10.18.124.204]) by orsmga006.jf.intel.com with ESMTP; 25 Feb 2020 21:05:50 -0800 Received: from fmsmsx154.amr.corp.intel.com (10.18.116.70) by FMSMSX106.amr.corp.intel.com (10.18.124.204) with Microsoft SMTP Server (TLS) id 14.3.439.0; Tue, 25 Feb 2020 21:05:49 -0800 Received: from shsmsx103.ccr.corp.intel.com (10.239.4.69) by FMSMSX154.amr.corp.intel.com (10.18.116.70) with Microsoft SMTP Server (TLS) id 14.3.439.0; Tue, 25 Feb 2020 21:05:49 -0800 Received: from shsmsx102.ccr.corp.intel.com ([169.254.2.126]) by SHSMSX103.ccr.corp.intel.com ([169.254.4.196]) with mapi id 14.03.0439.000; Wed, 26 Feb 2020 13:05:47 +0800 From: "Dong, Eric" To: "Duran, Leo" , "devel@edk2.groups.io" CC: "Ni, Ray" , Laszlo Ersek Subject: Re: [PATCH 1/2] UefiCpuPkg: LocalApicLib: Export StandardSignatureIsAuthenticAMD function Thread-Topic: [PATCH 1/2] UefiCpuPkg: LocalApicLib: Export StandardSignatureIsAuthenticAMD function Thread-Index: AQHV7BOC6MjVK7yhEUeIFwHCQWaU+qgsquWA//+TVQCAAK2qUA== Date: Wed, 26 Feb 2020 05:05:46 +0000 Message-ID: References: <1582659566-9893-1-git-send-email-leo.duran@amd.com> <1582659566-9893-2-git-send-email-leo.duran@amd.com> In-Reply-To: Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiZTU5ZGZiYWUtYjZiYy00MTViLThjZTAtMzYzYmU1NDE2NzU4IiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiMHEwTTUxNHUzTjd0bEZkN2pjaVg1XC9CU1pZY3JWS0J1MEs0NFcwUFpkSlRlQ1pRRk81a09BTHpoQ3FhTTI4Y2MifQ== x-ctpclassification: CTP_NT dlp-product: dlpe-windows dlp-version: 11.2.0.6 dlp-reaction: no-action x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Return-Path: eric.dong@intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Hi Leo, Yes, I means you also change the cod position in the c file, so in the patc= h file, it seems like it has other changes.=20 My recommendation is to refine the patch to not change the code postion. -----Original Message----- From: Duran, Leo =20 Sent: Wednesday, February 26, 2020 10:41 AM To: Dong, Eric ; devel@edk2.groups.io Cc: Ni, Ray ; Laszlo Ersek Subject: RE: [PATCH 1/2] UefiCpuPkg: LocalApicLib: Export StandardSignature= IsAuthenticAMD function Hi Eric, I added EFIAPI as the function is now intended to be called externally, as = a member of "LocalApicLib". And to that end I added the function prototype in UefiCpuPkg/Include/Librar= y/LocalApicLib,h. But perhaps I've misunderstood your question? Thanks, Leo. > -----Original Message----- > From: Dong, Eric [mailto:eric.dong@intel.com] > Sent: Tuesday, February 25, 2020 8:13 PM > To: Duran, Leo ; devel@edk2.groups.io > Cc: Ni, Ray ; Laszlo Ersek > Subject: RE: [PATCH 1/2] UefiCpuPkg: LocalApicLib: Export=20 > StandardSignatureIsAuthenticAMD function >=20 > Hi Leo, >=20 > I check the code and find the real change for the C files are add=20 > "EFIAPI" in the code. Can you help to refine the change and only keep th= e real changes? >=20 > Thanks, > Eric >=20 > -----Original Message----- > From: Leo Duran > Sent: Wednesday, February 26, 2020 3:39 AM > To: devel@edk2.groups.io > Cc: Leo Duran ; Dong, Eric ;=20 > Ni, Ray ; Laszlo Ersek > Subject: [PATCH 1/2] UefiCpuPkg: LocalApicLib: Export=20 > StandardSignatureIsAuthenticAMD function >=20 > REF: > https://nam11.safelinks.protection.outlook.com/?url=3Dhttps%3A%2F%2Fbugz > ill a.tianocore.org%2Fshow_bug.cgi%3Fid%3D2556&data=3D02%7C01%7Cleo. > duran%40amd.com%7C19e3e4c20ffa41d8de8508d7ba591944%7C3dd8961f > e4884e608e11a82d994e183d%7C0%7C0%7C637182764151879166&s > data=3Dn%2B3eeGu7%2BvmVCz2QP6aeJuiqQ08gX5ZaCAuDkNMO%2Bb8%3D&a > mp;reserved=3D0 >=20 > The StandardSignatureIsAuthenticAMD function was introduced locally to=20 > help divert code paths pertinent (or not) to AMD processors. > This patch exports that function so that it may serve the same purpose=20 > in other modules that consume LocalApicLib. >=20 > Cc: Eric Dong > Cc: Ray Ni > Cc: Laszlo Ersek > Signed-off-by: Leo Duran > --- > UefiCpuPkg/Include/Library/LocalApicLib.h | 15 +++++++ > UefiCpuPkg/Library/BaseXApicLib/BaseXApicLib.c | 47 +++++++++++-----= --- > --- > .../BaseXApicX2ApicLib/BaseXApicX2ApicLib.c | 47 +++++++++++-----= ----- > - > 3 files changed, 63 insertions(+), 46 deletions(-) >=20 > diff --git a/UefiCpuPkg/Include/Library/LocalApicLib.h > b/UefiCpuPkg/Include/Library/LocalApicLib.h > index 96b93aa..a6e9dc6 100644 > --- a/UefiCpuPkg/Include/Library/LocalApicLib.h > +++ b/UefiCpuPkg/Include/Library/LocalApicLib.h > @@ -5,6 +5,8 @@ > handles cases where local APIC is disabled. >=20 > Copyright (c) 2010 - 2019, Intel Corporation. All rights=20 > reserved.
> + Copyright (c) 2020, AMD Inc. All rights reserved.
> + > SPDX-License-Identifier: BSD-2-Clause-Patent >=20 > **/ > @@ -16,6 +18,19 @@ > #define LOCAL_APIC_MODE_X2APIC 0x2 ///< x2APIC mode. >=20 > /** > + Determine if the standard CPU signature is "AuthenticAMD". > + > + @retval TRUE The CPU signature matches. > + @retval FALSE The CPU signature does not match. > + > +**/ > +BOOLEAN > +EFIAPI > +StandardSignatureIsAuthenticAMD ( > + VOID > + ); > + > +/** > Retrieve the base address of local APIC. >=20 > @return The base address of local APIC. > diff --git a/UefiCpuPkg/Library/BaseXApicLib/BaseXApicLib.c > b/UefiCpuPkg/Library/BaseXApicLib/BaseXApicLib.c > index 33ea15c..cebf1b3 100644 > --- a/UefiCpuPkg/Library/BaseXApicLib/BaseXApicLib.c > +++ b/UefiCpuPkg/Library/BaseXApicLib/BaseXApicLib.c > @@ -4,7 +4,7 @@ > This local APIC library instance supports xAPIC mode only. >=20 > Copyright (c) 2010 - 2019, Intel Corporation. All rights=20 > reserved.
> - Copyright (c) 2017, AMD Inc. All rights reserved.
> + Copyright (c) 2017 - 2020, AMD Inc. All rights reserved.
>=20 > SPDX-License-Identifier: BSD-2-Clause-Patent >=20 > @@ -27,28 +27,6 @@ > // >=20 > /** > - Determine if the standard CPU signature is "AuthenticAMD". > - > - @retval TRUE The CPU signature matches. > - @retval FALSE The CPU signature does not match. > - > -**/ > -BOOLEAN > -StandardSignatureIsAuthenticAMD ( > - VOID > - ) > -{ > - UINT32 RegEbx; > - UINT32 RegEcx; > - UINT32 RegEdx; > - > - AsmCpuid (CPUID_SIGNATURE, NULL, &RegEbx, &RegEcx, &RegEdx); > - return (RegEbx =3D=3D CPUID_SIGNATURE_AUTHENTIC_AMD_EBX && > - RegEcx =3D=3D CPUID_SIGNATURE_AUTHENTIC_AMD_ECX && > - RegEdx =3D=3D CPUID_SIGNATURE_AUTHENTIC_AMD_EDX); > -} > - > -/** > Determine if the CPU supports the Local APIC Base Address MSR. >=20 > @retval TRUE The CPU supports the Local APIC Base Address MSR. > @@ -76,6 +54,29 @@ LocalApicBaseAddressMsrSupported ( } >=20 > /** > + Determine if the standard CPU signature is "AuthenticAMD". > + > + @retval TRUE The CPU signature matches. > + @retval FALSE The CPU signature does not match. > + > +**/ > +BOOLEAN > +EFIAPI > +StandardSignatureIsAuthenticAMD ( > + VOID > + ) > +{ > + UINT32 RegEbx; > + UINT32 RegEcx; > + UINT32 RegEdx; > + > + AsmCpuid (CPUID_SIGNATURE, NULL, &RegEbx, &RegEcx, &RegEdx); > + return (RegEbx =3D=3D CPUID_SIGNATURE_AUTHENTIC_AMD_EBX && > + RegEcx =3D=3D CPUID_SIGNATURE_AUTHENTIC_AMD_ECX && > + RegEdx =3D=3D CPUID_SIGNATURE_AUTHENTIC_AMD_EDX); > +} > + > +/** > Retrieve the base address of local APIC. >=20 > @return The base address of local APIC. > diff --git=20 > a/UefiCpuPkg/Library/BaseXApicX2ApicLib/BaseXApicX2ApicLib.c > b/UefiCpuPkg/Library/BaseXApicX2ApicLib/BaseXApicX2ApicLib.c > index d0f92b3..01996b1 100644 > --- a/UefiCpuPkg/Library/BaseXApicX2ApicLib/BaseXApicX2ApicLib.c > +++ b/UefiCpuPkg/Library/BaseXApicX2ApicLib/BaseXApicX2ApicLib.c > @@ -5,7 +5,7 @@ > which have xAPIC and x2APIC modes. >=20 > Copyright (c) 2010 - 2019, Intel Corporation. All rights=20 > reserved.
> - Copyright (c) 2017, AMD Inc. All rights reserved.
> + Copyright (c) 2017 - 2020, AMD Inc. All rights reserved.
>=20 > SPDX-License-Identifier: BSD-2-Clause-Patent >=20 > @@ -28,28 +28,6 @@ > // >=20 > /** > - Determine if the standard CPU signature is "AuthenticAMD". > - > - @retval TRUE The CPU signature matches. > - @retval FALSE The CPU signature does not match. > - > -**/ > -BOOLEAN > -StandardSignatureIsAuthenticAMD ( > - VOID > - ) > -{ > - UINT32 RegEbx; > - UINT32 RegEcx; > - UINT32 RegEdx; > - > - AsmCpuid (CPUID_SIGNATURE, NULL, &RegEbx, &RegEcx, &RegEdx); > - return (RegEbx =3D=3D CPUID_SIGNATURE_AUTHENTIC_AMD_EBX && > - RegEcx =3D=3D CPUID_SIGNATURE_AUTHENTIC_AMD_ECX && > - RegEdx =3D=3D CPUID_SIGNATURE_AUTHENTIC_AMD_EDX); > -} > - > -/** > Determine if the CPU supports the Local APIC Base Address MSR. >=20 > @retval TRUE The CPU supports the Local APIC Base Address MSR. > @@ -77,6 +55,29 @@ LocalApicBaseAddressMsrSupported ( } >=20 > /** > + Determine if the standard CPU signature is "AuthenticAMD". > + > + @retval TRUE The CPU signature matches. > + @retval FALSE The CPU signature does not match. > + > +**/ > +BOOLEAN > +EFIAPI > +StandardSignatureIsAuthenticAMD ( > + VOID > + ) > +{ > + UINT32 RegEbx; > + UINT32 RegEcx; > + UINT32 RegEdx; > + > + AsmCpuid (CPUID_SIGNATURE, NULL, &RegEbx, &RegEcx, &RegEdx); > + return (RegEbx =3D=3D CPUID_SIGNATURE_AUTHENTIC_AMD_EBX && > + RegEcx =3D=3D CPUID_SIGNATURE_AUTHENTIC_AMD_ECX && > + RegEdx =3D=3D CPUID_SIGNATURE_AUTHENTIC_AMD_EDX); > +} > + > +/** > Retrieve the base address of local APIC. >=20 > @return The base address of local APIC. > -- > 2.7.4