public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [edk2-devel] [PATCH v1 1/1] OvmfPkg/Bhyve: use a proper PCI IO range
@ 2023-11-17 12:43 Corvin Köhne
  2023-11-17 16:09 ` Laszlo Ersek
  2023-11-17 19:40 ` Rebecca Cran
  0 siblings, 2 replies; 4+ messages in thread
From: Corvin Köhne @ 2023-11-17 12:43 UTC (permalink / raw)
  To: devel; +Cc: Ard Biesheuvel, Gerd Hoffmann, Jiewen Yao, Rebecca Cran

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 exeed 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 and is a good idea anyway.

[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

Signed-off-by: Corvin Köhne <corvink@FreeBSD.org>
Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
Cc: Gerd Hoffmann <kraxel@redhat.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Rebecca Cran <rebecca@bsdio.com>
---
 OvmfPkg/Bhyve/PlatformPei/Platform.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/OvmfPkg/Bhyve/PlatformPei/Platform.c b/OvmfPkg/Bhyve/PlatformPei/Platform.c
index f6d9a9038e12..bd1b22a9476e 100644
--- a/OvmfPkg/Bhyve/PlatformPei/Platform.c
+++ b/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
-- 
2.42.0



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#111397): https://edk2.groups.io/g/devel/message/111397
Mute This Topic: https://groups.io/mt/102646333/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-



^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [edk2-devel] [PATCH v1 1/1] OvmfPkg/Bhyve: use a proper PCI IO range
  2023-11-17 12:43 [edk2-devel] [PATCH v1 1/1] OvmfPkg/Bhyve: use a proper PCI IO range Corvin Köhne
@ 2023-11-17 16:09 ` Laszlo Ersek
  2023-11-20  7:20   ` Corvin Köhne
  2023-11-17 19:40 ` Rebecca Cran
  1 sibling, 1 reply; 4+ messages in thread
From: Laszlo Ersek @ 2023-11-17 16:09 UTC (permalink / raw)
  To: devel, corvink
  Cc: Ard Biesheuvel, Gerd Hoffmann, Jiewen Yao, Rebecca Cran,
	Liming Gao (Byosoft address)

On 11/17/23 13:43, Corvin Köhne wrote:
> 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 exeed the bhyve range, it's causing

s/exeed/exceed/

> 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 and is a good idea anyway.
> 
> [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
> 
> Signed-off-by: Corvin Köhne <corvink@FreeBSD.org>
> Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
> Cc: Gerd Hoffmann <kraxel@redhat.com>
> Cc: Jiewen Yao <jiewen.yao@intel.com>
> Cc: Rebecca Cran <rebecca@bsdio.com>
> ---
>  OvmfPkg/Bhyve/PlatformPei/Platform.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/OvmfPkg/Bhyve/PlatformPei/Platform.c b/OvmfPkg/Bhyve/PlatformPei/Platform.c
> index f6d9a9038e12..bd1b22a9476e 100644
> --- a/OvmfPkg/Bhyve/PlatformPei/Platform.c
> +++ b/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

Reviewed-by: Laszlo Ersek <lersek@redhat.com>

Can you create a BZ for this issue? With that, I think this should be
possible to merge during the hard feature freeze. Adding Liming.

(For the typo fix in the commit message, either post v2, or ask Liming
to fix it up upon merge.)

Thanks
Laszlo



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#111403): https://edk2.groups.io/g/devel/message/111403
Mute This Topic: https://groups.io/mt/102646333/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/leave/12367111/7686176/1913456212/xyzzy [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [edk2-devel] [PATCH v1 1/1] OvmfPkg/Bhyve: use a proper PCI IO range
  2023-11-17 12:43 [edk2-devel] [PATCH v1 1/1] OvmfPkg/Bhyve: use a proper PCI IO range Corvin Köhne
  2023-11-17 16:09 ` Laszlo Ersek
@ 2023-11-17 19:40 ` Rebecca Cran
  1 sibling, 0 replies; 4+ messages in thread
From: Rebecca Cran @ 2023-11-17 19:40 UTC (permalink / raw)
  To: Corvin Köhne, devel; +Cc: Ard Biesheuvel, Gerd Hoffmann, Jiewen Yao

On 11/17/2023 5:43 AM, Corvin Köhne wrote:
> 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 exeed 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 and is a good idea anyway.

Reviewed-by: Rebecca Cran <rebecca@bsdio.com>



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#111408): https://edk2.groups.io/g/devel/message/111408
Mute This Topic: https://groups.io/mt/102646333/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [edk2-devel] [PATCH v1 1/1] OvmfPkg/Bhyve: use a proper PCI IO range
  2023-11-17 16:09 ` Laszlo Ersek
@ 2023-11-20  7:20   ` Corvin Köhne
  0 siblings, 0 replies; 4+ messages in thread
From: Corvin Köhne @ 2023-11-20  7:20 UTC (permalink / raw)
  To: devel, lersek
  Cc: Ard Biesheuvel, Gerd Hoffmann, Jiewen Yao, Rebecca Cran,
	Liming Gao (Byosoft address)

[-- Attachment #1: Type: text/plain, Size: 2619 bytes --]

On Fri, 2023-11-17 at 17:09 +0100, Laszlo Ersek wrote:
> On 11/17/23 13:43, Corvin Köhne wrote:
> > 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 exeed the bhyve range, it's causing
> 
> s/exeed/exceed/
> 
> > 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 and is a good idea anyway.
> > 
> > [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
> > 
> > Signed-off-by: Corvin Köhne <corvink@FreeBSD.org>
> > Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
> > Cc: Gerd Hoffmann <kraxel@redhat.com>
> > Cc: Jiewen Yao <jiewen.yao@intel.com>
> > Cc: Rebecca Cran <rebecca@bsdio.com>
> > ---
> >  OvmfPkg/Bhyve/PlatformPei/Platform.c | 4 ++--
> >  1 file changed, 2 insertions(+), 2 deletions(-)
> > 
> > diff --git a/OvmfPkg/Bhyve/PlatformPei/Platform.c
> > b/OvmfPkg/Bhyve/PlatformPei/Platform.c
> > index f6d9a9038e12..bd1b22a9476e 100644
> > --- a/OvmfPkg/Bhyve/PlatformPei/Platform.c
> > +++ b/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
> 
> Reviewed-by: Laszlo Ersek <lersek@redhat.com>
> 
> Can you create a BZ for this issue? With that, I think this should be
> possible to merge during the hard feature freeze. Adding Liming.
> 

I've never created a BZ yet. I can't find a button to create a new
account at https://bugzilla.tianocore.org/.

> (For the typo fix in the commit message, either post v2, or ask
> Liming
> to fix it up upon merge.)
> 
> Thanks
> Laszlo
> 
> 
> 
> 
> 
> 

-- 
Kind regards,
Corvin


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#111460): https://edk2.groups.io/g/devel/message/111460
Mute This Topic: https://groups.io/mt/102646333/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-



[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2023-11-20  7:20 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-11-17 12:43 [edk2-devel] [PATCH v1 1/1] OvmfPkg/Bhyve: use a proper PCI IO range Corvin Köhne
2023-11-17 16:09 ` Laszlo Ersek
2023-11-20  7:20   ` Corvin Köhne
2023-11-17 19:40 ` Rebecca Cran

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox