From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by mx.groups.io with SMTP id smtpd.web11.26503.1678727920720546779 for ; Mon, 13 Mar 2023 10:18:40 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=rA8A7urH; spf=pass (domain: kernel.org, ip: 139.178.84.217, mailfrom: ardb@kernel.org) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 4365A6142D; Mon, 13 Mar 2023 17:18:40 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 75EC5C4339C; Mon, 13 Mar 2023 17:18:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1678727919; bh=OSMkFts3RcsbykAAYuRDZpLIvxFiaUgAUK8vIb7fTKc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=rA8A7urH5JSmy/bDMHFqPpuiQKcZX4UN6HgtTi1Q6vmb2sg5dK1+vIDgYfCjqzAEn w7z5HAF0NgHgjS5AYrBqcBTqN/sevEfdtlXzMN1DE67FO4S5mAGQCojQUflcN05F8S Ba2oib/OmFXRUqUXk+DNqHld7NFGYIDUmYYGK7d6K+E+OTxWbvlE8UK6DD6LE3YoiI OBW75QH+GtjkvqcsEpTXuLq6jspZwXN+CS2e+w3oVtgOI3QwP7l3+M81fXzYXN11km f2Yi1m2XL4ouHwuTA11rgjByiXzSbC+lAd5QNHaoCoRq4UOdrod4firWopEDohau5W yilh6qB21kQ8Q== From: "Ard Biesheuvel" To: devel@edk2.groups.io Cc: Ard Biesheuvel , Michael Kinney , Liming Gao , Jiewen Yao , Michael Kubacki , Sean Brogan , Rebecca Cran , Leif Lindholm , Sami Mujawar , Taylor Beebe Subject: [PATCH v5 25/38] ArmVirtPkg/ArmVirtQemu: Use PEI flavor of ArmMmuLib for all PEIMs Date: Mon, 13 Mar 2023 18:17:01 +0100 Message-Id: <20230313171714.3866151-26-ardb@kernel.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230313171714.3866151-1-ardb@kernel.org> References: <20230313171714.3866151-1-ardb@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable The PEI flavor of the ArmMmuLib will install a HOB that exposes its implementation of the special helper routine that is used to update live entries, so that other instantiations of ArmMmuLib can invoke it. This is needed to ensure that splitting page tables using break-before-make (BBM) does not unmap the code that is performing the split. However, the BASE variety of ArmMmuLib discovers the HOB and sets a global pointer to refer to it, which is not possible in PEIMs, and so all PEIMs must use the PEI variety of this library if one does. Signed-off-by: Ard Biesheuvel --- ArmVirtPkg/ArmVirtQemu.dsc | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/ArmVirtPkg/ArmVirtQemu.dsc b/ArmVirtPkg/ArmVirtQemu.dsc index b9c244f16e04..7f79a2b5fa6b 100644 --- a/ArmVirtPkg/ArmVirtQemu.dsc +++ b/ArmVirtPkg/ArmVirtQemu.dsc @@ -107,6 +107,9 @@ [LibraryClasses.common.PEIM] Tpm2DeviceLib|SecurityPkg/Library/Tpm2DeviceLibDTpm/Tpm2DeviceLibDTpm.in= f=0D !endif=0D =0D +[LibraryClasses.AARCH64.PEIM]=0D + ArmMmuLib|ArmPkg/Library/ArmMmuLib/ArmMmuPeiLib.inf=0D +=0D [LibraryClasses.common.DXE_DRIVER]=0D ReportStatusCodeLib|MdeModulePkg/Library/DxeReportStatusCodeLib/DxeRepor= tStatusCodeLib.inf=0D =0D @@ -333,12 +336,7 @@ [Components.common] ArmPlatformPkg/PrePeiCore/PrePeiCoreUniCore.inf=0D MdeModulePkg/Core/Pei/PeiMain.inf=0D ArmPlatformPkg/PlatformPei/PlatformPeim.inf=0D - ArmVirtPkg/MemoryInitPei/MemoryInitPeim.inf {=0D - =0D -!if $(ARCH) =3D=3D AARCH64=0D - ArmMmuLib|ArmPkg/Library/ArmMmuLib/ArmMmuPeiLib.inf=0D -!endif=0D - }=0D + ArmVirtPkg/MemoryInitPei/MemoryInitPeim.inf=0D ArmPkg/Drivers/CpuPei/CpuPei.inf=0D =0D !if $(TPM2_ENABLE) =3D=3D TRUE=0D --=20 2.39.2