From nobody Mon Feb 9 05:20:47 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+88972+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+88972+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1650164503; cv=none; d=zohomail.com; s=zohoarc; b=dpY46V4iO2pR7AtsA7bLT53MtYOeds3xg8GjOqSoDPNTv+49JhBA4fX4XAe7rSrY43XKWrhaCaIVfGYfHD6gyM5U0dDHmUgnyp2+KRLHTButybKkZG+k0AVu3qH/ZDR8yxuatIbm/cj01Za+5TeX0+eADWh5If0RiyA9FV7N7uE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1650164503; 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=27rsD+Tmen2t7hvQeOwbuVsRbwxgEDbPykrD7hSFqgs=; b=DV/OlCgBDrJcCDEZp8VBkX1ikBbeAOJdIizqm+KlDMhQvWnBR/BpyM+s5UtfIs5bS4P972DthZchjqduAHYkI0XPjMFqktMw+BNJ+tHyPKYR/uvCBctiRsKobI+Hm9MGtSLFsOWKnY1IkjQ0nAxK0OyWao2Mg9cf34Wj0pdpjWs= 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+88972+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 1650164503897915.0312823068773; Sat, 16 Apr 2022 20:01:43 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id MrfSYY1788612xcCL82KpgbA; Sat, 16 Apr 2022 20:01:43 -0700 X-Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by mx.groups.io with SMTP id smtpd.web11.25369.1650164497717213024 for ; Sat, 16 Apr 2022 20:01:42 -0700 X-IronPort-AV: E=McAfee;i="6400,9594,10318"; a="349806222" X-IronPort-AV: E=Sophos;i="5.90,266,1643702400"; d="scan'208";a="349806222" X-Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Apr 2022 20:01:42 -0700 X-IronPort-AV: E=Sophos;i="5.90,266,1643702400"; d="scan'208";a="575044300" X-Received: from mxu9-mobl1.ccr.corp.intel.com ([10.255.29.191]) by orsmga008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Apr 2022 20:01:40 -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 Subject: [edk2-devel] [PATCH V3 3/7] MdePkg: Add CcProbeLib Date: Sun, 17 Apr 2022 11:01:09 +0800 Message-Id: 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: RMjDuOWeSn6JKgQNV9d8snY9x1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1650164503; bh=WnPhLx1NLKpvRwE/GXfSlIHhUdyQR5YXB+oc/myNUbU=; h=Cc:Date:From:Reply-To:Subject:To; b=jyhyjKSqqhoQtKTTJSqQf5CuYahUU7I7302u/kSWLBw3OxGd78IkrovCC1FZkCtg1fF l2NYToCt4bHAMS/tyqBwsGJORS+wLZXDbvHXbeQAbm4Ys90PXPcdrB6vaA5PaOZziCh5f QA6Tr2g3a0w7WYfAVz/TVsLlFWwjerA/xNw= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1650164505809100002 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 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..152d900eb099 --- /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 (#88972): https://edk2.groups.io/g/devel/message/88972 Mute This Topic: https://groups.io/mt/90516974/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-