diff mbox

new pc-bios/bios.bin breaks freebsd booting

Message ID 50C8C34E.9080409@redhat.com
State New
Headers show

Commit Message

Paolo Bonzini Dec. 12, 2012, 5:47 p.m. UTC
Il 12/12/2012 17:04, Luigi Rizzo ha scritto:
> I am not sure if it has been reported already but this commit
> 
> http://git.qemu.org/?p=qemu.git;a=commitdiff;h=d7a51dbbaa70677846453f8c961590913052dd86
> 
> (replacing pc-bios/bios.bin with a newer version)
> breaks booting of FreeBSD on recent qemu (starting roughly with
> qemu-1.3.0-rc2).
> 
> Using a FreeBSD host, and a FreeBSD guest,
> the qemu thread runs at 100% and the console is stuck
> after the 'pci0' probe:
> 
>                            
> ...
> hpet0: <High Precision Event Timer> iomem 0xfed00000-0xfed003ff on acpi0
>        
> Timecounter "HPET" frequency 100000000 Hz quality 950                  
>         
> Timecounter "ACPI-fast" frequency 3579545 Hz quality 900                
>        
> acpi_timer0: <24-bit timer at 3.579545MHz> port 0xb008-0xb00b on acpi0  
>        
> pcib0: <ACPI Host-PCI bridge> port 0xcf8-0xcff on acpi0                
>         
> pci0: <ACPI PCI bus> on pcib0
> 
> Reverting the bios fixes things.
> I wonder if it isn't the case of reverting this change ?

Not reverting the change (which fixes other things), but yes---we should
get the fix into SeaBIOS.

I don't have a FreeBSD VM handy, can you try the attached BIOS so I can
have your Tested-by?  The patch I used is after my signature.

Paolo

Comments

Luigi Rizzo Dec. 12, 2012, 11:54 p.m. UTC | #1
On Wed, Dec 12, 2012 at 06:47:58PM +0100, Paolo Bonzini wrote:
> Il 12/12/2012 17:04, Luigi Rizzo ha scritto:
> > I am not sure if it has been reported already but this commit
> > 
> > http://git.qemu.org/?p=qemu.git;a=commitdiff;h=d7a51dbbaa70677846453f8c961590913052dd86
> > 
> > (replacing pc-bios/bios.bin with a newer version)
> > breaks booting of FreeBSD on recent qemu (starting roughly with
> > qemu-1.3.0-rc2).
> > 
> > Using a FreeBSD host, and a FreeBSD guest,
> > the qemu thread runs at 100% and the console is stuck
> > after the 'pci0' probe:
> > 
> >                            
> > ...
> > hpet0: <High Precision Event Timer> iomem 0xfed00000-0xfed003ff on acpi0
> >        
> > Timecounter "HPET" frequency 100000000 Hz quality 950                  
> >         
> > Timecounter "ACPI-fast" frequency 3579545 Hz quality 900                
> >        
> > acpi_timer0: <24-bit timer at 3.579545MHz> port 0xb008-0xb00b on acpi0  
> >        
> > pcib0: <ACPI Host-PCI bridge> port 0xcf8-0xcff on acpi0                
> >         
> > pci0: <ACPI PCI bus> on pcib0
> > 
> > Reverting the bios fixes things.
> > I wonder if it isn't the case of reverting this change ?
> 
> Not reverting the change (which fixes other things), but yes---we should
> get the fix into SeaBIOS.
> 
> I don't have a FreeBSD VM handy, can you try the attached BIOS so I can
> have your Tested-by?  The patch I used is after my signature.

thanks, the attached bios successfully boots a FreeBSD guest

Tested-by: Luigi Rizzo <rizzo@iet.unipi.it>


cheers
luigi

> Paolo
> 
> diff --git a/src/acpi-dsdt.dsl b/src/acpi-dsdt.dsl
> index 8019b71..b58ef62 100644
> --- a/src/acpi-dsdt.dsl
> +++ b/src/acpi-dsdt.dsl
> @@ -187,7 +187,7 @@ DefinitionBlock (
>  
>                  prt_slot0(0x0000),
>                  /* Device 1 is power mgmt device, and can only use irq 9 */
> -                Package() { 0x1ffff, 0,    0, 9 },
> +                Package() { 0x1ffff, 0, LNKS, 0 },
>                  Package() { 0x1ffff, 1, LNKB, 0 },
>                  Package() { 0x1ffff, 2, LNKC, 0 },
>                  Package() { 0x1ffff, 3, LNKD, 0 },
> @@ -278,6 +278,22 @@ DefinitionBlock (
>          define_link(LNKB, 1, PRQ1)
>          define_link(LNKC, 2, PRQ2)
>          define_link(LNKD, 3, PRQ3)
> +
> +        Device(LNKS) {
> +            Name(_HID, EISAID("PNP0C0F"))
> +            Name(_UID, 4)
> +            Name(_PRS, ResourceTemplate() {
> +                Interrupt(, Level, ActiveHigh, Shared) { 9 }
> +            })
> +
> +            // The SCI cannot be disabled and is always attached to GSI 9,
> +            // so these are no-ops.  We only need this link to override the
> +            // polarity to active high and match the content of the MADT.
> +            Method(_STA, 0, NotSerialized) { Return (0x0b) }
> +            Method(_DIS, 0, NotSerialized) { }
> +            Method(_CRS, 0, NotSerialized) { Return (_PRS) }
> +            Method(_SRS, 1, NotSerialized) { }
> +        }
>      }
>  
>  #include "acpi-dsdt-cpu-hotplug.dsl"
>
Brad Smith Dec. 13, 2012, 10:25 a.m. UTC | #2
On Wed, Dec 12, 2012 at 06:47:58PM +0100, Paolo Bonzini wrote:
> Il 12/12/2012 17:04, Luigi Rizzo ha scritto:
> > I am not sure if it has been reported already but this commit
> > 
> > http://git.qemu.org/?p=qemu.git;a=commitdiff;h=d7a51dbbaa70677846453f8c961590913052dd86
> > 
> > (replacing pc-bios/bios.bin with a newer version)
> > breaks booting of FreeBSD on recent qemu (starting roughly with
> > qemu-1.3.0-rc2).
> > 
> > Using a FreeBSD host, and a FreeBSD guest,
> > the qemu thread runs at 100% and the console is stuck
> > after the 'pci0' probe:
> > 
> >                            
> > ...
> > hpet0: <High Precision Event Timer> iomem 0xfed00000-0xfed003ff on acpi0
> >        
> > Timecounter "HPET" frequency 100000000 Hz quality 950                  
> >         
> > Timecounter "ACPI-fast" frequency 3579545 Hz quality 900                
> >        
> > acpi_timer0: <24-bit timer at 3.579545MHz> port 0xb008-0xb00b on acpi0  
> >        
> > pcib0: <ACPI Host-PCI bridge> port 0xcf8-0xcff on acpi0                
> >         
> > pci0: <ACPI PCI bus> on pcib0
> > 
> > Reverting the bios fixes things.
> > I wonder if it isn't the case of reverting this change ?
> 
> Not reverting the change (which fixes other things), but yes---we should
> get the fix into SeaBIOS.
> 
> I don't have a FreeBSD VM handy, can you try the attached BIOS so I can
> have your Tested-by?  The patch I used is after my signature.
> 
> Paolo

Could you please provide a pre-compiled BIOS image so I could test
this out? I believe the issue I have is the same but it doesn't hurt
to have more testing. :)

I also noticed some issues booting FreeBSD 9 when I was testing
QEMU 1.3.0 on OpenBSD and have put it aside until some regressions
are fixed with the release.
Paolo Bonzini Dec. 13, 2012, 10:30 a.m. UTC | #3
> Could you please provide a pre-compiled BIOS image so I could test
> this out? I believe the issue I have is the same but it doesn't hurt
> to have more testing. :)

It's attached to my message.

Paolo
Brad Smith Dec. 14, 2012, 2:33 a.m. UTC | #4
On Thu, Dec 13, 2012 at 05:25:50AM -0500, Brad Smith wrote:
> On Wed, Dec 12, 2012 at 06:47:58PM +0100, Paolo Bonzini wrote:
> > Il 12/12/2012 17:04, Luigi Rizzo ha scritto:
> > > I am not sure if it has been reported already but this commit
> > > 
> > > http://git.qemu.org/?p=qemu.git;a=commitdiff;h=d7a51dbbaa70677846453f8c961590913052dd86
> > > 
> > > (replacing pc-bios/bios.bin with a newer version)
> > > breaks booting of FreeBSD on recent qemu (starting roughly with
> > > qemu-1.3.0-rc2).
> > > 
> > > Using a FreeBSD host, and a FreeBSD guest,
> > > the qemu thread runs at 100% and the console is stuck
> > > after the 'pci0' probe:
> > > 
> > >                            
> > > ...
> > > hpet0: <High Precision Event Timer> iomem 0xfed00000-0xfed003ff on acpi0
> > >        
> > > Timecounter "HPET" frequency 100000000 Hz quality 950                  
> > >         
> > > Timecounter "ACPI-fast" frequency 3579545 Hz quality 900                
> > >        
> > > acpi_timer0: <24-bit timer at 3.579545MHz> port 0xb008-0xb00b on acpi0  
> > >        
> > > pcib0: <ACPI Host-PCI bridge> port 0xcf8-0xcff on acpi0                
> > >         
> > > pci0: <ACPI PCI bus> on pcib0
> > > 
> > > Reverting the bios fixes things.
> > > I wonder if it isn't the case of reverting this change ?
> > 
> > Not reverting the change (which fixes other things), but yes---we should
> > get the fix into SeaBIOS.
> > 
> > I don't have a FreeBSD VM handy, can you try the attached BIOS so I can
> > have your Tested-by?  The patch I used is after my signature.
> > 
> > Paolo
> 
> Could you please provide a pre-compiled BIOS image so I could test
> this out? I believe the issue I have is the same but it doesn't hurt
> to have more testing. :)
> 
> I also noticed some issues booting FreeBSD 9 when I was testing
> QEMU 1.3.0 on OpenBSD and have put it aside until some regressions
> are fixed with the release.

