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.7143.1687180389233341535
 for <devel@edk2.groups.io>;
 Mon, 19 Jun 2023 06:13:09 -0700
Authentication-Results: mx.groups.io;
 dkim=fail reason="body hash did not verify" header.i=@freebsd.org header.s=dkim header.b=Hjb4fnL5;
 spf=pass (domain: freebsd.org, ip: 96.47.72.81, mailfrom: corvink@freebsd.org)
Received: from mx1.freebsd.org (mx1.freebsd.org [96.47.72.80])
	(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 4Ql9Dh4QS0z3Lqc;
	Mon, 19 Jun 2023 13:13:08 +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 4Ql9Dh3dWzz3vRH;
	Mon, 19 Jun 2023 13:13:08 +0000 (UTC)
	(envelope-from corvink@FreeBSD.org)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim;
	t=1687180388;
	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=DoJtGLtZGy0jQOGKrgvDoz0SwhcJsMopHomtdMhlmJw=;
	b=Hjb4fnL5ry3B20hEiLawMRT9Y5f36EY9N/Xw7M65FyQ+1Nh6PUnuIuxAtl7rkzRFUXwE+l
	m6edNMUEwRnFmDJ8G77NBQNU+GV864uuWRCDEvGWxvMhDt1Hvfdvz+16+3BhT66HVs+Mj3
	VBAoW+9WbkDC9igm7LrDeP8F0BmWkraRqKrEKihVe1iMZAxYdEdHZMHndAqtMIfxAXBKrs
	6TyeXffxNY72ODPZoqAQdIpCucR8lqs4owPD6m92KmH/BRycn4NMNtevR/Ylt7SQFNnDEo
	Z3OyVHLq7wPOPHaUWnb3lzPA2p/dIvSaYrvGTn4lLKAL13E8OxtK9MJmvc9pSQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org;
	s=dkim; t=1687180388;
	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=DoJtGLtZGy0jQOGKrgvDoz0SwhcJsMopHomtdMhlmJw=;
	b=PwEHRNgX7HHC0sHKT9qrnirxBcKnRrdcyd7Dj7aBznu3Rlc2HxN8l4w0HaeNuled32n6QJ
	8gc/3d9omHwDlgc4rKUo3DliEPAvh9StxLsBaJ2JeWqvloMg469hZlcUqR1xbad0XKY9Eh
	CyLWGXo/UY7+n727/FyUKp2d29MALtDi+fgTsAwPMN1fugfGtjIGxwWZby8KnbmvgfF2O4
	5SuN2rKsfU+qG2K3CD4GAhc3BqOmLUNEG+//7db9zoC9+K22+1srRvL3892vUW3HX1hqvJ
	uG5uZ21aCSDjyLTW5D5CBLPPLwDcvJsvEHDZO+N1+80k3SOqwQTn1h5XgPGuqQ==
ARC-Authentication-Results: i=1;
	mx1.freebsd.org;
	none
ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1687180388; a=rsa-sha256; cv=none;
	b=Lhcj+VEsL7AY5J3CzcCtUujJiDIqRmExCk7uBdwtRaQOaZd/y8G1Xxmakh6dj2oxUyoiyE
	BfR9vUrlZRAqhyo9BpFGWmSqUZUOGYFF3t5hxk2b/xT+2D3+jamnY1T8m4vz3mQiEZeEIP
	NvdAnvS5XFSvYGCEiaTTGKpMiWTBtsFmYeOjgJIW4phCP+dcCK/YAmNzz2znLm6IVjeTmn
	BbOV9axbFFveLfS9jWezt58NGmqRisdxU+aLO50omTdEn4dK4zAkHg8YRWtgOKM3BlEyq2
	DKNjnOcC5KYxUJ6bX0LVKxiNxt+4GMEtImUlRbjFZp7j/TSCatB2+XTdjFFuDQ==
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 4Ql9Dg2vH4zVBB;
	Mon, 19 Jun 2023 13:13:07 +0000 (UTC)
	(envelope-from corvink@FreeBSD.org)
From: =?UTF-8?B?Q29ydmluIEvDtmhuZQ==?= <corvink@FreeBSD.org>
To: devel@edk2.groups.io
Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>,
	Gerd Hoffmann <kraxel@redhat.com>,
	Jiewen Yao <jiewen.yao@intel.com>,
	Jordan Justen <jordan.l.justen@intel.com>,
	Leif Lindholm <quic_llindhol@quicinc.com>,
	Peter Grehan <grehan@freebsd.org>,
	Rebecca Cran <rebecca@bsdio.com>,
	Sami Mujawar <sami.mujawar@arm.com>
Subject: [PATCH v2 5/6] OvmfPkg: move QemuFwCfgAcpi into AcpiPlatformLib
Date: Mon, 19 Jun 2023 15:12:27 +0200
Message-ID: <20230619131255.364358-6-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 makes the InstallQemuFwcfgTables function reusable by bhyve.

Signed-off-by: Corvin K=C3=B6hne <corvink@FreeBSD.org>
Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
Cc: Gerd Hoffmann <kraxel@redhat.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Jordan Justen <jordan.l.justen@intel.com>
Cc: Leif Lindholm <quic_llindhol@quicinc.com>
Cc: Peter Grehan <grehan@freebsd.org>
Cc: Rebecca Cran <rebecca@bsdio.com>
Cc: Sami Mujawar <sami.mujawar@arm.com>
---
 OvmfPkg/AcpiPlatformDxe/AcpiPlatformDxe.inf                 | 3 ---
 OvmfPkg/Library/AcpiPlatformLib/DxeAcpiPlatformLib.inf      | 5 +++++
 OvmfPkg/AcpiPlatformDxe/AcpiPlatform.h                      | 6 ------
 OvmfPkg/Include/Library/AcpiPlatformLib.h                   | 6 ++++++
 OvmfPkg/AcpiPlatformDxe/AcpiPlatform.c                      | 3 +++
 .../AcpiPlatformLib}/QemuFwCfgAcpi.c                        | 2 --
 6 files changed, 14 insertions(+), 11 deletions(-)
 rename OvmfPkg/{AcpiPlatformDxe =3D> Library/AcpiPlatformLib}/QemuFwCfgA=
