From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from NAM10-MW2-obe.outbound.protection.outlook.com (NAM10-MW2-obe.outbound.protection.outlook.com [40.107.94.63]) by mx.groups.io with SMTP id smtpd.web09.10179.1582732791792633633 for ; Wed, 26 Feb 2020 07:59:52 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@amdcloud.onmicrosoft.com header.s=selector2-amdcloud-onmicrosoft-com header.b=1N18G34n; spf=none, err=SPF record not found (domain: amd.com, ip: 40.107.94.63, mailfrom: leo.duran@amd.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ksS9VjZV3UsCSqdePtfSlcwTN4M/FpVLpSAi6UOmmSNzYKWtO6FL5d43cI34g0Xf6xvw3Eu3jYm8xh3gpvNTwZ6sHBTyCi4PDPYUO+xJ8KW3MPtyY1xaiHQ12Csm4F1lNdur6qsiV58RaM4hw+9mb7W7ZKaXLfy434Nc9GBDFn1l+CIxEzJEQfdvm82QA9cyZUFRMJxfMJPms6R4KlqWsqk1zGXL7663c7X3mdnoHWlvraPAP118kqym3UrsZKgHpk0fTJfkRtnhbmURsPLccA0MMFW+rPGpPptTN60MHhG7WYd8qi2tCT7k9PYtT2LVTxdY0Ci1H8SpE0kif++yhg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=uQ0YLkGdCC4pf/PAfG9rgYcK8sTNyjnhRGB5DOIIxNM=; b=JDzAcKzyIidquWw4Tt8znBh28D0WBV/q15zPqjMTGr2h0MYblAyhweM7th9VJbJsffHqpWH7fLFgGwviskS/i91By1yzU1dSrOAGKCSe1WRltzblcbgNFSrmkDPrHrnq/68GsocY06rqnAtT3Uxowq9tibj7fZVMJ6sMO4x0FBPHzJPzSbl0hLf22j94dyHp0JpX0b2L9Q63MDTPsx0MEFYYCnxFbYU2FmcWweh6FREQOTuE65V3G8Rsx+kAddOpZBr90Xg8Bx00Ga1J7KWm5wmJuw++DBKiLz8i4FC40mxiqGBrrNUUBW3OXbgoqedg4vz9hC/s9LtoCEV9srdJyw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass header.d=amd.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amdcloud.onmicrosoft.com; s=selector2-amdcloud-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=uQ0YLkGdCC4pf/PAfG9rgYcK8sTNyjnhRGB5DOIIxNM=; b=1N18G34nUBTtJrLbtywCV8Knnxs/v8Zf9oQt3rvxl5m1VCoTYrMgJX0NE4hwYguyTvLq/kapFys9GL177k2jYbideifAeNW82wQDnpGj2/uslZcs4jwBaCzCF2JLxqFqbf67oMj3l+vW4xo5tX3aMXe/ZO/iqbt5wtV/SigGLpg= Received: from BN6PR12MB1922.namprd12.prod.outlook.com (2603:10b6:404:106::14) by BN6PR12MB1313.namprd12.prod.outlook.com (2603:10b6:404:18::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2750.21; Wed, 26 Feb 2020 15:59:49 +0000 Received: from BN6PR12MB1922.namprd12.prod.outlook.com ([fe80::d931:1942:a6b5:d74c]) by BN6PR12MB1922.namprd12.prod.outlook.com ([fe80::d931:1942:a6b5:d74c%7]) with mapi id 15.20.2750.021; Wed, 26 Feb 2020 15:59:49 +0000 From: "Duran, Leo" To: "Dong, Eric" , "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: AQHV7BNzW5NTADVc5E2Fs4Spy7z77qgsq76AgAAWQpCAACqnAIAAtYvA Date: Wed, 26 Feb 2020 15:59:48 +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: authentication-results: spf=none (sender IP is ) smtp.mailfrom=leo.duran@amd.com; x-originating-ip: [173.170.80.115] x-ms-publictraffictype: Email x-ms-office365-filtering-ht: Tenant x-ms-office365-filtering-correlation-id: 025539dc-7b57-49f6-edda-08d7bad4e87b x-ms-traffictypediagnostic: BN6PR12MB1313: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:6790; x-forefront-prvs: 0325F6C77B x-forefront-antispam-report: SFV:NSPM;SFS:(10001)(10009020)(6029001)(4636009)(136003)(376002)(366004)(346002)(396003)(39860400002)(199004)(189003)(71200400001)(8676002)(5660300002)(2906002)(81156014)(478600001)(81166006)(66476007)(55016002)(52536014)(6506007)(66556008)(110136005)(66946007)(8936002)(4326008)(54906003)(9686003)(66446008)(64756008)(53546011)(316002)(19627235002)(33656002)(186003)(26005)(7696005)(86362001)(966005)(45080400002)(76116006);DIR:OUT;SFP:1101;SCL:1;SRVR:BN6PR12MB1313;H:BN6PR12MB1922.namprd12.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;A:1;MX:1; received-spf: None (protection.outlook.com: amd.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: HEpAidGX7p4XaVoQN4QascChX7sC1sRcfmPgpHAwZqN+ois4ij1E0+EBrBz9nMyNzkgqdcIb+PyGS7/fR/q7nR3ggfdrWeLMmDrmiblQghwEPLaYEe4ULii8SNLcPs7OQPkQt/H82n0uBv6Mz1PiB5LLQ5x+aEuYuQxP6945KVQBm64wm+5BzQtKjlaamBVABXqdcE2X9W5sUl9YzJATkzCaC8oZDVrQFFwiWHgl3bgQGkJyLiGFRGsmb1phHSJLJ0pAmDgqWSGqmJDxbNmnnP8E/MMOHHDPhvAyQsNPkys993Zjz31QshiMo36MVZ/gqatbHIbeaFBE0T0WcIGaG2CuAfpBD1HHb3iKNOWLcunimntfuYkCxCHeNw7rSVnSjGeiVkFsWvlW+JKYnRr4mnTygwRwosetl4jfn42KW62ojTWMZB7uhrsTYOzyLc43mKIZZyf23LeupOHWXENkJ2Ud9sgUgF05DRVnVL7z4WSHZBZpdIo0qtzcg7D1LcrNfa/zdurfHjzb8FY5pTmlQrnB3xeeiBikk6LUG/jKnFvP638POisEqhUe9JV1T6ggiqJaajL86mkQrvF0ssigkMnEr7A50AY++jljWufHZTrBB/hWj+VrpGFi/seYYHGY x-ms-exchange-antispam-messagedata: i+onJxF+ynW/RIMbWq5nMtoFSZUiY0yyZff0CRI9YJ1HQnMy/d2ZweKNXsvfT6HIX/YVZzxeNk9jId9CrUpw2R0gwHDzXkeKKXWfM7yp7H1xCUXvv8wTGgH7zwwxFIRfFHREIn4CCgr8tONI9Lq+yA== x-ms-exchange-transport-forked: True MIME-Version: 1.0 X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: 025539dc-7b57-49f6-edda-08d7bad4e87b X-MS-Exchange-CrossTenant-originalarrivaltime: 26 Feb 2020 15:59:49.0284 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: rUpQrj2kw7Vk14YOnjPc0DqLvvsagCVWBP/cai7W8H7BHRHV5JKdeaqCcTb3Mm6U X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR12MB1313 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable > -----Original Message----- > From: Dong, Eric [mailto:eric.dong@intel.com] > Sent: Wednesday, February 26, 2020 12:06 AM > To: Duran, Leo ; devel@edk2.groups.io > Cc: Ni, Ray ; Laszlo Ersek > Subject: RE: [PATCH 1/2] UefiCpuPkg: LocalApicLib: Export > StandardSignatureIsAuthenticAMD function >=20 > Hi Leo, >=20 > Yes, I means you also change the cod position in the c file, so in the pa= tch file, > it seems like it has other changes. > My recommendation is to refine the patch to not change the code postion. [Duran, Leo]=20 Hi Eric, Apologies for my replies being out of order. Actually, changing code position was done on purpose! :-). For details, please refer to my reply Laszlo on the same topic. Thanks, Leo. >=20 > -----Original Message----- > From: Duran, Leo > 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 > StandardSignatureIsAuthenticAMD function >=20 > Hi Eric, >=20 > I added EFIAPI as the function is now intended to be called externally, a= s a > member of "LocalApicLib". > And to that end I added the function prototype in > UefiCpuPkg/Include/Library/LocalApicLib,h. >=20 > But perhaps I've misunderstood your question? >=20 > Thanks, > Leo. >=20 >=20 > > -----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 > > StandardSignatureIsAuthenticAMD function > > > > Hi Leo, > > > > I check the code and find the real change for the C files are add > > "EFIAPI" in the code. Can you help to refine the change and only keep = the > real changes? > > > > Thanks, > > Eric > > > > -----Original Message----- > > From: Leo Duran > > Sent: Wednesday, February 26, 2020 3:39 AM > > To: devel@edk2.groups.io > > Cc: Leo Duran ; Dong, Eric ; > > Ni, Ray ; Laszlo Ersek > > Subject: [PATCH 1/2] UefiCpuPkg: LocalApicLib: Export > > StandardSignatureIsAuthenticAMD function > > > > REF: > > https://nam11.safelinks.protection.outlook.com/?url=3Dhttps%3A%2F%2Fbug= z > > 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 > > > > The StandardSignatureIsAuthenticAMD function was introduced locally to > > help divert code paths pertinent (or not) to AMD processors. > > This patch exports that function so that it may serve the same purpose > > in other modules that consume LocalApicLib. > > > > 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(-) > > > > 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. > > > > Copyright (c) 2010 - 2019, Intel Corporation. All rights > > reserved.
> > + Copyright (c) 2020, AMD Inc. All rights reserved.
> > + > > SPDX-License-Identifier: BSD-2-Clause-Patent > > > > **/ > > @@ -16,6 +18,19 @@ > > #define LOCAL_APIC_MODE_X2APIC 0x2 ///< x2APIC mode. > > > > /** > > + 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. > > > > @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. > > > > Copyright (c) 2010 - 2019, Intel Corporation. All rights > > reserved.
> > - Copyright (c) 2017, AMD Inc. All rights reserved.
> > + Copyright (c) 2017 - 2020, AMD Inc. All rights reserved.
> > > > SPDX-License-Identifier: BSD-2-Clause-Patent > > > > @@ -27,28 +27,6 @@ > > // > > > > /** > > - 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. > > > > @retval TRUE The CPU supports the Local APIC Base Address MSR. > > @@ -76,6 +54,29 @@ LocalApicBaseAddressMsrSupported ( } > > > > /** > > + 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. > > > > @return The base address of local APIC. > > diff --git > > 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. > > > > Copyright (c) 2010 - 2019, Intel Corporation. All rights > > reserved.
> > - Copyright (c) 2017, AMD Inc. All rights reserved.
> > + Copyright (c) 2017 - 2020, AMD Inc. All rights reserved.
> > > > SPDX-License-Identifier: BSD-2-Clause-Patent > > > > @@ -28,28 +28,6 @@ > > // > > > > /** > > - 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. > > > > @retval TRUE The CPU supports the Local APIC Base Address MSR. > > @@ -77,6 +55,29 @@ LocalApicBaseAddressMsrSupported ( } > > > > /** > > + 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. > > > > @return The base address of local APIC. > > -- > > 2.7.4