From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by mx.groups.io with SMTP id smtpd.web11.790.1652845073744432984 for ; Tue, 17 May 2022 20:37:54 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="unable to parse pub key" header.i=@intel.com header.s=intel header.b=bxO0FH5D; spf=pass (domain: intel.com, ip: 134.134.136.20, mailfrom: min.m.xu@intel.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1652845073; x=1684381073; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=jsdbC2oYFr3tqSCmyicvf+xCf0QjI6UTYXE7UiG9u4E=; b=bxO0FH5DG+Cmhphp8A2Gwl5u1JWaQ9ZuqM1jkYfdAvJuYe3d82SjIeYi UfcAtVB7figkRDLYAvXmhmOj6C8Aazvi5O8EmY6bdDBvgnJgzd2ADDsjW XMuN5n7C1ChTOQo6P0R7Y8A0Jhs8hXyuKyDC0+GzLkViuRfmE54JzlGjo /VN+qTmUwmvCCN8TX/8KXnqMAfAC/BeknVfNgl+2i9JUWlMTB5/xHWZxG GfOG5SzkAt/rISwHdPBgmXHIxBONtSbplu6rCy9jSTojpwmThB9JqYMZ7 h60M6YOl0VSN8cQuhBRgHqou2RXRe6vWMreUXuhzgjzmdbdHNva9rBYa0 w==; X-IronPort-AV: E=McAfee;i="6400,9594,10350"; a="259021473" X-IronPort-AV: E=Sophos;i="5.91,234,1647327600"; d="scan'208";a="259021473" Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 May 2022 20:37:34 -0700 X-IronPort-AV: E=Sophos;i="5.91,234,1647327600"; d="scan'208";a="742113278" Received: from mxu9-mobl1.ccr.corp.intel.com ([10.249.174.105]) by orsmga005-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 May 2022 20:37:31 -0700 From: "Min Xu" To: devel@edk2.groups.io Cc: Min Xu , Andrew Fish , Leif Lindholm , Michael D Kinney , Dann Frazier , Erdem Aktas , James Bottomley , Jiewen Yao , Tom Lendacky , Liming Gao , Jiewen Yao Subject: [PATCH V2 1/1] [edk2-stable202205]OvmfPkg/OvmfPkgX64: Use different CcProbeLib when SMM is on or off Date: Wed, 18 May 2022 11:37:16 +0800 Message-Id: <21af12a38d5cf2acc4fe2c7ee39105feecf4e91d.1652844962.git.min.m.xu@intel.com> X-Mailer: git-send-email 2.29.2.windows.2 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=3930 CcProbeLib is designed to check the vm guest type. The OvmfPkg/CcProbeLib reads the OvmfWorkArea (0x80B000) to get the vm guest type which is written by each guest (SEV or TDX guest). But in SMM drivers the access to OvmfWorkArea is illegal. PiSmmCpuDxeSmm.inf is an example. It uses IoLib which in OvmfPkgX64 BaseIoLibIntrinsicSev.inf is included. The IoLib probes if the working guest is td guest by calling CcProbe(). So CcProbeLibNull will be included when SMM_REQUIRE is set. Currently only TDVF uses CcProbe to check the guest type, and TDVF doesn't support SMM, so this fix has no side-effect. Cc: Andrew Fish Cc: Leif Lindholm Cc: Michael D Kinney Cc: Dann Frazier Cc: Erdem Aktas Cc: James Bottomley Cc: Jiewen Yao Cc: Tom Lendacky Cc: Liming Gao Tested-by: dann frazier Acked-by: Jiewen Yao Signed-off-by: Min Xu --- OvmfPkg/OvmfPkgX64.dsc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/OvmfPkg/OvmfPkgX64.dsc b/OvmfPkg/OvmfPkgX64.dsc index 71526bba3183..db7f4def7a24 100644 --- a/OvmfPkg/OvmfPkgX64.dsc +++ b/OvmfPkg/OvmfPkgX64.dsc @@ -171,7 +171,6 @@ PciCapLib|OvmfPkg/Library/BasePciCapLib/BasePciCapLib.inf PciCapPciSegmentLib|OvmfPkg/Library/BasePciCapPciSegmentLib/BasePciCapPciSegmentLib.inf PciCapPciIoLib|OvmfPkg/Library/UefiPciCapPciIoLib/UefiPciCapPciIoLib.inf - CcProbeLib|OvmfPkg/Library/CcProbeLib/CcProbeLib.inf IoLib|MdePkg/Library/BaseIoLibIntrinsic/BaseIoLibIntrinsicSev.inf OemHookStatusCodeLib|MdeModulePkg/Library/OemHookStatusCodeLibNull/OemHookStatusCodeLibNull.inf SerialPortLib|PcAtChipsetPkg/Library/SerialIoLib/SerialIoLib.inf @@ -198,6 +197,9 @@ !if $(SMM_REQUIRE) == FALSE LockBoxLib|OvmfPkg/Library/LockBoxLib/LockBoxBaseLib.inf + CcProbeLib|OvmfPkg/Library/CcProbeLib/CcProbeLib.inf +!else + CcProbeLib|MdePkg/Library/CcProbeLibNull/CcProbeLibNull.inf !endif CustomizedDisplayLib|MdeModulePkg/Library/CustomizedDisplayLib/CustomizedDisplayLib.inf FrameBufferBltLib|MdeModulePkg/Library/FrameBufferBltLib/FrameBufferBltLib.inf -- 2.29.2.windows.2