Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: pci
Commits on Jun 16, 2014
  1. @bonzini

    qdev: recursively unrealize devices when unrealizing bus

    bonzini authored committed
    When the patch was posted that became 5c21ce7 (qdev: Realize buses
    on device realization, 2014-03-12), it included recursive realization
    and unrealization of devices when the bus's "realized" property
    was toggled.
    
    However, due to the same old worries about recursive realization
    and prerequisites not being realized yet, those hunks were dropped when
    committing the patch.  Unfortunately, this causes a use-after-free bug
    (easily reproduced by a PCI hot-unplug action).
    
    Before the patch, device_unparent behaved as follows:
    
       for each child bus
         unparent bus ----------------------------.
         | for each child device                  |
         |   unparent device ---------------.     |
         |   | unrealize device             |     |
         |   | call dc->unparent            |     |
         |   '-------------------------------     |
         '----------------------------------------'
       unrealize device
    
    After the patch, it behaves as follows instead:
    
       unrealize device --------------------.
       | for each child bus                 |
       |   unrealize bus               (A)  |
       '------------------------------------'
       for each child bus
         unparent bus ----------------------.
         | for each child device            |
         |   unrealize device          (B)  |
         |   call dc->unparent              |
         '----------------------------------'
    
    At the step marked (B) the device might use data from the bus that is
    not available anymore due to step (A).
    
    To fix this, we need to unrealize devices before step (A).  To sidestep
    concerns about recursive realization, only do recursive unrealization
    and leave the "value && !bus->realized" case as it is.
    
    The resulting flow is:
    
       for each child bus
         unrealize bus ---------------------.
         | for each child device            |
         |   unrealize device          (B)  |
         | call bc->unrealize          (A)  |
         '----------------------------------'
       unrealize device
       for each child bus
         unparent bus ----------------------.
         | for each child device            |
         |   unparent device                |
         '----------------------------------'
    
    where everything is "powered down" before it is unassembled.
    
    Cc: qemu-stable@nongnu.org
    Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
    Tested-by: Michael S. Tsirkin <mst@redhat.com>
    Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
    Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
    Reviewed-by: Andreas Färber <afaerber@suse.de>
  2. @bonzini

    qdev: reorganize error reporting in bus_set_realized

    bonzini authored committed
    No semantic change.
    
    Cc: qemu-stable@nongnu.org
    Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
    Tested-by: Michael S. Tsirkin <mst@redhat.com>
    Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
    Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
    Reviewed-by: Andreas Färber <afaerber@suse.de>
  3. qapi: make string output visitor parse int list

    Hu Tao authored committed
    Signed-off-by: Hu Tao <hutao@cn.fujitsu.com>
    Acked-by: Michael S. Tsirkin <mst@redhat.com>
    Tested-by: Michael S. Tsirkin <mst@redhat.com>
    Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
    
    MST: split up patch
  4. qapi: make string input visitor parse int list

    Hu Tao authored committed
    Signed-off-by: Hu Tao <hutao@cn.fujitsu.com>
    Acked-by: Michael S. Tsirkin <mst@redhat.com>
    Tested-by: Michael S. Tsirkin <mst@redhat.com>
    Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
    
    MST: split up patch
  5. tests: fix memory leak in test of string input visitor

    Hu Tao authored committed
    Signed-off-by: Hu Tao <hutao@cn.fujitsu.com>
    Acked-by: Michael S. Tsirkin <mst@redhat.com>
  6. hmp: add info memdev

    Hu Tao authored committed
    This is the hmp counterpart of qmp query-memdev.
    
    Signed-off-by: Hu Tao <hutao@cn.fujitsu.com>
    Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
    Acked-by: Michael S. Tsirkin <mst@redhat.com>
    
    MST: fix build on 32 bit
  7. qmp: add query-memdev

    Hu Tao authored committed
    Add qmp command query-memdev to query for information
    of memory devices
    
    Signed-off-by: Hu Tao <hutao@cn.fujitsu.com>
    Acked-by: Michael S. Tsirkin <mst@redhat.com>
  8. hostmem: add properties for NUMA memory policy

    Hu Tao authored committed
    Signed-off-by: Hu Tao <hutao@cn.fujitsu.com>
    [Raise errors on setting properties if !CONFIG_NUMA.  Add BUILD_BUG_ON
     checks. - Paolo]
    Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
    Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
    Signed-off-by: Hu Tao <hutao@cn.fujitsu.com>
    Acked-by: Michael S. Tsirkin <mst@redhat.com>
  9. @bonzini

    hostmem: add property to map memory with MAP_SHARED

    bonzini authored committed
    A new "share" property can be used with the "memory-file" backend to
    map memory with MAP_SHARED instead of MAP_PRIVATE.
    
    Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
    Signed-off-by: Hu Tao <hutao@cn.fujitsu.com>
    Acked-by: Michael S. Tsirkin <mst@redhat.com>
  10. @bonzini

    hostmem: allow preallocation of any memory region

    bonzini authored committed
    And allow preallocation of file-based memory even without -mem-prealloc.
    Some care is necessary because -mem-prealloc does not allow disabling
    preallocation for hostmem-file.
    
    Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
    Signed-off-by: Hu Tao <hutao@cn.fujitsu.com>
    Acked-by: Michael S. Tsirkin <mst@redhat.com>
  11. @bonzini

    hostmem: add merge and dump properties

    bonzini authored committed
    Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
    Signed-off-by: Hu Tao <hutao@cn.fujitsu.com>
    Acked-by: Michael S. Tsirkin <mst@redhat.com>
  12. @bonzini

    hostmem: add file-based HostMemoryBackend

    bonzini authored committed
    Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
    Signed-off-by: Hu Tao <hutao@cn.fujitsu.com>
    Acked-by: Michael S. Tsirkin <mst@redhat.com>
    Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
    
    MST: comment tweak
  13. hostmem: separate allocation from UserCreatable complete method

    Hu Tao authored committed
    This allows the superclass to set various policies on the memory
    region that the subclass creates. Drops hostmem-ram's complete method
    accordingly.
    
    Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
    Signed-off-by: Hu Tao <hutao@cn.fujitsu.com>
    Acked-by: Michael S. Tsirkin <mst@redhat.com>
  14. backend:hostmem: replace hostmemory with host_memory

    Hu Tao authored committed
    ..to keep names consistant.
    
    Signed-off-by: Hu Tao <hutao@cn.fujitsu.com>
    Acked-by: Michael S. Tsirkin <mst@redhat.com>
  15. @bonzini

    pc: pass MachineState to pc_memory_init

    bonzini authored committed
    Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
    Signed-off-by: Hu Tao <hutao@cn.fujitsu.com>
    Reviewed-By: Igor Mammedov <imammedo@redhat.com>
    Acked-by: Michael S. Tsirkin <mst@redhat.com>
  16. @bonzini

    vl: redo -object parsing

    bonzini authored committed
    Follow the lines of the HMP implementation, using OptsVisitor
    to parse the options.  This gives access to OptsVisitor's
    rich parsing of integer lists.
    
    Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
    Signed-off-by: Hu Tao <hutao@cn.fujitsu.com>
    Acked-by: Michael S. Tsirkin <mst@redhat.com>
  17. @bonzini

    memory: add error propagation to file-based RAM allocation

    bonzini authored committed
    Right now, -mem-path will fall back to RAM-based allocation in some
    cases.  This should never happen with "-object memory-file", prepare
    the code by adding correct error propagation.
    
    Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
    Signed-off-by: Hu Tao <hutao@cn.fujitsu.com>
    Acked-by: Michael S. Tsirkin <mst@redhat.com>
  18. @bonzini

    memory: move mem_path handling to memory_region_allocate_system_memory

    bonzini authored committed
    Like the previous patch did in exec.c, split memory_region_init_ram and
    memory_region_init_ram_from_file, and push mem_path one step further up.
    Other RAM regions than system memory will now be backed by regular RAM.
    
    Also, boards that do not use memory_region_allocate_system_memory will
    not support -mem-path anymore.  This can be changed before the patches
    are merged by migrating boards to use the function.
    
    Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
    Signed-off-by: Hu Tao <hutao@cn.fujitsu.com>
    Acked-by: Michael S. Tsirkin <mst@redhat.com>
  19. @bonzini

    numa: add -numa node,memdev= option

    bonzini authored committed
    This option provides the infrastructure for binding guest NUMA nodes
    to host NUMA nodes.  For example:
    
     -object memory-ram,size=1024M,policy=bind,host-nodes=0,id=ram-node0 \
     -numa node,nodeid=0,cpus=0,memdev=ram-node0 \
     -object memory-ram,size=1024M,policy=interleave,host-nodes=1-3,id=ram-node1 \
     -numa node,nodeid=1,cpus=1,memdev=ram-node1
    
    The option replaces "-numa node,mem=".
    
    Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
    Signed-off-by: Hu Tao <hutao@cn.fujitsu.com>
    Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
    Acked-by: Michael S. Tsirkin <mst@redhat.com>
    
    MST: trivial conflict resolution
