[edk2-devel] [PATCH v1] MdePkg/BaseCpuLibNull: Add stub function of StandardSignatureIsAuthenticAMD() in CpuLibNull instance

Huang, Qing posted 1 patch 1 month ago
Failed in applying to current master (apply log)
MdePkg/Library/BaseCpuLibNull/BaseCpuLibNull.c | 17 ++++++++++++++++-
1 file changed, 16 insertions(+), 1 deletion(-)
[edk2-devel] [PATCH v1] MdePkg/BaseCpuLibNull: Add stub function of StandardSignatureIsAuthenticAMD() in CpuLibNull instance
Posted by Huang, Qing 1 month ago
CpuLib.h exposes StandardSignatureIsAuthenticAMD() API and we require stub function in its BaseCpuLibNull library
instance to avoid potential link issue.

Signed-off-by: Qing Huang <qing.huang@intel.com>
---
 MdePkg/Library/BaseCpuLibNull/BaseCpuLibNull.c | 17 ++++++++++++++++-
 1 file changed, 16 insertions(+), 1 deletion(-)

diff --git a/MdePkg/Library/BaseCpuLibNull/BaseCpuLibNull.c b/MdePkg/Library/BaseCpuLibNull/BaseCpuLibNull.c
index 3ba7a35096..ba7981551d 100644
--- a/MdePkg/Library/BaseCpuLibNull/BaseCpuLibNull.c
+++ b/MdePkg/Library/BaseCpuLibNull/BaseCpuLibNull.c
@@ -1,7 +1,7 @@
 /** @file
   Null instance of CPU Library.
 
-  Copyright (c) 2020, Intel Corporation. All rights reserved.<BR>
+  Copyright (c) 2020 - 2024, Intel Corporation. All rights reserved.<BR>
   SPDX-License-Identifier: BSD-2-Clause-Patent
 
 **/
@@ -35,3 +35,18 @@ CpuFlushTlb (
   )
 {
 }
