1. 20 Mar, 2018 2 commits
  2. 08 Mar, 2018 1 commit
    • David Hildenbrand's avatar
      numa: we don't implement NUMA for s390x · 81ce6aa5
      David Hildenbrand authored
      Right now it is possible to crash QEMU for s390x by providing e.g.
          -numa node,nodeid=0,cpus=0-1
      Problem is, that numa.c uses mc->cpu_index_to_instance_props as an
      indicator whether NUMA is supported by a machine type. We don't
      implement NUMA for s390x ("topology") yet. However we need
      mc->cpu_index_to_instance_props for query-cpus.
      So let's fix this case by also checking for mc->get_default_cpu_node_id,
      which will be needed by machine_set_cpu_numa_node().
      qemu-system-s390x: -numa node,nodeid=0,cpus=0-1: NUMA is not supported by
                         this machine-type
      While at it, make s390_cpu_index_to_props() look like on other
      Signed-off-by: 's avatarDavid Hildenbrand <david@redhat.com>
      Message-Id: <20180227110255.20999-1-david@redhat.com>
      Reviewed-by: 's avatarChristian Borntraeger <borntraeger@de.ibm.com>
      Signed-off-by: 's avatarCornelia Huck <cohuck@redhat.com>
  3. 02 Mar, 2018 1 commit
    • Markus Armbruster's avatar
      qapi: Empty out qapi-schema.json · 112ed241
      Markus Armbruster authored
      The previous commit improved compile time by including less of the
      generated QAPI headers.  This is impossible for stuff defined directly
      in qapi-schema.json, because that ends up in headers that that pull in
      Move everything but include directives from qapi-schema.json to new
      sub-module qapi/misc.json, then include just the "misc" shard where
      It's possible everywhere, except:
      * monitor.c needs qmp-command.h to get qmp_init_marshal()
      * monitor.c, ui/vnc.c and the generated qapi-event-FOO.c need
        qapi-event.h to get enum QAPIEvent
      Perhaps we'll get rid of those some other day.
      Adding a type to qapi/migration.json now recompiles some 120 instead
      of 2300 out of 5100 objects.
      Signed-off-by: 's avatarMarkus Armbruster <armbru@redhat.com>
      Message-Id: <20180211093607.27351-25-armbru@redhat.com>
      [eblake: rebase to master]
      Signed-off-by: 's avatarEric Blake <eblake@redhat.com>
  4. 09 Feb, 2018 1 commit
  5. 05 Feb, 2018 1 commit
  6. 19 Jan, 2018 1 commit
    • Haozhong Zhang's avatar
      hostmem-file: add "align" option · 98376843
      Haozhong Zhang authored
      When mmap(2) the backend files, QEMU uses the host page size
      (getpagesize(2)) by default as the alignment of mapping address.
      However, some backends may require alignments different than the page
      size. For example, mmap a device DAX (e.g., /dev/dax0.0) on Linux
      kernel 4.13 to an address, which is 4K-aligned but not 2M-aligned,
      fails with a kernel message like
      [617494.969768] dax dax0.0: qemu-system-x86: dax_mmap: fail, unaligned vma (0x7fa37c579000 - 0x7fa43c579000, 0x1fffff)
      Because there is no common approach to get such alignment requirement,
      we add the 'align' option to 'memory-backend-file', so that users or
      management utils, which have enough knowledge about the backend, can
      specify a proper alignment via this option.
      Signed-off-by: 's avatarHaozhong Zhang <haozhong.zhang@intel.com>
      Message-Id: <20171211072806.2812-2-haozhong.zhang@intel.com>
      Reviewed-by: 's avatarMichael S. Tsirkin <mst@redhat.com>
      Reviewed-by: 's avatarStefan Hajnoczi <stefanha@redhat.com>
      [ehabkost: fixed typo, fixed error_setg() format string]
      Signed-off-by: 's avatarEduardo Habkost <ehabkost@redhat.com>
  7. 18 Dec, 2017 1 commit
  8. 14 Dec, 2017 1 commit
  9. 16 Nov, 2017 1 commit
    • Dou Liyang's avatar
      NUMA: Enable adding NUMA node implicitly · 7b8be49d
      Dou Liyang authored
      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: 's avatarThadeu Lima de Souza Cascardo <cascardo@canonical.com>
      Suggested-by: 's avatarIgor Mammedov <imammedo@redhat.com>
      Signed-off-by: 's avatarDou 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: 's avatarIgor Mammedov <imammedo@redhat.com>
      Reviewed-by: 's avatarMichael S. Tsirkin <mst@redhat.com>
      Signed-off-by: 's avatarMichael S. Tsirkin <mst@redhat.com>
  10. 27 Oct, 2017 1 commit
    • Igor Mammedov's avatar
      numa: fixup parsed NumaNodeOptions earlier · cc001888
      Igor Mammedov authored
      numa 'mem' option with suffix or without one is possible
      only on CLI/HMP. Instead of fixing up special suffix less
      CLI case deep in parse_numa_node() do it earlier right
      after option is parsed into NumaNodeOptions with OptVisistor
      so that the rest of the code would use valid values in
      NumaNodeOptions and won't have to reparse QemuOpts.
      It will help to isolate CLI/HMP parts in parse_numa() and
      split out parsed NumaNodeOptions processing into separate
      function that could be reused by QMP handler where we have
      only NumaNodeOptions and don't need any fixups.
      While at it reuse qemu_strtosz_MiB() instead of manually
      checking for suffixes.
      Signed-off-by: 's avatarIgor Mammedov <imammedo@redhat.com>
      Message-Id: <1507801198-98182-1-git-send-email-imammedo@redhat.com>
      Reviewed-by: 's avatarEduardo Habkost <ehabkost@redhat.com>
      Signed-off-by: 's avatarEduardo Habkost <ehabkost@redhat.com>
  11. 19 Sep, 2017 1 commit
  12. 14 Sep, 2017 1 commit
  13. 14 Jul, 2017 1 commit
  14. 20 Jun, 2017 1 commit
  15. 05 Jun, 2017 3 commits
  16. 30 May, 2017 1 commit
    • Eduardo Habkost's avatar
      numa: Fix format string for "Invalid node" message · f892291e
      Eduardo Habkost authored
      Some compilers complain about the PRIu16 format string with the
      MAX(src, dst) and MAX_NODES arguments.  Example output from Apple LLVM
      version 7.3.0 (clang-703.0.31):
        numa.c:236:20: warning: format specifies type 'unsigned short' but the argument has type 'int' [-Wformat]
                           MAX(src, dst), MAX_NODES);
        include/qapi/error.h:163:35: note: expanded from macro 'error_setg'
                                (fmt), ## __VA_ARGS__)
        glib/2.52.2/include/glib-2.0/glib/gmacros.h:288:20: note: expanded from macro 'MAX'
        #define MAX(a, b)  (((a) > (b)) ? (a) : (b))
        numa.c:236:35: warning: format specifies type 'unsigned short' but the argument has type 'int' [-Wformat]
                           MAX(src, dst), MAX_NODES);
        include/qapi/error.h:163:35: note: expanded from macro 'error_setg'
                                (fmt), ## __VA_ARGS__)
        include/sysemu/sysemu.h:165:19: note: expanded from macro 'MAX_NODES'
        #define MAX_NODES 128
      MAX(src, dst) promotes the src and dst arguments to int, and MAX_NODES
      is an int.  Use %d to silence those warnings.
      Signed-off-by: 's avatarEduardo Habkost <ehabkost@redhat.com>
      Message-Id: <20170530184013.31044-1-ehabkost@redhat.com>
      Reviewed-by: 's avatarEric Blake <eblake@redhat.com>
      Signed-off-by: 's avatarEduardo Habkost <ehabkost@redhat.com>
  17. 11 May, 2017 11 commits
  18. 07 May, 2017 1 commit
  19. 22 Mar, 2017 1 commit
    • Laurent Vivier's avatar
      numa,spapr: align default numa node memory size to 256MB · 55641213
      Laurent Vivier authored
      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: 's avatarLaurent Vivier <lvivier@redhat.com>
      Signed-off-by: 's avatarDavid Gibson <david@gibson.dropbear.id.au>
  20. 22 Feb, 2017 1 commit
  21. 16 Jan, 2017 1 commit
  22. 12 Jan, 2017 2 commits
  23. 09 Oct, 2016 1 commit
  24. 07 Aug, 2016 1 commit
  25. 02 Aug, 2016 1 commit
    • Greg Kurz's avatar
      numa: set the memory backend "is_mapped" field · 0b217571
      Greg Kurz authored
      Commit 2aece63c "hostmem: detect host backend memory is being used properly"
      added a way to know if a memory backend is busy or available for use. It
      caused a slight regression if we pass the same backend to a NUMA node and
      to a pc-dimm device:
      -m 1G,slots=2,maxmem=2G \
      -object memory-backend-ram,size=1G,id=mem-mem1 \
      -device pc-dimm,id=dimm-mem1,memdev=mem-mem1 \
      -numa node,nodeid=0,memdev=mem-mem1
      Before commit 2aece63c, this would cause QEMU to print an error message and
      to exit gracefully:
      qemu-system-ppc64: -device pc-dimm,id=dimm-mem1,memdev=mem-mem1:
          can't use already busy memdev: mem-mem1
      Since commit 2aece63c, QEMU hits an assertion in the memory code:
      qemu-system-ppc64: memory.c:1934: memory_region_add_subregion_common:
          Assertion `!subregion->container' failed.
      This happens because pc-dimm devices don't use memory_region_is_mapped()
      anymore and cannot guess the backend is already used by a NUMA node.
      Let's revert to the previous behavior by turning the NUMA code to also
      call host_memory_backend_set_mapped() when it uses a backend.
      Fixes: 2aece63cSigned-off-by: 's avatarGreg Kurz <groug@kaod.org>
      Message-Id: <146891691503.15642.9817215371777203794.stgit@bahia.lan>
      Signed-off-by: 's avatarPaolo Bonzini <pbonzini@redhat.com>
  26. 06 Jul, 2016 1 commit