From nobody Mon Feb 9 05:01:36 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+89032+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+89032+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1650328011; cv=none; d=zohomail.com; s=zohoarc; b=BRmSoiJAt5xCR1A0HgISLdivJ9+SVRQbVKTvOkQj8nVPHJY+ZLtHPT/E23ovO01SpAxT8gOsonSXjCuFkCyOvpJO02PwkSy0+vqMF9Oc/97eaiS0ud+zAU4zP5tSIW0EGujp9zj3QbViUwwvyiJhRdWg1PWmUrEVaU7FO8caico= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1650328011; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=RmbD3aM74CrVd7LUZKeipHKQDYgsFGD3ZCL/YRnYAPA=; b=YB7178R/OZ+8QTOWr3OS3Y0mY1K0YgtthpjS95IBp6eHyhVdkIjxnq8DJIP4C8polYz7Guy+wlkhFHGLXXaW8jflwAvgsYHBUUkegtNVAvYJTiSj9IM+R0genY4+bUfcA9Ob06bTw2sRglSHf5xg1oNZxzpeTTT+3YBciICV9gU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+89032+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 165032801121732.34147565287833; Mon, 18 Apr 2022 17:26:51 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id AHYvYY1788612xrvaewAxV8W; Mon, 18 Apr 2022 17:26:50 -0700 X-Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by mx.groups.io with SMTP id smtpd.web08.3858.1650328002343868729 for ; Mon, 18 Apr 2022 17:26:50 -0700 X-IronPort-AV: E=McAfee;i="6400,9594,10321"; a="326540348" X-IronPort-AV: E=Sophos;i="5.90,271,1643702400"; d="scan'208";a="326540348" X-Received: from orsmga006.jf.intel.com ([10.7.209.51]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Apr 2022 17:26:49 -0700 X-IronPort-AV: E=Sophos;i="5.90,271,1643702400"; d="scan'208";a="529079988" X-Received: from mxu9-mobl1.ccr.corp.intel.com ([10.249.171.121]) by orsmga006-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Apr 2022 17:26:47 -0700 From: "Min Xu" To: devel@edk2.groups.io Cc: Min Xu , Michael D Kinney , Liming Gao , Zhiguang Liu , James Bottomley , Jiewen Yao , Gerd Hoffmann , Tom Lendacky Subject: [edk2-devel] [PATCH V4 3/7] MdePkg: Add CcProbeLibNull Date: Tue, 19 Apr 2022 08:26:24 +0800 Message-Id: <90ad9eafb65e53d912d3f76a582a58e340bd7bda.1650326140.git.min.m.xu@intel.com> In-Reply-To: References: MIME-Version: 1.0 Precedence: Bulk List-Unsubscribe: List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,min.m.xu@intel.com X-Gm-Message-State: oU3NpaOeCFTJXJid5CMANT2ux1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1650328010; bh=0m6nSVITw1N+pPLTN2A21RL63n6P6eAU2bEK6SRGrwg=; h=Cc:Date:From:Reply-To:Subject:To; b=ALxs2ksm/9yZaBAFK4IyLaR3K4gmx69eGBxBTDNx0tNrGCBMuFsRv0/EFUxZgfaH8gz OTmZX7dM8DVbidPgVc+swZFutLcLsomUEeoc6950Zz+3bZrYOoVTknwMmaNaCOdW8ufKf N0NhzV0n8Y6zVuggb7DXlSV88139Wa8ddLw= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1650328012367100013 Content-Type: text/plain; charset="utf-8" BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=3D3902 CcProbeLib is used to probe the Confidential Computing guest type. This library is designed to run on SEC / PEI / DXE phases. A null instance of the library always returns CCGuestTypeNonEncrypted. A platform specific CcProbeLib will be implemented, for example, in OvmfPkg. Cc: Michael D Kinney Cc: Liming Gao Cc: Zhiguang Liu Cc: James Bottomley Cc: Jiewen Yao Cc: Gerd Hoffmann Reviewed-by: Liming Gao Reviewed-by: Jiewen Yao Reviewed-by: Tom Lendacky Signed-off-by: Min Xu --- MdePkg/Include/Library/CcProbeLib.h | 26 +++++++++++++++++++ .../Library/CcProbeLibNull/CcProbeLibNull.c | 26 +++++++++++++++++++ .../Library/CcProbeLibNull/CcProbeLibNull.inf | 21 +++++++++++++++ MdePkg/MdePkg.dec | 5 ++++ MdePkg/MdePkg.dsc | 1 + 5 files changed, 79 insertions(+) create mode 100644 MdePkg/Include/Library/CcProbeLib.h create mode 100644 MdePkg/Library/CcProbeLibNull/CcProbeLibNull.c create mode 100644 MdePkg/Library/CcProbeLibNull/CcProbeLibNull.inf diff --git a/MdePkg/Include/Library/CcProbeLib.h b/MdePkg/Include/Library/C= cProbeLib.h new file mode 100644 index 000000000000..2857dddfb2d3 --- /dev/null +++ b/MdePkg/Include/Library/CcProbeLib.h @@ -0,0 +1,26 @@ +/** @file + +Copyright (c) 2022, Intel Corporation. All rights reserved.
+SPDX-License-Identifier: BSD-2-Clause-Patent + +**/ + +#ifndef CC_PROBE_LIB_H_ +#define CC_PROBE_LIB_H_ + +#include + +/** + Probe the ConfidentialComputing Guest type. See defition of + CC_GUEST_TYPE in . + + @return The guest type + +**/ +UINT8 +EFIAPI +CcProbe ( + VOID + ); + +#endif diff --git a/MdePkg/Library/CcProbeLibNull/CcProbeLibNull.c b/MdePkg/Librar= y/CcProbeLibNull/CcProbeLibNull.c new file mode 100644 index 000000000000..ca4111dc3077 --- /dev/null +++ b/MdePkg/Library/CcProbeLibNull/CcProbeLibNull.c @@ -0,0 +1,26 @@ +/** @file + + Null stub of CcProbeLib + + Copyright (c) 2022, Intel Corporation. All rights reserved.
+ SPDX-License-Identifier: BSD-2-Clause-Patent + +**/ + +#include + +/** + Probe the ConfidentialComputing Guest type. See defition of + CC_GUEST_TYPE in . + + @return The guest type + +**/ +UINT8 +EFIAPI +CcProbe ( + VOID + ) +{ + return CcGuestTypeNonEncrypted; +} diff --git a/MdePkg/Library/CcProbeLibNull/CcProbeLibNull.inf b/MdePkg/Libr= ary/CcProbeLibNull/CcProbeLibNull.inf new file mode 100644 index 000000000000..f37c25f73439 --- /dev/null +++ b/MdePkg/Library/CcProbeLibNull/CcProbeLibNull.inf @@ -0,0 +1,21 @@ +## @file +# CcProbeLib null instance. +# +# Copyright (c) 2022, Intel Corporation. All rights reserved.
+# SPDX-License-Identifier: BSD-2-Clause-Patent +# +## + +[Defines] + INF_VERSION =3D 0x00010005 + BASE_NAME =3D CcProbeLibNull + FILE_GUID =3D B15D67FE-0DAC-4316-8E26-8A6b85E43782 + MODULE_TYPE =3D BASE + VERSION_STRING =3D 1.0 + LIBRARY_CLASS =3D CcProbeLib + +[Sources] + CcProbeLibNull.c + +[Packages] + MdePkg/MdePkg.dec diff --git a/MdePkg/MdePkg.dec b/MdePkg/MdePkg.dec index 1934c9840423..faeb28c80cbd 100644 --- a/MdePkg/MdePkg.dec +++ b/MdePkg/MdePkg.dec @@ -267,6 +267,11 @@ # RegisterFilterLib|Include/Library/RegisterFilterLib.h =20 + ## @libraryclass This library provides interfances to probe Confidenti= alComputing guest type. + # + # + CcProbeLib|Include/Library/CcProbeLib.h + [LibraryClasses.IA32, LibraryClasses.X64, LibraryClasses.AARCH64] ## @libraryclass Provides services to generate random number. # diff --git a/MdePkg/MdePkg.dsc b/MdePkg/MdePkg.dsc index d6a7af412be7..c8d282882ec1 100644 --- a/MdePkg/MdePkg.dsc +++ b/MdePkg/MdePkg.dsc @@ -130,6 +130,7 @@ MdePkg/Library/StandaloneMmServicesTableLib/StandaloneMmServicesTableLib= .inf =20 MdePkg/Library/RegisterFilterLibNull/RegisterFilterLibNull.inf + MdePkg/Library/CcProbeLibNull/CcProbeLibNull.inf =20 [Components.IA32, Components.X64, Components.ARM, Components.AARCH64] # --=20 2.29.2.windows.2 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#89032): https://edk2.groups.io/g/devel/message/89032 Mute This Topic: https://groups.io/mt/90552653/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-