1. 20 11月, 2017 1 次提交
  2. 16 11月, 2017 2 次提交
    • D
      NUMA: Enable adding NUMA node implicitly · 7b8be49d
      Dou Liyang 提交于
      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: NThadeu Lima de Souza Cascardo <cascardo@canonical.com>
      Suggested-by: NIgor Mammedov <imammedo@redhat.com>
      Signed-off-by: NDou 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: NIgor Mammedov <imammedo@redhat.com>
      Reviewed-by: NMichael S. Tsirkin <mst@redhat.com>
      Signed-off-by: NMichael S. Tsirkin <mst@redhat.com>
      7b8be49d
    • M
      hw/pci-host: Fix x86 Host Bridges 64bit PCI hole · 9fa99d25
      Marcel Apfelbaum 提交于
      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: NLaszlo Ersek <lersek@redhat.com>
      Reviewed-by: NGerd Hoffmann <kraxel@redhat.com>
      Signed-off-by: NMarcel Apfelbaum <marcel@redhat.com>
      Reviewed-by: NMichael S. Tsirkin <mst@redhat.com>
      Signed-off-by: NMichael S. Tsirkin <mst@redhat.com>
      9fa99d25
  3. 14 11月, 2017 1 次提交
    • G
      xics/kvm: synchonize state before 'info pic' · dcb556fc
      Greg Kurz 提交于
      When using the emulated XICS, the 'info pic' monitor command shows:
      
      CPU 0 XIRR=ff000000 ((nil)) PP=ff MFRR=ff
      ICS 1000..13ff 0x10040060340
        1000 MSI 05 00
        1001 MSI 05 00
        1002 MSI 05 00
        1003 MSI ff 00
        1004 LSI ff 00
        1005 LSI ff 00
        1006 LSI ff 00
        1007 LSI ff 00
        1008 MSI 05 00
        1009 MSI 05 00
        100a MSI 05 00
        100b MSI 05 00
        100c MSI 05 00
      
      but when using the in-kernel XICS with the very same guest, we get:
      
      CPU 0 XIRR=00000000 ((nil)) PP=ff MFRR=ff
      ICS 1000..13ff 0x10032e00340
        1000 MSI ff 00
        1001 MSI ff 00
        1002 MSI ff 00
        1003 MSI ff 00
        1004 LSI ff 00
        1005 LSI ff 00
        1006 LSI ff 00
        1007 LSI ff 00
        1008 MSI ff 00
        1009 MSI ff 00
        100a MSI ff 00
        100b MSI ff 00
        100c MSI ff 00
      
      ie, all irqs are masked and XIRR is null, while we should get the
      same output as with the emulated XICS.
      
      If the guest is then migrated, 'info pic' shows the expected values
      on both source and destination.
      
      The problem is that QEMU doesn't synchronize with KVM before printing
      the XICS state. Migration happens to fix the output because it enforces
      synchronization with KVM.
      
      To fix the invalid output of 'info pic', this patch introduces a new
      synchronize_state operation for both ICPStateClass and ICSStateClass.
      The ICP operation relies on run_on_cpu() in order to kick the vCPU
      and avoid sleeping on KVM_GET_ONE_REG.
      Signed-off-by: NGreg Kurz <groug@kaod.org>
      Signed-off-by: NDavid Gibson <david@gibson.dropbear.id.au>
      dcb556fc
  4. 13 11月, 2017 2 次提交
  5. 05 11月, 2017 1 次提交
  6. 01 11月, 2017 11 次提交
  7. 30 10月, 2017 1 次提交
    • C
      s390x/kvm: use cpu model for gscb on compat machines · 0280b3eb
      Christian Borntraeger 提交于
      Starting a guest with
         <os>
          <type arch='s390x' machine='s390-ccw-virtio-2.9'>hvm</type>
        </os>
        <cpu mode='host-model'/>
      
      on an IBM z14 results in
      
      "qemu-system-s390x: Some features requested in the CPU model are not
      available in the configuration: gs"
      
      This is because guarded storage is fenced for compat machines that did
      not have guarded storage support. While this prevents future migration
      abort (by not starting the guest at all), not being able to start a
      "host-model" guest is very much unexpected.  As it turns out, even if we
      would modify libvirt to not expand the cpu model to contain "gs" for
      compat machines, it cannot guarantee that a migration will succeed. For
      example if the kernel changes its features (or the user has nested=1 on
      one host but not on the other) the migration will fail nevertheless.  So
      instead of fencing "gs" for machines <= 2.9 lets allow it for all
      machine types that support the CPU model. This will make "host-model"
      runnable all the time, while relying on the CPU model to reject invalid
      migration attempts. We also need to change the migration for guarded
      storage.
      Additional discussions about host-model are still pending but are out
      of scope of this patch.
      Suggested-by: NDavid Hildenbrand <david@redhat.com>
      Signed-off-by: NChristian Borntraeger <borntraeger@de.ibm.com>
      Acked-by: NDavid Hildenbrand <david@redhat.com>
      Acked-by: NCornelia Huck &lt;Cornelia Huck <cohuck@redhat.com>
      Acked-by: NHalil Pasic <pasic@linux.vnet.ibm.com>
      0280b3eb
  8. 27 10月, 2017 3 次提交
  9. 20 10月, 2017 7 次提交
  10. 18 10月, 2017 1 次提交
    • M
      qdev: store DeviceState's canonical path to use when unparenting · 04162f8f
      Michael Roth 提交于
      device_unparent(dev, ...) is called when a device is unparented,
      either directly, or as a result of a parent device being
      finalized, and handles some final cleanup for the device. Part
      of this includes emiting a DEVICE_DELETED QMP event to notify
      management, which includes the device's path in the composition
      tree as provided by object_get_canonical_path().
      
      object_get_canonical_path() assumes the device is still connected
      to the machine/root container, and will assert otherwise, but
      in some situations this isn't the case:
      
      If the parent is finalized as a result of object_unparent(), it
      will still be attached to the composition tree at the time any
      children are unparented as a result of that same call to
      object_unparent(). However, in some cases, object_unparent()
      will complete without finalizing the parent device, due to
      lingering references that won't be released till some time later.
      One such example is if the parent has MemoryRegion children (which
      take a ref on their parent), who in turn have AddressSpace's (which
      take a ref on their regions), since those AddressSpaces get cleaned
      up asynchronously by the RCU thread.
      
      In this case qdev:device_unparent() may be called for a child Device
      that no longer has a path to the root/machine container, causing
      object_get_canonical_path() to assert.
      
      Fix this by storing the canonical path during realize() so the
      information will still be available for device_unparent() in such
      cases.
      
      Cc: Michael S. Tsirkin <mst@redhat.com>
      Cc: Paolo Bonzini <pbonzini@redhat.com>
      Signed-off-by: NMichael Roth <mdroth@linux.vnet.ibm.com>
      Signed-off-by: NGreg Kurz <groug@kaod.org>
      Signed-off-by: NMichael Roth <mdroth@linux.vnet.ibm.com>
      Tested-by: NEric Auger <eric.auger@redhat.com>
      Reviewed-by: NDavid Gibson <david@gibson.dropbear.id.au>
      Message-Id: <20171016222315.407-2-mdroth@linux.vnet.ibm.com>
      [Clear dev->canonical_path at the post_realize_fail label, which is
       cleaner.  Suggested by David Gibson. - Paolo]
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      04162f8f
  11. 17 10月, 2017 10 次提交