qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH for-4.1] q35: acpi: do not create dummy MCFG tab


From: Igor Mammedov
Subject: Re: [Qemu-devel] [PATCH for-4.1] q35: acpi: do not create dummy MCFG table
Date: Wed, 10 Apr 2019 17:01:50 +0200

On Wed, 10 Apr 2019 22:27:56 +0800
Wei Yang <address@hidden> wrote:

[...]
> >@@ -2411,19 +2410,7 @@ build_mcfg_q35(GArray *table_data, BIOSLinker 
> >*linker, AcpiMcfgInfo *info)
> >     mcfg->allocation[0].start_bus_number = 0;
> >     mcfg->allocation[0].end_bus_number = PCIE_MMCFG_BUS(info->mcfg_size - 
> > 1);
> > 
> >-    /* MCFG is used for ECAM which can be enabled or disabled by guest.  
> 
> I want to cnfirm what is "enabled or disabled by guest" here.

Firmware theoretically during PCI initialization may disable ECAM support
and that's when we do no need MCFG. In practice that's not happening
(SeaBIOS or UEFI) but we in case there is out there a firmware that does
disable ECAM we do not generate MCFG.

Note:
ACPI tables generated twice, 1st when QEMU starts and the second time
when firmware accesses fwcfg to read blobs for the 1st time.
The later happens after PCI subsystem was initialized by firmware.
At that time we know if ECAM was enabled or not.

> If we don't reserve mcfg and "guest" enable mcfg during running, the ACPI
> table size changed. But the destination still has the original table size,
> since destination "guest" keep sleep during this period.
> 
> Now the migration would face table size difference

with commit a1666142db we do not care as all the tables created on
source will be migrated to destination as is overwriting whatever blobs
destination created on startup.

> and break migration?
nope,

to help you figure out why it works
look at what following git commits did:
  git log c8d6f66ae7..a1666142db
and pay attention to 'used_length'

> 
> >-     * To avoid table size changes (which create migration issues),
> >-     * always create the table even if there are no allocations,
> >-     * but set the signature to a reserved value in this case.
> >-     * ACPI spec requires OSPMs to ignore such tables.
> >-     */
> >-    if (info->mcfg_base == PCIE_BASE_ADDR_UNMAPPED) {
> >-        /* Reserved signature: ignored by OSPM */
> >-        sig = "QEMU";
> >-    } else {
> >-        sig = "MCFG";
> >-    }
> >-    build_header(linker, table_data, (void *)mcfg, sig, len, 1, NULL, NULL);
> >+    build_header(linker, table_data, (void *)mcfg, "MCFG", len, 1, NULL, 
> >NULL);
> > }
> > 
> > /*
> >@@ -2592,6 +2579,9 @@ static bool acpi_get_mcfg(AcpiMcfgInfo *mcfg)
> >     }
> >     mcfg->mcfg_base = qnum_get_uint(qobject_to(QNum, o));
> >     qobject_unref(o);
> >+    if (mcfg->mcfg_base == PCIE_BASE_ADDR_UNMAPPED) {
> >+        return false;
> >+    }
> > 
> >     o = object_property_get_qobject(pci_host, PCIE_HOST_MCFG_SIZE, NULL);
> >     assert(o);
> >-- 
> >2.7.4  
> 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]