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.web11.9458.1687265663146404604 for ; Tue, 20 Jun 2023 05:54:23 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="body hash did not verify" header.i=@freebsd.org header.s=dkim header.b=o4vjZWQb; 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 4QlmmZ3n0sz3ZRF; Tue, 20 Jun 2023 12:54:22 +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 4QlmmZ2sK2z4T30; Tue, 20 Jun 2023 12:54:22 +0000 (UTC) (envelope-from corvink@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1687265662; 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=o4vjZWQbW2Os/Lfet68LPPnymx/4cxE+8HDe6Fl3kf64/Id17kh13vhm9UPJGGPWxyl38u 7BRl/muvcTHW/q5l2ty1zrWavLhbDfUmLnfMQwwflmBp7FAgWSjhn5Aib6EFwBhE3F25VI 52JviXzQUCVz3kPFxfweA8gkAO0hiVbxdH4JHcAKq8+wl6JwKkMH9kqc6TfxyDrPWZ6eGs xoj+7ob/L/IkjnAg1CM57UYsw6uokzhg4ajr/c0W41cQUFDrmhgXPhxAShIx+IbkQdhDok ob4NdKvNR3NJI4h/qfNnBbjO1NTIpd1h3tLK/E4LWMbzvgSXqpy10kvhAmNBrg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1687265662; 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=pJwFI0XCV81NrOzhUptNKNBC9NBI877d2nigQHJCGEivshhNuMqIWtc4thfGFU7Ul7h3qh K6FeYrAEIddVB+MvO1UwyLPUuX6Duvvow4Qmbv9hvw9tbkVoQX2fMj3nlKYQ5ArZmgt/Zd VMCsDWOSEj6OuwgRLEgnxhQNPXq+UXEerpV+AYj0yRXUyRROcUbUGhLF/zr0Au7Fw1DD38 ZdchmZgAYp6cqiQYF0f1hfs/YUtjnoj+cHLdNwqql7vkVxbUJcCA9DMtGc8SUXHyZ0p1Ii mLp/J4UzN+4aHpnmjNVN1fErb8i2KK5ZqxTbvilD3hE90tSz3on67gOMa/TVPA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1687265662; a=rsa-sha256; cv=none; b=blNvzmTqiyKgF19NSppx0oZZA9o3W8Dh2RXnSde1cAflig3rWAIhBpavL3i+HoZ/aFOVOE 9nOe2QVvKh0WAQoOYiEbeYh6vY/1A3VsMRnuAB4gEBR/NnzzS99z5uyn4nZNKX3j1AaDBO ItdKx49gaTINxpCuy32Dgz6muYeom4EwAH5SVGM4OqNpgrG9v4pG2Ym5CjSO9KxdGxFa6H LFCafOzQMUxYMXiytJ7VLS5LGH6KEOBYHMC3NB2XF5ZLOXN2G9yjfiGIj1wTjWCNLZoiF0 74mx9FAsZsPjveW+GQ6VrMXF8rgADMAowCI12x1KX+xG5p3QL6ULH1zgjPm5Ag== Received: from corvink-nb.beckhoff.com (unknown [IPv6:2001:9e8:da45:9200:c724:a25a:dc54:e67e]) (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 4QlmmY2Chxz10rg; Tue, 20 Jun 2023 12:54:21 +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 v3 4/6] OvmfPkg: move BootScript into AcpiPlatformLib Date: Tue, 20 Jun 2023 14:53:38 +0200 Message-ID: <20230620125407.516697-5-corvink@FreeBSD.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230620125407.516697-1-corvink@FreeBSD.org> References: <20230620125407.516697-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