Patchwork [v5,00/23] qemu: generate acpi tables for the guest

login
register
mail settings
Submitter Michael S. Tsirkin
Date Sept. 26, 2013, 9:50 p.m.
Message ID <20130926215023.GA26451@redhat.com>
Download mbox | patch
Permalink /patch/278282/
State New
Headers show

Comments

Michael S. Tsirkin - Sept. 26, 2013, 9:50 p.m.
On Thu, Sep 26, 2013 at 08:26:51AM +0200, Gerd Hoffmann wrote:
>   Hi,
> 
> > diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c
> > index 1ba86d0..d1ccdf7 100644
> > --- a/hw/i386/acpi-build.c
> > +++ b/hw/i386/acpi-build.c
> > @@ -961,8 +961,8 @@ static void acpi_build_update(void *build_opaque, uint32_t offset)
> >      if (build_state->mcfg_base) {
> >          AcpiMcfgAllocation *a;
> >          mcfg_base = qint_get_int(build_state->mcfg_base);
> > +        assert(build_state->mcfg_size);
> >          mcfg_size = qint_get_int(build_state->mcfg_size);
> > -        assert(mcfg_size);
> >  
> >          a = ACPI_BUILD_STATE_PTR(build_state, off_mcfg_allocation,
> >                                   AcpiMcfgAllocation);
> 
> Well, that fixes the assert, but it still isn't working correctly.  No
> mcfg table in acpi, even though the mcfg bar is programmed correctly.
> 
> Seeing this with both seabios+coreboot.
> 
> cheers,
>   Gerd
> 

OK here's a quick fix - it's ugly, I'll clean it up
a bit before reposting.
It's pushed, you can take the final one from my tree.
Thanks for the testing!

Patch

diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c
index d1ccdf7..e4fe196 100644
--- a/hw/i386/acpi-build.c
+++ b/hw/i386/acpi-build.c
@@ -938,6 +938,8 @@  struct AcpiBuildState {
                                 build_state->table_size, \
                                 build_state->off, sizeof(type))))
 
+/* Hack: we don't really need this */
+static void acpi_set_pci_info(AcpiBuildState *build_state);
 static void acpi_build_update(void *build_opaque, uint32_t offset)
 {
     AcpiBuildState *build_state = build_opaque;
@@ -954,6 +956,7 @@  static void acpi_build_update(void *build_opaque, uint32_t offset)
 
     acpi_get_pci_info(&pci_info);
     acpi_get_pm_info(&pm);
+    acpi_set_pci_info(build_state);
 
     fadt_update(ACPI_BUILD_STATE_PTR(build_state, off_fadt_base,
                                      AcpiFadtDescriptorRev1), &pm);