From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mx2.freebsd.org (mx2.freebsd.org [96.47.72.81]) by mx.groups.io with SMTP id smtpd.web10.7142.1687180388005031465 for ; Mon, 19 Jun 2023 06:13:08 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="body hash did not verify" header.i=@freebsd.org header.s=dkim header.b=yraccekD; spf=pass (domain: freebsd.org, ip: 96.47.72.81, mailfrom: corvink@freebsd.org) Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits)) (Client CN "mx1.freebsd.org", Issuer "R3" (verified OK)) by mx2.freebsd.org (Postfix) with ESMTPS id 4Ql9Dg2v1Wz3Lt3; Mon, 19 Jun 2023 13:13:07 +0000 (UTC) (envelope-from corvink@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Ql9Dg2BGjz3vLP; Mon, 19 Jun 2023 13:13:07 +0000 (UTC) (envelope-from corvink@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1687180387; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=zEfQOzZlriC8xgfdqfWBecoWMPyKztz5zACneSjtJnE=; b=yraccekD4TXmdQu8FZwHWTc8RqzO2Cc5fKqNLKhI7NMPKENY56UctlF8gwPOoA/KtZ99jE /vptYhLHhFuGSn+O2HFLdoCpVnHR1fRW3SOlfjs760PZFzOZZAlVq+Z9lkxRbRNedC8oRr XjmieR/Y9djVQLbT7reXGwS9Q525KO3K01HPu7nSpeOlZglhGRjU60yjSq+vNWkN/zbScn +YPDYdRTX1D50WB8aNSazN9AdkbG+zpgszyNBXMt0lpGFT+Hqm8lOeJt56bLhWGnmYmYgr ag7aDUW/iwWcuhri7roSJ1XDwsCSapFoz94BEfK3XkMGVO1q34q2SFPek0YDww== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1687180387; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=zEfQOzZlriC8xgfdqfWBecoWMPyKztz5zACneSjtJnE=; b=ElxZYxL7T5Os5nlfoOsu8S2AYBotqNWRNCYrcO8/jsAc03b1epXZ5TAhAjxTYp8XgQAMvQ freP5X2PsplHV3ud1U+OcO33gCOHq11a0Z6/mkX0Jl/1GTKrNX7Bxf63wcYKpdRas1Q2Ro jxguPS+/2RdUGKgJHnF0bGllngrgXGBAgvWse6A8m1xKEX1Bb3oFOd/PFu/rFlhy3xsf2v o0xIpFfJ0YMZ81BSszjFhmlO5wiMj2phWBA7M10iTNzJSAeVVsMdh4X1Jqm4Ozj5qtKJqK vXC3uXQDrte1k1Jgqa1Wdxs5wkcJA8cbM57s/D3p3VJ6MNWKWUaZUM0Nw3iGyA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1687180387; a=rsa-sha256; cv=none; b=tqtEGVN2dFNI7epNNp4M3291s2apH1kUcu0XDK1yoDsN8JuXcTpc4tmKH4Xx60cjnKHW2H qXXCRMMcpfk/snJzcQQ7D1iqd3syG8r9ndML2FhcVHgns/B0HDGMzqNoEMHyQj+AD0n/2i LHj3ujieooXFI1QJOVmXS15eDTyUHaF9KoYTN8PmLfBAz4eBQaaHSU4d7pNDmQ/6YN9zx1 MMnUXvUIteeH119lLPMT0p9KZx79/idKHl/HmkUh/NV+B/OFGPyOcqS9I02S35IgCeoRom tX/4CBXhEFTamozFVUVwRDWUhYdzVENPz/gFjZlsicigqT5DpmFBKlYTy1Ynzg== Received: from corvink-nb.fritz.box (unknown [IPv6:2001:9e8:da5e:c500:c216:138:c907:f83b]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) (Authenticated sender: corvink) by smtp.freebsd.org (Postfix) with ESMTPSA id 4Ql9Df1XCNzVM1; Mon, 19 Jun 2023 13:13:06 +0000 (UTC) (envelope-from corvink@FreeBSD.org) From: =?UTF-8?B?Q29ydmluIEvDtmhuZQ==?= To: devel@edk2.groups.io Cc: Ard Biesheuvel , Gerd Hoffmann , Jiewen Yao , Jordan Justen , Leif Lindholm , Peter Grehan , Rebecca Cran , Sami Mujawar Subject: [PATCH v2 4/6] OvmfPkg: move BootScript into AcpiPlatformLib Date: Mon, 19 Jun 2023 15:12:26 +0200 Message-ID: <20230619131255.364358-5-corvink@FreeBSD.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230619131255.364358-1-corvink@FreeBSD.org> References: <20230619131255.364358-1-corvink@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable This is required to move InstallQemuFwCfgTables into AcpiPlatformLib. Signed-off-by: Corvin K=C3=B6hne Cc: Ard Biesheuvel Cc: Gerd Hoffmann Cc: Jiewen Yao Cc: Jordan Justen Cc: Leif Lindholm Cc: Peter Grehan Cc: Rebecca Cran Cc: Sami Mujawar --- OvmfPkg/AcpiPlatformDxe/AcpiPlatformDxe.inf | 2 -- .../AcpiPlatformLib/DxeAcpiPlatformLib.inf | 2 ++ OvmfPkg/AcpiPlatformDxe/AcpiPlatform.h | 27 ------------------- OvmfPkg/Include/Library/AcpiPlatformLib.h | 27 +++++++++++++++++++ .../AcpiPlatformLib}/BootScript.c | 3 +-- 5 files changed, 30 insertions(+), 31 deletions(-) rename OvmfPkg/{AcpiPlatformDxe =3D> Library/AcpiPlatformLib}/BootScript= .c (96%) diff --git a/OvmfPkg/AcpiPlatformDxe/AcpiPlatformDxe.inf b/OvmfPkg/AcpiPl= atformDxe/AcpiPlatformDxe.inf index b22aad95e081..6001b9626970 100644 --- a/OvmfPkg/AcpiPlatformDxe/AcpiPlatformDxe.inf +++ b/OvmfPkg/AcpiPlatformDxe/AcpiPlatformDxe.inf @@ -23,7 +23,6 @@ [Defines] [Sources] AcpiPlatform.c AcpiPlatform.h - BootScript.c CloudHvAcpi.c EntryPoint.c QemuFwCfgAcpi.c @@ -40,7 +39,6 @@ [LibraryClasses] MemoryAllocationLib OrderedCollectionLib QemuFwCfgLib - QemuFwCfgS3Lib UefiDriverEntryPoint HobLib TpmMeasurementLib diff --git a/OvmfPkg/Library/AcpiPlatformLib/DxeAcpiPlatformLib.inf b/Ovm= fPkg/Library/AcpiPlatformLib/DxeAcpiPlatformLib.inf index 4be501bb2c58..b6e55b618cbb 100644 --- a/OvmfPkg/Library/AcpiPlatformLib/DxeAcpiPlatformLib.inf +++ b/OvmfPkg/Library/AcpiPlatformLib/DxeAcpiPlatformLib.inf @@ -15,6 +15,7 @@ [Defines] LIBRARY_CLASS =3D AcpiPlatformLib =20 [Sources] + BootScript.c DxeAcpiPlatformLib.c PciDecoding.c =20 @@ -27,6 +28,7 @@ [LibraryClasses] BaseLib DebugLib PcdLib + QemuFwCfgS3Lib UefiBootServicesTableLib =20 [Pcd] diff --git a/OvmfPkg/AcpiPlatformDxe/AcpiPlatform.h b/OvmfPkg/AcpiPlatfor= mDxe/AcpiPlatform.h index 1328f6d1cba6..c9f2755014a1 100644 --- a/OvmfPkg/AcpiPlatformDxe/AcpiPlatform.h +++ b/OvmfPkg/AcpiPlatformDxe/AcpiPlatform.h @@ -11,8 +11,6 @@ =20 #include // EFI_ACPI_TABLE_PROTOCOL =20 -typedef struct S3_CONTEXT S3_CONTEXT; - EFI_STATUS EFIAPI InstallCloudHvTablesTdx ( @@ -37,29 +35,4 @@ InstallAcpiTables ( IN EFI_ACPI_TABLE_PROTOCOL *AcpiTable ); =20 -EFI_STATUS -AllocateS3Context ( - OUT S3_CONTEXT **S3Context, - IN UINTN WritePointerCount - ); - -VOID -ReleaseS3Context ( - IN S3_CONTEXT *S3Context - ); - -EFI_STATUS -SaveCondensedWritePointerToS3Context ( - IN OUT S3_CONTEXT *S3Context, - IN UINT16 PointerItem, - IN UINT8 PointerSize, - IN UINT32 PointerOffset, - IN UINT64 PointerValue - ); - -EFI_STATUS -TransferS3ContextToBootScript ( - IN S3_CONTEXT *S3Context - ); - #endif diff --git a/OvmfPkg/Include/Library/AcpiPlatformLib.h b/OvmfPkg/Include/= Library/AcpiPlatformLib.h index 167d6c49d6e2..70c974dce05e 100644 --- a/OvmfPkg/Include/Library/AcpiPlatformLib.h +++ b/OvmfPkg/Include/Library/AcpiPlatformLib.h @@ -15,6 +15,8 @@ typedef struct { UINT64 PciAttributes; } ORIGINAL_ATTRIBUTES; =20 +typedef struct S3_CONTEXT S3_CONTEXT; + /** Searches and returns the address of the ACPI Root System Description P= ointer (RSDP) in system memory. =20 @@ -69,4 +71,29 @@ RestorePciDecoding ( IN UINTN Count ); =20 +EFI_STATUS +AllocateS3Context ( + OUT S3_CONTEXT **S3Context, + IN UINTN WritePointerCount + ); + +VOID +ReleaseS3Context ( + IN S3_CONTEXT *S3Context + ); + +EFI_STATUS +SaveCondensedWritePointerToS3Context ( + IN OUT S3_CONTEXT *S3Context, + IN UINT16 PointerItem, + IN UINT8 PointerSize, + IN UINT32 PointerOffset, + IN UINT64 PointerValue + ); + +EFI_STATUS +TransferS3ContextToBootScript ( + IN S3_CONTEXT *S3Context + ); + #endif diff --git a/OvmfPkg/AcpiPlatformDxe/BootScript.c b/OvmfPkg/Library/AcpiP= latformLib/BootScript.c similarity index 96% rename from OvmfPkg/AcpiPlatformDxe/BootScript.c rename to OvmfPkg/Library/AcpiPlatformLib/BootScript.c index ff1491de0d2d..1b1658d703b0 100644 --- a/OvmfPkg/AcpiPlatformDxe/BootScript.c +++ b/OvmfPkg/Library/AcpiPlatformLib/BootScript.c @@ -7,13 +7,12 @@ SPDX-License-Identifier: BSD-2-Clause-Patent **/ =20 +#include #include // CpuDeadLoop() #include // DEBUG() #include // AllocatePool() #include // QemuFwCfgS3ScriptSkipBytes() =20 -#include "AcpiPlatform.h" - // // Condensed structure for capturing the fw_cfg operations -- select, sk= ip, // write -- inherent in executing a QEMU_LOADER_WRITE_POINTER command. --=20 2.41.0