From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from NAM02-BL2-obe.outbound.protection.outlook.com (NAM02-BL2-obe.outbound.protection.outlook.com [40.107.75.42]) by mx.groups.io with SMTP id smtpd.web12.2184.1582684891413722183 for ; Tue, 25 Feb 2020 18:41:31 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@amdcloud.onmicrosoft.com header.s=selector2-amdcloud-onmicrosoft-com header.b=vxm+Gk4w; spf=none, err=SPF record not found (domain: amd.com, ip: 40.107.75.42, mailfrom: leo.duran@amd.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=UhyBttQ7NRa5kPSSi6HwdUOsQJ1JGXCfm3M3IpSOxVI3E6QHEtg+AqZLFiWg6kqLj1U4+pYLQMkahkD80kojUkB3y36+tfHz7T1ImG/K3qz8iMEGioTkuD9zK0KTlnq1KMUMTeV4yU7iTZSXA2VRtzWctKX3O1scD43OPMZqsRg/gBNkmWQrO8rpB6BZ+C5mZHlCJvfSjnK082F+7ONfnRXl7jVPkYktmk/9r6TY4q2rRpay5YMVOwjwGtHKjDAX8TJAZ6XBOF9QRqbWXlwOFg9S6CWnxZOEALJCjy6S4oApCtJoVE69CcYCv9OZru1HhBUKdLRM09fYL4dFlJpLPA== 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=IFWFEET9jzdm13ObxFWZvIRPSXdbitS4YPD627xO+hk=; b=iCKnMxYpHxDpAatipUTAZUaS/Lahh1HDlZFvQm039ik3xDky3L5XaH6J7lM/+VZuxSWFjPBc/ja/je82FFaRRECZmFvfNE3I7/YdDkunk97yrEn9a3QIpgy9IQVKHz8rwi65MuOpN9ZCZ7htq3ab12blNzBXjGkl/x0mGUuMehHCH9mLQYhiqreHch/Z6jJMk9+SLw73rMS1vpml/hnDe3PUP8EP0pTpHOsy5yrH2RklzUUIGNRGQ3wvWvK8JOLa835iLk2cdpVDilgPyiHkaLI1BbDmnArcvAuQZyO/87ASRlVLR/UxGiY1qG+ybG/KEtYJFbP1zm/h6g/x9ZwHHQ== 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=IFWFEET9jzdm13ObxFWZvIRPSXdbitS4YPD627xO+hk=; b=vxm+Gk4wJoYuVyRebgfnVwQYNosHj+L203RVxOcL4JzhWihp9xEhdo7BOZle367IU7IJHSBMWdbKe7hL7sG7+EZW0mQCgBprRfRuSKM8IUW1iK3Cu6tAPzv53yO7pXCYP58XdYWhWEtGs/QRioiDpVLThGzNQC/kTTNtmqSOJsA= Received: from BN6PR12MB1922.namprd12.prod.outlook.com (2603:10b6:404:106::14) by BN6PR12MB1827.namprd12.prod.outlook.com (2603:10b6:404:fd::22) 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 02:41:29 +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 02:41:28 +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: AQHV7BNzW5NTADVc5E2Fs4Spy7z77qgsq76AgAAWQpA= Date: Wed, 26 Feb 2020 02:41:28 +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: [165.204.25.250] x-ms-publictraffictype: Email x-ms-office365-filtering-ht: Tenant x-ms-office365-filtering-correlation-id: 88af8573-90f0-43fc-0b12-08d7ba6561a9 x-ms-traffictypediagnostic: BN6PR12MB1827: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:6430; x-forefront-prvs: 0325F6C77B x-forefront-antispam-report: SFV:NSPM;SFS:(10001)(10009020)(6029001)(4636009)(366004)(376002)(396003)(346002)(39860400002)(136003)(189003)(199004)(7696005)(66946007)(66446008)(66476007)(45080400002)(64756008)(66556008)(71200400001)(9686003)(966005)(6506007)(76116006)(53546011)(478600001)(19627235002)(5660300002)(33656002)(52536014)(110136005)(4326008)(54906003)(316002)(8936002)(86362001)(8676002)(2906002)(81156014)(55016002)(81166006)(26005)(186003);DIR:OUT;SFP:1101;SCL:1;SRVR:BN6PR12MB1827;H:BN6PR12MB1922.namprd12.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;MX:1;A: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: gwjAQ73sLVBvWoldi6mE7YMO4O4LOeJffDEtyV+yTGmL3PxtrlOIWGbKIRAAqHsWyX8/zCdN5YEHiy6B3wHoNl0xMObowDEVg5ZGv5Ve07UfbvGBRhFaY97UO8/L0G0t96caopqFWcXcbzTqIg1jFgqMOnjRbgdkKFF0lzRlROS1ULJ3nWaXfurpgIgYfzuhbuu7DxkntglMmdxCq/ZZTi/MQAHbr/ctSF5yjfA6tX6rJ0pcCsEFbl1e/ZKESAZeHb+GmloPjb/ODHEDpbrglVrlLQZvVo98UL9kVh5i58zNSBx+IZv/kNu1ziabhVWmbyo+V64eF850nVS88SoXp5eSSYkK7KF1SN4/UeLFZit6rsTx/ncWOgt1Mztlkwq1/g8EytIP0tA6EW5BhP+DX4r0Eo6cq5UJeCsQehdJXtCCL+eE5yGcPd4KXVRZdCBwu8fdM+BrnK13aiQePweZc81UdHqErLbZyGvZzfI35zTjCH8KSJWamijQZhbQ/R2nrXceh/4CJew83v3DVN5QjY89mXu9A2UzusPnZSM9N5UE92smSu+z0u9JAvo4QKbM5xykfUy+/DlnV+k1O58xxGHCU4UP5rmSEFA7BijwqeiqtUSf45GHapqUwINbO3bo x-ms-exchange-antispam-messagedata: JaejjWxGrTTikVdUm3OyWBkjqq2OxsjYnORcIG4pgTozJHablMOZY364Y1To8t74KgEYtugg08oxSxSeRv2VT+iIUcp5Scq5MFMPRDdAiwadzH9t5vxPnYTq/qTiYHr4X8SuoWOjM6cZMfeGe/ViLA== x-ms-exchange-transport-forked: True MIME-Version: 1.0 X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: 88af8573-90f0-43fc-0b12-08d7ba6561a9 X-MS-Exchange-CrossTenant-originalarrivaltime: 26 Feb 2020 02:41:28.7506 (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: kFnkAj9jhDKiyzPifuhRfHe3Dg9WZ1PsNYSS87DTxz+y7WDGvlO8zZ66UeettJz1 X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR12MB1827 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable 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 > StandardSignatureIsAuthenticAMD function >=20 > Hi Leo, >=20 > 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 chang= es? >=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 ; Ni, > Ray ; Laszlo Ersek > Subject: [PATCH 1/2] UefiCpuPkg: LocalApicLib: Export > StandardSignatureIsAuthenticAMD function >=20 > REF: > https://nam11.safelinks.protection.outlook.com/?url=3Dhttps%3A%2F%2Fbugzi= ll > 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 > 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. >=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 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 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 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 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