1. 21 6月, 2018 6 次提交
  2. 02 12月, 2017 1 次提交
  3. 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
  4. 05 11月, 2017 1 次提交
  5. 27 10月, 2017 2 次提交
  6. 15 10月, 2017 4 次提交
  7. 12 10月, 2017 1 次提交
    • I
      pc: make sure that plugged CPUs are of the same type · 6970c5ff
      Igor Mammedov 提交于
      heterogeneous cpus are not supported and hotplugging different
      cpu model crashes QEMU:
      
        qemu-system-x86_64 -cpu qemu64 -smp 1,maxcpus=2
        (qemu) device_add host-x86_64-cpu,socket-id=1,core-id=0,thread-id=0,id=foo
        (qemu) info cpus
        error: failed to get MSR 0x38d
        qemu-system-x86_64: target/i386/kvm.c:2121: kvm_get_msrs: Assertion `ret == cpu->kvm_msr_buf->nmsrs' failed.
        Aborted (core dumped)
      
      Gracefully fail hotplug process in case of user mistake.
      Reported-by: NGreg Kurz <groug@kaod.org>
      Signed-off-by: NIgor Mammedov <imammedo@redhat.com>
      Message-Id: <1507638879-200718-1-git-send-email-imammedo@redhat.com>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      6970c5ff
  8. 02 10月, 2017 1 次提交
  9. 27 9月, 2017 1 次提交
  10. 20 9月, 2017 2 次提交
    • E
      hw/acpi-build: Fix SRAT memory building in case of node 0 without RAM · 4926403c
      Eduardo Habkost 提交于
      Currently, Using the fisrt node without memory on the machine makes
      QEMU unhappy. With this example command line:
        ... \
        -m 1024M,slots=4,maxmem=32G \
        -numa node,nodeid=0 \
        -numa node,mem=1024M,nodeid=1 \
        -numa node,nodeid=2 \
        -numa node,nodeid=3 \
      Guest reports "No NUMA configuration found" and the NUMA topology is
      wrong.
      
      This is because when QEMU builds ACPI SRAT, it regards node 0 as the
      default node to deal with the memory hole(640K-1M). this means the
      node0 must have some memory(>1M), but, actually it can have no
      memory.
      
      Fix this problem by cut out the 640K hole in the same way the PCI
      4G hole does.
      Signed-off-by: NEduardo Habkost <ehabkost@redhat.com>
      Signed-off-by: NDou Liyang <douly.fnst@cn.fujitsu.com>
      Message-Id: <1504231805-30957-2-git-send-email-douly.fnst@cn.fujitsu.com>
      Signed-off-by: NEduardo Habkost <ehabkost@redhat.com>
      4926403c
    • I
      numa: cpu: calculate/set default node-ids after all -numa CLI options are parsed · 79e07936
      Igor Mammedov 提交于
      Calculating default node-ids for CPUs in possible_cpu_arch_ids()
      is rather fragile since defaults calculation uses nb_numa_nodes but
      callback might be potentially called early before all -numa CLI
      options are parsed, which would lead to cpus assigned only upto
      nb_numa_nodes at the time possible_cpu_arch_ids() is called.
      
      Issue was introduced by
      (7c88e65d numa: mirror cpu to node mapping in MachineState::possible_cpus)
      and for example CLI:
        -smp 4 -numa node,cpus=0 -numa node
      would set props.node-id in possible_cpus array for every non
      explicitly mapped CPU to the first node.
      
      Issue is not visible to guest nor to mgmt interface due to
        1) implictly mapped cpus are forced to the first node in
           case of partial mapping
        2) in case of default mapping possible_cpu_arch_ids() is
           called after all -numa options are parsed (resulting
           in correct mapping).
      
      However it's fragile to rely on late execution of
      possible_cpu_arch_ids(), therefore add machine specific
      callback that returns node-id for CPU and use it to calculate/
      set defaults at machine_numa_finish_init() time when all -numa
      options are parsed.
      Reported-by: NEduardo Habkost <ehabkost@redhat.com>
      Signed-off-by: NIgor Mammedov <imammedo@redhat.com>
      Message-Id: <1496314408-163972-1-git-send-email-imammedo@redhat.com>
      Reviewed-by: NEduardo Habkost <ehabkost@redhat.com>
      Signed-off-by: NEduardo Habkost <ehabkost@redhat.com>
      79e07936
  11. 19 9月, 2017 6 次提交
    • A
      General warn report fixups · b62e39b4
      Alistair Francis 提交于
      Tidy up some of the warn_report() messages after having converted them
      to use warn_report().
      Signed-off-by: NAlistair Francis <alistair.francis@xilinx.com>
      Reviewed-by: NMarkus Armbruster <armbru@redhat.com>
      Message-Id: <9cb1d23551898c9c9a5f84da6773e99871285120.1505158760.git.alistair.francis@xilinx.com>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      b62e39b4
    • A
      Convert multi-line fprintf() to warn_report() · 8297be80
      Alistair Francis 提交于
      Convert all the multi-line uses of fprintf(stderr, "warning:"..."\n"...
      to use warn_report() instead. This helps standardise on a single
      method of printing warnings to the user.
      
      All of the warnings were changed using these commands:
        find ./* -type f -exec sed -i \
          'N; {s|fprintf(.*".*warning[,:] \(.*\)\\n"\(.*\));|warn_report("\1"\2);|Ig}' \
          {} +
        find ./* -type f -exec sed -i \
          'N;N; {s|fprintf(.*".*warning[,:] \(.*\)\\n"\(.*\));|warn_report("\1"\2);|Ig}' \
          {} +
        find ./* -type f -exec sed -i \
          'N;N;N; {s|fprintf(.*".*warning[,:] \(.*\)\\n"\(.*\));|warn_report("\1"\2);|Ig}' \
          {} +
        find ./* -type f -exec sed -i \
          'N;N;N;N {s|fprintf(.*".*warning[,:] \(.*\)\\n"\(.*\));|warn_report("\1"\2);|Ig}' \
          {} +
        find ./* -type f -exec sed -i \
          'N;N;N;N;N {s|fprintf(.*".*warning[,:] \(.*\)\\n"\(.*\));|warn_report("\1"\2);|Ig}' \
          {} +
        find ./* -type f -exec sed -i \
          'N;N;N;N;N;N {s|fprintf(.*".*warning[,:] \(.*\)\\n"\(.*\));|warn_report("\1"\2);|Ig}' \
          {} +
        find ./* -type f -exec sed -i \
          'N;N;N;N;N;N;N; {s|fprintf(.*".*warning[,:] \(.*\)\\n"\(.*\));|warn_report("\1"\2);|Ig}' \
          {} +
      
      Indentation fixed up manually afterwards.
      
      Some of the lines were manually edited to reduce the line length to below
      80 charecters. Some of the lines with newlines in the middle of the
      string were also manually edit to avoid checkpatch errrors.
      
      The #include lines were manually updated to allow the code to compile.
      
      Several of the warning messages can be improved after this patch, to
      keep this patch mechanical this has been moved into a later patch.
      Signed-off-by: NAlistair Francis <alistair.francis@xilinx.com>
      Cc: Paolo Bonzini <pbonzini@redhat.com>
      Cc: Kevin Wolf <kwolf@redhat.com>
      Cc: Max Reitz <mreitz@redhat.com>
      Cc: "Michael S. Tsirkin" <mst@redhat.com>
      Cc: Igor Mammedov <imammedo@redhat.com>
      Cc: Peter Maydell <peter.maydell@linaro.org>
      Cc: Stefano Stabellini <sstabellini@kernel.org>
      Cc: Anthony Perard <anthony.perard@citrix.com>
      Cc: Richard Henderson <rth@twiddle.net>
      Cc: Eduardo Habkost <ehabkost@redhat.com>
      Cc: Aurelien Jarno <aurelien@aurel32.net>
      Cc: Yongbok Kim <yongbok.kim@imgtec.com>
      Cc: Cornelia Huck <cohuck@redhat.com>
      Cc: Christian Borntraeger <borntraeger@de.ibm.com>
      Cc: Alexander Graf <agraf@suse.de>
      Cc: Jason Wang <jasowang@redhat.com>
      Cc: David Gibson <david@gibson.dropbear.id.au>
      Cc: Gerd Hoffmann <kraxel@redhat.com>
      Acked-by: NCornelia Huck <cohuck@redhat.com>
      Reviewed-by: NMarkus Armbruster <armbru@redhat.com>
      Message-Id: <5def63849ca8f551630c6f2b45bcb1c482f765a6.1505158760.git.alistair.francis@xilinx.com>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      8297be80
    • A
      Convert single line fprintf(.../n) to warn_report() · 2ab4b135
      Alistair Francis 提交于
      Convert all the single line uses of fprintf(stderr, "warning:"..."\n"...
      to use warn_report() instead. This helps standardise on a single
      method of printing warnings to the user.
      
      All of the warnings were changed using this command:
        find ./* -type f -exec sed -i \
          's|fprintf(.*".*warning[,:] \(.*\)\\n"\(.*\));|warn_report("\1"\2);|Ig' \
          {} +
      
      Some of the lines were manually edited to reduce the line length to below
      80 charecters.
      
      The #include lines were manually updated to allow the code to compile.
      Signed-off-by: NAlistair Francis <alistair.francis@xilinx.com>
      Cc: Kevin Wolf <kwolf@redhat.com>
      Cc: Max Reitz <mreitz@redhat.com>
      Cc: "Michael S. Tsirkin" <mst@redhat.com>
      Cc: Igor Mammedov <imammedo@redhat.com>
      Cc: Paolo Bonzini <pbonzini@redhat.com>
      Cc: Richard Henderson <rth@twiddle.net>
      Cc: Eduardo Habkost <ehabkost@redhat.com>
      Cc: Gerd Hoffmann <kraxel@redhat.com>
      Cc: Jason Wang <jasowang@redhat.com>
      Cc: Michael Roth <mdroth@linux.vnet.ibm.com>
      Cc: James Hogan <james.hogan@imgtec.com>
      Cc: Aurelien Jarno <aurelien@aurel32.net>
      Cc: Yongbok Kim <yongbok.kim@imgtec.com>
      Cc: Stefan Hajnoczi <stefanha@redhat.com>
      Reviewed-by: NMarkus Armbruster <armbru@redhat.com>
      Reviewed-by: James Hogan <james.hogan@imgtec.com> [mips]
      Message-Id: <ae8f8a7f0a88ded61743dff2adade21f8122a9e7.1505158760.git.alistair.francis@xilinx.com>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      2ab4b135
    • A
      hw/i386: Improve some of the warning messages · 9e5d2c52
      Alistair Francis 提交于
      Signed-off-by: NAlistair Francis <alistair.francis@xilinx.com>
      Suggested-by: NEduardo Habkost <ehabkost@redhat.com>
      Cc: Eduardo Habkost <ehabkost@redhat.com>
      Message-Id: <1d6ef2ccd9667878ed5820fcf17eef35957ea5d8.1505158760.git.alistair.francis@xilinx.com>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      9e5d2c52
    • P
      multiboot: validate multiboot header address values · ed4f86e8
      Prasad J Pandit 提交于
      While loading kernel via multiboot-v1 image, (flags & 0x00010000)
      indicates that multiboot header contains valid addresses to load
      the kernel image. These addresses are used to compute kernel
      size and kernel text offset in the OS image. Validate these
      address values to avoid an OOB access issue.
      
      This is CVE-2017-14167.
      Reported-by: NThomas Garnier <thgarnie@google.com>
      Signed-off-by: NPrasad J Pandit <pjp@fedoraproject.org>
      Message-Id: <20170907063256.7418-1-ppandit@redhat.com>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      ed4f86e8
    • I
      pc: use generic cpu_model parsing · 311ca98d
      Igor Mammedov 提交于
      define default CPU type in generic way in pc_machine_class_init()
      and let common machine code to handle cpu_model parsing
      
      Patch also introduces TARGET_DEFAULT_CPU_TYPE define for 2 purposes:
        * make foo_machine_class_init() look uniform on every target
        * use define in [bsd|linux]-user targets to pick default
          cpu type
      Signed-off-by: NIgor Mammedov <imammedo@redhat.com>
      Reviewed-by: NPhilippe Mathieu-Daudé <f4bug@amsat.org>
      Message-Id: <1505318697-77161-5-git-send-email-imammedo@redhat.com>
      Signed-off-by: NEduardo Habkost <ehabkost@redhat.com>
      311ca98d
  12. 08 9月, 2017 3 次提交
  13. 31 8月, 2017 1 次提交
  14. 23 8月, 2017 1 次提交
  15. 22 8月, 2017 1 次提交
    • T
      hw/ppc/spapr: Fix segfault when instantiating a 'pc-dimm' without 'memdev' · 04790978
      Thomas Huth 提交于
      QEMU currently crashes when trying to use a 'pc-dimm' on the pseries
      machine without specifying its 'memdev' property. This happens because
      pc_dimm_get_memory_region() does not check whether the 'memdev' property
      has properly been set by the user. Looking closer at this function, it's
      also obvious that it is using &error_abort to call another function - and
      this is bad in a function that is used in the hot-plugging calling chain
      since this can also cause QEMU to exit unexpectedly.
      
      So let's fix these issues in a proper way now: Add a "Error **errp"
      parameter to pc_dimm_get_memory_region() which we use in case the 'memdev'
      property has not been set by the user, and which we can use instead of
      the &error_abort, and change the callers of get_memory_region() to make
      use of this "errp" parameter for proper error checking.
      Signed-off-by: NThomas Huth <thuth@redhat.com>
      Reviewed-by: NIgor Mammedov <imammedo@redhat.com>
      Signed-off-by: NDavid Gibson <david@gibson.dropbear.id.au>
      04790978
  16. 08 8月, 2017 1 次提交
  17. 02 8月, 2017 4 次提交
  18. 01 8月, 2017 2 次提交