cpi.c (96%)

diff --git a/OvmfPkg/AcpiPlatformDxe/AcpiPlatformDxe.inf b/OvmfPkg/AcpiPl=
atformDxe/AcpiPlatformDxe.inf
index 6001b9626970..622589e607e9 100644
--- a/OvmfPkg/AcpiPlatformDxe/AcpiPlatformDxe.inf
+++ b/OvmfPkg/AcpiPlatformDxe/AcpiPlatformDxe.inf
@@ -25,7 +25,6 @@ [Sources]
   AcpiPlatform.h
   CloudHvAcpi.c
   EntryPoint.c
-  QemuFwCfgAcpi.c
=20
 [Packages]
   MdeModulePkg/MdeModulePkg.dec
@@ -41,12 +40,10 @@ [LibraryClasses]
   QemuFwCfgLib
   UefiDriverEntryPoint
   HobLib
-  TpmMeasurementLib
=20
 [Protocols]
   gEfiAcpiTableProtocolGuid                     # PROTOCOL ALWAYS_CONSUM=
ED
   gEfiPciIoProtocolGuid                         # PROTOCOL SOMETIMES_CON=
SUMED
-  gQemuAcpiTableNotifyProtocolGuid              # PROTOCOL PRODUCES
=20
 [Guids]
   gRootBridgesConnectedEventGroupGuid
diff --git a/OvmfPkg/Library/AcpiPlatformLib/DxeAcpiPlatformLib.inf b/Ovm=
fPkg/Library/AcpiPlatformLib/DxeAcpiPlatformLib.inf
index b6e55b618cbb..59fcb957d059 100644
--- a/OvmfPkg/Library/AcpiPlatformLib/DxeAcpiPlatformLib.inf
+++ b/OvmfPkg/Library/AcpiPlatformLib/DxeAcpiPlatformLib.inf
@@ -18,6 +18,7 @@ [Sources]
   BootScript.c
   DxeAcpiPlatformLib.c
   PciDecoding.c
