From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by mx.groups.io with SMTP id smtpd.web11.45336.1612226499289338429 for ; Mon, 01 Feb 2021 16:41:39 -0800 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: intel.com, ip: 192.55.52.115, mailfrom: yun.lou@intel.com) IronPort-SDR: ytB3TGN03jCr9FUCZLS1vwNBrInpyRbAtL7LNtBSjKT5NK/EnsiJ3pdBRdnHjElxcObGfgIkN5 LpAQOeQ5/smA== X-IronPort-AV: E=McAfee;i="6000,8403,9882"; a="179999202" X-IronPort-AV: E=Sophos;i="5.79,393,1602572400"; d="scan'208";a="179999202" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Feb 2021 16:41:37 -0800 IronPort-SDR: +T4CcTtsM/8LezumtKfb4VnFpWIJhK0j4tRjv6auo6wuct3fie8/xcE/+Divc6FpyV4fSQmz2i Ci5XY8vJgN+Q== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.79,393,1602572400"; d="scan'208";a="370174909" Received: from shwdeopenlab102.ccr.corp.intel.com ([10.239.183.61]) by fmsmga008.fm.intel.com with ESMTP; 01 Feb 2021 16:41:35 -0800 From: "Jason Lou" To: devel@edk2.groups.io Cc: Jason , Ray Ni , Eric Dong , Laszlo Ersek , Rahul Kumar Subject: [PATCH v2 1/1] UefiCpuPkg/CpuCacheInfoLib: Add MpService dependency Date: Tue, 2 Feb 2021 08:41:29 +0800 Message-Id: <20210202004129.6055-1-yun.lou@intel.com> X-Mailer: git-send-email 2.28.0.windows.1 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D3190 Add MpService dependency to enforce the executability of CpuCacheInfoLib. Signed-off-by: Jason Lou Cc: Ray Ni Cc: Eric Dong Cc: Laszlo Ersek Cc: Rahul Kumar --- UefiCpuPkg/Library/CpuCacheInfoLib/CpuCacheInfoLib.c | 7 +------ UefiCpuPkg/Include/Library/CpuCacheInfoLib.h | 2 -- UefiCpuPkg/Library/CpuCacheInfoLib/DxeCpuCacheInfoLib.inf | 2 +- UefiCpuPkg/Library/CpuCacheInfoLib/PeiCpuCacheInfoLib.inf | 2 +- 4 files changed, 3 insertions(+), 10 deletions(-) diff --git a/UefiCpuPkg/Library/CpuCacheInfoLib/CpuCacheInfoLib.c b/UefiCpu= Pkg/Library/CpuCacheInfoLib/CpuCacheInfoLib.c index d1f9830c91e7..d46fb0425851 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 CpuCa= cheInfoCount contains the value=0D greater than zero.=0D @retval EFI_UNSUPPORTED Processor does not support CPUID= _CACHE_PARAMS Leaf.=0D - @retval EFI_NOT_FOUND EDKII_PEI_MP_SERVICES2_PPI or EF= I_MP_SERVICES_PROTOCOL interface=0D - is not found.=0D @retval EFI_OUT_OF_RESOURCES Required resources could not be = allocated.=0D @retval EFI_BUFFER_TOO_SMALL CpuCacheInfoCount is too small t= o hold the response CpuCacheInfo=0D array. CpuCacheInfoCount has bee= n updated with the length needed=0D @@ -384,10 +382,7 @@ GetCpuCacheInfo ( //=0D // Initialize COLLECT_CPUID_CACHE_DATA_CONTEXT.MpServices.=0D //=0D - Status =3D CpuCacheInfoGetMpServices (&Context.MpServices);=0D - if (EFI_ERROR(Status)) {=0D - return Status;=0D - }=0D + CpuCacheInfoGetMpServices (&Context.MpServices);=0D =0D NumberOfProcessors =3D CpuCacheInfoGetNumberOfProcessors (Context.MpServ= ices);=0D =0D diff --git a/UefiCpuPkg/Include/Library/CpuCacheInfoLib.h b/UefiCpuPkg/Incl= ude/Library/CpuCacheInfoLib.h index a23b8b12b5ee..a7f29b188775 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 CpuCa= cheInfoCount contains the value=0D greater than zero.=0D @retval EFI_UNSUPPORTED Processor does not support CPUID= _CACHE_PARAMS Leaf.=0D - @retval EFI_NOT_FOUND EDKII_PEI_MP_SERVICES2_PPI or EF= I_MP_SERVICES_PROTOCOL interface=0D - is not found.=0D @retval EFI_OUT_OF_RESOURCES Required resources could not be = allocated.=0D @retval EFI_BUFFER_TOO_SMALL CpuCacheInfoCount is too small t= o hold the response CpuCacheInfo=0D array. CpuCacheInfoCount has bee= n updated with the length needed=0D diff --git a/UefiCpuPkg/Library/CpuCacheInfoLib/DxeCpuCacheInfoLib.inf b/Ue= fiCpuPkg/Library/CpuCacheInfoLib/DxeCpuCacheInfoLib.inf index 1fd45380b871..c481080e49d8 100644 --- a/UefiCpuPkg/Library/CpuCacheInfoLib/DxeCpuCacheInfoLib.inf +++ b/UefiCpuPkg/Library/CpuCacheInfoLib/DxeCpuCacheInfoLib.inf @@ -40,4 +40,4 @@ [Protocols] [Pcd]=0D =0D [Depex]=0D - TRUE=0D + gEfiMpServiceProtocolGuid=0D diff --git a/UefiCpuPkg/Library/CpuCacheInfoLib/PeiCpuCacheInfoLib.inf b/Ue= fiCpuPkg/Library/CpuCacheInfoLib/PeiCpuCacheInfoLib.inf index c8aa33c95a8f..0c73015cac8b 100644 --- a/UefiCpuPkg/Library/CpuCacheInfoLib/PeiCpuCacheInfoLib.inf +++ b/UefiCpuPkg/Library/CpuCacheInfoLib/PeiCpuCacheInfoLib.inf @@ -40,4 +40,4 @@ [Ppis] [Pcd]=0D =0D [Depex]=0D - TRUE=0D + gEdkiiPeiMpServices2PpiGuid=0D --=20 2.28.0.windows.1