All the mail mirrored from lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PULL 00/10] pc, pci, virtio: fixes for rc1
@ 2017-11-15 18:17 Michael S. Tsirkin
  2017-11-15 18:17 ` [Qemu-devel] [PULL 01/10] fix: unrealize virtio device if we fail to hotplug it Michael S. Tsirkin
                   ` (10 more replies)
  0 siblings, 11 replies; 23+ messages in thread
From: Michael S. Tsirkin @ 2017-11-15 18:17 UTC (permalink / raw
  To: qemu-devel; +Cc: Peter Maydell

The following changes since commit 1fa0f627d03cd0d0755924247cafeb42969016bf:

  Update version for v2.11.0-rc1 release (2017-11-14 18:37:49 +0000)

are available in the git repository at:

  git://git.kernel.org/pub/scm/virt/kvm/mst/qemu.git tags/for_upstream

for you to fetch changes up to 6ed0c1c3ab0925009d15cffb944d9ccb04718846:

  build-sys: restrict vmcoreinfo to fw_cfg+dma capable targets (2017-11-15 20:13:13 +0200)

----------------------------------------------------------------
pc, pci, virtio: fixes for rc1

A bunch of fixes all over the place.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>

----------------------------------------------------------------
Alexey Kardashevskiy (1):
      pci: Initialize pci_dev->name before use

Daniel P. Berrange (2):
      tests: report errors when iasl exits with non-zero status
      test: fix detection of errors from iasl

Dou Liyang (1):
      NUMA: Enable adding NUMA node implicitly

Marc-André Lureau (2):
      vmcoreinfo: put it in the 'misc' device category
      build-sys: restrict vmcoreinfo to fw_cfg+dma capable targets

Marcel Apfelbaum (2):
      hw/pci-host: Fix x86 Host Bridges 64bit PCI hole
      hw/pcie-pci-bridge: restrict to X86 and ARM

Michael S. Tsirkin (1):
      tests/acpi-test-data: update _CRS in DSDT

linzhecheng (1):
      fix: unrealize virtio device if we fail to hotplug it

 default-configs/arm-softmmu.mak      |   2 ++
 default-configs/i386-softmmu.mak     |   1 +
 default-configs/x86_64-softmmu.mak   |   1 +
 include/hw/boards.h                  |   1 +
 include/hw/i386/pc.h                 |  10 ++++++++-
 include/hw/pci-host/q35.h            |   1 +
 hw/i386/pc.c                         |  23 +++++++++++++++++++
 hw/i386/pc_piix.c                    |   1 +
 hw/i386/pc_q35.c                     |   1 +
 hw/misc/vmcoreinfo.c                 |   1 +
 hw/pci-host/piix.c                   |  32 ++++++++++++++++++++++++--
 hw/pci-host/q35.c                    |  42 ++++++++++++++++++++++++++++++++---
 hw/pci/pci.c                         |   2 +-
 hw/virtio/virtio.c                   |   1 +
 numa.c                               |  21 +++++++++++++++++-
 tests/bios-tables-test.c             |  26 ++++++++++++++++------
 vl.c                                 |   3 +--
 hw/misc/Makefile.objs                |   2 +-
 hw/pci-bridge/Makefile.objs          |   4 ++--
 tests/acpi-test-data/pc/DSDT         | Bin 5098 -> 5144 bytes
 tests/acpi-test-data/pc/DSDT.bridge  | Bin 6957 -> 7003 bytes
 tests/acpi-test-data/pc/DSDT.cphp    | Bin 5561 -> 5607 bytes
 tests/acpi-test-data/pc/DSDT.ipmikcs | Bin 5170 -> 5216 bytes
 tests/acpi-test-data/pc/DSDT.memhp   | Bin 6463 -> 6509 bytes
 tests/acpi-test-data/q35/DSDT        | Bin 7782 -> 7828 bytes
 tests/acpi-test-data/q35/DSDT.bridge | Bin 7799 -> 7845 bytes
 tests/acpi-test-data/q35/DSDT.cphp   | Bin 8245 -> 8291 bytes
 tests/acpi-test-data/q35/DSDT.ipmibt | Bin 7857 -> 7903 bytes
 tests/acpi-test-data/q35/DSDT.memhp  | Bin 9147 -> 9193 bytes
 29 files changed, 155 insertions(+), 20 deletions(-)

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

* [Qemu-devel] [PULL 01/10] fix: unrealize virtio device if we fail to hotplug it
  2017-11-15 18:17 [Qemu-devel] [PULL 00/10] pc, pci, virtio: fixes for rc1 Michael S. Tsirkin
@ 2017-11-15 18:17 ` Michael S. Tsirkin
  2017-11-15 18:17 ` [Qemu-devel] [PULL 02/10] pci: Initialize pci_dev->name before use Michael S. Tsirkin
                   ` (9 subsequent siblings)
  10 siblings, 0 replies; 23+ messages in thread
From: Michael S. Tsirkin @ 2017-11-15 18:17 UTC (permalink / raw
  To: qemu-devel; +Cc: Peter Maydell, linzhecheng, Stefan Hajnoczi

From: linzhecheng <linzhecheng@huawei.com>

If we fail to hotplug virtio-blk device and then suspend
or shutdown VM, qemu is likely to crash.

Re-production steps:
1. Run VM named vm001
2. Create a virtio-blk.xml which contains wrong configurations:
<disk device="lun" rawio="yes" type="block">
  <driver cache="none" io="native" name="qemu" type="raw" />
  <source dev="/dev/mapper/11-dm" />
  <target bus="virtio" dev="vdx" />
</disk>
3. Run command : virsh attach-device vm001 virtio-blk.xml
error: Failed to attach device from blk-scsi.xml
error: internal error: unable to execute QEMU command 'device_add': Please set scsi=off for virtio-blk devices in order to use virtio 1.0
it means hotplug virtio-blk device failed.
4. Suspend or shutdown VM will leads to qemu crash

Problem happens in virtio_vmstate_change which is called by
vm_state_notify:
vdev’s parent_bus is NULL, so qdev_get_parent_bus(DEVICE(vdev)) will crash.
virtio_vmstate_change is added to the list vm_change_state_head at virtio_blk_device_realize(virtio_init),
but after hotplug virtio-blk failed, virtio_vmstate_change will not be removed from vm_change_state_head.
Adding unrealize function of virtio-blk device can solve this problem.

Signed-off-by: linzhecheng <linzhecheng@huawei.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
---
 hw/virtio/virtio.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/hw/virtio/virtio.c b/hw/virtio/virtio.c
index 5884ce3..ea532dc 100644
--- a/hw/virtio/virtio.c
+++ b/hw/virtio/virtio.c
@@ -2491,6 +2491,7 @@ static void virtio_device_realize(DeviceState *dev, Error **errp)
     virtio_bus_device_plugged(vdev, &err);
     if (err != NULL) {
         error_propagate(errp, err);
+        vdc->unrealize(dev, NULL);
         return;
     }
 
-- 
MST

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

* [Qemu-devel] [PULL 02/10] pci: Initialize pci_dev->name before use
  2017-11-15 18:17 [Qemu-devel] [PULL 00/10] pc, pci, virtio: fixes for rc1 Michael S. Tsirkin
  2017-11-15 18:17 ` [Qemu-devel] [PULL 01/10] fix: unrealize virtio device if we fail to hotplug it Michael S. Tsirkin
@ 2017-11-15 18:17 ` Michael S. Tsirkin
  2017-11-15 18:18 ` [Qemu-devel] [PULL 03/10] tests: report errors when iasl exits with non-zero status Michael S. Tsirkin
                   ` (8 subsequent siblings)
  10 siblings, 0 replies; 23+ messages in thread
From: Michael S. Tsirkin @ 2017-11-15 18:17 UTC (permalink / raw
  To: qemu-devel
  Cc: Peter Maydell, Alexey Kardashevskiy, Philippe Mathieu-Daudé,
	Peter Xu, Marcel Apfelbaum

From: Alexey Kardashevskiy <aik@ozlabs.ru>

This moves pci_dev->name initialization earlier so
pci_dev->bus_master_as could get a name instead of an empty string.

Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Peter Xu <peterx@redhat.com>
Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
---
 hw/pci/pci.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/hw/pci/pci.c b/hw/pci/pci.c
index 5ed3c8d..b2d139b 100644
--- a/hw/pci/pci.c
+++ b/hw/pci/pci.c
@@ -1030,6 +1030,7 @@ static PCIDevice *do_pci_register_device(PCIDevice *pci_dev, PCIBus *bus,
 
     pci_dev->devfn = devfn;
     pci_dev->requester_id_cache = pci_req_id_cache_get(pci_dev);
+    pstrcpy(pci_dev->name, sizeof(pci_dev->name), name);
 
     memory_region_init(&pci_dev->bus_master_container_region, OBJECT(pci_dev),
                        "bus master container", UINT64_MAX);
@@ -1039,7 +1040,6 @@ static PCIDevice *do_pci_register_device(PCIDevice *pci_dev, PCIBus *bus,
     if (qdev_hotplug) {
         pci_init_bus_master(pci_dev);
     }
-    pstrcpy(pci_dev->name, sizeof(pci_dev->name), name);
     pci_dev->irq_state = 0;
     pci_config_alloc(pci_dev);
 
-- 
MST

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

* [Qemu-devel] [PULL 03/10] tests: report errors when iasl exits with non-zero status
  2017-11-15 18:17 [Qemu-devel] [PULL 00/10] pc, pci, virtio: fixes for rc1 Michael S. Tsirkin
  2017-11-15 18:17 ` [Qemu-devel] [PULL 01/10] fix: unrealize virtio device if we fail to hotplug it Michael S. Tsirkin
  2017-11-15 18:17 ` [Qemu-devel] [PULL 02/10] pci: Initialize pci_dev->name before use Michael S. Tsirkin
@ 2017-11-15 18:18 ` Michael S. Tsirkin
  2017-11-15 18:18 ` [Qemu-devel] [PULL 04/10] test: fix detection of errors from iasl Michael S. Tsirkin
                   ` (7 subsequent siblings)
  10 siblings, 0 replies; 23+ messages in thread
From: Michael S. Tsirkin @ 2017-11-15 18:18 UTC (permalink / raw
  To: qemu-devel
  Cc: Peter Maydell, Daniel P. Berrange, Philippe Mathieu-Daudé,
	Igor Mammedov

From: "Daniel P. Berrange" <berrange@redhat.com>

If iasl exits with non-zero status, the test unhelpfully just reports
that the AML did not match, because the data files it thought iasl
generated do not exist. This adds an explicit check for the exit status
of iasl and prints stderr if it was non-zero. Thus gives us a fighting
chance of diagnosing why iasl failed.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
---
 tests/bios-tables-test.c | 24 ++++++++++++++++++------
 1 file changed, 18 insertions(+), 6 deletions(-)

diff --git a/tests/bios-tables-test.c b/tests/bios-tables-test.c
index 564da45..ee441f1 100644
--- a/tests/bios-tables-test.c
+++ b/tests/bios-tables-test.c
@@ -304,6 +304,7 @@ static bool load_asl(GArray *sdts, AcpiSdtTable *sdt)
     gchar *out, *out_err;
     gboolean ret;
     int i;
+    int status;
 
     fd = g_file_open_tmp("asl-XXXXXX.dsl", &sdt->asl_file, &error);
     g_assert_no_error(error);
@@ -324,14 +325,25 @@ static bool load_asl(GArray *sdts, AcpiSdtTable *sdt)
     g_string_append_printf(command_line, "-d %s", sdt->aml_file);
 
     /* pass 'out' and 'out_err' in order to be redirected */
-    ret = g_spawn_command_line_sync(command_line->str, &out, &out_err, NULL, &error);
+    ret = g_spawn_command_line_sync(command_line->str, &out, &out_err, &status, &error);
     g_assert_no_error(error);
     if (ret) {
-        ret = g_file_get_contents(sdt->asl_file, (gchar **)&sdt->asl,
-                                  &sdt->asl_len, &error);
-        g_assert(ret);
-        g_assert_no_error(error);
-        ret = (sdt->asl_len > 0);
+        if (status != 0) {
+            g_printerr("'%s' exited with status %d", command_line->str, status);
+            if (!g_str_equal(out, "")) {
+                g_printerr("%s", out);
+            }
+            if (!g_str_equal(out_err, "")) {
+                g_printerr("%s", out_err);
+            }
+            ret = FALSE;
+        } else {
+            ret = g_file_get_contents(sdt->asl_file, (gchar **)&sdt->asl,
+                                      &sdt->asl_len, &error);
+            g_assert(ret);
+            g_assert_no_error(error);
+            ret = (sdt->asl_len > 0);
+        }
     }
 
     g_free(out);
-- 
MST

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

* [Qemu-devel] [PULL 04/10] test: fix detection of errors from iasl
  2017-11-15 18:17 [Qemu-devel] [PULL 00/10] pc, pci, virtio: fixes for rc1 Michael S. Tsirkin
                   ` (2 preceding siblings ...)
  2017-11-15 18:18 ` [Qemu-devel] [PULL 03/10] tests: report errors when iasl exits with non-zero status Michael S. Tsirkin
@ 2017-11-15 18:18 ` Michael S. Tsirkin
  2017-11-15 18:18 ` [Qemu-devel] [PULL 05/10] hw/pci-host: Fix x86 Host Bridges 64bit PCI hole Michael S. Tsirkin
                   ` (6 subsequent siblings)
  10 siblings, 0 replies; 23+ messages in thread
From: Michael S. Tsirkin @ 2017-11-15 18:18 UTC (permalink / raw
  To: qemu-devel; +Cc: Peter Maydell, Daniel P. Berrange, Igor Mammedov

From: "Daniel P. Berrange" <berrange@redhat.com>

The conditional looking for errors while loading asl files would ignore
errors from loading the expected data, if the actual data succeeded.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
---
 tests/bios-tables-test.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tests/bios-tables-test.c b/tests/bios-tables-test.c
index ee441f1..be05e8b 100644
--- a/tests/bios-tables-test.c
+++ b/tests/bios-tables-test.c
@@ -458,7 +458,7 @@ static void test_acpi_asl(test_data *data)
         exp_asl = normalize_asl(exp_sdt->asl);
 
         /* TODO: check for warnings */
-        g_assert(!err || exp_err);
+        g_assert(!err && !exp_err);
 
         if (g_strcmp0(asl->str, exp_asl->str)) {
             if (exp_err) {
-- 
MST

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

* [Qemu-devel] [PULL 05/10] hw/pci-host: Fix x86 Host Bridges 64bit PCI hole
  2017-11-15 18:17 [Qemu-devel] [PULL 00/10] pc, pci, virtio: fixes for rc1 Michael S. Tsirkin
                   ` (3 preceding siblings ...)
  2017-11-15 18:18 ` [Qemu-devel] [PULL 04/10] test: fix detection of errors from iasl Michael S. Tsirkin
@ 2017-11-15 18:18 ` Michael S. Tsirkin
  2017-11-15 18:18 ` [Qemu-devel] [PULL 06/10] hw/pcie-pci-bridge: restrict to X86 and ARM Michael S. Tsirkin
                   ` (5 subsequent siblings)
  10 siblings, 0 replies; 23+ messages in thread
From: Michael S. Tsirkin @ 2017-11-15 18:18 UTC (permalink / raw
  To: qemu-devel
  Cc: Peter Maydell, Marcel Apfelbaum, Laszlo Ersek, Gerd Hoffmann,
	Paolo Bonzini, Richard Henderson, Eduardo Habkost

From: Marcel Apfelbaum <marcel@redhat.com>

Currently there is no MMIO range over 4G
reserved for PCI hotplug. Since the 32bit PCI hole
depends on the number of cold-plugged PCI devices
and other factors, it is very possible is too small
to hotplug PCI devices with large BARs.

Fix it by reserving 2G for I4400FX chipset
in order to comply with older Win32 Guest OSes
and 32G for Q35 chipset.

Even if the new defaults of pci-hole64-size will appear in
"info qtree" also for older machines, the property was
not implemented so no changes will be visible to guests.

Note this is a regression since prev QEMU versions had
some range reserved for 64bit PCI hotplug.

Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Marcel Apfelbaum <marcel@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
---
 include/hw/i386/pc.h      | 10 +++++++++-
 include/hw/pci-host/q35.h |  1 +
 hw/i386/pc.c              | 22 ++++++++++++++++++++++
 hw/pci-host/piix.c        | 32 ++++++++++++++++++++++++++++++--
 hw/pci-host/q35.c         | 42 +++++++++++++++++++++++++++++++++++++++---
 5 files changed, 101 insertions(+), 6 deletions(-)

diff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h
index 087d184..ef438bd 100644
--- a/include/hw/i386/pc.h
+++ b/include/hw/i386/pc.h
@@ -238,7 +238,6 @@ void pc_guest_info_init(PCMachineState *pcms);
 #define PCI_HOST_PROP_PCI_HOLE64_SIZE  "pci-hole64-size"
 #define PCI_HOST_BELOW_4G_MEM_SIZE     "below-4g-mem-size"
 #define PCI_HOST_ABOVE_4G_MEM_SIZE     "above-4g-mem-size"
-#define DEFAULT_PCI_HOLE64_SIZE (~0x0ULL)
 
 
 void pc_pci_as_mapping_init(Object *owner, MemoryRegion *system_memory,
@@ -249,6 +248,7 @@ void pc_memory_init(PCMachineState *pcms,
                     MemoryRegion *system_memory,
                     MemoryRegion *rom_memory,
                     MemoryRegion **ram_memory);
+uint64_t pc_pci_hole64_start(void);
 qemu_irq pc_allocate_cpu_irq(void);
 DeviceState *pc_vga_init(ISABus *isa_bus, PCIBus *pci_bus);
 void pc_basic_device_init(ISABus *isa_bus, qemu_irq *gsi,
@@ -375,6 +375,14 @@ bool e820_get_entry(int, uint32_t, uint64_t *, uint64_t *);
         .driver   = TYPE_X86_CPU,\
         .property = "x-hv-max-vps",\
         .value    = "0x40",\
+    },{\
+        .driver   = "i440FX-pcihost",\
+        .property = "x-pci-hole64-fix",\
+        .value    = "off",\
+    },{\
+        .driver   = "q35-pcihost",\
+        .property = "x-pci-hole64-fix",\
+        .value    = "off",\
     },
 
 #define PC_COMPAT_2_9 \
diff --git a/include/hw/pci-host/q35.h b/include/hw/pci-host/q35.h
index 58983c0..8f4ddde 100644
--- a/include/hw/pci-host/q35.h
+++ b/include/hw/pci-host/q35.h
@@ -68,6 +68,7 @@ typedef struct Q35PCIHost {
     PCIExpressHost parent_obj;
     /*< public >*/
 
+    bool pci_hole64_fix;
     MCHPCIState mch;
 } Q35PCIHost;
 
diff --git a/hw/i386/pc.c b/hw/i386/pc.c
index e11a65b..fafe5ba 100644
--- a/hw/i386/pc.c
+++ b/hw/i386/pc.c
@@ -1448,6 +1448,28 @@ void pc_memory_init(PCMachineState *pcms,
     pcms->ioapic_as = &address_space_memory;
 }
 
+/*
+ * The 64bit pci hole starts after "above 4G RAM" and
+ * potentially the space reserved for memory hotplug.
+ */
+uint64_t pc_pci_hole64_start(void)
+{
+    PCMachineState *pcms = PC_MACHINE(qdev_get_machine());
+    PCMachineClass *pcmc = PC_MACHINE_GET_CLASS(pcms);
+    uint64_t hole64_start = 0;
+
+    if (pcmc->has_reserved_memory && pcms->hotplug_memory.base) {
+        hole64_start = pcms->hotplug_memory.base;
+        if (!pcmc->broken_reserved_end) {
+            hole64_start += memory_region_size(&pcms->hotplug_memory.mr);
+        }
+    } else {
+        hole64_start = 0x100000000ULL + pcms->above_4g_mem_size;
+    }
+
+    return ROUND_UP(hole64_start, 1ULL << 30);
+}
+
 qemu_irq pc_allocate_cpu_irq(void)
 {
     return qemu_allocate_irq(pic_irq_request, NULL, 0);
diff --git a/hw/pci-host/piix.c b/hw/pci-host/piix.c
index a7e2256..a684a7c 100644
--- a/hw/pci-host/piix.c
+++ b/hw/pci-host/piix.c
@@ -50,6 +50,7 @@ typedef struct I440FXState {
     PCIHostState parent_obj;
     Range pci_hole;
     uint64_t pci_hole64_size;
+    bool pci_hole64_fix;
     uint32_t short_root_bus;
 } I440FXState;
 
@@ -112,6 +113,9 @@ struct PCII440FXState {
 #define I440FX_PAM_SIZE 7
 #define I440FX_SMRAM    0x72
 
+/* Keep it 2G to comply with older win32 guests */
+#define I440FX_PCI_HOST_HOLE64_SIZE_DEFAULT (1ULL << 31)
+
 /* Older coreboot versions (4.0 and older) read a config register that doesn't
  * exist in real hardware, to get the RAM size from QEMU.
  */
@@ -238,29 +242,52 @@ static void i440fx_pcihost_get_pci_hole_end(Object *obj, Visitor *v,
     visit_type_uint32(v, name, &value, errp);
 }
 
+/*
+ * The 64bit PCI hole start is set by the Guest firmware
+ * as the address of the first 64bit PCI MEM resource.
+ * If no PCI device has resources on the 64bit area,
+ * the 64bit PCI hole will start after "over 4G RAM" and the
+ * reserved space for memory hotplug if any.
+ */
 static void i440fx_pcihost_get_pci_hole64_start(Object *obj, Visitor *v,
                                                 const char *name,
                                                 void *opaque, Error **errp)
 {
     PCIHostState *h = PCI_HOST_BRIDGE(obj);
+    I440FXState *s = I440FX_PCI_HOST_BRIDGE(obj);
     Range w64;
     uint64_t value;
 
     pci_bus_get_w64_range(h->bus, &w64);
     value = range_is_empty(&w64) ? 0 : range_lob(&w64);
+    if (!value && s->pci_hole64_fix) {
+        value = pc_pci_hole64_start();
+    }
     visit_type_uint64(v, name, &value, errp);
 }
 
+/*
+ * The 64bit PCI hole end is set by the Guest firmware
+ * as the address of the last 64bit PCI MEM resource.
+ * Then it is expanded to the PCI_HOST_PROP_PCI_HOLE64_SIZE
+ * that can be configured by the user.
+ */
 static void i440fx_pcihost_get_pci_hole64_end(Object *obj, Visitor *v,
                                               const char *name, void *opaque,
                                               Error **errp)
 {
     PCIHostState *h = PCI_HOST_BRIDGE(obj);
+    I440FXState *s = I440FX_PCI_HOST_BRIDGE(obj);
+    uint64_t hole64_start = pc_pci_hole64_start();
     Range w64;
-    uint64_t value;
+    uint64_t value, hole64_end;
 
     pci_bus_get_w64_range(h->bus, &w64);
     value = range_is_empty(&w64) ? 0 : range_upb(&w64) + 1;
+    hole64_end = ROUND_UP(hole64_start + s->pci_hole64_size, 1ULL << 30);
+    if (s->pci_hole64_fix && value < hole64_end) {
+        value = hole64_end;
+    }
     visit_type_uint64(v, name, &value, errp);
 }
 
@@ -863,8 +890,9 @@ static const char *i440fx_pcihost_root_bus_path(PCIHostState *host_bridge,
 
 static Property i440fx_props[] = {
     DEFINE_PROP_SIZE(PCI_HOST_PROP_PCI_HOLE64_SIZE, I440FXState,
-                     pci_hole64_size, DEFAULT_PCI_HOLE64_SIZE),
+                     pci_hole64_size, I440FX_PCI_HOST_HOLE64_SIZE_DEFAULT),
     DEFINE_PROP_UINT32("short_root_bus", I440FXState, short_root_bus, 0),
+    DEFINE_PROP_BOOL("x-pci-hole64-fix", I440FXState, pci_hole64_fix, true),
     DEFINE_PROP_END_OF_LIST(),
 };
 
diff --git a/hw/pci-host/q35.c b/hw/pci-host/q35.c
index ddaa7d1..6cb9a8d 100644
--- a/hw/pci-host/q35.c
+++ b/hw/pci-host/q35.c
@@ -37,6 +37,8 @@
  * Q35 host
  */
 
+#define Q35_PCI_HOST_HOLE64_SIZE_DEFAULT (1ULL << 35)
+
 static void q35_host_realize(DeviceState *dev, Error **errp)
 {
     PCIHostState *pci = PCI_HOST_BRIDGE(dev);
@@ -99,29 +101,52 @@ static void q35_host_get_pci_hole_end(Object *obj, Visitor *v,
     visit_type_uint32(v, name, &value, errp);
 }
 
+/*
+ * The 64bit PCI hole start is set by the Guest firmware
+ * as the address of the first 64bit PCI MEM resource.
+ * If no PCI device has resources on the 64bit area,
+ * the 64bit PCI hole will start after "over 4G RAM" and the
+ * reserved space for memory hotplug if any.
+ */
 static void q35_host_get_pci_hole64_start(Object *obj, Visitor *v,
                                           const char *name, void *opaque,
                                           Error **errp)
 {
     PCIHostState *h = PCI_HOST_BRIDGE(obj);
+    Q35PCIHost *s = Q35_HOST_DEVICE(obj);
     Range w64;
     uint64_t value;
 
     pci_bus_get_w64_range(h->bus, &w64);
     value = range_is_empty(&w64) ? 0 : range_lob(&w64);
+    if (!value && s->pci_hole64_fix) {
+        value = pc_pci_hole64_start();
+    }
     visit_type_uint64(v, name, &value, errp);
 }
 
+/*
+ * The 64bit PCI hole end is set by the Guest firmware
+ * as the address of the last 64bit PCI MEM resource.
+ * Then it is expanded to the PCI_HOST_PROP_PCI_HOLE64_SIZE
+ * that can be configured by the user.
+ */
 static void q35_host_get_pci_hole64_end(Object *obj, Visitor *v,
                                         const char *name, void *opaque,
                                         Error **errp)
 {
     PCIHostState *h = PCI_HOST_BRIDGE(obj);
+    Q35PCIHost *s = Q35_HOST_DEVICE(obj);
+    uint64_t hole64_start = pc_pci_hole64_start();
     Range w64;
-    uint64_t value;
+    uint64_t value, hole64_end;
 
     pci_bus_get_w64_range(h->bus, &w64);
     value = range_is_empty(&w64) ? 0 : range_upb(&w64) + 1;
+    hole64_end = ROUND_UP(hole64_start + s->mch.pci_hole64_size, 1ULL << 30);
+    if (s->pci_hole64_fix && value < hole64_end) {
+        value = hole64_end;
+    }
     visit_type_uint64(v, name, &value, errp);
 }
 
@@ -133,16 +158,25 @@ static void q35_host_get_mmcfg_size(Object *obj, Visitor *v, const char *name,
     visit_type_uint64(v, name, &e->size, errp);
 }
 
+/*
+ * NOTE: setting defaults for the mch.* fields in this table
+ * doesn't work, because mch is a separate QOM object that is
+ * zeroed by the object_initialize(&s->mch, ...) call inside
+ * q35_host_initfn().  The default values for those
+ * properties need to be initialized manually by
+ * q35_host_initfn() after the object_initialize() call.
+ */
 static Property q35_host_props[] = {
     DEFINE_PROP_UINT64(PCIE_HOST_MCFG_BASE, Q35PCIHost, parent_obj.base_addr,
                         MCH_HOST_BRIDGE_PCIEXBAR_DEFAULT),
     DEFINE_PROP_SIZE(PCI_HOST_PROP_PCI_HOLE64_SIZE, Q35PCIHost,
-                     mch.pci_hole64_size, DEFAULT_PCI_HOLE64_SIZE),
+                     mch.pci_hole64_size, Q35_PCI_HOST_HOLE64_SIZE_DEFAULT),
     DEFINE_PROP_UINT32("short_root_bus", Q35PCIHost, mch.short_root_bus, 0),
     DEFINE_PROP_SIZE(PCI_HOST_BELOW_4G_MEM_SIZE, Q35PCIHost,
                      mch.below_4g_mem_size, 0),
     DEFINE_PROP_SIZE(PCI_HOST_ABOVE_4G_MEM_SIZE, Q35PCIHost,
                      mch.above_4g_mem_size, 0),
+    DEFINE_PROP_BOOL("x-pci-hole64-fix", Q35PCIHost, pci_hole64_fix, true),
     DEFINE_PROP_END_OF_LIST(),
 };
 
@@ -174,7 +208,9 @@ static void q35_host_initfn(Object *obj)
     object_property_add_child(OBJECT(s), "mch", OBJECT(&s->mch), NULL);
     qdev_prop_set_int32(DEVICE(&s->mch), "addr", PCI_DEVFN(0, 0));
     qdev_prop_set_bit(DEVICE(&s->mch), "multifunction", false);
-
+    /* mch's object_initialize resets the default value, set it again */
+    qdev_prop_set_uint64(DEVICE(s), PCI_HOST_PROP_PCI_HOLE64_SIZE,
+                         Q35_PCI_HOST_HOLE64_SIZE_DEFAULT);
     object_property_add(obj, PCI_HOST_PROP_PCI_HOLE_START, "uint32",
                         q35_host_get_pci_hole_start,
                         NULL, NULL, NULL, NULL);
-- 
MST

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

* [Qemu-devel] [PULL 06/10] hw/pcie-pci-bridge: restrict to X86 and ARM
  2017-11-15 18:17 [Qemu-devel] [PULL 00/10] pc, pci, virtio: fixes for rc1 Michael S. Tsirkin
                   ` (4 preceding siblings ...)
  2017-11-15 18:18 ` [Qemu-devel] [PULL 05/10] hw/pci-host: Fix x86 Host Bridges 64bit PCI hole Michael S. Tsirkin
@ 2017-11-15 18:18 ` Michael S. Tsirkin
  2017-11-15 18:18 ` [Qemu-devel] [PULL 07/10] tests/acpi-test-data: update _CRS in DSDT Michael S. Tsirkin
                   ` (4 subsequent siblings)
  10 siblings, 0 replies; 23+ messages in thread
From: Michael S. Tsirkin @ 2017-11-15 18:18 UTC (permalink / raw
  To: qemu-devel
  Cc: Peter Maydell, Marcel Apfelbaum, Thomas Huth,
	Philippe Mathieu-Daudé, Cornelia Huck, Yongbok Kim

From: Marcel Apfelbaum <marcel@redhat.com>

The PCIE-PCI bridge is specific to "pure" PCIe systems
(on QEMU we have X86 and ARM), it does not make sense to
have it in other archs.

Reported-by: Thomas Huth <thuth@redhat.com>
Signed-off-by: Marcel Apfelbaum <marcel@redhat.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Tested-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Cornelia Huck <cohuck@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Tested-by: Yongbok Kim <yongbok.kim@mips.com>
---
 hw/pci-bridge/Makefile.objs | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/hw/pci-bridge/Makefile.objs b/hw/pci-bridge/Makefile.objs
index 666db37..1b05023 100644
--- a/hw/pci-bridge/Makefile.objs
+++ b/hw/pci-bridge/Makefile.objs
@@ -1,5 +1,5 @@
-common-obj-y += pci_bridge_dev.o pcie_pci_bridge.o
-common-obj-$(CONFIG_PCIE_PORT) += pcie_root_port.o gen_pcie_root_port.o
+common-obj-y += pci_bridge_dev.o
+common-obj-$(CONFIG_PCIE_PORT) += pcie_root_port.o gen_pcie_root_port.o pcie_pci_bridge.o
 common-obj-$(CONFIG_PXB) += pci_expander_bridge.o
 common-obj-$(CONFIG_XIO3130) += xio3130_upstream.o xio3130_downstream.o
 common-obj-$(CONFIG_IOH3420) += ioh3420.o
-- 
MST

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

* [Qemu-devel] [PULL 07/10] tests/acpi-test-data: update _CRS in DSDT
  2017-11-15 18:17 [Qemu-devel] [PULL 00/10] pc, pci, virtio: fixes for rc1 Michael S. Tsirkin
                   ` (5 preceding siblings ...)
  2017-11-15 18:18 ` [Qemu-devel] [PULL 06/10] hw/pcie-pci-bridge: restrict to X86 and ARM Michael S. Tsirkin
@ 2017-11-15 18:18 ` Michael S. Tsirkin
  2017-11-15 18:18 ` [Qemu-devel] [PULL 08/10] NUMA: Enable adding NUMA node implicitly Michael S. Tsirkin
                   ` (3 subsequent siblings)
  10 siblings, 0 replies; 23+ messages in thread
From: Michael S. Tsirkin @ 2017-11-15 18:18 UTC (permalink / raw
  To: qemu-devel; +Cc: Peter Maydell

commit dadf988e81b15065ac1d6dbaf4b87b5b80c7b670
    hw/pci-host: Fix x86 Host Bridges 64bit PCI hole

Added a 64 bit hole to _CRS of PCI0.
Update the expected files accordingly.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
---
 tests/acpi-test-data/pc/DSDT         | Bin 5098 -> 5144 bytes
 tests/acpi-test-data/pc/DSDT.bridge  | Bin 6957 -> 7003 bytes
 tests/acpi-test-data/pc/DSDT.cphp    | Bin 5561 -> 5607 bytes
 tests/acpi-test-data/pc/DSDT.ipmikcs | Bin 5170 -> 5216 bytes
 tests/acpi-test-data/pc/DSDT.memhp   | Bin 6463 -> 6509 bytes
 tests/acpi-test-data/q35/DSDT        | Bin 7782 -> 7828 bytes
 tests/acpi-test-data/q35/DSDT.bridge | Bin 7799 -> 7845 bytes
 tests/acpi-test-data/q35/DSDT.cphp   | Bin 8245 -> 8291 bytes
 tests/acpi-test-data/q35/DSDT.ipmibt | Bin 7857 -> 7903 bytes
 tests/acpi-test-data/q35/DSDT.memhp  | Bin 9147 -> 9193 bytes
 10 files changed, 0 insertions(+), 0 deletions(-)

diff --git a/tests/acpi-test-data/pc/DSDT b/tests/acpi-test-data/pc/DSDT
index 15c3135d65f168a91edfdc3471ea1d3f012a824f..99f05a502752d9dbac38fdd93f1ebb79b4564fb4 100644
GIT binary patch
delta 98
zcmaE*K0|}cCD<iILWF^VF?=IeJhzy$NQ_>5uv2`1v!?+^ymL^npaU1zoXPdvIeJ~%
d3=BNX3`l?x$o~KTe?5ps0u3Pc=GWZ+*#RA&6M_H$

delta 51
zcmbQC@k*V`CD<k8l`sPXW5q_Ucy2LQ!5F>xV5j&1XHNr;c;}#CK__;uyvg<4Ih!SU
H{<8xBdNvM&

diff --git a/tests/acpi-test-data/pc/DSDT.bridge b/tests/acpi-test-data/pc/DSDT.bridge
index d38586c95bf31f0212279a2505efd8e2fd321ccc..cf23343e6402421f09da5d09f72811108fbd2661 100644
GIT binary patch
delta 98
zcmZ2$cH4~0CD<h-TAG1@aluBecy2Lgkr=)BV5j&1XHNr;c;}#CK?g3bIg{(TbM(5j
d85nq&8IS-Ykp2Jv|9TLO1R6l>&9Awg_yJmb6N3N%

delta 51
zcmca@w$_ZxCD<iISDJx=@xVr|cy2LQ!5F>xV5j&1XHNr;c;}#CK__;uyvg<4Ih!SU
GocIB3sttqy

diff --git a/tests/acpi-test-data/pc/DSDT.cphp b/tests/acpi-test-data/pc/DSDT.cphp
index 2dd70bf9520406c36c3684714bb714e536a28d20..c99c49f43705e99d1e0a8ba19d44145dfa63d009 100644
GIT binary patch
delta 98
zcmdm~{al;NCD<k8xhMkz<He0!dc0!JA~AaL!A|i3&YlJw@y<cPf(~3<b0+)o=IC{4
eGcfQlGavy*Ap8IS|Megm2{eG%n|Ja4X9oa*yA)&q

delta 51
zcmaE^y;GaZCD<iorzish<HwC$dc0z;f-!pW!A|i3&YlJw@y<cPf==vQd6WHkb2h)=
H{m%{nhcXXj

diff --git a/tests/acpi-test-data/pc/DSDT.ipmikcs b/tests/acpi-test-data/pc/DSDT.ipmikcs
index 2796d96b0eec17fb68a79234cbccb70708ac2587..5e970fda7296f9ce44487e0a578a1dead982ba66 100644
GIT binary patch
delta 98
zcmdm_@j!#iCD<h-L4<*U@y<rB<=kS<A~AaL!A|i3&YlJw@y<cPf(~3<b0#0>&e7}A
eW?<l9W<UarK=%Lt|LZ|C5@-OiHyiW(X9oa_pA<O&

delta 51
zcmaE$u}Oo=CD<jzNQ8lb@y|xC<=kSff-!pW!A|i3&YlJw@y<cPf==vQd6SQG=WI^o
H`OgjjfCCRX

diff --git a/tests/acpi-test-data/pc/DSDT.memhp b/tests/acpi-test-data/pc/DSDT.memhp
index 53f6d5824359ff0ca20179b19b3b5cb79f017f82..1fe6871aa245277e0562ff0a1e93a9bf3bcf2295 100644
GIT binary patch
delta 98
zcmdmQ^wx;WCD<h-SCWB&F>)i<76CD5kr=)BV5j&1XHNr;c;}#CK?g3bIg_sl<mh#2
eGcfQlGavybAp8IS|Megm2{eG%n;iuIvjYHvJrphg

delta 51
zcmaEBwBLx!CD<jzUXp=<v3eud76CC=!5F>xV5j&1XHNr;c;}#CK__;uyvbJtayI7)
H{$~dOd}0qS

diff --git a/tests/acpi-test-data/q35/DSDT b/tests/acpi-test-data/q35/DSDT
index a080e2ace20ce9b88d5a61078d8caa0262617eed..aa402cca667f82ed0a2dc4969508d8f6e38ad910 100644
GIT binary patch
delta 97
zcmaE6GsTw6CD<ioiW~z2quNHUdop6~{4sj*!A|i3&YlJw@y<cPf(~3<b0+_j$<gc5
bW?<l9W<UarK=ywi;6M@sF+u#vS+aishSC&{

delta 50
zcmbPY`^<*RCD<h-O^$(qF?1u>JsB}io*2FOV5j&1XHNr;c;}#CK__;uyvhG$awgA^
G{R04T6c3I7

diff --git a/tests/acpi-test-data/q35/DSDT.bridge b/tests/acpi-test-data/q35/DSDT.bridge
index 31a76732e563dde32e6d976670baa732a6b91807..fc3e79c583ababf5615e76ba2f7bc3df1483abb4 100644
GIT binary patch
delta 98
zcmexvv(%Q$CD<iosT>0X<FSog_hiJ}`D66rgPr07oIMRV;+=zn1s%A!=1l%4lcU$A
c&A`CJ%zy+Kf$aZ4z=0$NVuJXavt)T00pV^GlK=n!

delta 51
zcmZ2#``w1iCD<jTT#kW(@#{vedop64JTZFl!A|i3&YlJw@y<cPf==vQd6WOi<ZPZH
H%gYD=pYsos

diff --git a/tests/acpi-test-data/q35/DSDT.cphp b/tests/acpi-test-data/q35/DSDT.cphp
index 3e23cb638f296644154100379584b30b644926bd..fd3cb3421814d0383863dc780d9a2a9077b727a3 100644
GIT binary patch
delta 97
zcmdn$@YsRNCD<h-S%HCpasEcGwQ^$a{4sj*!A|i3&YlJw@y<cPf(~3<b0(ja%hBu7
bW?<l9W<UarK=ywi;6M@sF+u#vmhyi9k`NSd

delta 50
zcmaFtu+@RfCD<jzRDpqk@!UqPwQ^#fJTZFl!A|i3&YlJw@y<cPf==vQd6Un|<xEbO
G{{sMeF%NJ6

diff --git a/tests/acpi-test-data/q35/DSDT.ipmibt b/tests/acpi-test-data/q35/DSDT.ipmibt
index 9c5e03fd2ffd3a99f3e5214ba187456a86410b22..332237529e114256384c051858fdac36b024c72e 100644
GIT binary patch
delta 97
zcmdmJd*7DJCD<k8z8nJsqxVKGO<6H_{usUZV5j&1XHNr;c;}#CK?g3bIg>qQbM(5j
b85nq&8IS-Yko_MBIFQ6ZOb~zaR@pxQS6~zP

delta 50
zcmca_yU~`*CD<ioqZ|VRW7S43O<6Hdo*2FOV5j&1XHNr;c;}#CK__;uyvd%jIg=mD
G{s91M?+*9?

diff --git a/tests/acpi-test-data/q35/DSDT.memhp b/tests/acpi-test-data/q35/DSDT.memhp
index 1b7c484a5e31ec456685bc246197252cb48a3adf..f0a27e1a3093ff7525f62b7509ea44dfe9eb8908 100644
GIT binary patch
delta 97
zcmdn({?eVxCD<k8r7{BpqsB%qV<j<n{usUZV5j&1XHNr;c;}#CK?g3bIg^8xa`d{i
c85nq&8IS-Iko_MBIFZCaOb#HPykF@L0BA-OI{*Lx

delta 50
zcmaFqzT2J4CD<iow=x3*W8_9IV<j<9o*2FOV5j&1XHNr;c;}#CK__;uyve~zIg{Ti
G{Q&@Tw+}l2

-- 
MST

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

* [Qemu-devel] [PULL 08/10] NUMA: Enable adding NUMA node implicitly
  2017-11-15 18:17 [Qemu-devel] [PULL 00/10] pc, pci, virtio: fixes for rc1 Michael S. Tsirkin
                   ` (6 preceding siblings ...)
  2017-11-15 18:18 ` [Qemu-devel] [PULL 07/10] tests/acpi-test-data: update _CRS in DSDT Michael S. Tsirkin
@ 2017-11-15 18:18 ` Michael S. Tsirkin
  2017-11-16 10:22   ` Thadeu Lima de Souza Cascardo
  2017-11-15 18:19 ` [Qemu-devel] [PULL 09/10] vmcoreinfo: put it in the 'misc' device category Michael S. Tsirkin
                   ` (2 subsequent siblings)
  10 siblings, 1 reply; 23+ messages in thread
From: Michael S. Tsirkin @ 2017-11-15 18:18 UTC (permalink / raw
  To: qemu-devel
  Cc: Peter Maydell, Dou Liyang, Thadeu Lima de Souza Cascardo,
	Igor Mammedov, Paolo Bonzini, Richard Henderson, Eduardo Habkost,
	Marcel Apfelbaum, David Hildenbrand, Thomas Huth,
	Alistair Francis, Takao Indoh, Izumi Taku

From: Dou Liyang <douly.fnst@cn.fujitsu.com>

Linux and Windows need ACPI SRAT table to make memory hotplug work properly,
however currently QEMU doesn't create SRAT table if numa options aren't present
on CLI.

Which breaks both linux and windows guests in certain conditions:
 * Windows: won't enable memory hotplug without SRAT table at all
 * Linux: if QEMU is started with initial memory all below 4Gb and no SRAT table
   present, guest kernel will use nommu DMA ops, which breaks 32bit hw drivers
   when memory is hotplugged and guest tries to use it with that drivers.

Fix above issues by automatically creating a numa node when QEMU is started with
memory hotplug enabled but without '-numa' options on CLI.
(PS: auto-create numa node only for new machine types so not to break migration).

Which would provide SRAT table to guests without explicit -numa options on CLI
and would allow:
 * Windows: to enable memory hotplug
 * Linux: switch to SWIOTLB DMA ops, to bounce DMA transfers to 32bit allocated
   buffers that legacy drivers/hw can handle.

[Rewritten by Igor]

Reported-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
Suggested-by: Igor Mammedov <imammedo@redhat.com>
Signed-off-by: Dou Liyang <douly.fnst@cn.fujitsu.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>
Cc: Richard Henderson <rth@twiddle.net>
Cc: Eduardo Habkost <ehabkost@redhat.com>
Cc: "Michael S. Tsirkin" <mst@redhat.com>
Cc: Marcel Apfelbaum <marcel@redhat.com>
Cc: Igor Mammedov <imammedo@redhat.com>
Cc: David Hildenbrand <david@redhat.com>
Cc: Thomas Huth <thuth@redhat.com>
Cc: Alistair Francis <alistair23@gmail.com>
Cc: Takao Indoh <indou.takao@jp.fujitsu.com>
Cc: Izumi Taku <izumi.taku@jp.fujitsu.com>
Reviewed-by: Igor Mammedov <imammedo@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
---
 include/hw/boards.h |  1 +
 hw/i386/pc.c        |  1 +
 hw/i386/pc_piix.c   |  1 +
 hw/i386/pc_q35.c    |  1 +
 numa.c              | 21 ++++++++++++++++++++-
 vl.c                |  3 +--
 6 files changed, 25 insertions(+), 3 deletions(-)

diff --git a/include/hw/boards.h b/include/hw/boards.h
index 62f160e..156b16f 100644
--- a/include/hw/boards.h
+++ b/include/hw/boards.h
@@ -197,6 +197,7 @@ struct MachineClass {
     bool ignore_memory_transaction_failures;
     int numa_mem_align_shift;
     const char **valid_cpu_types;
+    bool auto_enable_numa_with_memhp;
     void (*numa_auto_assign_ram)(MachineClass *mc, NodeInfo *nodes,
                                  int nb_nodes, ram_addr_t size);
 
diff --git a/hw/i386/pc.c b/hw/i386/pc.c
index fafe5ba..c3afe5b 100644
--- a/hw/i386/pc.c
+++ b/hw/i386/pc.c
@@ -2347,6 +2347,7 @@ static void pc_machine_class_init(ObjectClass *oc, void *data)
     mc->cpu_index_to_instance_props = pc_cpu_index_to_props;
     mc->get_default_cpu_node_id = pc_get_default_cpu_node_id;
     mc->possible_cpu_arch_ids = pc_possible_cpu_arch_ids;
+    mc->auto_enable_numa_with_memhp = true;
     mc->has_hotpluggable_cpus = true;
     mc->default_boot_order = "cad";
     mc->hot_add_cpu = pc_hot_add_cpu;
diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c
index f79d5cb..5e47528 100644
--- a/hw/i386/pc_piix.c
+++ b/hw/i386/pc_piix.c
@@ -446,6 +446,7 @@ static void pc_i440fx_2_10_machine_options(MachineClass *m)
     m->is_default = 0;
     m->alias = NULL;
     SET_MACHINE_COMPAT(m, PC_COMPAT_2_10);
+    m->auto_enable_numa_with_memhp = false;
 }
 
 DEFINE_I440FX_MACHINE(v2_10, "pc-i440fx-2.10", NULL,
diff --git a/hw/i386/pc_q35.c b/hw/i386/pc_q35.c
index da3ea60..d606004 100644
--- a/hw/i386/pc_q35.c
+++ b/hw/i386/pc_q35.c
@@ -318,6 +318,7 @@ static void pc_q35_2_10_machine_options(MachineClass *m)
     m->alias = NULL;
     SET_MACHINE_COMPAT(m, PC_COMPAT_2_10);
     m->numa_auto_assign_ram = numa_legacy_auto_assign_ram;
+    m->auto_enable_numa_with_memhp = false;
 }
 
 DEFINE_Q35_MACHINE(v2_10, "pc-q35-2.10", NULL,
diff --git a/numa.c b/numa.c
index 8d78d95..7151b24 100644
--- a/numa.c
+++ b/numa.c
@@ -216,6 +216,7 @@ static void parse_numa_node(MachineState *ms, NumaNodeOptions *node,
     }
     numa_info[nodenr].present = true;
     max_numa_nodeid = MAX(max_numa_nodeid, nodenr + 1);
+    nb_numa_nodes++;
 }
 
 static void parse_numa_distance(NumaDistOptions *dist, Error **errp)
@@ -282,7 +283,6 @@ static int parse_numa(void *opaque, QemuOpts *opts, Error **errp)
         if (err) {
             goto end;
         }
-        nb_numa_nodes++;
         break;
     case NUMA_OPTIONS_TYPE_DIST:
         parse_numa_distance(&object->u.dist, &err);
@@ -433,6 +433,25 @@ void parse_numa_opts(MachineState *ms)
         exit(1);
     }
 
+    /*
+     * If memory hotplug is enabled (slots > 0) but without '-numa'
+     * options explicitly on CLI, guestes will break.
+     *
+     *   Windows: won't enable memory hotplug without SRAT table at all
+     *
+     *   Linux: if QEMU is started with initial memory all below 4Gb
+     *   and no SRAT table present, guest kernel will use nommu DMA ops,
+     *   which breaks 32bit hw drivers when memory is hotplugged and
+     *   guest tries to use it with that drivers.
+     *
+     * Enable NUMA implicitly by adding a new NUMA node automatically.
+     */
+    if (ms->ram_slots > 0 && nb_numa_nodes == 0 &&
+        mc->auto_enable_numa_with_memhp) {
+            NumaNodeOptions node = { };
+            parse_numa_node(ms, &node, NULL);
+    }
+
     assert(max_numa_nodeid <= MAX_NODES);
 
     /* No support for sparse NUMA node IDs yet: */
diff --git a/vl.c b/vl.c
index 7372424..1ad1c04 100644
--- a/vl.c
+++ b/vl.c
@@ -4690,8 +4690,6 @@ int main(int argc, char **argv, char **envp)
     default_drive(default_floppy, snapshot, IF_FLOPPY, 0, FD_OPTS);
     default_drive(default_sdcard, snapshot, IF_SD, 0, SD_OPTS);
 
-    parse_numa_opts(current_machine);
-
     if (qemu_opts_foreach(qemu_find_opts("mon"),
                           mon_init_func, NULL, NULL)) {
         exit(1);
@@ -4741,6 +4739,7 @@ int main(int argc, char **argv, char **envp)
     current_machine->boot_order = boot_order;
     current_machine->cpu_model = cpu_model;
 
+    parse_numa_opts(current_machine);
 
     /* parse features once if machine provides default cpu_type */
     if (machine_class->default_cpu_type) {
-- 
MST

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

* [Qemu-devel] [PULL 09/10] vmcoreinfo: put it in the 'misc' device category
  2017-11-15 18:17 [Qemu-devel] [PULL 00/10] pc, pci, virtio: fixes for rc1 Michael S. Tsirkin
                   ` (7 preceding siblings ...)
  2017-11-15 18:18 ` [Qemu-devel] [PULL 08/10] NUMA: Enable adding NUMA node implicitly Michael S. Tsirkin
@ 2017-11-15 18:19 ` Michael S. Tsirkin
  2017-11-15 18:19 ` [Qemu-devel] [PULL 10/10] build-sys: restrict vmcoreinfo to fw_cfg+dma capable targets Michael S. Tsirkin
  2017-11-16 14:41 ` [Qemu-devel] [PULL 00/10] pc, pci, virtio: fixes for rc1 Peter Maydell
  10 siblings, 0 replies; 23+ messages in thread
From: Michael S. Tsirkin @ 2017-11-15 18:19 UTC (permalink / raw
  To: qemu-devel; +Cc: Peter Maydell, Marc-André Lureau

From: Marc-André Lureau <marcandre.lureau@redhat.com>

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
---
 hw/misc/vmcoreinfo.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/hw/misc/vmcoreinfo.c b/hw/misc/vmcoreinfo.c
index a618e12..31db57a 100644
--- a/hw/misc/vmcoreinfo.c
+++ b/hw/misc/vmcoreinfo.c
@@ -79,6 +79,7 @@ static void vmcoreinfo_device_class_init(ObjectClass *klass, void *data)
     dc->vmsd = &vmstate_vmcoreinfo;
     dc->realize = vmcoreinfo_realize;
     dc->hotpluggable = false;
+    set_bit(DEVICE_CATEGORY_MISC, dc->categories);
 }
 
 static const TypeInfo vmcoreinfo_device_info = {
-- 
MST

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

* [Qemu-devel] [PULL 10/10] build-sys: restrict vmcoreinfo to fw_cfg+dma capable targets
  2017-11-15 18:17 [Qemu-devel] [PULL 00/10] pc, pci, virtio: fixes for rc1 Michael S. Tsirkin
                   ` (8 preceding siblings ...)
  2017-11-15 18:19 ` [Qemu-devel] [PULL 09/10] vmcoreinfo: put it in the 'misc' device category Michael S. Tsirkin
@ 2017-11-15 18:19 ` Michael S. Tsirkin
  2017-11-16 14:41 ` [Qemu-devel] [PULL 00/10] pc, pci, virtio: fixes for rc1 Peter Maydell
  10 siblings, 0 replies; 23+ messages in thread
From: Michael S. Tsirkin @ 2017-11-15 18:19 UTC (permalink / raw
  To: qemu-devel
  Cc: Peter Maydell, Marc-André Lureau, Thomas Huth,
	Daniel Henrique Barboza, Philippe Mathieu-Daudé,
	Alex Bennée, David Gibson, Stefano Stabellini,
	Markus Armbruster, Ben Warren, Edgar E. Iglesias,
	Krzysztof Kozlowski

From: Marc-André Lureau <marcandre.lureau@redhat.com>

vmcoreinfo is built for all targets. However, it requires fw_cfg with
DMA operations support (write operation). Restrict vmcoreinfo exposure
to architectures that are supporting FW_CFG_DMA, that is arm-virt and
x86 only atm.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Reviewed-by: Daniel Henrique Barboza <danielhb@linux.vnet.ibm.com>
Tested-by: Daniel Henrique Barboza <danielhb@linux.vnet.ibm.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
---
 default-configs/arm-softmmu.mak    | 2 ++
 default-configs/i386-softmmu.mak   | 1 +
 default-configs/x86_64-softmmu.mak | 1 +
 hw/misc/Makefile.objs              | 2 +-
 4 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/default-configs/arm-softmmu.mak b/default-configs/arm-softmmu.mak
index 5059d13..d37edc4 100644
--- a/default-configs/arm-softmmu.mak
+++ b/default-configs/arm-softmmu.mak
@@ -130,3 +130,5 @@ CONFIG_SMBIOS=y
 CONFIG_ASPEED_SOC=y
 CONFIG_GPIO_KEY=y
 CONFIG_MSF2=y
+
+CONFIG_FW_CFG_DMA=y
diff --git a/default-configs/i386-softmmu.mak b/default-configs/i386-softmmu.mak
index a685c43..95ac4b4 100644
--- a/default-configs/i386-softmmu.mak
+++ b/default-configs/i386-softmmu.mak
@@ -60,3 +60,4 @@ CONFIG_SMBIOS=y
 CONFIG_HYPERV_TESTDEV=$(CONFIG_KVM)
 CONFIG_PXB=y
 CONFIG_ACPI_VMGENID=y
+CONFIG_FW_CFG_DMA=y
diff --git a/default-configs/x86_64-softmmu.mak b/default-configs/x86_64-softmmu.mak
index ea69e82..0221236 100644
--- a/default-configs/x86_64-softmmu.mak
+++ b/default-configs/x86_64-softmmu.mak
@@ -60,3 +60,4 @@ CONFIG_SMBIOS=y
 CONFIG_HYPERV_TESTDEV=$(CONFIG_KVM)
 CONFIG_PXB=y
 CONFIG_ACPI_VMGENID=y
+CONFIG_FW_CFG_DMA=y
diff --git a/hw/misc/Makefile.objs b/hw/misc/Makefile.objs
index 19202d9..10c88a8 100644
--- a/hw/misc/Makefile.objs
+++ b/hw/misc/Makefile.objs
@@ -9,7 +9,7 @@ common-obj-$(CONFIG_PCI_TESTDEV) += pci-testdev.o
 common-obj-$(CONFIG_EDU) += edu.o
 
 common-obj-y += unimp.o
-common-obj-y += vmcoreinfo.o
+common-obj-$(CONFIG_FW_CFG_DMA) += vmcoreinfo.o
 
 obj-$(CONFIG_VMPORT) += vmport.o
 
-- 
MST

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

* Re: [Qemu-devel] [PULL 08/10] NUMA: Enable adding NUMA node implicitly
  2017-11-15 18:18 ` [Qemu-devel] [PULL 08/10] NUMA: Enable adding NUMA node implicitly Michael S. Tsirkin
@ 2017-11-16 10:22   ` Thadeu Lima de Souza Cascardo
  0 siblings, 0 replies; 23+ messages in thread
From: Thadeu Lima de Souza Cascardo @ 2017-11-16 10:22 UTC (permalink / raw
  To: Michael S. Tsirkin
  Cc: qemu-devel, Peter Maydell, Dou Liyang, Igor Mammedov,
	Paolo Bonzini, Richard Henderson, Eduardo Habkost,
	Marcel Apfelbaum, David Hildenbrand, Thomas Huth,
	Alistair Francis, Takao Indoh, Izumi Taku

On Wed, Nov 15, 2017 at 08:18:50PM +0200, Michael S. Tsirkin wrote:
> From: Dou Liyang <douly.fnst@cn.fujitsu.com>
> 
> Linux and Windows need ACPI SRAT table to make memory hotplug work properly,
> however currently QEMU doesn't create SRAT table if numa options aren't present
> on CLI.
> 
> Which breaks both linux and windows guests in certain conditions:
>  * Windows: won't enable memory hotplug without SRAT table at all
>  * Linux: if QEMU is started with initial memory all below 4Gb and no SRAT table
>    present, guest kernel will use nommu DMA ops, which breaks 32bit hw drivers
>    when memory is hotplugged and guest tries to use it with that drivers.
> 
> Fix above issues by automatically creating a numa node when QEMU is started with
> memory hotplug enabled but without '-numa' options on CLI.
> (PS: auto-create numa node only for new machine types so not to break migration).
> 
> Which would provide SRAT table to guests without explicit -numa options on CLI
> and would allow:
>  * Windows: to enable memory hotplug
>  * Linux: switch to SWIOTLB DMA ops, to bounce DMA transfers to 32bit allocated
>    buffers that legacy drivers/hw can handle.
> 
> [Rewritten by Igor]

Thanks for copying me on this.

Acked-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>

> 
> Reported-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
> Suggested-by: Igor Mammedov <imammedo@redhat.com>
> Signed-off-by: Dou Liyang <douly.fnst@cn.fujitsu.com>
> Cc: Paolo Bonzini <pbonzini@redhat.com>
> Cc: Richard Henderson <rth@twiddle.net>
> Cc: Eduardo Habkost <ehabkost@redhat.com>
> Cc: "Michael S. Tsirkin" <mst@redhat.com>
> Cc: Marcel Apfelbaum <marcel@redhat.com>
> Cc: Igor Mammedov <imammedo@redhat.com>
> Cc: David Hildenbrand <david@redhat.com>
> Cc: Thomas Huth <thuth@redhat.com>
> Cc: Alistair Francis <alistair23@gmail.com>
> Cc: Takao Indoh <indou.takao@jp.fujitsu.com>
> Cc: Izumi Taku <izumi.taku@jp.fujitsu.com>
> Reviewed-by: Igor Mammedov <imammedo@redhat.com>
> Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
> ---
>  include/hw/boards.h |  1 +
>  hw/i386/pc.c        |  1 +
>  hw/i386/pc_piix.c   |  1 +
>  hw/i386/pc_q35.c    |  1 +
>  numa.c              | 21 ++++++++++++++++++++-
>  vl.c                |  3 +--
>  6 files changed, 25 insertions(+), 3 deletions(-)
> 
> diff --git a/include/hw/boards.h b/include/hw/boards.h
> index 62f160e..156b16f 100644
> --- a/include/hw/boards.h
> +++ b/include/hw/boards.h
> @@ -197,6 +197,7 @@ struct MachineClass {
>      bool ignore_memory_transaction_failures;
>      int numa_mem_align_shift;
>      const char **valid_cpu_types;
> +    bool auto_enable_numa_with_memhp;
>      void (*numa_auto_assign_ram)(MachineClass *mc, NodeInfo *nodes,
>                                   int nb_nodes, ram_addr_t size);
>  
> diff --git a/hw/i386/pc.c b/hw/i386/pc.c
> index fafe5ba..c3afe5b 100644
> --- a/hw/i386/pc.c
> +++ b/hw/i386/pc.c
> @@ -2347,6 +2347,7 @@ static void pc_machine_class_init(ObjectClass *oc, void *data)
>      mc->cpu_index_to_instance_props = pc_cpu_index_to_props;
>      mc->get_default_cpu_node_id = pc_get_default_cpu_node_id;
>      mc->possible_cpu_arch_ids = pc_possible_cpu_arch_ids;
> +    mc->auto_enable_numa_with_memhp = true;
>      mc->has_hotpluggable_cpus = true;
>      mc->default_boot_order = "cad";
>      mc->hot_add_cpu = pc_hot_add_cpu;
> diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c
> index f79d5cb..5e47528 100644
> --- a/hw/i386/pc_piix.c
> +++ b/hw/i386/pc_piix.c
> @@ -446,6 +446,7 @@ static void pc_i440fx_2_10_machine_options(MachineClass *m)
>      m->is_default = 0;
>      m->alias = NULL;
>      SET_MACHINE_COMPAT(m, PC_COMPAT_2_10);
> +    m->auto_enable_numa_with_memhp = false;
>  }
>  
>  DEFINE_I440FX_MACHINE(v2_10, "pc-i440fx-2.10", NULL,
> diff --git a/hw/i386/pc_q35.c b/hw/i386/pc_q35.c
> index da3ea60..d606004 100644
> --- a/hw/i386/pc_q35.c
> +++ b/hw/i386/pc_q35.c
> @@ -318,6 +318,7 @@ static void pc_q35_2_10_machine_options(MachineClass *m)
>      m->alias = NULL;
>      SET_MACHINE_COMPAT(m, PC_COMPAT_2_10);
>      m->numa_auto_assign_ram = numa_legacy_auto_assign_ram;
> +    m->auto_enable_numa_with_memhp = false;
>  }
>  
>  DEFINE_Q35_MACHINE(v2_10, "pc-q35-2.10", NULL,
> diff --git a/numa.c b/numa.c
> index 8d78d95..7151b24 100644
> --- a/numa.c
> +++ b/numa.c
> @@ -216,6 +216,7 @@ static void parse_numa_node(MachineState *ms, NumaNodeOptions *node,
>      }
>      numa_info[nodenr].present = true;
>      max_numa_nodeid = MAX(max_numa_nodeid, nodenr + 1);
> +    nb_numa_nodes++;
>  }
>  
>  static void parse_numa_distance(NumaDistOptions *dist, Error **errp)
> @@ -282,7 +283,6 @@ static int parse_numa(void *opaque, QemuOpts *opts, Error **errp)
>          if (err) {
>              goto end;
>          }
> -        nb_numa_nodes++;
>          break;
>      case NUMA_OPTIONS_TYPE_DIST:
>          parse_numa_distance(&object->u.dist, &err);
> @@ -433,6 +433,25 @@ void parse_numa_opts(MachineState *ms)
>          exit(1);
>      }
>  
> +    /*
> +     * If memory hotplug is enabled (slots > 0) but without '-numa'
> +     * options explicitly on CLI, guestes will break.
> +     *
> +     *   Windows: won't enable memory hotplug without SRAT table at all
> +     *
> +     *   Linux: if QEMU is started with initial memory all below 4Gb
> +     *   and no SRAT table present, guest kernel will use nommu DMA ops,
> +     *   which breaks 32bit hw drivers when memory is hotplugged and
> +     *   guest tries to use it with that drivers.
> +     *
> +     * Enable NUMA implicitly by adding a new NUMA node automatically.
> +     */
> +    if (ms->ram_slots > 0 && nb_numa_nodes == 0 &&
> +        mc->auto_enable_numa_with_memhp) {
> +            NumaNodeOptions node = { };
> +            parse_numa_node(ms, &node, NULL);
> +    }
> +
>      assert(max_numa_nodeid <= MAX_NODES);
>  
>      /* No support for sparse NUMA node IDs yet: */
> diff --git a/vl.c b/vl.c
> index 7372424..1ad1c04 100644
> --- a/vl.c
> +++ b/vl.c
> @@ -4690,8 +4690,6 @@ int main(int argc, char **argv, char **envp)
>      default_drive(default_floppy, snapshot, IF_FLOPPY, 0, FD_OPTS);
>      default_drive(default_sdcard, snapshot, IF_SD, 0, SD_OPTS);
>  
> -    parse_numa_opts(current_machine);
> -
>      if (qemu_opts_foreach(qemu_find_opts("mon"),
>                            mon_init_func, NULL, NULL)) {
>          exit(1);
> @@ -4741,6 +4739,7 @@ int main(int argc, char **argv, char **envp)
>      current_machine->boot_order = boot_order;
>      current_machine->cpu_model = cpu_model;
>  
> +    parse_numa_opts(current_machine);
>  
>      /* parse features once if machine provides default cpu_type */
>      if (machine_class->default_cpu_type) {
> -- 
> MST
> 

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

* Re: [Qemu-devel] [PULL 00/10] pc, pci, virtio: fixes for rc1
  2017-11-15 18:17 [Qemu-devel] [PULL 00/10] pc, pci, virtio: fixes for rc1 Michael S. Tsirkin
                   ` (9 preceding siblings ...)
  2017-11-15 18:19 ` [Qemu-devel] [PULL 10/10] build-sys: restrict vmcoreinfo to fw_cfg+dma capable targets Michael S. Tsirkin
@ 2017-11-16 14:41 ` Peter Maydell
  2017-11-16 15:19   ` Thomas Huth
  2017-11-16 15:38   ` Michael S. Tsirkin
  10 siblings, 2 replies; 23+ messages in thread
From: Peter Maydell @ 2017-11-16 14:41 UTC (permalink / raw
  To: Michael S. Tsirkin; +Cc: QEMU Developers

On 15 November 2017 at 18:17, Michael S. Tsirkin <mst@redhat.com> wrote:
> The following changes since commit 1fa0f627d03cd0d0755924247cafeb42969016bf:
>
>   Update version for v2.11.0-rc1 release (2017-11-14 18:37:49 +0000)
>
> are available in the git repository at:
>
>   git://git.kernel.org/pub/scm/virt/kvm/mst/qemu.git tags/for_upstream
>
> for you to fetch changes up to 6ed0c1c3ab0925009d15cffb944d9ccb04718846:
>
>   build-sys: restrict vmcoreinfo to fw_cfg+dma capable targets (2017-11-15 20:13:13 +0200)
>
> ----------------------------------------------------------------
> pc, pci, virtio: fixes for rc1
>
> A bunch of fixes all over the place.
>
> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>

Hi. This failed tests on a couple of machines:

s390x:

TEST: tests/bios-tables-test... (pid=58925)
  /i386/acpi/piix4:
Looking for expected file 'tests/acpi-test-data/pc/DSDT'

Using expected file 'tests/acpi-test-data/pc/DSDT'

Looking for expected file 'tests/acpi-test-data/pc/APIC'

Using expected file 'tests/acpi-test-data/pc/APIC'

Looking for expected file 'tests/acpi-test-data/pc/HPET'

Using expected file 'tests/acpi-test-data/pc/HPET'
'iasl -p /tmp/asl-CHIM9Y.dsl -d tests/acpi-test-data/pc/DSDT' exited
with status 65280
Intel ACPI Component Architecture
ASL+ Optimizing Compiler version 20160108-64
Copyright (c) 2000 - 2016 Intel Corporation

Could not get ACPI tables from tests/acpi-test-data/pc/DSDT, AE_BAD_HEADER
Input file tests/acpi-test-data/pc/DSDT, Length 0x1418 (5144) bytes
Table [DSDT] is too long for file - needs: 0x18140000, remaining in file: 0x1418
**
ERROR:/home/linux1/qemu/tests/bios-tables-test.c:461:test_acpi_asl:
assertion failed: (!err && !exp_err)
FAIL
GTester: last random seed: R02S7430f83941b25a926c586492b2745d2c
(pid=58933)
  /i386/acpi/q35:
Looking for expected file 'tests/acpi-test-data/q35/DSDT'

Using expected file 'tests/acpi-test-data/q35/DSDT'

Looking for expected file 'tests/acpi-test-data/q35/APIC'

Using expected file 'tests/acpi-test-data/q35/APIC'

Looking for expected file 'tests/acpi-test-data/q35/HPET'

Using expected file 'tests/acpi-test-data/q35/HPET'

Looking for expected file 'tests/acpi-test-data/q35/MCFG'

Using expected file 'tests/acpi-test-data/q35/MCFG'
'iasl -p /tmp/asl-NRWT9Y.dsl -d tests/acpi-test-data/q35/DSDT' exited
with status 65280
Intel ACPI Component Architecture
ASL+ Optimizing Compiler version 20160108-64
Copyright (c) 2000 - 2016 Intel Corporation

Could not get ACPI tables from tests/acpi-test-data/q35/DSDT, AE_BAD_HEADER
Input file tests/acpi-test-data/q35/DSDT, Length 0x1E94 (7828) bytes
Table [DSDT] is too long for file - needs: 0x941E0000, remaining in file: 0x1E94
**
ERROR:/home/linux1/qemu/tests/bios-tables-test.c:461:test_acpi_asl:
assertion failed: (!err && !exp_err)
FAIL

& similarly for a bunch of other tests. Looks like an
endianness issue.

and on 32-bit arm:

TEST: tests/bios-tables-test... (pid=30809)
  /i386/acpi/piix4:
Looking for expected file 'tests/acpi-test-data/pc/DSDT'

Using expected file 'tests/acpi-test-data/pc/DSDT'

Looking for expected file 'tests/acpi-test-data/pc/APIC'

Using expected file 'tests/acpi-test-data/pc/APIC'

Looking for expected file 'tests/acpi-test-data/pc/HPET'

Using expected file 'tests/acpi-test-data/pc/HPET'
'iasl -p /tmp/asl-6T2N9Y.dsl -e /tmp/aml-TV2N9Y -d /tmp/aml-TV2N9Y'
exited with status 11Input file /tmp/aml-TV2N9Y, Length 0x1418 (5144)
bytes
ACPI: DSDT 0x0000000000000000 001418 (v01 BOCHS  BXPCDSDT 00000001
BXPC 00000001)
Pass 1 parse of [DSDT]
Pass 2 parse of [DSDT]
Parsing Deferred Opcodes (Methods/Buffers/Packages/Regions)

Parsing completed
'iasl -p /tmp/asl-PKDO9Y.dsl -e tests/acpi-test-data/pc/DSDT -d
tests/acpi-test-data/pc/DSDT' exited with status 11Input file
tests/acpi-test-data/pc/DSDT, Length 0x1418 (5144) bytes
ACPI: DSDT 0x0000000000000000 001418 (v01 BOCHS  BXPCDSDT 00000001
BXPC 00000001)
Pass 1 parse of [DSDT]
Pass 2 parse of [DSDT]
Parsing Deferred Opcodes (Methods/Buffers/Packages/Regions)

Parsing completed
**
ERROR:/home/peter.maydell/qemu/tests/bios-tables-test.c:461:test_acpi_asl:
assertion failed: (!err && !exp_err)
FAIL
GTester: last random seed: R02S5d06952865b5a6ffb8443ae4d324e880
(pid=30816)
  /i386/acpi/q35:
Looking for expected file 'tests/acpi-test-data/q35/DSDT'

Using expected file 'tests/acpi-test-data/q35/DSDT'

Looking for expected file 'tests/acpi-test-data/q35/APIC'

Using expected file 'tests/acpi-test-data/q35/APIC'

Looking for expected file 'tests/acpi-test-data/q35/HPET'

Using expected file 'tests/acpi-test-data/q35/HPET'

Looking for expected file 'tests/acpi-test-data/q35/MCFG'

Using expected file 'tests/acpi-test-data/q35/MCFG'
OK

(and similar fails in other tests)


thanks
-- PMM

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

* Re: [Qemu-devel] [PULL 00/10] pc, pci, virtio: fixes for rc1
  2017-11-16 14:41 ` [Qemu-devel] [PULL 00/10] pc, pci, virtio: fixes for rc1 Peter Maydell
@ 2017-11-16 15:19   ` Thomas Huth
  2017-11-16 15:38   ` Michael S. Tsirkin
  1 sibling, 0 replies; 23+ messages in thread
From: Thomas Huth @ 2017-11-16 15:19 UTC (permalink / raw
  To: Peter Maydell, Michael S. Tsirkin; +Cc: QEMU Developers, Daniel P. Berrange

On 16.11.2017 15:41, Peter Maydell wrote:
> On 15 November 2017 at 18:17, Michael S. Tsirkin <mst@redhat.com> wrote:
>> The following changes since commit 1fa0f627d03cd0d0755924247cafeb42969016bf:
>>
>>   Update version for v2.11.0-rc1 release (2017-11-14 18:37:49 +0000)
>>
>> are available in the git repository at:
>>
>>   git://git.kernel.org/pub/scm/virt/kvm/mst/qemu.git tags/for_upstream
>>
>> for you to fetch changes up to 6ed0c1c3ab0925009d15cffb944d9ccb04718846:
>>
>>   build-sys: restrict vmcoreinfo to fw_cfg+dma capable targets (2017-11-15 20:13:13 +0200)
>>
>> ----------------------------------------------------------------
>> pc, pci, virtio: fixes for rc1
>>
>> A bunch of fixes all over the place.
>>
>> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
> 
> Hi. This failed tests on a couple of machines:
> 
> s390x:
> 
> TEST: tests/bios-tables-test... (pid=58925)
>   /i386/acpi/piix4:
> Looking for expected file 'tests/acpi-test-data/pc/DSDT'
> 
> Using expected file 'tests/acpi-test-data/pc/DSDT'
> 
> Looking for expected file 'tests/acpi-test-data/pc/APIC'
> 
> Using expected file 'tests/acpi-test-data/pc/APIC'
> 
> Looking for expected file 'tests/acpi-test-data/pc/HPET'
> 
> Using expected file 'tests/acpi-test-data/pc/HPET'
> 'iasl -p /tmp/asl-CHIM9Y.dsl -d tests/acpi-test-data/pc/DSDT' exited
> with status 65280
> Intel ACPI Component Architecture
> ASL+ Optimizing Compiler version 20160108-64
> Copyright (c) 2000 - 2016 Intel Corporation
> 
> Could not get ACPI tables from tests/acpi-test-data/pc/DSDT, AE_BAD_HEADER
> Input file tests/acpi-test-data/pc/DSDT, Length 0x1418 (5144) bytes
> Table [DSDT] is too long for file - needs: 0x18140000, remaining in file: 0x1418
> **
> ERROR:/home/linux1/qemu/tests/bios-tables-test.c:461:test_acpi_asl:
> assertion failed: (!err && !exp_err)

That likely means that either iasl does not contain the right endianess
fixes yet (which OS are you using there?), or you need my patch here:

 https://lists.gnu.org/archive/html/qemu-devel/2017-11/msg03007.html

No clue about the arm issue, though.

 Thomas

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

* Re: [Qemu-devel] [PULL 00/10] pc, pci, virtio: fixes for rc1
  2017-11-16 14:41 ` [Qemu-devel] [PULL 00/10] pc, pci, virtio: fixes for rc1 Peter Maydell
  2017-11-16 15:19   ` Thomas Huth
@ 2017-11-16 15:38   ` Michael S. Tsirkin
  2017-11-16 15:45     ` Daniel P. Berrange
  1 sibling, 1 reply; 23+ messages in thread
From: Michael S. Tsirkin @ 2017-11-16 15:38 UTC (permalink / raw
  To: Peter Maydell; +Cc: QEMU Developers

On Thu, Nov 16, 2017 at 02:41:09PM +0000, Peter Maydell wrote:
> On 15 November 2017 at 18:17, Michael S. Tsirkin <mst@redhat.com> wrote:
> > The following changes since commit 1fa0f627d03cd0d0755924247cafeb42969016bf:
> >
> >   Update version for v2.11.0-rc1 release (2017-11-14 18:37:49 +0000)
> >
> > are available in the git repository at:
> >
> >   git://git.kernel.org/pub/scm/virt/kvm/mst/qemu.git tags/for_upstream
> >
> > for you to fetch changes up to 6ed0c1c3ab0925009d15cffb944d9ccb04718846:
> >
> >   build-sys: restrict vmcoreinfo to fw_cfg+dma capable targets (2017-11-15 20:13:13 +0200)
> >
> > ----------------------------------------------------------------
> > pc, pci, virtio: fixes for rc1
> >
> > A bunch of fixes all over the place.
> >
> > Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
> 
> Hi. This failed tests on a couple of machines:
> 
> s390x:
> 
> TEST: tests/bios-tables-test... (pid=58925)
>   /i386/acpi/piix4:
> Looking for expected file 'tests/acpi-test-data/pc/DSDT'
> 
> Using expected file 'tests/acpi-test-data/pc/DSDT'
> 
> Looking for expected file 'tests/acpi-test-data/pc/APIC'
> 
> Using expected file 'tests/acpi-test-data/pc/APIC'
> 
> Looking for expected file 'tests/acpi-test-data/pc/HPET'
> 
> Using expected file 'tests/acpi-test-data/pc/HPET'
> 'iasl -p /tmp/asl-CHIM9Y.dsl -d tests/acpi-test-data/pc/DSDT' exited
> with status 65280
> Intel ACPI Component Architecture
> ASL+ Optimizing Compiler version 20160108-64
> Copyright (c) 2000 - 2016 Intel Corporation
> 
> Could not get ACPI tables from tests/acpi-test-data/pc/DSDT, AE_BAD_HEADER
> Input file tests/acpi-test-data/pc/DSDT, Length 0x1418 (5144) bytes
> Table [DSDT] is too long for file - needs: 0x18140000, remaining in file: 0x1418
> **
> ERROR:/home/linux1/qemu/tests/bios-tables-test.c:461:test_acpi_asl:
> assertion failed: (!err && !exp_err)
> FAIL
> GTester: last random seed: R02S7430f83941b25a926c586492b2745d2c
> (pid=58933)
>   /i386/acpi/q35:



> Looking for expected file 'tests/acpi-test-data/q35/DSDT'
> 
> Using expected file 'tests/acpi-test-data/q35/DSDT'
> 
> Looking for expected file 'tests/acpi-test-data/q35/APIC'
> 
> Using expected file 'tests/acpi-test-data/q35/APIC'
> 
> Looking for expected file 'tests/acpi-test-data/q35/HPET'
> 
> Using expected file 'tests/acpi-test-data/q35/HPET'
> 
> Looking for expected file 'tests/acpi-test-data/q35/MCFG'
> 
> Using expected file 'tests/acpi-test-data/q35/MCFG'
> 'iasl -p /tmp/asl-NRWT9Y.dsl -d tests/acpi-test-data/q35/DSDT' exited
> with status 65280
> Intel ACPI Component Architecture
> ASL+ Optimizing Compiler version 20160108-64
> Copyright (c) 2000 - 2016 Intel Corporation
> 
> Could not get ACPI tables from tests/acpi-test-data/q35/DSDT, AE_BAD_HEADER
> Input file tests/acpi-test-data/q35/DSDT, Length 0x1E94 (7828) bytes
> Table [DSDT] is too long for file - needs: 0x941E0000, remaining in file: 0x1E94
> **
> ERROR:/home/linux1/qemu/tests/bios-tables-test.c:461:test_acpi_asl:
> assertion failed: (!err && !exp_err)
> FAIL
> 
> & similarly for a bunch of other tests. Looks like an
> endianness issue.
> 
> and on 32-bit arm:
> 
> TEST: tests/bios-tables-test... (pid=30809)
>   /i386/acpi/piix4:
> Looking for expected file 'tests/acpi-test-data/pc/DSDT'
> 
> Using expected file 'tests/acpi-test-data/pc/DSDT'
> 
> Looking for expected file 'tests/acpi-test-data/pc/APIC'
> 
> Using expected file 'tests/acpi-test-data/pc/APIC'
> 
> Looking for expected file 'tests/acpi-test-data/pc/HPET'
> 
> Using expected file 'tests/acpi-test-data/pc/HPET'
> 'iasl -p /tmp/asl-6T2N9Y.dsl -e /tmp/aml-TV2N9Y -d /tmp/aml-TV2N9Y'
> exited with status 11Input file /tmp/aml-TV2N9Y, Length 0x1418 (5144)
> bytes
> ACPI: DSDT 0x0000000000000000 001418 (v01 BOCHS  BXPCDSDT 00000001
> BXPC 00000001)
> Pass 1 parse of [DSDT]
> Pass 2 parse of [DSDT]
> Parsing Deferred Opcodes (Methods/Buffers/Packages/Regions)
> 
> Parsing completed
> 'iasl -p /tmp/asl-PKDO9Y.dsl -e tests/acpi-test-data/pc/DSDT -d
> tests/acpi-test-data/pc/DSDT' exited with status 11Input file
> tests/acpi-test-data/pc/DSDT, Length 0x1418 (5144) bytes
> ACPI: DSDT 0x0000000000000000 001418 (v01 BOCHS  BXPCDSDT 00000001
> BXPC 00000001)
> Pass 1 parse of [DSDT]
> Pass 2 parse of [DSDT]
> Parsing Deferred Opcodes (Methods/Buffers/Packages/Regions)
> 
> Parsing completed
> **
> ERROR:/home/peter.maydell/qemu/tests/bios-tables-test.c:461:test_acpi_asl:
> assertion failed: (!err && !exp_err)
> FAIL
> GTester: last random seed: R02S5d06952865b5a6ffb8443ae4d324e880
> (pid=30816)
>   /i386/acpi/q35:
> Looking for expected file 'tests/acpi-test-data/q35/DSDT'
> 
> Using expected file 'tests/acpi-test-data/q35/DSDT'
> 
> Looking for expected file 'tests/acpi-test-data/q35/APIC'
> 
> Using expected file 'tests/acpi-test-data/q35/APIC'
> 
> Looking for expected file 'tests/acpi-test-data/q35/HPET'
> 
> Using expected file 'tests/acpi-test-data/q35/HPET'
> 
> Looking for expected file 'tests/acpi-test-data/q35/MCFG'
> 
> Using expected file 'tests/acpi-test-data/q35/MCFG'
> OK
> 
> (and similar fails in other tests)
> 
> 
> thanks
> -- PMM

I think it's     test: fix detection of errors from iasl
I'll drop it for now.

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

* Re: [Qemu-devel] [PULL 00/10] pc, pci, virtio: fixes for rc1
  2017-11-16 15:38   ` Michael S. Tsirkin
@ 2017-11-16 15:45     ` Daniel P. Berrange
  2017-11-16 15:56       ` Michael S. Tsirkin
  0 siblings, 1 reply; 23+ messages in thread
From: Daniel P. Berrange @ 2017-11-16 15:45 UTC (permalink / raw
  To: Michael S. Tsirkin; +Cc: Peter Maydell, QEMU Developers

On Thu, Nov 16, 2017 at 05:38:18PM +0200, Michael S. Tsirkin wrote:
> On Thu, Nov 16, 2017 at 02:41:09PM +0000, Peter Maydell wrote:
> > On 15 November 2017 at 18:17, Michael S. Tsirkin <mst@redhat.com> wrote:
> > > The following changes since commit 1fa0f627d03cd0d0755924247cafeb42969016bf:
> > >
> > >   Update version for v2.11.0-rc1 release (2017-11-14 18:37:49 +0000)
> > >
> > > are available in the git repository at:
> > >
> > >   git://git.kernel.org/pub/scm/virt/kvm/mst/qemu.git tags/for_upstream
> > >
> > > for you to fetch changes up to 6ed0c1c3ab0925009d15cffb944d9ccb04718846:
> > >
> > >   build-sys: restrict vmcoreinfo to fw_cfg+dma capable targets (2017-11-15 20:13:13 +0200)
> > >
> > > ----------------------------------------------------------------
> > > pc, pci, virtio: fixes for rc1
> > >
> > > A bunch of fixes all over the place.
> > >
> > > Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
> > 
> > Hi. This failed tests on a couple of machines:
> > 
> > s390x:
> > 
> > TEST: tests/bios-tables-test... (pid=58925)
> >   /i386/acpi/piix4:
> > Looking for expected file 'tests/acpi-test-data/pc/DSDT'
> > 
> > Using expected file 'tests/acpi-test-data/pc/DSDT'
> > 
> > Looking for expected file 'tests/acpi-test-data/pc/APIC'
> > 
> > Using expected file 'tests/acpi-test-data/pc/APIC'
> > 
> > Looking for expected file 'tests/acpi-test-data/pc/HPET'
> > 
> > Using expected file 'tests/acpi-test-data/pc/HPET'
> > 'iasl -p /tmp/asl-CHIM9Y.dsl -d tests/acpi-test-data/pc/DSDT' exited
> > with status 65280
> > Intel ACPI Component Architecture
> > ASL+ Optimizing Compiler version 20160108-64
> > Copyright (c) 2000 - 2016 Intel Corporation
> > 
> > Could not get ACPI tables from tests/acpi-test-data/pc/DSDT, AE_BAD_HEADER
> > Input file tests/acpi-test-data/pc/DSDT, Length 0x1418 (5144) bytes
> > Table [DSDT] is too long for file - needs: 0x18140000, remaining in file: 0x1418
> > **
> > ERROR:/home/linux1/qemu/tests/bios-tables-test.c:461:test_acpi_asl:
> > assertion failed: (!err && !exp_err)
> > FAIL
> > GTester: last random seed: R02S7430f83941b25a926c586492b2745d2c
> > (pid=58933)
> >   /i386/acpi/q35:
> 
> 
> 
> > Looking for expected file 'tests/acpi-test-data/q35/DSDT'
> > 
> > Using expected file 'tests/acpi-test-data/q35/DSDT'
> > 
> > Looking for expected file 'tests/acpi-test-data/q35/APIC'
> > 
> > Using expected file 'tests/acpi-test-data/q35/APIC'
> > 
> > Looking for expected file 'tests/acpi-test-data/q35/HPET'
> > 
> > Using expected file 'tests/acpi-test-data/q35/HPET'
> > 
> > Looking for expected file 'tests/acpi-test-data/q35/MCFG'
> > 
> > Using expected file 'tests/acpi-test-data/q35/MCFG'
> > 'iasl -p /tmp/asl-NRWT9Y.dsl -d tests/acpi-test-data/q35/DSDT' exited
> > with status 65280
> > Intel ACPI Component Architecture
> > ASL+ Optimizing Compiler version 20160108-64
> > Copyright (c) 2000 - 2016 Intel Corporation
> > 
> > Could not get ACPI tables from tests/acpi-test-data/q35/DSDT, AE_BAD_HEADER
> > Input file tests/acpi-test-data/q35/DSDT, Length 0x1E94 (7828) bytes
> > Table [DSDT] is too long for file - needs: 0x941E0000, remaining in file: 0x1E94
> > **
> > ERROR:/home/linux1/qemu/tests/bios-tables-test.c:461:test_acpi_asl:
> > assertion failed: (!err && !exp_err)
> > FAIL
> > 
> > & similarly for a bunch of other tests. Looks like an
> > endianness issue.
> > 
> > and on 32-bit arm:
> > 
> > TEST: tests/bios-tables-test... (pid=30809)
> >   /i386/acpi/piix4:
> > Looking for expected file 'tests/acpi-test-data/pc/DSDT'
> > 
> > Using expected file 'tests/acpi-test-data/pc/DSDT'
> > 
> > Looking for expected file 'tests/acpi-test-data/pc/APIC'
> > 
> > Using expected file 'tests/acpi-test-data/pc/APIC'
> > 
> > Looking for expected file 'tests/acpi-test-data/pc/HPET'
> > 
> > Using expected file 'tests/acpi-test-data/pc/HPET'
> > 'iasl -p /tmp/asl-6T2N9Y.dsl -e /tmp/aml-TV2N9Y -d /tmp/aml-TV2N9Y'
> > exited with status 11Input file /tmp/aml-TV2N9Y, Length 0x1418 (5144)
> > bytes
> > ACPI: DSDT 0x0000000000000000 001418 (v01 BOCHS  BXPCDSDT 00000001
> > BXPC 00000001)
> > Pass 1 parse of [DSDT]
> > Pass 2 parse of [DSDT]
> > Parsing Deferred Opcodes (Methods/Buffers/Packages/Regions)
> > 
> > Parsing completed
> > 'iasl -p /tmp/asl-PKDO9Y.dsl -e tests/acpi-test-data/pc/DSDT -d
> > tests/acpi-test-data/pc/DSDT' exited with status 11Input file
> > tests/acpi-test-data/pc/DSDT, Length 0x1418 (5144) bytes
> > ACPI: DSDT 0x0000000000000000 001418 (v01 BOCHS  BXPCDSDT 00000001
> > BXPC 00000001)
> > Pass 1 parse of [DSDT]
> > Pass 2 parse of [DSDT]
> > Parsing Deferred Opcodes (Methods/Buffers/Packages/Regions)
> > 
> > Parsing completed
> > **
> > ERROR:/home/peter.maydell/qemu/tests/bios-tables-test.c:461:test_acpi_asl:
> > assertion failed: (!err && !exp_err)
> > FAIL
> > GTester: last random seed: R02S5d06952865b5a6ffb8443ae4d324e880
> > (pid=30816)
> >   /i386/acpi/q35:
> > Looking for expected file 'tests/acpi-test-data/q35/DSDT'
> > 
> > Using expected file 'tests/acpi-test-data/q35/DSDT'
> > 
> > Looking for expected file 'tests/acpi-test-data/q35/APIC'
> > 
> > Using expected file 'tests/acpi-test-data/q35/APIC'
> > 
> > Looking for expected file 'tests/acpi-test-data/q35/HPET'
> > 
> > Using expected file 'tests/acpi-test-data/q35/HPET'
> > 
> > Looking for expected file 'tests/acpi-test-data/q35/MCFG'
> > 
> > Using expected file 'tests/acpi-test-data/q35/MCFG'
> > OK
> > 
> > (and similar fails in other tests)
> > 
> > 
> > thanks
> > -- PMM
> 
> I think it's     test: fix detection of errors from iasl
> I'll drop it for now.

I think that patch is merely exposing a failure that has always
happened, but which we've never noticed before. So dropping that
patch just hides the error again, doesn't fix the error.

Regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|

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

* Re: [Qemu-devel] [PULL 00/10] pc, pci, virtio: fixes for rc1
  2017-11-16 15:45     ` Daniel P. Berrange
@ 2017-11-16 15:56       ` Michael S. Tsirkin
  2017-11-16 16:10         ` Peter Maydell
  0 siblings, 1 reply; 23+ messages in thread
From: Michael S. Tsirkin @ 2017-11-16 15:56 UTC (permalink / raw
  To: Daniel P. Berrange; +Cc: Peter Maydell, QEMU Developers

On Thu, Nov 16, 2017 at 03:45:34PM +0000, Daniel P. Berrange wrote:
> On Thu, Nov 16, 2017 at 05:38:18PM +0200, Michael S. Tsirkin wrote:
> > On Thu, Nov 16, 2017 at 02:41:09PM +0000, Peter Maydell wrote:
> > > On 15 November 2017 at 18:17, Michael S. Tsirkin <mst@redhat.com> wrote:
> > > > The following changes since commit 1fa0f627d03cd0d0755924247cafeb42969016bf:
> > > >
> > > >   Update version for v2.11.0-rc1 release (2017-11-14 18:37:49 +0000)
> > > >
> > > > are available in the git repository at:
> > > >
> > > >   git://git.kernel.org/pub/scm/virt/kvm/mst/qemu.git tags/for_upstream
> > > >
> > > > for you to fetch changes up to 6ed0c1c3ab0925009d15cffb944d9ccb04718846:
> > > >
> > > >   build-sys: restrict vmcoreinfo to fw_cfg+dma capable targets (2017-11-15 20:13:13 +0200)
> > > >
> > > > ----------------------------------------------------------------
> > > > pc, pci, virtio: fixes for rc1
> > > >
> > > > A bunch of fixes all over the place.
> > > >
> > > > Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
> > > 
> > > Hi. This failed tests on a couple of machines:
> > > 
> > > s390x:
> > > 
> > > TEST: tests/bios-tables-test... (pid=58925)
> > >   /i386/acpi/piix4:
> > > Looking for expected file 'tests/acpi-test-data/pc/DSDT'
> > > 
> > > Using expected file 'tests/acpi-test-data/pc/DSDT'
> > > 
> > > Looking for expected file 'tests/acpi-test-data/pc/APIC'
> > > 
> > > Using expected file 'tests/acpi-test-data/pc/APIC'
> > > 
> > > Looking for expected file 'tests/acpi-test-data/pc/HPET'
> > > 
> > > Using expected file 'tests/acpi-test-data/pc/HPET'
> > > 'iasl -p /tmp/asl-CHIM9Y.dsl -d tests/acpi-test-data/pc/DSDT' exited
> > > with status 65280
> > > Intel ACPI Component Architecture
> > > ASL+ Optimizing Compiler version 20160108-64
> > > Copyright (c) 2000 - 2016 Intel Corporation
> > > 
> > > Could not get ACPI tables from tests/acpi-test-data/pc/DSDT, AE_BAD_HEADER
> > > Input file tests/acpi-test-data/pc/DSDT, Length 0x1418 (5144) bytes
> > > Table [DSDT] is too long for file - needs: 0x18140000, remaining in file: 0x1418
> > > **
> > > ERROR:/home/linux1/qemu/tests/bios-tables-test.c:461:test_acpi_asl:
> > > assertion failed: (!err && !exp_err)
> > > FAIL
> > > GTester: last random seed: R02S7430f83941b25a926c586492b2745d2c
> > > (pid=58933)
> > >   /i386/acpi/q35:
> > 
> > 
> > 
> > > Looking for expected file 'tests/acpi-test-data/q35/DSDT'
> > > 
> > > Using expected file 'tests/acpi-test-data/q35/DSDT'
> > > 
> > > Looking for expected file 'tests/acpi-test-data/q35/APIC'
> > > 
> > > Using expected file 'tests/acpi-test-data/q35/APIC'
> > > 
> > > Looking for expected file 'tests/acpi-test-data/q35/HPET'
> > > 
> > > Using expected file 'tests/acpi-test-data/q35/HPET'
> > > 
> > > Looking for expected file 'tests/acpi-test-data/q35/MCFG'
> > > 
> > > Using expected file 'tests/acpi-test-data/q35/MCFG'
> > > 'iasl -p /tmp/asl-NRWT9Y.dsl -d tests/acpi-test-data/q35/DSDT' exited
> > > with status 65280
> > > Intel ACPI Component Architecture
> > > ASL+ Optimizing Compiler version 20160108-64
> > > Copyright (c) 2000 - 2016 Intel Corporation
> > > 
> > > Could not get ACPI tables from tests/acpi-test-data/q35/DSDT, AE_BAD_HEADER
> > > Input file tests/acpi-test-data/q35/DSDT, Length 0x1E94 (7828) bytes
> > > Table [DSDT] is too long for file - needs: 0x941E0000, remaining in file: 0x1E94
> > > **
> > > ERROR:/home/linux1/qemu/tests/bios-tables-test.c:461:test_acpi_asl:
> > > assertion failed: (!err && !exp_err)
> > > FAIL
> > > 
> > > & similarly for a bunch of other tests. Looks like an
> > > endianness issue.
> > > 
> > > and on 32-bit arm:
> > > 
> > > TEST: tests/bios-tables-test... (pid=30809)
> > >   /i386/acpi/piix4:
> > > Looking for expected file 'tests/acpi-test-data/pc/DSDT'
> > > 
> > > Using expected file 'tests/acpi-test-data/pc/DSDT'
> > > 
> > > Looking for expected file 'tests/acpi-test-data/pc/APIC'
> > > 
> > > Using expected file 'tests/acpi-test-data/pc/APIC'
> > > 
> > > Looking for expected file 'tests/acpi-test-data/pc/HPET'
> > > 
> > > Using expected file 'tests/acpi-test-data/pc/HPET'
> > > 'iasl -p /tmp/asl-6T2N9Y.dsl -e /tmp/aml-TV2N9Y -d /tmp/aml-TV2N9Y'
> > > exited with status 11Input file /tmp/aml-TV2N9Y, Length 0x1418 (5144)
> > > bytes
> > > ACPI: DSDT 0x0000000000000000 001418 (v01 BOCHS  BXPCDSDT 00000001
> > > BXPC 00000001)
> > > Pass 1 parse of [DSDT]
> > > Pass 2 parse of [DSDT]
> > > Parsing Deferred Opcodes (Methods/Buffers/Packages/Regions)
> > > 
> > > Parsing completed
> > > 'iasl -p /tmp/asl-PKDO9Y.dsl -e tests/acpi-test-data/pc/DSDT -d
> > > tests/acpi-test-data/pc/DSDT' exited with status 11Input file
> > > tests/acpi-test-data/pc/DSDT, Length 0x1418 (5144) bytes
> > > ACPI: DSDT 0x0000000000000000 001418 (v01 BOCHS  BXPCDSDT 00000001
> > > BXPC 00000001)
> > > Pass 1 parse of [DSDT]
> > > Pass 2 parse of [DSDT]
> > > Parsing Deferred Opcodes (Methods/Buffers/Packages/Regions)
> > > 
> > > Parsing completed
> > > **
> > > ERROR:/home/peter.maydell/qemu/tests/bios-tables-test.c:461:test_acpi_asl:
> > > assertion failed: (!err && !exp_err)
> > > FAIL
> > > GTester: last random seed: R02S5d06952865b5a6ffb8443ae4d324e880
> > > (pid=30816)
> > >   /i386/acpi/q35:
> > > Looking for expected file 'tests/acpi-test-data/q35/DSDT'
> > > 
> > > Using expected file 'tests/acpi-test-data/q35/DSDT'
> > > 
> > > Looking for expected file 'tests/acpi-test-data/q35/APIC'
> > > 
> > > Using expected file 'tests/acpi-test-data/q35/APIC'
> > > 
> > > Looking for expected file 'tests/acpi-test-data/q35/HPET'
> > > 
> > > Using expected file 'tests/acpi-test-data/q35/HPET'
> > > 
> > > Looking for expected file 'tests/acpi-test-data/q35/MCFG'
> > > 
> > > Using expected file 'tests/acpi-test-data/q35/MCFG'
> > > OK
> > > 
> > > (and similar fails in other tests)
> > > 
> > > 
> > > thanks
> > > -- PMM
> > 
> > I think it's     test: fix detection of errors from iasl
> > I'll drop it for now.
> 
> I think that patch is merely exposing a failure that has always
> happened, but which we've never noticed before. So dropping that
> patch just hides the error again, doesn't fix the error.
> 
> Regards,
> Daniel

We shouldn't fail test if system can't load expected files.
This just will trip up people trying to build qemu.

Maybe at this point we shouldn't run iasl unconditionally.

It used to be very important when we had parts of the tables
generated by iasl, so different versions would introduce
trivial changes.

Maybe now we should compare binaries first, run iasl to help debugging
only if they differ.

Will save writing out files too.

And maybe show the diff in rebuild-expected-aml too - add it to
.git/COMMIT_EDITMSG so people remember to include it in the commit log?




> -- 
> |: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
> |: https://libvirt.org         -o-            https://fstop138.berrange.com :|
> |: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|

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

* Re: [Qemu-devel] [PULL 00/10] pc, pci, virtio: fixes for rc1
  2017-11-16 15:56       ` Michael S. Tsirkin
@ 2017-11-16 16:10         ` Peter Maydell
  2017-11-16 16:13           ` Daniel P. Berrange
  2017-11-16 16:15           ` Michael S. Tsirkin
  0 siblings, 2 replies; 23+ messages in thread
From: Peter Maydell @ 2017-11-16 16:10 UTC (permalink / raw
  To: Michael S. Tsirkin; +Cc: Daniel P. Berrange, QEMU Developers

On 16 November 2017 at 15:56, Michael S. Tsirkin <mst@redhat.com> wrote:
> On Thu, Nov 16, 2017 at 03:45:34PM +0000, Daniel P. Berrange wrote:
>> On Thu, Nov 16, 2017 at 05:38:18PM +0200, Michael S. Tsirkin wrote:
>> > I think it's     test: fix detection of errors from iasl
>> > I'll drop it for now.
>>
>> I think that patch is merely exposing a failure that has always
>> happened, but which we've never noticed before. So dropping that
>> patch just hides the error again, doesn't fix the error.

> We shouldn't fail test if system can't load expected files.
> This just will trip up people trying to build qemu.

If there are known-buggy iasl versions in the wild we could
consider a configure test and treat buggy-iasl like no-iasl.

thanks
-- PMM

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

* Re: [Qemu-devel] [PULL 00/10] pc, pci, virtio: fixes for rc1
  2017-11-16 16:10         ` Peter Maydell
@ 2017-11-16 16:13           ` Daniel P. Berrange
  2017-11-16 16:15             ` Peter Maydell
  2017-11-16 16:15           ` Michael S. Tsirkin
  1 sibling, 1 reply; 23+ messages in thread
From: Daniel P. Berrange @ 2017-11-16 16:13 UTC (permalink / raw
  To: Peter Maydell; +Cc: Michael S. Tsirkin, QEMU Developers

On Thu, Nov 16, 2017 at 04:10:22PM +0000, Peter Maydell wrote:
> On 16 November 2017 at 15:56, Michael S. Tsirkin <mst@redhat.com> wrote:
> > On Thu, Nov 16, 2017 at 03:45:34PM +0000, Daniel P. Berrange wrote:
> >> On Thu, Nov 16, 2017 at 05:38:18PM +0200, Michael S. Tsirkin wrote:
> >> > I think it's     test: fix detection of errors from iasl
> >> > I'll drop it for now.
> >>
> >> I think that patch is merely exposing a failure that has always
> >> happened, but which we've never noticed before. So dropping that
> >> patch just hides the error again, doesn't fix the error.
> 
> > We shouldn't fail test if system can't load expected files.
> > This just will trip up people trying to build qemu.
> 
> If there are known-buggy iasl versions in the wild we could
> consider a configure test and treat buggy-iasl like no-iasl.

iasl has long been broken on big-endian, but it has also long contained
code that simply makes it exit immediately in that case, and qemu copes
with that. So if there's buggy iasl it would be a distro which removed
this big-endian check and tried to make it work on big-endian but failed.
Fedora tried the latter, but at least in rawhide it works properly now.
I'm unclear if we shipped broken iasl with the BE check removed in stable
versions though

Regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|

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

* Re: [Qemu-devel] [PULL 00/10] pc, pci, virtio: fixes for rc1
  2017-11-16 16:10         ` Peter Maydell
  2017-11-16 16:13           ` Daniel P. Berrange
@ 2017-11-16 16:15           ` Michael S. Tsirkin
  1 sibling, 0 replies; 23+ messages in thread
From: Michael S. Tsirkin @ 2017-11-16 16:15 UTC (permalink / raw
  To: Peter Maydell; +Cc: Daniel P. Berrange, QEMU Developers

On Thu, Nov 16, 2017 at 04:10:22PM +0000, Peter Maydell wrote:
> On 16 November 2017 at 15:56, Michael S. Tsirkin <mst@redhat.com> wrote:
> > On Thu, Nov 16, 2017 at 03:45:34PM +0000, Daniel P. Berrange wrote:
> >> On Thu, Nov 16, 2017 at 05:38:18PM +0200, Michael S. Tsirkin wrote:
> >> > I think it's     test: fix detection of errors from iasl
> >> > I'll drop it for now.
> >>
> >> I think that patch is merely exposing a failure that has always
> >> happened, but which we've never noticed before. So dropping that
> >> patch just hides the error again, doesn't fix the error.
> 
> > We shouldn't fail test if system can't load expected files.
> > This just will trip up people trying to build qemu.
> 
> If there are known-buggy iasl versions in the wild we could
> consider a configure test and treat buggy-iasl like no-iasl.
> 
> thanks
> -- PMM

Right. All this is not 2.11 material though.

-- 
MST

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

* Re: [Qemu-devel] [PULL 00/10] pc, pci, virtio: fixes for rc1
  2017-11-16 16:13           ` Daniel P. Berrange
@ 2017-11-16 16:15             ` Peter Maydell
  2017-11-16 16:43               ` Thomas Huth
  0 siblings, 1 reply; 23+ messages in thread
From: Peter Maydell @ 2017-11-16 16:15 UTC (permalink / raw
  To: Daniel P. Berrange; +Cc: Michael S. Tsirkin, QEMU Developers

On 16 November 2017 at 16:13, Daniel P. Berrange <berrange@redhat.com> wrote:
> On Thu, Nov 16, 2017 at 04:10:22PM +0000, Peter Maydell wrote:
>> If there are known-buggy iasl versions in the wild we could
>> consider a configure test and treat buggy-iasl like no-iasl.
>
> iasl has long been broken on big-endian, but it has also long contained
> code that simply makes it exit immediately in that case, and qemu copes
> with that. So if there's buggy iasl it would be a distro which removed
> this big-endian check and tried to make it work on big-endian but failed.
> Fedora tried the latter, but at least in rawhide it works properly now.
> I'm unclear if we shipped broken iasl with the BE check removed in stable
> versions though

In this case this is Ubuntu 16.04.2 LTS (xenial) on s390x, with

linux1@lxub05:~$ iasl -v

Intel ACPI Component Architecture
ASL+ Optimizing Compiler version 20160108-64
Copyright (c) 2000 - 2016 Intel Corporation

thanks
-- PMM

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

* Re: [Qemu-devel] [PULL 00/10] pc, pci, virtio: fixes for rc1
  2017-11-16 16:15             ` Peter Maydell
@ 2017-11-16 16:43               ` Thomas Huth
  2017-11-17  4:24                 ` Michael S. Tsirkin
  0 siblings, 1 reply; 23+ messages in thread
From: Thomas Huth @ 2017-11-16 16:43 UTC (permalink / raw
  To: Peter Maydell, Daniel P. Berrange; +Cc: QEMU Developers, Michael S. Tsirkin

On 16.11.2017 17:15, Peter Maydell wrote:
> On 16 November 2017 at 16:13, Daniel P. Berrange <berrange@redhat.com> wrote:
>> On Thu, Nov 16, 2017 at 04:10:22PM +0000, Peter Maydell wrote:
>>> If there are known-buggy iasl versions in the wild we could
>>> consider a configure test and treat buggy-iasl like no-iasl.
>>
>> iasl has long been broken on big-endian, but it has also long contained
>> code that simply makes it exit immediately in that case, and qemu copes
>> with that. So if there's buggy iasl it would be a distro which removed
>> this big-endian check and tried to make it work on big-endian but failed.
>> Fedora tried the latter, but at least in rawhide it works properly now.
>> I'm unclear if we shipped broken iasl with the BE check removed in stable
>> versions though
> 
> In this case this is Ubuntu 16.04.2 LTS (xenial) on s390x, with
> 
> linux1@lxub05:~$ iasl -v
> 
> Intel ACPI Component Architecture
> ASL+ Optimizing Compiler version 20160108-64
> Copyright (c) 2000 - 2016 Intel Corporation

That's likely a broken version, indeed. I've noticed that the iasl that
ships with the acpica-tools in RHEL7 is broken, too - it does not
contain the big-endian check (yet?), and fails to byte-swap on big
endian hosts.

If you compile the latest version from upstream, you get this instead:

$ iasl -v
iASL is not currently supported on big-endian machines.

But as Daniel already wrote: The version from Fedora contains some
patches that fix the endianess issue, so that iasl with these patches
also works fine on big endian hosts:

 https://src.fedoraproject.org/rpms/acpica-tools/blob/master/f/big-endian.patch
 https://src.fedoraproject.org/rpms/acpica-tools/blob/master/f/big-endian-v2.patch

 Thomas

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

* Re: [Qemu-devel] [PULL 00/10] pc, pci, virtio: fixes for rc1
  2017-11-16 16:43               ` Thomas Huth
@ 2017-11-17  4:24                 ` Michael S. Tsirkin
  0 siblings, 0 replies; 23+ messages in thread
From: Michael S. Tsirkin @ 2017-11-17  4:24 UTC (permalink / raw
  To: Thomas Huth
  Cc: Peter Maydell, Daniel P. Berrange, QEMU Developers, Igor Mammedov,
	Marcel Apfelbaum

On Thu, Nov 16, 2017 at 05:43:52PM +0100, Thomas Huth wrote:
> On 16.11.2017 17:15, Peter Maydell wrote:
> > On 16 November 2017 at 16:13, Daniel P. Berrange <berrange@redhat.com> wrote:
> >> On Thu, Nov 16, 2017 at 04:10:22PM +0000, Peter Maydell wrote:
> >>> If there are known-buggy iasl versions in the wild we could
> >>> consider a configure test and treat buggy-iasl like no-iasl.
> >>
> >> iasl has long been broken on big-endian, but it has also long contained
> >> code that simply makes it exit immediately in that case, and qemu copes
> >> with that. So if there's buggy iasl it would be a distro which removed
> >> this big-endian check and tried to make it work on big-endian but failed.
> >> Fedora tried the latter, but at least in rawhide it works properly now.
> >> I'm unclear if we shipped broken iasl with the BE check removed in stable
> >> versions though
> > 
> > In this case this is Ubuntu 16.04.2 LTS (xenial) on s390x, with
> > 
> > linux1@lxub05:~$ iasl -v
> > 
> > Intel ACPI Component Architecture
> > ASL+ Optimizing Compiler version 20160108-64
> > Copyright (c) 2000 - 2016 Intel Corporation
> 
> That's likely a broken version, indeed. I've noticed that the iasl that
> ships with the acpica-tools in RHEL7 is broken, too - it does not
> contain the big-endian check (yet?), and fails to byte-swap on big
> endian hosts.
> 
> If you compile the latest version from upstream, you get this instead:
> 
> $ iasl -v
> iASL is not currently supported on big-endian machines.
> 
> But as Daniel already wrote: The version from Fedora contains some
> patches that fix the endianess issue, so that iasl with these patches
> also works fine on big endian hosts:
> 
>  https://src.fedoraproject.org/rpms/acpica-tools/blob/master/f/big-endian.patch
>  https://src.fedoraproject.org/rpms/acpica-tools/blob/master/f/big-endian-v2.patch
> 
>  Thomas

For the record, I think we should remove the dependency on iasl for
tests too. It is still a handy tool for debugging, so the following
would be a good plan IMHO:

- compare binary actual to expected in memory
- on match pass and skip iasl
- on mismatch, generate aml, run iasl, show
  output in existing format.
  then fail
- when generating expected files, print diff
  and make it easy to append to commit log


-- 
MST

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

end of thread, other threads:[~2017-11-17  4:24 UTC | newest]

Thread overview: 23+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-11-15 18:17 [Qemu-devel] [PULL 00/10] pc, pci, virtio: fixes for rc1 Michael S. Tsirkin
2017-11-15 18:17 ` [Qemu-devel] [PULL 01/10] fix: unrealize virtio device if we fail to hotplug it Michael S. Tsirkin
2017-11-15 18:17 ` [Qemu-devel] [PULL 02/10] pci: Initialize pci_dev->name before use Michael S. Tsirkin
2017-11-15 18:18 ` [Qemu-devel] [PULL 03/10] tests: report errors when iasl exits with non-zero status Michael S. Tsirkin
2017-11-15 18:18 ` [Qemu-devel] [PULL 04/10] test: fix detection of errors from iasl Michael S. Tsirkin
2017-11-15 18:18 ` [Qemu-devel] [PULL 05/10] hw/pci-host: Fix x86 Host Bridges 64bit PCI hole Michael S. Tsirkin
2017-11-15 18:18 ` [Qemu-devel] [PULL 06/10] hw/pcie-pci-bridge: restrict to X86 and ARM Michael S. Tsirkin
2017-11-15 18:18 ` [Qemu-devel] [PULL 07/10] tests/acpi-test-data: update _CRS in DSDT Michael S. Tsirkin
2017-11-15 18:18 ` [Qemu-devel] [PULL 08/10] NUMA: Enable adding NUMA node implicitly Michael S. Tsirkin
2017-11-16 10:22   ` Thadeu Lima de Souza Cascardo
2017-11-15 18:19 ` [Qemu-devel] [PULL 09/10] vmcoreinfo: put it in the 'misc' device category Michael S. Tsirkin
2017-11-15 18:19 ` [Qemu-devel] [PULL 10/10] build-sys: restrict vmcoreinfo to fw_cfg+dma capable targets Michael S. Tsirkin
2017-11-16 14:41 ` [Qemu-devel] [PULL 00/10] pc, pci, virtio: fixes for rc1 Peter Maydell
2017-11-16 15:19   ` Thomas Huth
2017-11-16 15:38   ` Michael S. Tsirkin
2017-11-16 15:45     ` Daniel P. Berrange
2017-11-16 15:56       ` Michael S. Tsirkin
2017-11-16 16:10         ` Peter Maydell
2017-11-16 16:13           ` Daniel P. Berrange
2017-11-16 16:15             ` Peter Maydell
2017-11-16 16:43               ` Thomas Huth
2017-11-17  4:24                 ` Michael S. Tsirkin
2017-11-16 16:15           ` Michael S. Tsirkin

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.