*sigh* Of course now that I am trying to reproduce the issue with
the BIOS image that comes with 1.3.0 with the FreeBSD 9.1 RC3 CD
image I was testing with earlier I am not able to. But this newer
BIOS image doesn't seem to make it any worse either.
Dietmar Maurer Dec. 20, 2012, 5:57 a.m. UTC | #5
Do you plan to upload that fix into qemu git repository? From what I see the 
repository still contains the broken version?

> -----Original Message-----
> From: qemu-devel-bounces+dietmar=proxmox.com@nongnu.org
> [mailto:qemu-devel-bounces+dietmar=proxmox.com@nongnu.org] On
> Behalf Of Paolo Bonzini
> Sent: Mittwoch, 12. Dezember 2012 18:48
> To: Luigi Rizzo
> Cc: qemu-devel@nongnu.org; kraxel@redhat.com
> Subject: Re: [Qemu-devel] new pc-bios/bios.bin breaks freebsd booting
> 
> Il 12/12/2012 17:04, Luigi Rizzo ha scritto:
> > I am not sure if it has been reported already but this commit
> >
> >
> http://git.qemu.org/?p=qemu.git;a=commitdiff;h=d7a51dbbaa70677846453f
> 8
> > c961590913052dd86
> >
> > (replacing pc-bios/bios.bin with a newer version) breaks booting of
> > FreeBSD on recent qemu (starting roughly with qemu-1.3.0-rc2).
> >
> > Using a FreeBSD host, and a FreeBSD guest, the qemu thread runs at
> > 100% and the console is stuck after the 'pci0' probe:
> >
> >
> > ...
> > hpet0: <High Precision Event Timer> iomem 0xfed00000-0xfed003ff on
> > acpi0
> >
> > Timecounter "HPET" frequency 100000000 Hz quality 950
> >
> > Timecounter "ACPI-fast" frequency 3579545 Hz quality 900
> >
> > acpi_timer0: <24-bit timer at 3.579545MHz> port 0xb008-0xb00b on acpi0
> >
> > pcib0: <ACPI Host-PCI bridge> port 0xcf8-0xcff on acpi0
> >
> > pci0: <ACPI PCI bus> on pcib0
> >
> > Reverting the bios fixes things.
> > I wonder if it isn't the case of reverting this change ?
> 
> Not reverting the change (which fixes other things), but yes---we should get
> the fix into SeaBIOS.
> 
> I don't have a FreeBSD VM handy, can you try the attached BIOS so I can
> have your Tested-by?  The patch I used is after my signature.
Gerd Hoffmann Dec. 20, 2012, 7:16 a.m. UTC | #6
On 12/20/12 06:57, Dietmar Maurer wrote:
> Do you plan to upload that fix into qemu git repository? From what I see the 
> repository still contains the broken version?

Indeed, I'll go build a seabios update pull req.

cheers,
  Gerd
diff mbox

Patch

diff --git a/src/acpi-dsdt.dsl b/src/acpi-dsdt.dsl
index 8019b71..b58ef62 100644
--- a/src/acpi-dsdt.dsl
+++ b/src/acpi-dsdt.dsl
@@ -187,7 +187,7 @@  DefinitionBlock (
 
                 prt_slot0(0x0000),
                 /* Device 1 is power mgmt device, and can only use irq 9 */
-                Package() { 0x1ffff, 0,    0, 9 },
+                Package() { 0x1ffff, 0, LNKS, 0 },
                 Package() { 0x1ffff, 1, LNKB, 0 },
                 Package() { 0x1ffff, 2, LNKC, 0 },
                 Package() { 0x1ffff, 3, LNKD, 0 },
@@ -278,6 +278,22 @@  DefinitionBlock (
         define_link(LNKB, 1, PRQ1)
         define_link(LNKC, 2, PRQ2)
         define_link(LNKD, 3, PRQ3)
+
+        Device(LNKS) {
+            Name(_HID, EISAID("PNP0C0F"))
+            Name(_UID, 4)
+            Name(_PRS, ResourceTemplate() {
+                Interrupt(, Level, ActiveHigh, Shared) { 9 }
+            })
+
+            // The SCI cannot be disabled and is always attached to GSI 9,
+            // so these are no-ops.  We only need this link to override the
+            // polarity to active high and match the content of the MADT.
+            Method(_STA, 0, NotSerialized) { Return (0x0b) }
+            Method(_DIS, 0, NotSerialized) { }
+            Method(_CRS, 0, NotSerialized) { Return (_PRS) }
+            Method(_SRS, 1, NotSerialized) { }
+        }
     }
 
 #include "acpi-dsdt-cpu-hotplug.dsl"