From nobody Tue Feb 10 00:39:54 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+99960+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+99960+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1676009144; cv=none; d=zohomail.com; s=zohoarc; b=ZasPdNYFy+/ggxuJOxhYqHHrQ10IveGtWtQa+esuvZLBlTMlWOQCStMtF1MGMe024CDezLWmoZfk/iTf2GpPxFzpD9U0gs+T+34cuYM8FUcxkBK/bgzC+bxkIrKzOOF/vYlWCjZhrNM0enRx1AgLufTnTHHlQZ7Fj/nb3HVQhz0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1676009144; h=Cc:Date:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:Message-ID:Reply-To:References:Sender:Subject:To; bh=y52ED/WxUxBpq1KIdn8NMw+pczvr2WSpsfIXLYxLm94=; b=MKoRsPg5gqKBSGxezfM3MkRdRgUm8W8FqEQor29jXQA+gU1fyzBBfIWPmqhPuoNzMoS7ZJ32L+CI++p7If3o913TD2Jf7mQteNmjifG5PizGqAnWV80VWajYBz0GcdSEh4I1in28Z1PC/zeuoC7Zq/fD+j+ktkDDTuGlR4jsC5o= 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+99960+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 167600914434061.02777788830099; Thu, 9 Feb 2023 22:05:44 -0800 (PST) Return-Path: X-Received: by 127.0.0.2 with SMTP id mpHsYY1788612xNcpfk2ZhHy; Thu, 09 Feb 2023 22:05:43 -0800 X-Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by mx.groups.io with SMTP id smtpd.web11.7856.1676009142701719213 for ; Thu, 09 Feb 2023 22:05:43 -0800 X-IronPort-AV: E=McAfee;i="6500,9779,10616"; a="310711776" X-IronPort-AV: E=Sophos;i="5.97,286,1669104000"; d="scan'208";a="310711776" X-Received: from orsmga004.jf.intel.com ([10.7.209.38]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Feb 2023 22:05:41 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10616"; a="791854754" X-IronPort-AV: E=Sophos;i="5.97,286,1669104000"; d="scan'208";a="791854754" X-Received: from sh1gapp1009.ccr.corp.intel.com ([10.239.189.79]) by orsmga004.jf.intel.com with ESMTP; 09 Feb 2023 22:05:37 -0800 From: "Wu, Jiaxin" To: devel@edk2.groups.io Cc: Eric Dong , Ray Ni , Zeng Star , Laszlo Ersek , Gerd Hoffmann , Rahul Kumar Subject: [edk2-devel] [PATCH v4 5/5] OvmfPkg/SmmCpuFeaturesLib: Check SmBase relocation supported or not Date: Fri, 10 Feb 2023 14:05:19 +0800 Message-Id: <20230210060519.11100-6-jiaxin.wu@intel.com> In-Reply-To: <20230210060519.11100-1-jiaxin.wu@intel.com> References: <20230210060519.11100-1-jiaxin.wu@intel.com> 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,jiaxin.wu@intel.com X-Gm-Message-State: NREXWsSw426bIwI91XlYOpaPx1787277AA= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1676009143; bh=KhZj7X+8JPTwJJGsWTLpjkY1e2whjhZou4wt0eyWU0Q=; h=Cc:Date:From:Reply-To:Subject:To; b=PzJLhFUITFDT6JSxWYOfL1JUlARZxKNpH4WGFGDY+lWPyeCEGGkBdNfIAmn0WWn1UJZ el9CM8eJuq47ehoHiC+6f1SEV2oJZ9iPKcwZ0kTSeinfn2u/LlC/ngBcY4/729iON0e1Y 6Z6fKIBn32TUTN6o8Y+EccBhPfG2s8vrKH8= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1676009144907100001 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D4337 This patch is to check SmBase relocation supported or not. If gSmmBaseHobGuid found, means SmBase info has been relocated and recorded in the SmBase array. ASSERT it's not supported in OVMF. Cc: Eric Dong Cc: Ray Ni Cc: Zeng Star Cc: Laszlo Ersek Cc: Gerd Hoffmann Cc: Rahul Kumar Signed-off-by: Jiaxin Wu Reviewed-by: Gerd Hoffmann --- OvmfPkg/Library/SmmCpuFeaturesLib/SmmCpuFeaturesLib.c | 8 ++++++++ OvmfPkg/Library/SmmCpuFeaturesLib/SmmCpuFeaturesLib.inf | 4 ++++ 2 files changed, 12 insertions(+) diff --git a/OvmfPkg/Library/SmmCpuFeaturesLib/SmmCpuFeaturesLib.c b/OvmfPk= g/Library/SmmCpuFeaturesLib/SmmCpuFeaturesLib.c index 6693666d04..ec918cad06 100644 --- a/OvmfPkg/Library/SmmCpuFeaturesLib/SmmCpuFeaturesLib.c +++ b/OvmfPkg/Library/SmmCpuFeaturesLib/SmmCpuFeaturesLib.c @@ -15,14 +15,16 @@ #include #include #include #include #include +#include #include #include #include #include +#include =20 // // EFER register LMA bit // #define LMA BIT10 @@ -41,10 +43,16 @@ EFIAPI SmmCpuFeaturesLibConstructor ( IN EFI_HANDLE ImageHandle, IN EFI_SYSTEM_TABLE *SystemTable ) { + // + // If gSmmBaseHobGuid found, means SmBase info has been relocated and re= corded + // in the SmBase array. ASSERT it's not supported in OVMF. + // + ASSERT (GetFirstGuidHob (&gSmmBaseHobGuid) =3D=3D NULL); + // // No need to program SMRRs on our virtual platform. // return EFI_SUCCESS; } diff --git a/OvmfPkg/Library/SmmCpuFeaturesLib/SmmCpuFeaturesLib.inf b/Ovmf= Pkg/Library/SmmCpuFeaturesLib/SmmCpuFeaturesLib.inf index 8a426a4c10..6a281518f5 100644 --- a/OvmfPkg/Library/SmmCpuFeaturesLib/SmmCpuFeaturesLib.inf +++ b/OvmfPkg/Library/SmmCpuFeaturesLib/SmmCpuFeaturesLib.inf @@ -33,10 +33,14 @@ MemoryAllocationLib PcdLib SafeIntLib SmmServicesTableLib UefiBootServicesTableLib + HobLib + +[Guids] + gSmmBaseHobGuid ## CONSUMES =20 [Pcd] gUefiCpuPkgTokenSpaceGuid.PcdCpuMaxLogicalProcessorNumber gUefiOvmfPkgTokenSpaceGuid.PcdCpuHotEjectDataAddress gUefiOvmfPkgTokenSpaceGuid.PcdQ35SmramAtDefaultSmbase --=20 2.16.2.windows.1 -=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 (#99960): https://edk2.groups.io/g/devel/message/99960 Mute This Topic: https://groups.io/mt/96871375/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-