summaryrefslogtreecommitdiffstats
path: root/UefiCpuPkg
diff options
context:
space:
mode:
authorLou, Yun <Yun.Lou@intel.com>2021-02-02 08:41:29 +0800
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>2021-02-03 07:41:46 +0000
commit51b96e4b4cb6d68093f7c7004d4716152ad3ac79 (patch)
treed53f8350e78e595cccf4289cd497c55f40808734 /UefiCpuPkg
parent618e6a1f21a11eaee0a92e19c753969eb4a1b198 (diff)
downloadedk2-51b96e4b4cb6d68093f7c7004d4716152ad3ac79.tar.gz
edk2-51b96e4b4cb6d68093f7c7004d4716152ad3ac79.tar.bz2
edk2-51b96e4b4cb6d68093f7c7004d4716152ad3ac79.zip
UefiCpuPkg/CpuCacheInfoLib: Add MpService dependency
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3190 Add MpService dependency to enforce the executability of CpuCacheInfoLib. Signed-off-by: Jason Lou <yun.lou@intel.com> Reviewed-by: Ray Ni <ray.ni@intel.com> Cc: Eric Dong <eric.dong@intel.com> Cc: Laszlo Ersek <lersek@redhat.com> Cc: Rahul Kumar <rahul1.kumar@intel.com>
Diffstat (limited to 'UefiCpuPkg')
-rw-r--r--UefiCpuPkg/Include/Library/CpuCacheInfoLib.h2
-rw-r--r--UefiCpuPkg/Library/CpuCacheInfoLib/CpuCacheInfoLib.c7
-rw-r--r--UefiCpuPkg/Library/CpuCacheInfoLib/DxeCpuCacheInfoLib.inf2
-rw-r--r--UefiCpuPkg/Library/CpuCacheInfoLib/PeiCpuCacheInfoLib.inf2
4 files changed, 3 insertions, 10 deletions
diff --git a/UefiCpuPkg/Include/Library/CpuCacheInfoLib.h b/UefiCpuPkg/Include/Library/CpuCacheInfoLib.h
index a23b8b12b5..a7f29b1887 100644
--- a/UefiCpuPkg/Include/Library/CpuCacheInfoLib.h
+++ b/UefiCpuPkg/Include/Library/CpuCacheInfoLib.h
@@ -59,8 +59,6 @@ typedef struct {
@retval EFI_INVALID_PARAMETER CpuCacheInfo is NULL while CpuCacheInfoCount contains the value
greater than zero.
@retval EFI_UNSUPPORTED Processor does not support CPUID_CACHE_PARAMS Leaf.
- @retval EFI_NOT_FOUND EDKII_PEI_MP_SERVICES2_PPI or EFI_MP_SERVICES_PROTOCOL interface
- is not found.
@retval EFI_OUT_OF_RESOURCES Required resources could not be allocated.
@retval EFI_BUFFER_TOO_SMALL CpuCacheInfoCount is too small to hold the response CpuCacheInfo
array. CpuCacheInfoCount has been updated with the length needed
diff --git a/UefiCpuPkg/Library/CpuCacheInfoLib/CpuCacheInfoLib.c b/UefiCpuPkg/Library/CpuCacheInfoLib/CpuCacheInfoLib.c
index d1f9830c91..d46fb04258 100644
--- a/UefiCpuPkg/Library/CpuCacheInfoLib/CpuCacheInfoLib.c
+++ b/UefiCpuPkg/Library/CpuCacheInfoLib/CpuCacheInfoLib.c
@@ -346,8 +346,6 @@ CpuCacheInfoCollectCpuCacheInfoData (
@retval EFI_INVALID_PARAMETER CpuCacheInfo is NULL while CpuCacheInfoCount contains the value
greater than zero.
@retval EFI_UNSUPPORTED Processor does not support CPUID_CACHE_PARAMS Leaf.
- @retval EFI_NOT_FOUND EDKII_PEI_MP_SERVICES2_PPI or EFI_MP_SERVICES_PROTOCOL interface
- is not found.
@retval EFI_OUT_OF_RESOURCES Required resources could not be allocated.
@retval EFI_BUFFER_TOO_SMALL CpuCacheInfoCount is too small to hold the response CpuCacheInfo
array. CpuCacheInfoCount has been updated with the length needed
@@ -384,10 +382,7 @@ GetCpuCacheInfo (
//
// Initialize COLLECT_CPUID_CACHE_DATA_CONTEXT.MpServices.
//
- Status = CpuCacheInfoGetMpServices (&Context.MpServices);
- if (EFI_ERROR(Status)) {
- return Status;
- }
+ CpuCacheInfoGetMpServices (&Context.MpServices);
NumberOfProcessors = CpuCacheInfoGetNumberOfProcessors (Context.MpServices);
diff --git a/UefiCpuPkg/Library/CpuCacheInfoLib/DxeCpuCacheInfoLib.inf b/UefiCpuPkg/Library/CpuCacheInfoLib/DxeCpuCacheInfoLib.inf
index 1fd45380b8..c481080e49 100644
--- a/UefiCpuPkg/Library/CpuCacheInfoLib/DxeCpuCacheInfoLib.inf
+++ b/UefiCpuPkg/Library/CpuCacheInfoLib/DxeCpuCacheInfoLib.inf
@@ -40,4 +40,4 @@
[Pcd]
[Depex]
- TRUE
+ gEfiMpServiceProtocolGuid
diff --git a/UefiCpuPkg/Library/CpuCacheInfoLib/PeiCpuCacheInfoLib.inf b/UefiCpuPkg/Library/CpuCacheInfoLib/PeiCpuCacheInfoLib.inf
index c8aa33c95a..0c73015cac 100644
--- a/UefiCpuPkg/Library/CpuCacheInfoLib/PeiCpuCacheInfoLib.inf
+++ b/UefiCpuPkg/Library/CpuCacheInfoLib/PeiCpuCacheInfoLib.inf
@@ -40,4 +40,4 @@
[Pcd]
[Depex]
- TRUE
+ gEdkiiPeiMpServices2PpiGuid