1. 28 6月, 2017 2 次提交
  2. 20 6月, 2017 3 次提交
  3. 19 6月, 2017 1 次提交
  4. 06 6月, 2017 2 次提交
    • I
      numa: make sure that all cpus have has_node_id set if numa is enabled · d41f3e75
      Igor Mammedov 提交于
      It fixes/add missing _PXM object for non mapped CPU (x86)
      and missing fdt node (virt-arm).
      
      It ensures that possible_cpus contains complete mapping if
      numa is enabled by the time machine_init() is executed.
      
      As result non completely mapped CPUs:
       1) appear in ACPI/fdt blobs
       2) QMP query-hotpluggable-cpus command shows bound nodes for such CPUs
       3) allows to drop checks for has_node_id in numa only code,
         reducing number of invariants incomplete mapping could produce
       4) moves fixup/implicit node init from runtime numa_cpu_pre_plug()
         (when CPU object is created) to machine_numa_finish_init() which
         helps to fix [1, 2] and make possible_cpus complete source
         of numa mapping available even before CPUs are created.
      Signed-off-by: NIgor Mammedov <imammedo@redhat.com>
      Message-Id: <1496161442-96665-4-git-send-email-imammedo@redhat.com>
      Signed-off-by: NEduardo Habkost <ehabkost@redhat.com>
      d41f3e75
    • I
      numa: move default mapping init to machine · 60bed6a3
      Igor Mammedov 提交于
      there is no need use cpu_index_to_instance_props() for setting
      default cpu -> node mapping. Generic machine code can do it
      without cpu_index by just enabling already preset defaults
      in possible_cpus.
      
      PS:
      as bonus it makes one less user of cpu_index_to_instance_props()
      Signed-off-by: NIgor Mammedov <imammedo@redhat.com>
      Message-Id: <1496161442-96665-3-git-send-email-imammedo@redhat.com>
      Signed-off-by: NEduardo Habkost <ehabkost@redhat.com>
      60bed6a3
  5. 05 6月, 2017 1 次提交
  6. 04 6月, 2017 1 次提交
  7. 02 6月, 2017 5 次提交
  8. 23 5月, 2017 1 次提交
  9. 17 5月, 2017 3 次提交
    • E
      sysbus: Set user_creatable=false by default on TYPE_SYS_BUS_DEVICE · e4f4fb1e
      Eduardo Habkost 提交于
      commit 33cd52b5 unset
      cannot_instantiate_with_device_add_yet in TYPE_SYSBUS, making all
      sysbus devices appear on "-device help" and lack the "no-user"
      flag in "info qdm".
      
      To fix this, we can set user_creatable=false by default on
      TYPE_SYS_BUS_DEVICE, but this requires setting
      user_creatable=true explicitly on the sysbus devices that
      actually work with -device.
      
      Fortunately today we have just a few has_dynamic_sysbus=1
      machines: virt, pc-q35-*, ppce500, and spapr.
      
      virt, ppce500, and spapr have extra checks to ensure just a few
      device types can be instantiated:
      
      * virt supports only TYPE_VFIO_CALXEDA_XGMAC, TYPE_VFIO_AMD_XGBE.
      * ppce500 supports only TYPE_ETSEC_COMMON.
      * spapr supports only TYPE_SPAPR_PCI_HOST_BRIDGE.
      
      This patch sets user_creatable=true explicitly on those 4 device
      classes.
      
      Now, the more complex cases:
      
      pc-q35-*: q35 has no sysbus device whitelist yet (which is a
      separate bug). We are in the process of fixing it and building a
      sysbus whitelist on q35, but in the meantime we can fix the
      "-device help" and "info qdm" bugs mentioned above. Also, despite
      not being strictly necessary for fixing the q35 bug, reducing the
      list of user_creatable=true devices will help us be more
      confident when building the q35 whitelist.
      
      xen: We also have a hack at xen_set_dynamic_sysbus(), that sets
      has_dynamic_sysbus=true at runtime when using the Xen
      accelerator. This hack is only used to allow xen-backend devices
      to be dynamically plugged/unplugged.
      
      This means today we can use -device with the following 22 device
      types, that are the ones compiled into the qemu-system-x86_64 and
      qemu-system-i386 binaries:
      
      * allwinner-ahci
      * amd-iommu
      * cfi.pflash01
      * esp
      * fw_cfg_io
      * fw_cfg_mem
      * generic-sdhci
      * hpet
      * intel-iommu
      * ioapic
      * isabus-bridge
      * kvmclock
      * kvm-ioapic
      * kvmvapic
      * SUNW,fdtwo
      * sysbus-ahci
      * sysbus-fdc
      * sysbus-ohci
      * unimplemented-device
      * virtio-mmio
      * xen-backend
      * xen-sysdev
      
      This patch adds user_creatable=true explicitly to those devices,
      temporarily, just to keep 100% compatibility with existing
      behavior of q35. Subsequent patches will remove
      user_creatable=true from the devices that are really not meant to
      user-creatable on any machine, and remove the FIXME comment from
      the ones that are really supposed to be user-creatable. This is
      being done in separate patches because we still don't have an
      obvious list of devices that will be whitelisted by q35, and I
      would like to get each device reviewed individually.
      
      Cc: Alexander Graf <agraf@suse.de>
      Cc: Alex Williamson <alex.williamson@redhat.com>
      Cc: Alistair Francis <alistair.francis@xilinx.com>
      Cc: Beniamino Galvani <b.galvani@gmail.com>
      Cc: Christian Borntraeger <borntraeger@de.ibm.com>
      Cc: Cornelia Huck <cornelia.huck@de.ibm.com>
      Cc: David Gibson <david@gibson.dropbear.id.au>
      Cc: "Edgar E. Iglesias" <edgar.iglesias@gmail.com>
      Cc: Eduardo Habkost <ehabkost@redhat.com>
      Cc: Frank Blaschka <frank.blaschka@de.ibm.com>
      Cc: Gabriel L. Somlo <somlo@cmu.edu>
      Cc: Gerd Hoffmann <kraxel@redhat.com>
      Cc: Igor Mammedov <imammedo@redhat.com>
      Cc: Jason Wang <jasowang@redhat.com>
      Cc: John Snow <jsnow@redhat.com>
      Cc: Juergen Gross <jgross@suse.com>
      Cc: Kevin Wolf <kwolf@redhat.com>
      Cc: Laszlo Ersek <lersek@redhat.com>
      Cc: Marcel Apfelbaum <marcel@redhat.com>
      Cc: Markus Armbruster <armbru@redhat.com>
      Cc: Max Reitz <mreitz@redhat.com>
      Cc: "Michael S. Tsirkin" <mst@redhat.com>
      Cc: Paolo Bonzini <pbonzini@redhat.com>
      Cc: Peter Maydell <peter.maydell@linaro.org>
      Cc: Pierre Morel <pmorel@linux.vnet.ibm.com>
      Cc: Prasad J Pandit <pjp@fedoraproject.org>
      Cc: qemu-arm@nongnu.org
      Cc: qemu-block@nongnu.org
      Cc: qemu-ppc@nongnu.org
      Cc: Richard Henderson <rth@twiddle.net>
      Cc: Rob Herring <robh@kernel.org>
      Cc: Shannon Zhao <zhaoshenglong@huawei.com>
      Cc: sstabellini@kernel.org
      Cc: Thomas Huth <thuth@redhat.com>
      Cc: Yi Min Zhao <zyimin@linux.vnet.ibm.com>
      Acked-by: NJohn Snow <jsnow@redhat.com>
      Acked-by: NJuergen Gross <jgross@suse.com>
      Acked-by: NMarcel Apfelbaum <marcel@redhat.com>
      Signed-off-by: NEduardo Habkost <ehabkost@redhat.com>
      Message-Id: <20170503203604.31462-3-ehabkost@redhat.com>
      Reviewed-by: NMarkus Armbruster <armbru@redhat.com>
      [ehabkost: Small changes at sysbus_device_class_init() comments]
      Signed-off-by: NEduardo Habkost <ehabkost@redhat.com>
      e4f4fb1e
    • E
      qdev: Replace cannot_instantiate_with_device_add_yet with !user_creatable · e90f2a8c
      Eduardo Habkost 提交于
      cannot_instantiate_with_device_add_yet was introduced by commit
      efec3dd6 to replace no_user. It was
      supposed to be a temporary measure.
      
      When it was introduced, we had 54
      cannot_instantiate_with_device_add_yet=true lines in the code.
      Today (3 years later) this number has not shrunk: we now have
      57 cannot_instantiate_with_device_add_yet=true lines. I think it
      is safe to say it is not a temporary measure, and we won't see
      the flag go away soon.
      
      Instead of a long field name that misleads people to believe it
      is temporary, replace it a shorter and less misleading field:
      user_creatable.
      
      Except for code comments, changes were generated using the
      following Coccinelle patch:
      
        @@
        expression DC;
        @@
        (
        -DC->cannot_instantiate_with_device_add_yet = false;
        +DC->user_creatable = true;
        |
        -DC->cannot_instantiate_with_device_add_yet = true;
        +DC->user_creatable = false;
        )
      
        @@
        typedef ObjectClass;
        expression dc;
        identifier class, data;
        @@
         static void device_class_init(ObjectClass *class, void *data)
         {
         ...
         dc->hotpluggable = true;
        +dc->user_creatable = true;
         ...
         }
      
        @@
        @@
         struct DeviceClass {
         ...
        -bool cannot_instantiate_with_device_add_yet;
        +bool user_creatable;
         ...
        }
      
        @@
        expression DC;
        @@
        (
        -!DC->cannot_instantiate_with_device_add_yet
        +DC->user_creatable
        |
        -DC->cannot_instantiate_with_device_add_yet
        +!DC->user_creatable
        )
      
      Cc: Alistair Francis <alistair.francis@xilinx.com>
      Cc: Laszlo Ersek <lersek@redhat.com>
      Cc: Marcel Apfelbaum <marcel@redhat.com>
      Cc: Markus Armbruster <armbru@redhat.com>
      Cc: Peter Maydell <peter.maydell@linaro.org>
      Cc: Thomas Huth <thuth@redhat.com>
      Acked-by: NAlistair Francis <alistair.francis@xilinx.com>
      Reviewed-by: NThomas Huth <thuth@redhat.com>
      Reviewed-by: NMarcel Apfelbaum <marcel@redhat.com>
      Acked-by: NMarcel Apfelbaum <marcel@redhat.com>
      Signed-off-by: NEduardo Habkost <ehabkost@redhat.com>
      Message-Id: <20170503203604.31462-2-ehabkost@redhat.com>
      [ehabkost: kept "TODO remove once we're there" comment]
      Reviewed-by: NMarkus Armbruster <armbru@redhat.com>
      Signed-off-by: NEduardo Habkost <ehabkost@redhat.com>
      e90f2a8c
    • J
      migration: Move check_migratable() into qdev.c · 1bfe5f05
      Juan Quintela 提交于
      The function is only used once, and nothing else in migration knows
      about objects.  Create the function vmstate_device_is_migratable() in
      savem.c that really do the bit that is related with migration.
      Signed-off-by: NJuan Quintela <quintela@redhat.com>
      Reviewed-by: NPeter Xu <peterx@redhat.com>
      1bfe5f05
  10. 12 5月, 2017 4 次提交
  11. 10 5月, 2017 1 次提交
  12. 21 4月, 2017 7 次提交
  13. 03 4月, 2017 1 次提交
    • D
      block: add missed aio_context_acquire into release_drive · 9588c589
      Denis V. Lunev 提交于
      Recently we expirience hang with iothreads enabled with the following
      call trace:
      Thread 1 (Thread 0x7fa95efebc80 (LWP 177117)):
      0  ppoll () from /lib64/libc.so.6
      2  qemu_poll_ns () at qemu-timer.c:313
      3  aio_poll () at aio-posix.c:457
      4  bdrv_flush () at block/io.c:2641
      5  bdrv_close () at block.c:2143
      6  bdrv_delete () at block.c:2352
      7  bdrv_unref () at block.c:3429
      8  blk_remove_bs () at block/block-backend.c:427
      9  blk_delete () at block/block-backend.c:178
      10 blk_unref () at block/block-backend.c:226
      11 object_property_del_all () at qom/object.c:399
      12 object_finalize () at qom/object.c:461
      13 object_unref () at qom/object.c:898
      14 object_property_del_child () at qom/object.c:422
      15 qmp_marshal_device_del () at qmp-marshal.c:1145
      16 handle_qmp_command () at /usr/src/debug/qemu-2.6.0/monitor.c:3929
      
      Technically bdrv_flush() stucks in
          while (rwco.ret == NOT_DONE) {
              aio_poll(aio_context, true);
          }
      but rwco.ret is equal to 0 thus we have missed wakeup. Code investigation
      reveals that we do not have performed aio_context_acquire() on this call
      stack.
      
      This patch adds missed lock.
      Signed-off-by: NDenis V. Lunev <den@openvz.org>
      CC: Kevin Wolf <kwolf@redhat.com>
      CC: Max Reitz <mreitz@redhat.com>
      CC: Eric Blake <eblake@redhat.com>
      CC: Markus Armbruster <armbru@redhat.com>
      Message-id: 1490717566-25516-1-git-send-email-den@openvz.org
      Reviewed-by: NFam Zheng <famz@redhat.com>
      Signed-off-by: NMax Reitz <mreitz@redhat.com>
      9588c589
  14. 22 3月, 2017 1 次提交
    • L
      numa,spapr: align default numa node memory size to 256MB · 55641213
      Laurent Vivier 提交于
      Since commit 224245bf ("spapr: Add LMB DR connectors"), NUMA node
      memory size must be aligned to 256MB (SPAPR_MEMORY_BLOCK_SIZE).
      
      But when "-numa" option is provided without "mem" parameter,
      the memory is equally divided between nodes, but 8MB aligned.
      This can be not valid for pseries.
      
      In that case we can have:
      $ ./ppc64-softmmu/qemu-system-ppc64 -m 4G -numa node -numa node -numa node
      qemu-system-ppc64: Node 0 memory size 0x55000000 is not aligned to 256 MiB
      
      With this patch, we have:
      (qemu) info numa
      3 nodes
      node 0 cpus: 0
      node 0 size: 1280 MB
      node 1 cpus:
      node 1 size: 1280 MB
      node 2 cpus:
      node 2 size: 1536 MB
      Signed-off-by: NLaurent Vivier <lvivier@redhat.com>
      Signed-off-by: NDavid Gibson <david@gibson.dropbear.id.au>
      55641213
  15. 15 3月, 2017 1 次提交
    • E
      machine: Convert abstract typename on compat_props to subclass names · 0bcba41f
      Eduardo Habkost 提交于
      Original problem description by Greg Kurz:
      
      > Since commit "9a4c0e22 hw/virtio-pci: fix virtio
      > behaviour", passing -device virtio-blk-pci.disable-modern=off
      > has no effect on 2.6 machine types because the internal
      > virtio-pci.disable-modern=on compat property always prevail.
      
      The same bug also affects other abstract type names mentioned on
      compat_props by machine-types: apic-common, i386-cpu, pci-device,
      powerpc64-cpu, s390-skeys, spapr-pci-host-bridge, usb-device,
      virtio-pci, x86_64-cpu.
      
      The right fix for this problem is to make sure compat_props and
      -global options are always applied in the order they are
      registered, instead of reordering them based on the type
      hierarchy. But changing the ordering rules of -global is risky
      and might break existing configurations, so we shouldn't do that
      on a stable branch.
      
      This is a temporary hack that will work around the bug when
      registering compat_props properties: if we find an abstract class
      on compat_props, register properties for all its non-abstract
      subtypes instead. This will make sure -global won't be overridden
      by compat_props, while keeping the existing ordering rules on
      -global options.
      
      Note that there's one case that won't be fixed by this hack:
      "-global spapr-pci-vfio-host-bridge.<option>=<value>" won't be
      able to override compat_props, because spapr-pci-host-bridge is
      not an abstract class.
      Signed-off-by: NEduardo Habkost <ehabkost@redhat.com>
      Message-Id: <1481575745-26120-1-git-send-email-ehabkost@redhat.com>
      Reviewed-by: NCornelia Huck <cornelia.huck@de.ibm.com>
      Reviewed-by: NHalil Pasic <pasic@linux.vnet.ibm.com>
      Reviewed-by: NGreg Kurz <groug@kaod.org>
      Tested-by: NGreg Kurz <groug@kaod.org>
      Signed-off-by: NEduardo Habkost <ehabkost@redhat.com>
      0bcba41f
  16. 14 3月, 2017 1 次提交
  17. 01 3月, 2017 5 次提交