[SeaBIOS] [PATCH v2 2/2] update pci_pad_mem64 handling

Gerd Hoffmann posted 2 patches 1 year, 2 months ago
[SeaBIOS] [PATCH v2 2/2] update pci_pad_mem64 handling
Posted by Gerd Hoffmann 1 year, 2 months ago
Add a new possible state: '-1' means 'use default'.  In that case
seabios continue to use the current heuristic:  In case memory
above 4G is present enable 64-bit guest friendly configuration.

This allows forcing the one or the other behavior by setting the
pci_pad_mem64 variable beforehand (which is done by another patch).

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
 src/fw/pciinit.c | 13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)

diff --git a/src/fw/pciinit.c b/src/fw/pciinit.c
index b3e359d7fe62..be76c447cf19 100644
--- a/src/fw/pciinit.c
+++ b/src/fw/pciinit.c
@@ -55,7 +55,7 @@ u64 pcimem64_end   = BUILD_PCIMEM64_END;
 // Resource allocation limits
 static u64 pci_io_low_end = 0xa000;
 static u64 pci_mem64_top  = 0;
-static u32 pci_pad_mem64  = 0;
+static u32 pci_pad_mem64  = -1;
 
 struct pci_region_entry {
     struct pci_device *dev;
@@ -1202,8 +1202,15 @@ pci_setup(void)
         }
     }
 
-    if (CPUPhysBits >= 36 && CPULongMode && RamSizeOver4G)
-        pci_pad_mem64 = 1;
+    pci_pad_mem64 = romfile_loadbool("opt/org.seabios/pci64", -1);
+
+    if (pci_pad_mem64 == -1)
+        // when not set enable in case memory over 4G is present
+        pci_pad_mem64 = RamSizeOver4G ? 1 : 0;
+
+    if (!CPULongMode)
+        // force off for 32-bit CPUs
+        pci_pad_mem64 = 0;
 
     dprintf(1, "=== PCI bus & bridge init ===\n");
     if (pci_probe_host() != 0) {
-- 
2.47.0

_______________________________________________
SeaBIOS mailing list -- seabios@seabios.org
To unsubscribe send an email to seabios-leave@seabios.org
[SeaBIOS] Re: [PATCH v2 2/2] update pci_pad_mem64 handling
Posted by Fiona Ebner 11 months, 1 week ago
Thank you! Works for my 32-bit Debian 12 VM :)

I wanted to briefly ask if a new SeaBIOS release is planned before/for
QEMU 10.0?

A colleague told me that commit ec0bc256 ("limit address space used for
pci devices, part two") alleviates another issue one of our users faced.
Of course we could ship an updated SeaBIOS ROM downstream, but others
might benefit from a new release too, so I wanted to ask.

Best Regards,
Fiona

Am 22.11.24 um 15:33 schrieb Gerd Hoffmann:
> Add a new possible state: '-1' means 'use default'.  In that case
> seabios continue to use the current heuristic:  In case memory
> above 4G is present enable 64-bit guest friendly configuration.
> 
> This allows forcing the one or the other behavior by setting the
> pci_pad_mem64 variable beforehand (which is done by another patch).
> 
> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
> ---
>  src/fw/pciinit.c | 13 ++++++++++---
>  1 file changed, 10 insertions(+), 3 deletions(-)
> 
> diff --git a/src/fw/pciinit.c b/src/fw/pciinit.c
> index b3e359d7fe62..be76c447cf19 100644
> --- a/src/fw/pciinit.c
> +++ b/src/fw/pciinit.c
> @@ -55,7 +55,7 @@ u64 pcimem64_end   = BUILD_PCIMEM64_END;
>  // Resource allocation limits
>  static u64 pci_io_low_end = 0xa000;
>  static u64 pci_mem64_top  = 0;
> -static u32 pci_pad_mem64  = 0;
> +static u32 pci_pad_mem64  = -1;
>  
>  struct pci_region_entry {
>      struct pci_device *dev;
> @@ -1202,8 +1202,15 @@ pci_setup(void)
>          }
>      }
>  
> -    if (CPUPhysBits >= 36 && CPULongMode && RamSizeOver4G)
> -        pci_pad_mem64 = 1;
> +    pci_pad_mem64 = romfile_loadbool("opt/org.seabios/pci64", -1);
> +
> +    if (pci_pad_mem64 == -1)
> +        // when not set enable in case memory over 4G is present
> +        pci_pad_mem64 = RamSizeOver4G ? 1 : 0;
> +
> +    if (!CPULongMode)
> +        // force off for 32-bit CPUs
> +        pci_pad_mem64 = 0;
>  
>      dprintf(1, "=== PCI bus & bridge init ===\n");
>      if (pci_probe_host() != 0) {


_______________________________________________
SeaBIOS mailing list -- seabios@seabios.org
To unsubscribe send an email to seabios-leave@seabios.org
[SeaBIOS] Re: [PATCH v2 2/2] update pci_pad_mem64 handling
Posted by Gerd Hoffmann 11 months ago
On Thu, Mar 06, 2025 at 11:44:01AM +0100, Fiona Ebner wrote:
> Thank you! Works for my 32-bit Debian 12 VM :)
> 
> I wanted to briefly ask if a new SeaBIOS release is planned before/for
> QEMU 10.0?

