git: 231c5bc3a4c9 - main - sysutils/edk2: set IO port range properly for bhyve

From: Corvin Köhne <corvink_at_FreeBSD.org>
Date: Fri, 24 Nov 2023 09:37:54 UTC
The branch main has been updated by corvink:

URL: https://cgit.FreeBSD.org/ports/commit/?id=231c5bc3a4c964746ccd21f3d44720617dd3d40a

commit 231c5bc3a4c964746ccd21f3d44720617dd3d40a
Author:     Corvin Köhne <corvink@FreeBSD.org>
AuthorDate: 2023-11-16 05:58:01 +0000
Commit:     Corvin Köhne <corvink@FreeBSD.org>
CommitDate: 2023-11-24 09:30:35 +0000

    sysutils/edk2: set IO port range properly for bhyve
    
    Bhyve uses an io port range of [ 0x2000, 0x10000 ] [1]. At the moment,
    EDKII is using a subset of this range [ 0xC000, 0x10000 ] [2]. Even
    though the EDKII range doesn't exceed the bhyve range, it's causing
    issues on some guests like OpenBSD. We don't know why it's causing
    issues yet. However, using the same IO port range in EDKII fixes the
    issue.
    
    [1] https://github.com/freebsd/freebsd-src/blob/82ea0132c8b17a7a6067c8a36c6434e587ede6de/usr.sbin/bhyve/pci_emul.c#L133-L134
    [2] https://github.com/tianocore/edk2/blob/fb044b7fe893a4545995bfe2701fd38e593355d9/OvmfPkg/Bhyve/PlatformPei/Platform.c#L156-L157
    
    PR:                     274389
    Reviewed by:            manu, markj
    Approved by:            manu
    Sponsored by:           Beckhoff Automation GmbH & Co. KG
    Differential Revision:  https://reviews.freebsd.org/D42627
---
 sysutils/edk2/Makefile                                      |  2 +-
 .../edk2/files/patch-OvmfPkg_Bhyve_PlatformPei_Platform.c   | 13 +++++++++++++
 2 files changed, 14 insertions(+), 1 deletion(-)

diff --git a/sysutils/edk2/Makefile b/sysutils/edk2/Makefile
index 839b3aa3fa88..8cc289fb77ec 100644
--- a/sysutils/edk2/Makefile
+++ b/sysutils/edk2/Makefile
@@ -1,6 +1,6 @@
 PORTNAME=	edk2
 PORTVERSION=	g202308
-PORTREVISION=	3
+PORTREVISION=	4
 CATEGORIES=	sysutils
 
 PATCH_SITES=	https://github.com/${GH_ACCOUNT}/${GH_PROJECT}/commit/
diff --git a/sysutils/edk2/files/patch-OvmfPkg_Bhyve_PlatformPei_Platform.c b/sysutils/edk2/files/patch-OvmfPkg_Bhyve_PlatformPei_Platform.c
new file mode 100644
index 000000000000..38dd3d905ee1
--- /dev/null
+++ b/sysutils/edk2/files/patch-OvmfPkg_Bhyve_PlatformPei_Platform.c
@@ -0,0 +1,13 @@
+--- OvmfPkg/Bhyve/PlatformPei/Platform.c.orig	2023-11-17 12:26:16 UTC
++++ OvmfPkg/Bhyve/PlatformPei/Platform.c
+@@ -153,8 +153,8 @@ MemMapInitialization (
+   UINT64         PciIoSize;
+   RETURN_STATUS  PcdStatus;
+ 
+-  PciIoBase = 0xC000;
+-  PciIoSize = 0x4000;
++  PciIoBase = 0x2000;
++  PciIoSize = 0xE000;
+ 
+   //
+   // Create Memory Type Information HOB