From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by mx.groups.io with SMTP id smtpd.web11.16992.1676301541096724228 for ; Mon, 13 Feb 2023 07:19:01 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=GoA8lEqF; spf=pass (domain: kernel.org, ip: 145.40.68.75, 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 ams.source.kernel.org (Postfix) with ESMTPS id 7D8DCB81260; Mon, 13 Feb 2023 15:18:59 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 756B2C433A4; Mon, 13 Feb 2023 15:18:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1676301538; bh=msN91X6eNYX8SRgSRrfuXxrzOMfbngbgKamiaqvGGEc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=GoA8lEqFzOrrIUb+Ea/AgQA3EiHZ5PpO4LDw8GKKiYcJHhdEfo3suOQrg23kP8zXh RFEAZfw9eefTN3+KhQQSZ1URDebyMh0Q34X+YmeGe/pKsFn1lzEcquyMzLbSuay96T YebHVEdbqGhkLoYfaA77NoJ8db1KCbDh9Agxo7yJ5aZ2/jnVUZY5Cwz1vFSGX6u50f yiYm80uH06WU6MhT+2No+HZhbqMnMQs9wLcyoxHA2gpuaZHYGTxXQf/xYV/GdnLr4v WIpFsliMzdnjvBpi8ROvQFMEr0xcYm3DPMRDHqRXkzeckE+gN6Crx0SPEiQgSQpJml AuFn2Yeuj+Kog== 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 , Matthew Garrett , Peter Jones , Kees Cook Subject: [RFC 10/13] ArmVirtPkg/ArmVirtQemu: Use PEI flavor of ArmMmuLib for all PEIMs Date: Mon, 13 Feb 2023 16:18:07 +0100 Message-Id: <20230213151810.2301480-11-ardb@kernel.org> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230213151810.2301480-1-ardb@kernel.org> References: <20230213151810.2301480-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 dd4c84ae6eb9..69e51d19300d 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.1