Re: [edk2-devel] [PATCH 2/6] UefiCpuPkg/MtrrTest: Only claim CPUID max leaf as 1

2023-03-29 Thread Michael D Kinney
Reviewed-by: Michael D Kinney 

> -Original Message-
> From: Ni, Ray 
> Sent: Tuesday, March 21, 2023 4:57 PM
> To: devel@edk2.groups.io
> Cc: Dong, Eric ; Kumar, Rahul R 
> ; Gerd Hoffmann ; Kinney,
> Michael D ; Anadani, Ahmad 
> 
> Subject: [PATCH 2/6] UefiCpuPkg/MtrrTest: Only claim CPUID max leaf as 1
> 
> MtrrLib code queries the CPUID leaf 7h result if support.
> Update Test code temporary to claim the CPUID only
> supports max leaf as 1 so MtrrLib skips to query CPUID leaf 7h.
> 
> Signed-off-by: Ray Ni 
> Cc: Eric Dong 
> Cc: Rahul Kumar 
> Cc: Gerd Hoffmann 
> Cc: Michael D Kinney 
> Cc: Ahmad Anadani 
> ---
>  UefiCpuPkg/Library/MtrrLib/UnitTest/Support.c | 9 -
>  1 file changed, 8 insertions(+), 1 deletion(-)
> 
> diff --git a/UefiCpuPkg/Library/MtrrLib/UnitTest/Support.c 
> b/UefiCpuPkg/Library/MtrrLib/UnitTest/Support.c
> index 748c403281..260966e7b6 100644
> --- a/UefiCpuPkg/Library/MtrrLib/UnitTest/Support.c
> +++ b/UefiCpuPkg/Library/MtrrLib/UnitTest/Support.c
> @@ -1,7 +1,7 @@
>  /** @file
> 
>Unit tests of the MtrrLib instance of the MtrrLib class
> 
> 
> 
> -  Copyright (c) 2018 - 2020, Intel Corporation. All rights reserved.
> 
> +  Copyright (c) 2018 - 2023, Intel Corporation. All rights reserved.
> 
>SPDX-License-Identifier: BSD-2-Clause-Patent
> 
> 
> 
>  **/
> 
> @@ -122,6 +122,13 @@ UnitTestMtrrLibAsmCpuid (
>)
> 
>  {
> 
>switch (Index) {
> 
> +case CPUID_SIGNATURE:
> 
> +  if (Eax != NULL) {
> 
> +*Eax = CPUID_VERSION_INFO;
> 
> +  }
> 
> +
> 
> +  return Index;
> 
> +  break;
> 
>  case CPUID_VERSION_INFO:
> 
>if (Edx != NULL) {
> 
>  *Edx = mCpuidVersionInfoEdx.Uint32;
> 
> --
> 2.39.1.windows.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#102136): https://edk2.groups.io/g/devel/message/102136
Mute This Topic: https://groups.io/mt/97767968/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: 
https://edk2.groups.io/g/devel/leave/9847357/21656/1706620634/xyzzy 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




[edk2-devel] [PATCH 2/6] UefiCpuPkg/MtrrTest: Only claim CPUID max leaf as 1

2023-03-21 Thread Ni, Ray
MtrrLib code queries the CPUID leaf 7h result if support.
Update Test code temporary to claim the CPUID only
supports max leaf as 1 so MtrrLib skips to query CPUID leaf 7h.

Signed-off-by: Ray Ni 
Cc: Eric Dong 
Cc: Rahul Kumar 
Cc: Gerd Hoffmann 
Cc: Michael D Kinney 
Cc: Ahmad Anadani 
---
 UefiCpuPkg/Library/MtrrLib/UnitTest/Support.c | 9 -
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/UefiCpuPkg/Library/MtrrLib/UnitTest/Support.c 
b/UefiCpuPkg/Library/MtrrLib/UnitTest/Support.c
index 748c403281..260966e7b6 100644
--- a/UefiCpuPkg/Library/MtrrLib/UnitTest/Support.c
+++ b/UefiCpuPkg/Library/MtrrLib/UnitTest/Support.c
@@ -1,7 +1,7 @@
 /** @file
   Unit tests of the MtrrLib instance of the MtrrLib class
 
-  Copyright (c) 2018 - 2020, Intel Corporation. All rights reserved.
+  Copyright (c) 2018 - 2023, Intel Corporation. All rights reserved.
   SPDX-License-Identifier: BSD-2-Clause-Patent
 
 **/
@@ -122,6 +122,13 @@ UnitTestMtrrLibAsmCpuid (
   )
 {
   switch (Index) {
+case CPUID_SIGNATURE:
+  if (Eax != NULL) {
+*Eax = CPUID_VERSION_INFO;
+  }
+
+  return Index;
+  break;
 case CPUID_VERSION_INFO:
   if (Edx != NULL) {
 *Edx = mCpuidVersionInfoEdx.Uint32;
-- 
2.39.1.windows.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#101521): https://edk2.groups.io/g/devel/message/101521
Mute This Topic: https://groups.io/mt/97767968/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: 
https://edk2.groups.io/g/devel/leave/9847357/21656/1706620634/xyzzy 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-