From nobody Wed Feb 11 02:54:02 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+105776+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+105776+1787277+3901457@groups.io; arc=fail (BodyHash is different from the expected one) Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1686043331102555.876468509564; Tue, 6 Jun 2023 02:22:11 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id CHafYY1788612xfsfwx2bzl9; Tue, 06 Jun 2023 02:22:10 -0700 X-Received: from mx2.freebsd.org (mx2.freebsd.org [96.47.72.81]) by mx.groups.io with SMTP id smtpd.web11.4551.1686043329772731404 for ; Tue, 06 Jun 2023 02:22:10 -0700 X-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 4Qb4k91BV7z48sH; Tue, 6 Jun 2023 09:22:09 +0000 (UTC) (envelope-from corvink@FreeBSD.org) X-Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (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 4Qb4k90V8Mz4DFL; Tue, 6 Jun 2023 09:22:09 +0000 (UTC) (envelope-from corvink@FreeBSD.org) ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1686043329; 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=3ZvAifMvrFiYDGNeaGJ6aRjf1em63yL0iUytdRhXQRY=; b=UA2w0OlJ7vPyaHvrrcNs/UKQ7GuEIDD+QO62Z7MK/th9sQN5s62PUxBADPOul3wWog30nF 4/8zysgeGnrxnnsJmBBQPyAoFA098SuNhCLAaijGoZEzPCXD1jHOkM+Z2gi6y0wvThy8qV ATyksnASny95uFKlR2jiaKQrCPv3MPOJPfaUqa0uKUd+P1Kij55tsUQmS+z1POYkxprbPI 1t6/7HJDXR2UyYI9x4B68e7aMLhJ0+IR6mAoJmblVikSKTVDNgmtNpPoBaD9ZOP1I6ddyT YalgObvsm5ChjcbmgAL+uVEFeetdntbTy+c0JW87FKBc0GoXcF941/bKw+/YLA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1686043329; a=rsa-sha256; cv=none; b=UXqkwGhaVg9c6DaedQXelU0fF95LWPz4Lx4OS2LQaKEO9eUz67rCfPO/xUDB0PCqZ4cum/ +5n//sId0ZoOpg3lO3wjZqXE+zDP7OrcrOwsVBzK5KEYMm9jCv9ZL7BL2jwpfhzmsoSBiI dz88sczKZddX656bwxZgxeAV2tfOhh9HlblYjgxL11A5eqrmfr9pQvOTmlu2EEX6c93Ajd U1MN4HbsAvqwBMSxjQJdQiuL80WszYXIJUIaGHoMVIXlH6pxMHuaJ472JdOnAl2a+PHMHX KBSQeiPuJESsiuh0PKsdqFNcOeJ6ESjGLl4Qohu6fVG5e9zHo1jqepMwY7fn2g== X-Received: from corvink-nb.beckhoff.com (unknown [IPv6:2001:9e8:da59:8e00:1c7e:7163:67b2:a7d8]) (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 4Qb4k80RbXzfm2; Tue, 6 Jun 2023 09:22:07 +0000 (UTC) (envelope-from corvink@FreeBSD.org) From: =?UTF-8?B?Q29ydmluIEvDtmhuZQ==?= To: devel@edk2.groups.io Cc: =?UTF-8?q?Corvin=20K=C3=B6hne?= , Rebecca Cran , Peter Grehan , Gerd Hoffmann , Ard Biesheuvel , Jiewen Yao , Jordan Justen Subject: [edk2-devel] [PATCH v6 3/3] OvmfPkg/Bhyve: install ACPI tables from memory Date: Tue, 6 Jun 2023 11:21:39 +0200 Message-Id: <20230606092139.115800-4-corvink@FreeBSD.org> In-Reply-To: <20230606092139.115800-1-corvink@FreeBSD.org> References: <20230606092139.115800-1-corvink@FreeBSD.org> MIME-Version: 1.0 Precedence: Bulk List-Unsubscribe: List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,corvink@FreeBSD.org X-Gm-Message-State: FgSBk3ApBfBu9ma1FzYiDRcOx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1686043330; bh=GK0HKpufcVKDT7uoQExKbFvzJJkqfWHZY1ODCufBk8Y=; h=Cc:Content-Type:Date:From:Reply-To:Subject:To; b=NqtMfnviO1hQkpUPuuJ5DgWcwj8S2W5XEUapfS3FE6RStiP59XAUXd8vkNouMZmQ5AF ds0jdSKxuPv1vWKA9enkzZLH1TYU8kk5uwQeuTgrsEu/IpXu+zjYw8hYGLViE2NIhsS18 CaFFOJMEC++fhrqxTGcZAaG7LnewjXdRigI= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1686043331611100011 Content-Type: text/plain; charset="utf-8" It's much easier to create configuration dependend ACPI tables for bhyve than for OVMF. For this reason, don't use the statically created ACPI tables provided by OVMF. Instead prefer the dynamically created ACPI tables of bhyve. If bhyve provides no ACPI tables or we are unable to detect those, fall back to OVMF tables. Ideally, we use the qemu fwcfg interface to pass the ACPI tables from bhyve to OVMF. bhyve will support this in the future. However, current bhyve executables don't support passing ACPI tables by the qemu fwcfg interface. They just copy the ACPI into main memory. For that reason, pick up the ACPI tables from main memory. Signed-off-by: Corvin K=C3=B6hne Reviewed-by: Rebecca Cran Acked-by: Peter Grehan Acked-by: Gerd Hoffmann Cc: Ard Biesheuvel Cc: Jiewen Yao Cc: Jordan Justen --- OvmfPkg/Bhyve/BhyveX64.dsc | 1 + .../Bhyve/AcpiPlatformDxe/AcpiPlatformDxe.inf | 1 + OvmfPkg/Bhyve/AcpiPlatformDxe/AcpiPlatform.c | 37 ++++++++++++++++++- 3 files changed, 38 insertions(+), 1 deletion(-) diff --git a/OvmfPkg/Bhyve/BhyveX64.dsc b/OvmfPkg/Bhyve/BhyveX64.dsc index bb317a50e6af..7b974706f958 100644 --- a/OvmfPkg/Bhyve/BhyveX64.dsc +++ b/OvmfPkg/Bhyve/BhyveX64.dsc @@ -341,6 +341,7 @@ [LibraryClasses.common.UEFI_DRIVER] PciLib|OvmfPkg/Library/DxePciLibI440FxQ35/DxePciLibI440FxQ35.inf =20 [LibraryClasses.common.DXE_DRIVER] + AcpiPlatformLib|OvmfPkg/Library/AcpiPlatformLib/DxeAcpiPlatformLib.inf PcdLib|MdePkg/Library/DxePcdLib/DxePcdLib.inf HobLib|MdePkg/Library/DxeHobLib/DxeHobLib.inf MemoryAllocationLib|MdePkg/Library/UefiMemoryAllocationLib/UefiMemoryAll= ocationLib.inf diff --git a/OvmfPkg/Bhyve/AcpiPlatformDxe/AcpiPlatformDxe.inf b/OvmfPkg/Bh= yve/AcpiPlatformDxe/AcpiPlatformDxe.inf index 94c65f32dcab..75ed8e4a7deb 100644 --- a/OvmfPkg/Bhyve/AcpiPlatformDxe/AcpiPlatformDxe.inf +++ b/OvmfPkg/Bhyve/AcpiPlatformDxe/AcpiPlatformDxe.inf @@ -35,6 +35,7 @@ [Packages] UefiCpuPkg/UefiCpuPkg.dec =20 [LibraryClasses] + AcpiPlatformLib BaseLib BaseMemoryLib BhyveFwCtlLib diff --git a/OvmfPkg/Bhyve/AcpiPlatformDxe/AcpiPlatform.c b/OvmfPkg/Bhyve/A= cpiPlatformDxe/AcpiPlatform.c index 999e9f151ebb..1e1c90614ea1 100644 --- a/OvmfPkg/Bhyve/AcpiPlatformDxe/AcpiPlatform.c +++ b/OvmfPkg/Bhyve/AcpiPlatformDxe/AcpiPlatform.c @@ -10,6 +10,11 @@ =20 #include "AcpiPlatform.h" =20 +#include // InstallAcpiTablesFromMemory() + +#define BHYVE_ACPI_PHYSICAL_ADDRESS ((UINTN)0x000F2400) +#define BHYVE_BIOS_PHYSICAL_END ((UINTN)0x00100000) + EFI_STATUS EFIAPI InstallAcpiTable ( @@ -241,7 +246,37 @@ InstallAcpiTables ( IN EFI_ACPI_TABLE_PROTOCOL *AcpiTable ) { - EFI_STATUS Status; + EFI_ACPI_2_0_ROOT_SYSTEM_DESCRIPTION_POINTER *Rsdp; + EFI_STATUS Status; + + Status =3D GetAcpiRsdpFromMemory ( + BHYVE_ACPI_PHYSICAL_ADDRESS, + BHYVE_BIOS_PHYSICAL_END, + &Rsdp + ); + if (EFI_ERROR (Status)) { + return Status; + } + + Status =3D InstallAcpiTablesFromRsdp ( + AcpiTable, + Rsdp + ); + if (!EFI_ERROR (Status)) { + return EFI_SUCCESS; + } + + if (Status !=3D EFI_NOT_FOUND) { + DEBUG ( + ( + DEBUG_WARN, + "%a: unable to install bhyve's ACPI tables (%r)\n", + __func__, + Status + ) + ); + return Status; + } =20 Status =3D InstallOvmfFvTables (AcpiTable); =20 --=20 2.40.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#105776): https://edk2.groups.io/g/devel/message/105776 Mute This Topic: https://groups.io/mt/99359679/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-