Commits on Jun 15, 2014
  1. qom: introduce object_property_get_enum and object_property_get_uint1…

    Hu Tao authored committed
    …6List
    
    Signed-off-by: Hu Tao <hutao@cn.fujitsu.com>
    Acked-by: Michael S. Tsirkin <mst@redhat.com>
  2. Introduce signed range.

    Hu Tao authored committed
    Signed-off-by: Hu Tao <hutao@cn.fujitsu.com>
    Acked-by: Michael S. Tsirkin <mst@redhat.com>
    Tested-by: Michael S. Tsirkin <mst@redhat.com>
    Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
    
    MST: split up patch
  3. @gaowanlong

    configure: add Linux libnuma detection

    gaowanlong authored committed
    Add detection of libnuma (mostly contained in the numactl package)
    to the configure script. Can be enabled or disabled on the command
    line, default is use if available.
    
    Signed-off-by: Andre Przywara <andre.przywara@amd.com>
    Signed-off-by: Wanlong Gao <gaowanlong@cn.fujitsu.com>
    Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
    Signed-off-by: Hu Tao <hutao@cn.fujitsu.com>
    Acked-by: Michael S. Tsirkin <mst@redhat.com>
  4. @bonzini

    memory: move RAM_PREALLOC_MASK to exec.c, rename

    bonzini authored committed
    Prepare for adding more flags.  The "_MASK" suffix is unique, kill it.
    
    Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
    Signed-off-by: Hu Tao <hutao@cn.fujitsu.com>
    Acked-by: Michael S. Tsirkin <mst@redhat.com>
  5. @bonzini

    memory: move preallocation code out of exec.c

    bonzini authored committed
    So that backends can use it.
    
    Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
    Signed-off-by: Hu Tao <hutao@cn.fujitsu.com>
    Acked-by: Michael S. Tsirkin <mst@redhat.com>
  6. @bonzini

    memory: reorganize file-based allocation

    bonzini authored committed
    Split the internal interface in exec.c to a separate function, and
    push the check on mem_path up to memory_region_init_ram.
    
    Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
    Signed-off-by: Hu Tao <hutao@cn.fujitsu.com>
    Acked-by: Michael S. Tsirkin <mst@redhat.com>
  7. @bonzini

    numa: introduce memory_region_allocate_system_memory

    bonzini authored committed
    Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
    Signed-off-by: Hu Tao <hutao@cn.fujitsu.com>
    Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
    Acked-by: Michael S. Tsirkin <mst@redhat.com>
    Reviewed-by: Eduardo Habkost <ehabkost@redhat.com>
    
    MST: resolve conflicts
  8. @bonzini

    qmp: improve error reporting for -object and object-add

    bonzini authored committed
    Use QERR_INVALID_PARAMETER_VALUE for consistency.
    
    Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
    Signed-off-by: Hu Tao <hutao@cn.fujitsu.com>
    Acked-by: Michael S. Tsirkin <mst@redhat.com>
  9. man: improve -numa doc

    Luiz Capitulino authored committed
    The -numa option documentation in qemu's manpage lacks the command-line
    options and some information regarding how it relates to options -m and
    -smp. This commit fills in the missing text.
    
    Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
    Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
    Signed-off-by: Hu Tao <hutao@cn.fujitsu.com>
    Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
    Reviewed-by: Eduardo Habkost <ehabkost@redhat.com>
    Acked-by: Michael S. Tsirkin <mst@redhat.com>
  10. @gaowanlong

    NUMA: expand MAX_NODES from 64 to 128

    gaowanlong authored committed
    libnuma choosed 128 for MAX_NODES, so we follow libnuma here.
    
    Signed-off-by: Wanlong Gao <gaowanlong@cn.fujitsu.com>
    Reviewed-by: Eduardo Habkost <ehabkost@redhat.com>
    Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
    Signed-off-by: Hu Tao <hutao@cn.fujitsu.com>
    Acked-by: Michael S. Tsirkin <mst@redhat.com>
  11. @gaowanlong

    NUMA: convert -numa option to use OptsVisitor

    gaowanlong authored committed
    Signed-off-by: Wanlong Gao <gaowanlong@cn.fujitsu.com>
    Signed-off-by: Igor Mammedov <imammedo@redhat.com>
    Tested-by: Eduardo Habkost <ehabkost@redhat.com>
    Reviewed-by: Eduardo Habkost <ehabkost@redhat.com>
    Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
    Signed-off-by: Hu Tao <hutao@cn.fujitsu.com>
    Acked-by: Michael S. Tsirkin <mst@redhat.com>
  12. @gaowanlong

    NUMA: Add numa_info structure to contain numa nodes info

    gaowanlong authored committed
    Add the numa_info structure to contain the numa nodes memory,
    VCPUs information and the future added numa nodes host memory
    policies.
    
    Reviewed-by: Eduardo Habkost <ehabkost@redhat.com>
    Signed-off-by: Andre Przywara <andre.przywara@amd.com>
    Signed-off-by: Wanlong Gao <gaowanlong@cn.fujitsu.com>
    [Fix hw/ppc/spapr.c - Paolo]
    Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
    
    Signed-off-by: Hu Tao <hutao@cn.fujitsu.com>
    Acked-by: Michael S. Tsirkin <mst@redhat.com>
  13. @gaowanlong

    NUMA: check if the total numa memory size is equal to ram_size

    gaowanlong authored committed
    If the total number of the assigned numa nodes memory is not
    equal to the assigned ram size, it will write the wrong data
    to ACPI table, then the guest will ignore the wrong ACPI table
    and recognize all memory to one node. It's buggy, we should
    check it to ensure that we write the right data to ACPI table.
    
    Signed-off-by: Wanlong Gao <gaowanlong@cn.fujitsu.com>
    Reviewed-by: Eduardo Habkost <ehabkost@redhat.com>
    Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
    Signed-off-by: Hu Tao <hutao@cn.fujitsu.com>
    Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
    Acked-by: Michael S. Tsirkin <mst@redhat.com>
    
    MST: error message reworded
  14. @gaowanlong

    NUMA: move numa related code to new file numa.c

    gaowanlong authored committed
    Signed-off-by: Wanlong Gao <gaowanlong@cn.fujitsu.com>
    Reviewed-by: Eduardo Habkost <ehabkost@redhat.com>
    Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
    Signed-off-by: Hu Tao <hutao@cn.fujitsu.com>
    Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
    Signed-off-by: Andre Przywara <andre.przywara@amd.com>
    Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
    Acked-by: Michael S. Tsirkin <mst@redhat.com>
    
    MST: comment tweaks
  15. @n-nikolaev

    Add qtest for vhost-user

    n-nikolaev authored committed
    This test creates a 'server' chardev to listen for vhost-user messages.
    Once VHOST_USER_SET_MEM_TABLE is received it mmaps each received region,
    and read 1k bytes from it. The read data is compared to data from readl.
    
    The test requires hugetlbfs to be already mounted and writable. The mount
    point defaults to '/hugetlbfs' and can be specified via the environment
    variable QTEST_HUGETLBFS_PATH.
    
    The rom pc-bios/pxe-virtio.rom is used to instantiate a virtio pcicontroller.
    
    Signed-off-by: Antonios Motakis <a.motakis@virtualopensystems.com>
    Signed-off-by: Nikolay Nikolaev <n.nikolaev@virtualopensystems.com>
    Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
    Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
    
    MST: fix up coding style
  16. @n-nikolaev

    libqemustub: add stubs to be able to use qemu-char.c

    n-nikolaev authored committed
    chardev depends on lots of external symbols that are not necessarily
    needed to be able to use, for example, 'socket chardev'. So add stubs
    for these functions:
    
     - bdrv_commit_all
     - qemu_chr_open_msmouse
     - is_daemonized
     - qemu_add_machine_init_done_notifier
     - monitor_init
     - qemu_notify_event
     - vc_init
    
    and this array:
    
     - serial_hds
    
    Signed-off-by: Antonios Motakis <a.motakis@virtualopensystems.com>
    Signed-off-by: Nikolay Nikolaev <n.nikolaev@virtualopensystems.com>
    Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
    Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Something went wrong with that request. Please try again.