Hmm.  Kevin?  1.17.0 release was briefly discussed a while back (january
IIRC).  Doing another 1.16.x feels wrong with the amount of changes we
have in master now.

I'm not aware of any pending changes right now.  So we could call code
freeze now and tag the release in ~ two weeks.  I can update seabios in
qemu to a snapshot now for some additional test coverage, and to 1.17.0
final by end of march.

comments?

take care,
  Gerd

_______________________________________________
SeaBIOS mailing list -- seabios@seabios.org
To unsubscribe send an email to seabios-leave@seabios.org
[SeaBIOS] Re: [PATCH v2 2/2] update pci_pad_mem64 handling
Posted by Kevin O'Connor via SeaBIOS 10 months, 2 weeks ago
On Mon, Mar 10, 2025 at 04:21:30PM +0100, Gerd Hoffmann wrote:
> On Thu, Mar 06, 2025 at 11:44:01AM +0100, Fiona Ebner wrote:
> > Thank you! Works for my 32-bit Debian 12 VM :)
> >
> > I wanted to briefly ask if a new SeaBIOS release is planned before/for
> > QEMU 10.0?
> 
> Hmm.  Kevin?  1.17.0 release was briefly discussed a while back (january
> IIRC).  Doing another 1.16.x feels wrong with the amount of changes we
> have in master now.
> 
> I'm not aware of any pending changes right now.  So we could call code
> freeze now and tag the release in ~ two weeks.  I can update seabios in
> qemu to a snapshot now for some additional test coverage, and to 1.17.0
> final by end of march.
> 
> comments?

I don't see an issue with tagging a new release.  Alas, my schedule
has been busy recently.  How about we target mid-April for the next
release?

-Kevin

_______________________________________________
SeaBIOS mailing list -- seabios@seabios.org
To unsubscribe send an email to seabios-leave@seabios.org
[SeaBIOS] Re: [PATCH v2 2/2] update pci_pad_mem64 handling
Posted by Gerd Hoffmann via SeaBIOS 10 months, 1 week ago
On Wed, Mar 26, 2025 at 02:21:47AM +0000, Kevin O'Connor wrote:
> > comments?
> 
> I don't see an issue with tagging a new release.  Alas, my schedule
> has been busy recently.  How about we target mid-April for the next
> release?

Yea, lets do that (or end-April meanwhile ...).

It's too late for qemu 10.0 now, but qemu has a working stable update
process now so we should be able to land the seabios release + bugfixes
in 10.0.1 instead of having to wait the full devel cycle for 10.1

take care,
  Gerd

_______________________________________________
SeaBIOS mailing list -- seabios@seabios.org
To unsubscribe send an email to seabios-leave@seabios.org
[SeaBIOS] Re: [PATCH v2 2/2] update pci_pad_mem64 handling
Posted by Gerd Hoffmann via SeaBIOS 8 months, 1 week ago
On Tue, Apr 08, 2025 at 11:48:19AM +0200, Gerd Hoffmann via SeaBIOS wrote:
> On Wed, Mar 26, 2025 at 02:21:47AM +0000, Kevin O'Connor wrote:
> > > comments?
> > 
> > I don't see an issue with tagging a new release.  Alas, my schedule
> > has been busy recently.  How about we target mid-April for the next
> > release?
> 
> Yea, lets do that (or end-April meanwhile ...).

Ok, the ahci regression is fixed now, so time to finally tag the long
overdue 1.17.0 release I'd say ...

take care,
  Gerd

_______________________________________________
SeaBIOS mailing list -- seabios@seabios.org
To unsubscribe send an email to seabios-leave@seabios.org
[SeaBIOS] Re: [PATCH v2 2/2] update pci_pad_mem64 handling
Posted by Kevin O'Connor via SeaBIOS 8 months, 1 week ago
On Mon, Jun 02, 2025 at 11:44:31AM +0200, Gerd Hoffmann wrote:
> On Tue, Apr 08, 2025 at 11:48:19AM +0200, Gerd Hoffmann via SeaBIOS wrote:
> > On Wed, Mar 26, 2025 at 02:21:47AM +0000, Kevin O'Connor wrote:
> > > > comments?
> > >
> > > I don't see an issue with tagging a new release.  Alas, my schedule
> > > has been busy recently.  How about we target mid-April for the next
> > > release?
> >
> > Yea, lets do that (or end-April meanwhile ...).
> 
> Ok, the ahci regression is fixed now, so time to finally tag the long
> overdue 1.17.0 release I'd say ...

Agreed.  I'd say lets give a few days to see if anyone screams about
the recent fix, and otherwise look to tag the next release early next
week (eg, 10 June).

-Kevin

_______________________________________________
SeaBIOS mailing list -- seabios@seabios.org
To unsubscribe send an email to seabios-leave@seabios.org