From nobody Mon Jun 12 13:18:47 2023 X-Original-To: virtualization@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Qfss21dH9z4cBl9 for ; Mon, 12 Jun 2023 13:26:14 +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 4Qfss15QmMz43PF; Mon, 12 Jun 2023 13:26:13 +0000 (UTC) (envelope-from corvink@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1686576373; 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=81pSQjipPQ5C1A1BM7vtTXb0zY2bfpARrmVm+XV/hro=; b=QGHJ/kf2Ot9y+MRbcdnOxUuyin+/9j+fLUoClP/x75VGfoiT4nltFM6nVlE5JUrA9ZcAhH ATl7WcoQzaM8oXQYvQC8mNk615yFDoCdtnYKG29A/lJqG2UYS27D+YWgrR6BZRhHv4qv57 Tnc7Svv3vTxf0qSxQn1aWIiI+9hlltps311IOC0cJ5+dGZDmVeMMmeUUoLjJ4NHEs4URPj GmTwpf/DwvFLFjY3tuyKQR5OAKubu2F0eXb+N7imV3mUqUG8HKTmmo/zLLCLR1G0hyTaLq CkFCsQFRNFg9S3EW/I6zwWfIiGFcW/OUpRevC1cNKuZql+3rjC8VLwLVI8i5UA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1686576373; 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=81pSQjipPQ5C1A1BM7vtTXb0zY2bfpARrmVm+XV/hro=; b=P4tVIP/IBxhxnUBNlv4s1Bl3HrT7AwXPNqrdvi6tpjZddbeYoO8pbz0hk7bVP8QkzjlX5u RpcD+8qJNi3OM0OpBRyZtafPAaD1apdqfpGz+TO2cSaAJmckeQBWG1HgMywmP8f/hTURYv CmuplHO0xpV4eDsUYj0J6nBHGrNzR1DmsJbTBYwHbtptK5/jga9bdQCUrTFo4Wr4hidkV4 jojF0LcsLzdDTY0XJRZosoA4Jr8UfCNBKjrvbT/0KTrg/cSYbnOvpMZQYq/hWBT6xzP7vu RW5X1MFfJ1+WIFfZbN3DAZYyjKuXmEVfYJfZqrc0YlRgXqoZl8DKpigaAWYDRQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1686576373; a=rsa-sha256; cv=none; b=OSHninhi4B3V2fsP4Qv6x9k3ID5vw4rjMD60kClklA1NU0mzGdeH0Vj4qUtFz75pHPZDuv 88CrPU7YEB+yZ6bBrKL4buCerLLgXZJlGNWRsEEPeU+yi9lrUj0oUhmCKUSCCcF/dEg7nu TCO1TCMLAFgAKYanKuXRgsUAc2RWvIjscnTSbSDZc/DZU4gHydhp+Ji2P5HapvrALirUh5 1/t/vU727oB+nNx+Q+dUltyYrQVjknqDuA0Dv7I7yoAWTvy2HJdAb6vGNvJg6E/hvhr6bT 8d4VoW+rl+6TPCuMGqGV/XUbvivDOplyRCwGn8f50/LvXHgZBpZyER7NaRkNsQ== Received: from corvink-nb.beckhoff.com (unknown [195.226.174.194]) (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 4Qfss11V5zzPBH; Mon, 12 Jun 2023 13:26:13 +0000 (UTC) (envelope-from corvink@FreeBSD.org) From: =?UTF-8?q?Corvin=20K=C3=B6hne?= To: virtualization@freebsd.org Cc: =?UTF-8?q?Corvin=20K=C3=B6hne?= Subject: [PATCH 3/5] OvmfPkg: move QemuFwCfgAcpi into AcpiPlatformLib Date: Mon, 12 Jun 2023 15:18:47 +0200 Message-ID: <20230612132558.349152-4-corvink@FreeBSD.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230612132558.349152-1-corvink@FreeBSD.org> References: <20230612132558.349152-1-corvink@FreeBSD.org> List-Id: Discussion List-Archive: https://lists.freebsd.org/archives/freebsd-virtualization List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-virtualization@freebsd.org X-BeenThere: freebsd-virtualization@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-ThisMailContainsUnwantedMimeParts: N This makes the InstallQemuFwcfgTables function reusable by bhyve. Signed-off-by: Corvin Köhne --- 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 => Library/AcpiPlatformLib}/QemuFwCfgAcpi.c (96%) diff --git a/OvmfPkg/AcpiPlatformDxe/AcpiPlatformDxe.inf b/OvmfPkg/AcpiPlatformDxe/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 [Packages] MdeModulePkg/MdeModulePkg.dec @@ -41,12 +40,10 @@ [LibraryClasses] QemuFwCfgLib UefiDriverEntryPoint HobLib - TpmMeasurementLib [Protocols] gEfiAcpiTableProtocolGuid # PROTOCOL ALWAYS_CONSUMED gEfiPciIoProtocolGuid # PROTOCOL SOMETIMES_CONSUMED - gQemuAcpiTableNotifyProtocolGuid # PROTOCOL PRODUCES [Guids] gRootBridgesConnectedEventGroupGuid diff --git a/OvmfPkg/Library/AcpiPlatformLib/DxeAcpiPlatformLib.inf b/OvmfPkg/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 [Packages] MdeModulePkg/MdeModulePkg.dec @@ -30,6 +31,10 @@ [LibraryClasses] PcdLib QemuFwCfgS3Lib UefiBootServicesTableLib + TpmMeasurementLib + +[Protocols] + gQemuAcpiTableNotifyProtocolGuid # PROTOCOL PRODUCES [Pcd] gEfiMdeModulePkgTokenSpaceGuid.PcdPciDisableBusEnumeration diff --git a/OvmfPkg/AcpiPlatformDxe/AcpiPlatform.h b/OvmfPkg/AcpiPlatformDxe/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 ); -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 a79d698a8750..54c89d62b3bf 100644 --- a/OvmfPkg/Include/Library/AcpiPlatformLib.h +++ b/OvmfPkg/Include/Library/AcpiPlatformLib.h @@ -56,6 +56,12 @@ InstallAcpiTablesFromRsdp ( IN EFI_ACPI_2_0_ROOT_SYSTEM_DESCRIPTION_POINTER *Rsdp ); +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/AcpiPlatformDxe/AcpiPlatform.c index b446bb487234..20c98bb67fa3 100644 --- a/OvmfPkg/AcpiPlatformDxe/AcpiPlatform.c +++ b/OvmfPkg/AcpiPlatformDxe/AcpiPlatform.c @@ -9,6 +9,9 @@ #include // CLOUDHV_DEVICE_ID #include + +#include + #include "AcpiPlatform.h" /** diff --git a/OvmfPkg/AcpiPlatformDxe/QemuFwCfgAcpi.c b/OvmfPkg/Library/AcpiPlatformLib/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 // gBS #include -#include "AcpiPlatform.h" - // // The user structure for the ordered collection that will track the fw_cfg // blobs under processing. -- 2.41.0