From nobody Sun Feb 8 22:43:38 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+88118+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+88118+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1648455010; cv=none; d=zohomail.com; s=zohoarc; b=RwwZ7vnPKpAACIwMsPKFZEDuMDlLxW4JYkh+4sImh8D+qA97CL1NJiwQeSjbKr5UIIp4+ych9Kv90JB4yd2seQcvgiWceIe2r9SfPDuuji6f/4/rZ3HVC0sKvSascwDiRTEbMSNGsx1PVzbQC57ToRm7Vs66wpGoJDanim7/5Yk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1648455010; 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=p0PePgS2OsU4/Nmb0M2YcbiYNXLQXJD2yLMbsz/twQc=; b=KLC3iOn2G9pq6qSG4/wnNASVyrwkp+bKpebMyYfrNf2tQry8ad4rMSCy/i8ATxARJwpjd9yxgbxiegUQS7fsCe/EnQZP28nnBOI6K/rNatrZoqhb2AQ9I13s512L3BokG+o+5rMvgfxAiBKsACRr11RERkrbiniB+oYIWmOc0m0= 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+88118+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 1648455010796514.4564447528514; Mon, 28 Mar 2022 01:10:10 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id SSusYY1788612x8X974bNJNL; Mon, 28 Mar 2022 01:10:10 -0700 X-Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by mx.groups.io with SMTP id smtpd.web12.8480.1648454962517853012 for ; Mon, 28 Mar 2022 01:10:09 -0700 X-IronPort-AV: E=McAfee;i="6200,9189,10299"; a="257771177" X-IronPort-AV: E=Sophos;i="5.90,216,1643702400"; d="scan'208";a="257771177" X-Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Mar 2022 01:10:09 -0700 X-IronPort-AV: E=Sophos;i="5.90,216,1643702400"; d="scan'208";a="563428014" X-Received: from mxu9-mobl1.ccr.corp.intel.com ([10.249.175.167]) by orsmga008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Mar 2022 01:10:06 -0700 From: "Min Xu" To: devel@edk2.groups.io Cc: Min Xu , Ard Biesheuvel , Jordan Justen , Brijesh Singh , Erdem Aktas , James Bottomley , Jiewen Yao , Tom Lendacky , Gerd Hoffmann , Sebastien Boeuf Subject: [edk2-devel] [PATCH V11 28/47] OvmfPkg/PlatformPei: Refactor MiscInitialization Date: Mon, 28 Mar 2022 16:08: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: LlJV0Bj6ZDsXWmHlm8xpgixix1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1648455010; bh=Nv6m+zrq1kI6wpbhEB2sBxLzBjdAIBj4QLvI+1MYF9Q=; h=Cc:Date:From:Reply-To:Subject:To; b=Aot6rMtCcLAgj3+cUEZq2VbQbDTJC9kK9KxrDy9Ao4GVoC0i310r5XdwV4OKW5XLlFO 9D+YDAHpOMhanDVzMOoGzzK7aNEMZBE+GtnNrB+fXE+Hxh+RPS3vS4BmeOVubyu2MV/eG ADrprb94VhVYD4n5V0u8VsI0IqkuJSJfLjg= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1648455011656100027 Content-Type: text/plain; charset="utf-8" BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=3D3863 MiscInitialization is split into 2 functions: - PlatformMiscInitialization is for PlatformInitLib. - MiscInitialization calls PlatformMiscInitialization and then sets PCD. It is for PlatformPei. Cc: Ard Biesheuvel Cc: Jordan Justen Cc: Brijesh Singh Cc: Erdem Aktas Cc: James Bottomley Cc: Jiewen Yao Cc: Tom Lendacky Cc: Gerd Hoffmann Cc: Sebastien Boeuf Acked-by: Gerd Hoffmann Signed-off-by: Min Xu --- OvmfPkg/PlatformPei/Platform.c | 43 ++++++++++++++++++++-------------- 1 file changed, 26 insertions(+), 17 deletions(-) diff --git a/OvmfPkg/PlatformPei/Platform.c b/OvmfPkg/PlatformPei/Platform.c index e91acca9f769..02697c473d01 100644 --- a/OvmfPkg/PlatformPei/Platform.c +++ b/OvmfPkg/PlatformPei/Platform.c @@ -57,12 +57,12 @@ PlatformMemMapInitialization ( IN OUT EFI_HOB_PLATFORM_INFO *PlatformInfoHob ) { - UINT64 PciIoBase; - UINT64 PciIoSize; - UINT32 TopOfLowRam; - UINT64 PciExBarBase; - UINT32 PciBase; - UINT32 PciSize; + UINT64 PciIoBase; + UINT64 PciIoSize; + UINT32 TopOfLowRam; + UINT64 PciExBarBase; + UINT32 PciBase; + UINT32 PciSize; =20 PciIoBase =3D 0xC000; PciIoSize =3D 0x4000; @@ -360,17 +360,16 @@ MiscInitializationForMicrovm ( } =20 VOID -MiscInitialization ( +PlatformMiscInitialization ( IN EFI_HOB_PLATFORM_INFO *PlatformInfoHob ) { - UINTN PmCmd; - UINTN Pmba; - UINT32 PmbaAndVal; - UINT32 PmbaOrVal; - UINTN AcpiCtlReg; - UINT8 AcpiEnBit; - RETURN_STATUS PcdStatus; + UINTN PmCmd; + UINTN Pmba; + UINT32 PmbaAndVal; + UINT32 PmbaOrVal; + UINTN AcpiCtlReg; + UINT8 AcpiEnBit; =20 // // Disable A20 Mask @@ -417,9 +416,6 @@ MiscInitialization ( return; } =20 - PcdStatus =3D PcdSet16S (PcdOvmfHostBridgePciDevId, PlatformInfoHob->Hos= tBridgeDevId); - ASSERT_RETURN_ERROR (PcdStatus); - if (PlatformInfoHob->HostBridgeDevId =3D=3D CLOUDHV_DEVICE_ID) { DEBUG ((DEBUG_INFO, "%a: Cloud Hypervisor is done.\n", __FUNCTION__)); return; @@ -464,6 +460,19 @@ MiscInitialization ( } } =20 +VOID +MiscInitialization ( + IN EFI_HOB_PLATFORM_INFO *PlatformInfoHob + ) +{ + RETURN_STATUS PcdStatus; + + PlatformMiscInitialization (PlatformInfoHob); + + PcdStatus =3D PcdSet16S (PcdOvmfHostBridgePciDevId, PlatformInfoHob->Hos= tBridgeDevId); + ASSERT_RETURN_ERROR (PcdStatus); +} + VOID BootModeInitialization ( IN OUT EFI_HOB_PLATFORM_INFO *PlatformInfoHob --=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 (#88118): https://edk2.groups.io/g/devel/message/88118 Mute This Topic: https://groups.io/mt/90080005/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-