+  QemuFwCfgAcpi.c
=20
 [Packages]
   MdeModulePkg/MdeModulePkg.dec
@@ -30,6 +31,10 @@ [LibraryClasses]
   PcdLib
   QemuFwCfgS3Lib
   UefiBootServicesTableLib
+  TpmMeasurementLib
+
+[Protocols]
+  gQemuAcpiTableNotifyProtocolGuid              # PROTOCOL PRODUCES
=20
 [Pcd]
   gEfiMdeModulePkgTokenSpaceGuid.PcdPciDisableBusEnumeration
diff --git a/OvmfPkg/AcpiPlatformDxe/AcpiPlatform.h b/OvmfPkg/AcpiPlatfor=
mDxe/AcpiPlatform.h
index c9f2755014a1..f4ae84b5a194 100644
--- a/OvmfPkg/AcpiPlatformDxe/AcpiPlatform.h
+++ b/OvmfPkg/AcpiPlatformDxe/AcpiPlatform.h
@@ -23,12 +23,6 @@ InstallCloudHvTables (
   IN   EFI_ACPI_TABLE_PROTOCOL  *AcpiProtocol
   );
=20
-EFI_STATUS
-EFIAPI
-InstallQemuFwCfgTables (
-  IN   EFI_ACPI_TABLE_PROTOCOL  *AcpiProtocol
-  );
-
 EFI_STATUS
 EFIAPI
 InstallAcpiTables (
diff --git a/OvmfPkg/Include/Library/AcpiPlatformLib.h b/OvmfPkg/Include/=
Library/AcpiPlatformLib.h
index 70c974dce05e..277be93a50bc 100644
--- a/OvmfPkg/Include/Library/AcpiPlatformLib.h
+++ b/OvmfPkg/Include/Library/AcpiPlatformLib.h
@@ -59,6 +59,12 @@ InstallAcpiTablesFromRsdp (
   IN EFI_ACPI_2_0_ROOT_SYSTEM_DESCRIPTION_POINTER  *Rsdp
   );
=20
+EFI_STATUS
+EFIAPI
+InstallQemuFwCfgTables (
+  IN   EFI_ACPI_TABLE_PROTOCOL  *AcpiProtocol
+  );
+
 VOID
 EnablePciDecoding (
   OUT ORIGINAL_ATTRIBUTES  **OriginalAttributes,
diff --git a/OvmfPkg/AcpiPlatformDxe/AcpiPlatform.c b/OvmfPkg/AcpiPlatfor=
mDxe/AcpiPlatform.c
index b446bb487234..20c98bb67fa3 100644
--- a/OvmfPkg/AcpiPlatformDxe/AcpiPlatform.c
+++ b/OvmfPkg/AcpiPlatformDxe/AcpiPlatform.c
@@ -9,6 +9,9 @@
=20
 #include <OvmfPlatforms.h> // CLOUDHV_DEVICE_ID
 #include <ConfidentialComputingGuestAttr.h>
+
+#include <Library/AcpiPlatformLib.h>
+
 #include "AcpiPlatform.h"
=20
 /**
diff --git a/OvmfPkg/AcpiPlatformDxe/QemuFwCfgAcpi.c b/OvmfPkg/Library/Ac=
piPlatformLib/QemuFwCfgAcpi.c
similarity index 96%
rename from OvmfPkg/AcpiPlatformDxe/QemuFwCfgAcpi.c
rename to OvmfPkg/Library/AcpiPlatformLib/QemuFwCfgAcpi.c
index 3de039d57414..d9d0163ffd9f 100644
--- a/OvmfPkg/AcpiPlatformDxe/QemuFwCfgAcpi.c
+++ b/OvmfPkg/Library/AcpiPlatformLib/QemuFwCfgAcpi.c
@@ -22,8 +22,6 @@
 #include <Library/UefiBootServicesTableLib.h> // gBS
 #include <Library/TpmMeasurementLib.h>
=20
-#include "AcpiPlatform.h"
-
 //
 // The user structure for the ordered collection that will track the fw_=
cfg
 // blobs under processing.
--=20
2.41.0