+
+/**
+  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
+  )
+{
+  return FALSE;
+}
-- 
2.42.0.windows.2



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#114194): https://edk2.groups.io/g/devel/message/114194
Mute This Topic: https://groups.io/mt/103907626/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-
Re: [edk2-devel] [PATCH v1] MdePkg/BaseCpuLibNull: Add stub function of StandardSignatureIsAuthenticAMD() in CpuLibNull instance
Posted by Michael D Kinney 1 month ago
Hi Qing,

Thank you for this update to add the missing API to BaseCpuLibNull.

There are a few very minor comments below.  I will make those updates
in the PR for merge.  With those changes:

Reviewed-by: Michael D Kinney <michael.d.kinney@intel.com>

Mike

> -----Original Message-----
> From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of Huang,
> Qing
> Sent: Tuesday, January 23, 2024 3:37 AM
> To: devel@edk2.groups.io
> Cc: Huang, Qing <qing.huang@intel.com>
> Subject: [edk2-devel] [PATCH v1] MdePkg/BaseCpuLibNull: Add stub
> function of StandardSignatureIsAuthenticAMD() in CpuLibNull instance

Subject line too long

> 
> CpuLib.h exposes StandardSignatureIsAuthenticAMD() API and we require
> stub function in its BaseCpuLibNull library
> instance to avoid potential link issue.
> 

Missing Cc for MdePkg maintainers.

> Signed-off-by: Qing Huang <qing.huang@intel.com>
> ---
>  MdePkg/Library/BaseCpuLibNull/BaseCpuLibNull.c | 17 ++++++++++++++++-
>  1 file changed, 16 insertions(+), 1 deletion(-)
> 
> diff --git a/MdePkg/Library/BaseCpuLibNull/BaseCpuLibNull.c
> b/MdePkg/Library/BaseCpuLibNull/BaseCpuLibNull.c
> index 3ba7a35096..ba7981551d 100644
> --- a/MdePkg/Library/BaseCpuLibNull/BaseCpuLibNull.c
> +++ b/MdePkg/Library/BaseCpuLibNull/BaseCpuLibNull.c
> @@ -1,7 +1,7 @@
>  /** @file
>    Null instance of CPU Library.
> 
> -  Copyright (c) 2020, Intel Corporation. All rights reserved.<BR>
> +  Copyright (c) 2020 - 2024, Intel Corporation. All rights
> reserved.<BR>

Updating end year not required for Intel copyright statements.

>    SPDX-License-Identifier: BSD-2-Clause-Patent
> 
>  **/
> @@ -35,3 +35,18 @@ CpuFlushTlb (
>    )
>  {
>  }
> +
> +/**
> +  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
> +  )
> +{
> +  return FALSE;
> +}
> --
> 2.42.0.windows.2
> 
> 
> 
> 
> 



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#114226): https://edk2.groups.io/g/devel/message/114226
Mute This Topic: https://groups.io/mt/103907626/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/leave/3901457/1787277/102458076/xyzzy [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-
Re: [edk2-devel] [PATCH v1] MdePkg/BaseCpuLibNull: Add stub function of StandardSignatureIsAuthenticAMD() in CpuLibNull instance
Posted by Michael D Kinney 1 month ago
Merged: https://github.com/tianocore/edk2/pull/5291

> -----Original Message-----
> From: Kinney, Michael D <michael.d.kinney@intel.com>
> Sent: Tuesday, January 23, 2024 9:26 AM
> To: devel@edk2.groups.io; Huang, Qing <qing.huang@intel.com>
> Cc: Kinney, Michael D <michael.d.kinney@intel.com>
> Subject: RE: [edk2-devel] [PATCH v1] MdePkg/BaseCpuLibNull: Add stub
> function of StandardSignatureIsAuthenticAMD() in CpuLibNull instance
> 
> Hi Qing,
> 
> Thank you for this update to add the missing API to BaseCpuLibNull.
> 
> There are a few very minor comments below.  I will make those updates
> in the PR for merge.  With those changes:
> 
> Reviewed-by: Michael D Kinney <michael.d.kinney@intel.com>
> 
> Mike
> 
> > -----Original Message-----
> > From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of Huang,
> > Qing
> > Sent: Tuesday, January 23, 2024 3:37 AM
> > To: devel@edk2.groups.io
> > Cc: Huang, Qing <qing.huang@intel.com>
> > Subject: [edk2-devel] [PATCH v1] MdePkg/BaseCpuLibNull: Add stub
> > function of StandardSignatureIsAuthenticAMD() in CpuLibNull instance
> 
> Subject line too long
> 
> >
> > CpuLib.h exposes StandardSignatureIsAuthenticAMD() API and we require
> > stub function in its BaseCpuLibNull library
> > instance to avoid potential link issue.
> >
> 
> Missing Cc for MdePkg maintainers.
> 
> > Signed-off-by: Qing Huang <qing.huang@intel.com>
> > ---
> >  MdePkg/Library/BaseCpuLibNull/BaseCpuLibNull.c | 17 ++++++++++++++++-
> >  1 file changed, 16 insertions(+), 1 deletion(-)
> >
> > diff --git a/MdePkg/Library/BaseCpuLibNull/BaseCpuLibNull.c
> > b/MdePkg/Library/BaseCpuLibNull/BaseCpuLibNull.c
> > index 3ba7a35096..ba7981551d 100644
> > --- a/MdePkg/Library/BaseCpuLibNull/BaseCpuLibNull.c
> > +++ b/MdePkg/Library/BaseCpuLibNull/BaseCpuLibNull.c
> > @@ -1,7 +1,7 @@
> >  /** @file
> >    Null instance of CPU Library.
> >
> > -  Copyright (c) 2020, Intel Corporation. All rights reserved.<BR>
> > +  Copyright (c) 2020 - 2024, Intel Corporation. All rights
> > reserved.<BR>
> 
> Updating end year not required for Intel copyright statements.
> 
> >    SPDX-License-Identifier: BSD-2-Clause-Patent
> >
> >  **/
> > @@ -35,3 +35,18 @@ CpuFlushTlb (
> >    )
> >  {
> >  }
> > +
> > +/**
> > +  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
> > +  )
> > +{
> > +  return FALSE;
> > +}
> > --
> > 2.42.0.windows.2
> >
> >
> >
> > 
> >



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#114231): https://edk2.groups.io/g/devel/message/114231
Mute This Topic: https://groups.io/mt/103907626/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/leave/3901457/1787277/102458076/xyzzy [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-
Re: [edk2-devel] [PATCH v1] MdePkg/BaseCpuLibNull: Add stub function of StandardSignatureIsAuthenticAMD() in CpuLibNull instance
Posted by Laszlo Ersek 1 month ago
On 1/23/24 12:36, Huang, Qing wrote:
> CpuLib.h exposes StandardSignatureIsAuthenticAMD() API and we require stub function in its BaseCpuLibNull library
> instance to avoid potential link issue.
> 
> Signed-off-by: Qing Huang <qing.huang@intel.com>
> ---
>  MdePkg/Library/BaseCpuLibNull/BaseCpuLibNull.c | 17 ++++++++++++++++-
>  1 file changed, 16 insertions(+), 1 deletion(-)
> 
> diff --git a/MdePkg/Library/BaseCpuLibNull/BaseCpuLibNull.c b/MdePkg/Library/BaseCpuLibNull/BaseCpuLibNull.c
> index 3ba7a35096..ba7981551d 100644
> --- a/MdePkg/Library/BaseCpuLibNull/BaseCpuLibNull.c
> +++ b/MdePkg/Library/BaseCpuLibNull/BaseCpuLibNull.c
> @@ -1,7 +1,7 @@
>  /** @file
>    Null instance of CPU Library.
>  
> -  Copyright (c) 2020, Intel Corporation. All rights reserved.<BR>
> +  Copyright (c) 2020 - 2024, Intel Corporation. All rights reserved.<BR>
>    SPDX-License-Identifier: BSD-2-Clause-Patent
>  
>  **/
> @@ -35,3 +35,18 @@ CpuFlushTlb (
>    )
>  {
>  }
> +
> +/**
> +  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
> +  )
> +{
> +  return FALSE;
> +}

(1) Could we complete the Null instance with all the missing functions,
in one go? Such as: InitializeFloatingPointUnits,
StandardSignatureIsAuthenticAMD, GetCpuFamilyModel, GetCpuSteppingId?

(2) All four of the mentioned APIs are only declared for IA32 and X64,
by the lib class header. Therefore their stub implementations, including
that of StandardSignatureIsAuthenticAMD(), should be restricted to IA32
and X64 too.

Thanks
Laszlo



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#114197): https://edk2.groups.io/g/devel/message/114197
Mute This Topic: https://groups.io/mt/103907626/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/leave/3901457/1787277/102458076/xyzzy [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-
Re: [edk2-devel] [PATCH v1] MdePkg/BaseCpuLibNull: Add stub function of StandardSignatureIsAuthenticAMD() in CpuLibNull instance
Posted by Michael D Kinney 1 month ago
Hi Laszlo,

Thanks for the feedback.  Sorry I missed this email this morning.

I will prepare a 2nd patch with these additional updates.

Mike

> -----Original Message-----
> From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of Laszlo
> Ersek
> Sent: Tuesday, January 23, 2024 5:57 AM
> To: devel@edk2.groups.io; Huang, Qing <qing.huang@intel.com>
> Subject: Re: [edk2-devel] [PATCH v1] MdePkg/BaseCpuLibNull: Add stub
> function of StandardSignatureIsAuthenticAMD() in CpuLibNull instance
> 
> On 1/23/24 12:36, Huang, Qing wrote:
> > CpuLib.h exposes StandardSignatureIsAuthenticAMD() API and we require
> stub function in its BaseCpuLibNull library
> > instance to avoid potential link issue.
> >
> > Signed-off-by: Qing Huang <qing.huang@intel.com>
> > ---
> >  MdePkg/Library/BaseCpuLibNull/BaseCpuLibNull.c | 17 ++++++++++++++++-
> >  1 file changed, 16 insertions(+), 1 deletion(-)
> >
> > diff --git a/MdePkg/Library/BaseCpuLibNull/BaseCpuLibNull.c
> b/MdePkg/Library/BaseCpuLibNull/BaseCpuLibNull.c
> > index 3ba7a35096..ba7981551d 100644
> > --- a/MdePkg/Library/BaseCpuLibNull/BaseCpuLibNull.c
> > +++ b/MdePkg/Library/BaseCpuLibNull/BaseCpuLibNull.c
> > @@ -1,7 +1,7 @@
> >  /** @file
> >    Null instance of CPU Library.
> >
> > -  Copyright (c) 2020, Intel Corporation. All rights reserved.<BR>
> > +  Copyright (c) 2020 - 2024, Intel Corporation. All rights
> reserved.<BR>
> >    SPDX-License-Identifier: BSD-2-Clause-Patent
> >
> >  **/
> > @@ -35,3 +35,18 @@ CpuFlushTlb (
> >    )
> >  {
> >  }
> > +
> > +/**
> > +  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
> > +  )
> > +{
> > +  return FALSE;
> > +}
> 
> (1) Could we complete the Null instance with all the missing functions,
> in one go? Such as: InitializeFloatingPointUnits,
> StandardSignatureIsAuthenticAMD, GetCpuFamilyModel, GetCpuSteppingId?
> 
> (2) All four of the mentioned APIs are only declared for IA32 and X64,
> by the lib class header. Therefore their stub implementations, including
> that of StandardSignatureIsAuthenticAMD(), should be restricted to IA32
> and X64 too.
> 
> Thanks
> Laszlo
> 
> 
> 
> 
> 



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#114235): https://edk2.groups.io/g/devel/message/114235
Mute This Topic: https://groups.io/mt/103907626/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/leave/3901457/1787277/102458076/xyzzy [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-