public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Duran, Leo" <leo.duran@amd.com>
To: "Dong, Eric" <eric.dong@intel.com>,
	"devel@edk2.groups.io" <devel@edk2.groups.io>
Cc: "Ni, Ray" <ray.ni@intel.com>, Laszlo Ersek <lersek@redhat.com>
Subject: Re: [PATCH 1/2] UefiCpuPkg: LocalApicLib: Export StandardSignatureIsAuthenticAMD function
Date: Wed, 26 Feb 2020 15:59:48 +0000	[thread overview]
Message-ID: <BN6PR12MB192276AFFB5E7C4C7094DFA6F9EA0@BN6PR12MB1922.namprd12.prod.outlook.com> (raw)
In-Reply-To: <ED077930C258884BBCB450DB737E662259FD16CA@shsmsx102.ccr.corp.intel.com>



> -----Original Message-----
> From: Dong, Eric [mailto:eric.dong@intel.com]
> Sent: Wednesday, February 26, 2020 12:06 AM
> To: Duran, Leo <leo.duran@amd.com>; devel@edk2.groups.io
> Cc: Ni, Ray <ray.ni@intel.com>; Laszlo Ersek <lersek@redhat.com>
> Subject: RE: [PATCH 1/2] UefiCpuPkg: LocalApicLib: Export
> StandardSignatureIsAuthenticAMD function
> 
> Hi Leo,
> 
> Yes, I means you also change the cod position in the c file, so in the patch file,
> it seems like it has other changes.
> My recommendation is to refine the patch to not change the code postion.
[Duran, Leo] 
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.

> 
> -----Original Message-----
> From: Duran, Leo <leo.duran@amd.com>
> Sent: Wednesday, February 26, 2020 10:41 AM
> To: Dong, Eric <eric.dong@intel.com>; devel@edk2.groups.io
> Cc: Ni, Ray <ray.ni@intel.com>; Laszlo Ersek <lersek@redhat.com>
> Subject: RE: [PATCH 1/2] UefiCpuPkg: LocalApicLib: Export
> StandardSignatureIsAuthenticAMD 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/Library/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 <leo.duran@amd.com>; devel@edk2.groups.io
> > Cc: Ni, Ray <ray.ni@intel.com>; Laszlo Ersek <lersek@redhat.com>
> > 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 <leo.duran@amd.com>
> > Sent: Wednesday, February 26, 2020 3:39 AM
> > To: devel@edk2.groups.io
> > Cc: Leo Duran <leo.duran@amd.com>; Dong, Eric <eric.dong@intel.com>;
> > Ni, Ray <ray.ni@intel.com>; Laszlo Ersek <lersek@redhat.com>
> > Subject: [PATCH 1/2] UefiCpuPkg: LocalApicLib: Export
> > StandardSignatureIsAuthenticAMD function
> >
> > REF:
> > https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fbugz
> > ill
> a.tianocore.org%2Fshow_bug.cgi%3Fid%3D2556&amp;data=02%7C01%7Cleo.
> >
> duran%40amd.com%7C19e3e4c20ffa41d8de8508d7ba591944%7C3dd8961f
> >
> e4884e608e11a82d994e183d%7C0%7C0%7C637182764151879166&amp;s
> >
> data=n%2B3eeGu7%2BvmVCz2QP6aeJuiqQ08gX5ZaCAuDkNMO%2Bb8%3D&a
> > mp;reserved=0
> >
> > 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 <eric.dong@intel.com>
> > Cc: Ray Ni <ray.ni@intel.com>
> > Cc: Laszlo Ersek <lersek@redhat.com>
> > Signed-off-by: Leo Duran <leo.duran@amd.com>
> > ---
> >  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.<BR>
> > +  Copyright (c) 2020, AMD Inc. All rights reserved.<BR>
> > +
> >    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.<BR>
> > -  Copyright (c) 2017, AMD Inc. All rights reserved.<BR>
> > +  Copyright (c) 2017 - 2020, AMD Inc. All rights reserved.<BR>
> >
> >    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 == CPUID_SIGNATURE_AUTHENTIC_AMD_EBX &&
> > -          RegEcx == CPUID_SIGNATURE_AUTHENTIC_AMD_ECX &&
> > -          RegEdx == 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 == CPUID_SIGNATURE_AUTHENTIC_AMD_EBX &&
> > +          RegEcx == CPUID_SIGNATURE_AUTHENTIC_AMD_ECX &&
> > +          RegEdx == 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.<BR>
> > -  Copyright (c) 2017, AMD Inc. All rights reserved.<BR>
> > +  Copyright (c) 2017 - 2020, AMD Inc. All rights reserved.<BR>
> >
> >    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 == CPUID_SIGNATURE_AUTHENTIC_AMD_EBX &&
> > -          RegEcx == CPUID_SIGNATURE_AUTHENTIC_AMD_ECX &&
> > -          RegEdx == 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 == CPUID_SIGNATURE_AUTHENTIC_AMD_EBX &&
> > +          RegEcx == CPUID_SIGNATURE_AUTHENTIC_AMD_ECX &&
> > +          RegEdx == CPUID_SIGNATURE_AUTHENTIC_AMD_EDX);
> > +}
> > +
> > +/**
> >    Retrieve the base address of local APIC.
> >
> >    @return The base address of local APIC.
> > --
> > 2.7.4


  parent reply	other threads:[~2020-02-26 15:59 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-25 19:39 [PATCH 0/2] UefiCpuPkg/Library: Fix bug in MpInitLib Leo Duran
2020-02-25 19:39 ` [PATCH 1/2] UefiCpuPkg: LocalApicLib: Export StandardSignatureIsAuthenticAMD function Leo Duran
2020-02-26  1:13   ` Dong, Eric
2020-02-26  2:41     ` Duran, Leo
2020-02-26  5:05       ` Dong, Eric
2020-02-26 10:13         ` [edk2-devel] " Laszlo Ersek
2020-02-26 15:03           ` Duran, Leo
2020-02-26 16:19             ` Laszlo Ersek
2020-02-26 15:59         ` Duran, Leo [this message]
2020-02-25 19:39 ` [PATCH 2/2] UefiCpuPkg: MpInitLib: Exclude code no pertinent to AMD processors Leo Duran
2020-02-26  7:45   ` Ni, Ray
2020-02-26  7:56     ` Siyuan, Fu
2020-02-26  0:54 ` [edk2-devel] [PATCH 0/2] UefiCpuPkg/Library: Fix bug in MpInitLib Laszlo Ersek
2020-02-26  7:57   ` Ni, Ray
2020-02-26  8:56     ` Liming Gao
2020-02-26 15:11       ` Duran, Leo
2020-02-26 16:24         ` Laszlo Ersek
2020-02-26 16:35           ` Duran, Leo
2020-02-26 15:25     ` Duran, Leo
2020-02-26 15:46       ` Duran, Leo
2020-02-26 16:20         ` Laszlo Ersek
2020-02-26 16:39           ` Duran, Leo
2020-02-26 16:46             ` Duran, Leo
2020-02-26 17:45             ` Laszlo Ersek
2020-02-26 17:51               ` Duran, Leo
2020-02-27  5:55                 ` Ni, Ray
2020-02-27 18:17                   ` Duran, Leo
2020-02-28  6:47                     ` Ni, Ray
2020-02-28 16:38                       ` Duran, Leo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=BN6PR12MB192276AFFB5E7C4C7094DFA6F9EA0@BN6PR12MB1922.namprd12.prod.outlook.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox