From nobody Sun Feb 8 18:09:03 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+92874+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+92874+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1661555244; cv=none; d=zohomail.com; s=zohoarc; b=G+SVQp2wF4GTSQNI7XhrO9/k2BGUGv0m1XiN8tjiQfG+aXw4wCf+hwrCnWniXTaUz6k21IpVz2qqQv/BHXUnwsGeE2LssS+R5buVl9w7DJYd+skcNTCKr5Wh/lC+M+56mLuG/OGUpShyAEvTaSmGaEpo8VyG/O6jIeCRXSvlVnc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1661555244; 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=yaITL28ITUNy/EcPgncvOkxlOpaDbE3RhKAbJpkpVWg=; b=bMqSYB9Zzv58Iv5UI7lcOVY8um9TwblhXjSBGWPfbl591vIK17rYoUHc7WtXQ3d6QUblgDAFCVyFOHz7ESxXhrbUuy65oimI5qKmPMJZHOGwOmjxb7rg1F+vf2onegV2rtsKJhnUYH7Y+ux521ZY5qLbtmd5VckAb6qbwuf3mrw= 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+92874+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 1661555244441752.2407286965313; Fri, 26 Aug 2022 16:07:24 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id y6nKYY1788612xdu66HZQL1n; Fri, 26 Aug 2022 16:07:23 -0700 X-Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by mx.groups.io with SMTP id smtpd.web12.43533.1661555241015452748 for ; Fri, 26 Aug 2022 16:07:22 -0700 X-IronPort-AV: E=McAfee;i="6500,9779,10451"; a="281579428" X-IronPort-AV: E=Sophos;i="5.93,266,1654585200"; d="scan'208";a="281579428" X-Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Aug 2022 16:07:22 -0700 X-IronPort-AV: E=Sophos;i="5.93,266,1654585200"; d="scan'208";a="671649423" X-Received: from mxu9-mobl1.ccr.corp.intel.com ([10.249.171.119]) by fmsmga008-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Aug 2022 16:07:20 -0700 From: "Min Xu" To: devel@edk2.groups.io Cc: Min M Xu , Erdem Aktas , James Bottomley , Jiewen Yao , Gerd Hoffmann , Tom Lendacky Subject: [edk2-devel] [PATCH V4 1/2] OvmfPkg: Add SecPeiCcProbeLib Date: Sat, 27 Aug 2022 07:07:07 +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: HXQx1WA5c95dC74VfZCALU2ix1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1661555243; bh=9dfh1ukNspsaIOfsfA+6bW3pfdiR8qh5KGsvpJJ8Jio=; h=Cc:Date:From:Reply-To:Subject:To; b=BJ/qm0dGV6ofHxML57DmEz1zFgJRrh5/4IMtIgpJUbC3DNhefl48hDaxIOW7rFSXRUV y/9MkRtXIWmNb/or2Cv11FZAYd5xtsSl8u8uLmu4HnCM/O92tsne2KVhi1DxMrbrpIE4T Ej47/3AURSYDM63LpGGRHi/JmePdG2hqQnU= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1661555245226100003 Content-Type: text/plain; charset="utf-8" From: Min M Xu BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=3D3974 SecPeiCcProbeLib is designed to probe the Confidential Computing guest type in SEC/PEI phase. The CC guest type was set by each CC guest at the beginning of boot up and saved in PcdOvmfWorkArea. Cc: Erdem Aktas Cc: James Bottomley Cc: Jiewen Yao Cc: Gerd Hoffmann Cc: Tom Lendacky Signed-off-by: Min Xu --- OvmfPkg/Library/CcProbeLib/SecPeiCcProbeLib.c | 31 +++++++++++++++++++ .../Library/CcProbeLib/SecPeiCcProbeLib.inf | 25 +++++++++++++++ 2 files changed, 56 insertions(+) create mode 100644 OvmfPkg/Library/CcProbeLib/SecPeiCcProbeLib.c create mode 100644 OvmfPkg/Library/CcProbeLib/SecPeiCcProbeLib.inf diff --git a/OvmfPkg/Library/CcProbeLib/SecPeiCcProbeLib.c b/OvmfPkg/Librar= y/CcProbeLib/SecPeiCcProbeLib.c new file mode 100644 index 000000000000..d698e5c8d7f8 --- /dev/null +++ b/OvmfPkg/Library/CcProbeLib/SecPeiCcProbeLib.c @@ -0,0 +1,31 @@ +/** @file + + CcProbeLib is used to probe the Confidential computing guest type. + + Copyright (c) 2022, Intel Corporation. All rights reserved.
+ SPDX-License-Identifier: BSD-2-Clause-Patent + +**/ + +#include +#include + +/** + Probe the ConfidentialComputing Guest type. See defition of + CC_GUEST_TYPE in . + + @return The guest type + +**/ +UINT8 +EFIAPI +CcProbe ( + VOID + ) +{ + OVMF_WORK_AREA *WorkArea; + + WorkArea =3D (OVMF_WORK_AREA *)FixedPcdGet32 (PcdOvmfWorkAreaBase); + + return WorkArea !=3D NULL ? WorkArea->Header.GuestType : CcGuestTypeNonE= ncrypted; +} diff --git a/OvmfPkg/Library/CcProbeLib/SecPeiCcProbeLib.inf b/OvmfPkg/Libr= ary/CcProbeLib/SecPeiCcProbeLib.inf new file mode 100644 index 000000000000..f63ed71e7c28 --- /dev/null +++ b/OvmfPkg/Library/CcProbeLib/SecPeiCcProbeLib.inf @@ -0,0 +1,25 @@ +## @file +# CcProbeLib is used to probe Confidential Computing guest type. +# +# Copyright (c) 2022, Intel Corporation. All rights reserved.
+# SPDX-License-Identifier: BSD-2-Clause-Patent +# +## + +[Defines] + INF_VERSION =3D 0x00010005 + BASE_NAME =3D SecPeiCcProbeLib + FILE_GUID =3D 78eb7f2a-a42a-4b01-b160-5a05a0a52bac + MODULE_TYPE =3D BASE + VERSION_STRING =3D 1.0 + LIBRARY_CLASS =3D CcProbeLib|SEC PEIM PEI_CORE + +[Sources] + SecPeiCcProbeLib.c + +[Packages] + MdePkg/MdePkg.dec + OvmfPkg/OvmfPkg.dec + +[Pcd] + gUefiOvmfPkgTokenSpaceGuid.PcdOvmfWorkAreaBase --=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 (#92874): https://edk2.groups.io/g/devel/message/92874 Mute This Topic: https://groups.io/mt/93281452/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-