1. 06 6月, 2017 3 次提交
    • D
      spapr: Move DRC RTAS calls into spapr_drc.c · b89b3d39
      David Gibson 提交于
      Currently implementations of the RTAS calls related to DRCs are in
      spapr_rtas.c.  They belong better in spapr_drc.c - that way they're closer
      to related code, and we'll be able to make some more things local.
      
      spapr_rtas.c was intended to contain the RTAS infrastructure and core calls
      that don't belong anywhere else, not every RTAS implementation.
      
      Code motion only.
      Signed-off-by: NDavid Gibson <david@gibson.dropbear.id.au>
      Reviewed-by: NGreg Kurz <groug@kaod.org>
      Tested-by: NDaniel Barboza <danielhb@linux.vnet.ibm.com>
      b89b3d39
    • D
      migration: Mark CPU states dirty before incoming migration/loadvm · 75e972da
      David Gibson 提交于
      As a rule, CPU internal state should never be updated when
      !cpu->kvm_vcpu_dirty (or the HAX equivalent).  If that is done, then
      subsequent calls to cpu_synchronize_state() - usually safe and idempotent -
      will clobber state.
      
      However, we routinely do this during a loadvm or incoming migration.
      Usually this is called shortly after a reset, which will clear all the cpu
      dirty flags with cpu_synchronize_all_post_reset().  Nothing is expected
      to set the dirty flags again before the cpu state is loaded from the
      incoming stream.
      
      This means that it isn't safe to call cpu_synchronize_state() from a
      post_load handler, which is non-obvious and potentially inconvenient.
      
      We could cpu_synchronize_all_state() before the loadvm, but that would be
      overkill since a) we expect the state to already be synchronized from the
      reset and b) we expect to completely rewrite the state with a call to
      cpu_synchronize_all_post_init() at the end of qemu_loadvm_state().
      
      To clear this up, this patch introduces cpu_synchronize_pre_loadvm() and
      associated helpers, which simply marks the cpu state as dirty without
      actually changing anything.  i.e. it says we want to discard any existing
      KVM (or HAX) state and replace it with what we're going to load.
      
      Cc: Juan Quintela <quintela@redhat.com>
      Cc: Dave Gilbert <dgilbert@redhat.com>
      Signed-off-by: NDavid Gibson <david@gibson.dropbear.id.au>
      Reviewed-by: NJuan Quintela <quintela@redhat.com>
      75e972da
    • L
      migration: remove register_savevm() · 1b6e7482
      Laurent Vivier 提交于
      We can replace the four remaining calls of register_savevm() by
      calls to register_savevm_live(). So we can remove the function and
      as we don't allocate anymore the ops pointer with g_new0()
      we don't have to free it then.
      Signed-off-by: NLaurent Vivier <lvivier@redhat.com>
      Reviewed-by: NJuan Quintela <quintela@redhat.com>
      Signed-off-by: NDavid Gibson <david@gibson.dropbear.id.au>
      1b6e7482
  2. 05 6月, 2017 3 次提交
    • P
      Merge remote-tracking branch 'remotes/mjt/tags/trivial-patches-fetch' into staging · 199e19ee
      Peter Maydell 提交于
      trivial patches for 2017-06-05
      
      # gpg: Signature made Mon 05 Jun 2017 15:23:46 BST
      # gpg:                using RSA key 0x701B4F6B1A693E59
      # gpg: Good signature from "Michael Tokarev <mjt@tls.msk.ru>"
      # gpg:                 aka "Michael Tokarev <mjt@corpit.ru>"
      # gpg:                 aka "Michael Tokarev <mjt@debian.org>"
      # Primary key fingerprint: 6EE1 95D1 886E 8FFB 810D  4324 457C E0A0 8044 65C5
      #      Subkey fingerprint: 7B73 BAD6 8BE7 A2C2 8931  4B22 701B 4F6B 1A69 3E59
      
      * remotes/mjt/tags/trivial-patches-fetch: (21 commits)
        hw/core: nmi.c can be compiled as common-obj nowadays
        dump: fix memory_mapping_filter leak
        ide-test: check return of fwrite
        help: Add newline to end of thread option help text
        qemu-ga: remove useless allocation
        scsi/lsi53c895a: Remove unused lsi_mem_*() return value
        qapi: Fix some QMP documentation regressions
        hw/mips: add missing include
        register: display register prefix (name) since it is available
        hw/sparc: use ARRAY_SIZE() macro
        hw/xtensa: sim: use g_string/g_new
        target/arm: add data cache invalidation cp15 instruction to cortex-r5
        block: Correct documentation for BLOCK_WRITE_THRESHOLD
        trivial: Remove unneeded ifndef in memory.h
        altera_timer: fix incorrect memset
        configure: Detect native NetBSD curses(3)
        tests/libqtest: Print error instead of aborting when env variable is missing
        docs/qdev-device-use.txt: update section Default Devices
        docs qemu-doc: Avoid ide-drive, it's deprecated
        qemu-doc: Add hyperlinks to further license information
        ...
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      199e19ee
    • T
      hw/core: nmi.c can be compiled as common-obj nowadays · 03e947f9
      Thomas Huth 提交于
      The target-specific code in nmi.c has been removed with this commit:
      
      	commit f7e981f2
      	nmi: remove x86 specific nmi handling
      Signed-off-by: NThomas Huth <thuth@redhat.com>
      Reviewed-by: NJuan Quintela <quintela@redhat.com>
      Signed-off-by: NMichael Tokarev <mjt@tls.msk.ru>
      03e947f9
    • P
      Merge remote-tracking branch 'remotes/elmarco/tags/chrfe-pull-request' into staging · cb8b8ef4
      Peter Maydell 提交于
      # gpg: Signature made Fri 02 Jun 2017 20:12:48 BST
      # gpg:                using RSA key 0xDAE8E10975969CE5
      # gpg: Good signature from "Marc-André Lureau <marcandre.lureau@redhat.com>"
      # gpg:                 aka "Marc-André Lureau <marcandre.lureau@gmail.com>"
      # gpg: WARNING: This key is not certified with sufficiently trusted signatures!
      # gpg:          It is not certain that the signature belongs to the owner.
      # Primary key fingerprint: 87A9 BD93 3F87 C606 D276  F62D DAE8 E109 7596 9CE5
      
      * remotes/elmarco/tags/chrfe-pull-request:
        char: move char devices to chardev/
        char: make chr_fe_deinit() optionaly delete backend
        char: rename functions that are not part of fe
        char: move CharBackend handling in char-fe unit
        char: generalize qemu_chr_write_all()
        be-hci: use backend functions
        chardev: serial & parallel declaration to own headers
        chardev: move headers to include/chardev
        Remove/replace sysemu/char.h inclusion
        char-win: close file handle except with console
        char-win: rename hcom->file
        char-win: rename win_chr_init/poll win_chr_serial_init/poll
        char-win: remove WinChardev.len
        char-win: simplify win_chr_read()
        char: cast ARRAY_SIZE() as signed to silent warning on empty array
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      cb8b8ef4
  3. 04 6月, 2017 20 次提交
  4. 03 6月, 2017 1 次提交
    • P
      Merge remote-tracking branch 'remotes/mst/tags/for_upstream' into staging · c6e84fbd
      Peter Maydell 提交于
      virtio, vhost: fixes, features
      
      IOTLB support in vhost-user.
      A bunch of fixes all over the place.
      Signed-off-by: NMichael S. Tsirkin <mst@redhat.com>
      
      # gpg: Signature made Fri 02 Jun 2017 17:33:25 BST
      # gpg:                using RSA key 0x281F0DB8D28D5469
      # gpg: Good signature from "Michael S. Tsirkin <mst@kernel.org>"
      # gpg:                 aka "Michael S. Tsirkin <mst@redhat.com>"
      # Primary key fingerprint: 0270 606B 6F3C DF3D 0B17  0970 C350 3912 AFBE 8E67
      #      Subkey fingerprint: 5D09 FD08 71C8 F85B 94CA  8A0D 281F 0DB8 D28D 5469
      
      * remotes/mst/tags/for_upstream:
        spec/vhost-user spec: Add IOMMU support
        vhost-user: add slave-req-fd support
        vhost-user: add vhost_user to hold the chr
        vhost: rework IOTLB messaging
        vhost: propagate errors in vhost_device_iotlb_miss()
        virtio-serial: fix segfault on disconnect
        virtio: add virtqueue_alloc_element tracepoint
        virtio-serial-bus: Unset hotplug handler when unrealize
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      c6e84fbd
  5. 02 6月, 2017 13 次提交
    • M
      spec/vhost-user spec: Add IOMMU support · 6dcdd06e
      Maxime Coquelin 提交于
      This patch specifies and implements the master/slave communication
      to support device IOTLB in slave.
      
      The vhost_iotlb_msg structure introduced for kernel backends is
      re-used, making the design close between the two backends.
      
      An exception is the use of the secondary channel to enable the
      slave to send IOTLB miss requests to the master.
      Signed-off-by: NMaxime Coquelin <maxime.coquelin@redhat.com>
      Reviewed-by: NMichael S. Tsirkin <mst@redhat.com>
      Signed-off-by: NMichael S. Tsirkin <mst@redhat.com>
      6dcdd06e
    • M
      vhost-user: add slave-req-fd support · 4bbeeba0
      Marc-André Lureau 提交于
      Learn to give a socket to the slave to let him make requests to the
      master.
      Signed-off-by: NMarc-André Lureau <marcandre.lureau@redhat.com>
      Signed-off-by: NMaxime Coquelin <maxime.coquelin@redhat.com>
      Reviewed-by: NMichael S. Tsirkin <mst@redhat.com>
      Signed-off-by: NMichael S. Tsirkin <mst@redhat.com>
      4bbeeba0
    • M
      vhost-user: add vhost_user to hold the chr · 2152f3fe
      Marc-André Lureau 提交于
      Next patches will add more fields to the structure
      Signed-off-by: NMarc-André Lureau <marcandre.lureau@redhat.com>
      Signed-off-by: NMaxime Coquelin <maxime.coquelin@redhat.com>
      Reviewed-by: NMichael S. Tsirkin <mst@redhat.com>
      Signed-off-by: NMichael S. Tsirkin <mst@redhat.com>
      2152f3fe
    • M
      vhost: rework IOTLB messaging · 020e571b
      Maxime Coquelin 提交于
      This patch reworks IOTLB messaging to prepare for vhost-user
      device IOTLB support.
      
      IOTLB messages handling is extracted from vhost-kernel backend,
      so that only the messages transport remains backend specifics.
      Signed-off-by: NMaxime Coquelin <maxime.coquelin@redhat.com>
      Reviewed-by: NMichael S. Tsirkin <mst@redhat.com>
      Signed-off-by: NMichael S. Tsirkin <mst@redhat.com>
      020e571b
    • M
      vhost: propagate errors in vhost_device_iotlb_miss() · fc58bd0d
      Maxime Coquelin 提交于
      Some backends might want to know when things went wrong.
      Signed-off-by: NMaxime Coquelin <maxime.coquelin@redhat.com>
      Reviewed-by: NMichael S. Tsirkin <mst@redhat.com>
      Signed-off-by: NMichael S. Tsirkin <mst@redhat.com>
      fc58bd0d
    • S
      virtio-serial: fix segfault on disconnect · 46764fe0
      Stefan Hajnoczi 提交于
      Since commit d4c19cde ("virtio-serial:
      add missing virtio_detach_element() call") the following commands may
      cause QEMU to segfault:
      
        $ qemu -M accel=kvm -cpu host -m 1G \
               -drive if=virtio,file=test.img,format=raw \
               -device virtio-serial-pci,id=virtio-serial0 \
               -chardev socket,id=channel1,path=/tmp/chardev.sock,server,nowait \
               -device virtserialport,chardev=channel1,bus=virtio-serial0.0,id=port1
        $ nc -U /tmp/chardev.sock
        ^C
      
        (guest)$ cat /dev/zero >/dev/vport0p1
      
      The segfault is non-deterministic: if the event loop notices the socket
      has been closed then there is no crash.  The disconnect has to happen
      right before QEMU attempts to write data to the socket.
      
      The backtrace is as follows:
      
        Thread 1 "qemu-system-x86" received signal SIGSEGV, Segmentation fault.
        0x00005555557e0698 in do_flush_queued_data (port=0x5555582cedf0, vq=0x7fffcc854290, vdev=0x55555807b1d0) at hw/char/virtio-serial-bus.c:180
        180           for (i = port->iov_idx; i < port->elem->out_num; i++) {
        #1  0x000055555580d363 in virtio_queue_notify_vq (vq=0x7fffcc854290) at hw/virtio/virtio.c:1524
        #2  0x000055555580d363 in virtio_queue_host_notifier_read (n=0x7fffcc8542f8) at hw/virtio/virtio.c:2430
        #3  0x0000555555b3482c in aio_dispatch_handlers (ctx=ctx@entry=0x5555566b8c80) at util/aio-posix.c:399
        #4  0x0000555555b350d8 in aio_dispatch (ctx=0x5555566b8c80) at util/aio-posix.c:430
        #5  0x0000555555b3212e in aio_ctx_dispatch (source=<optimized out>, callback=<optimized out>, user_data=<optimized out>) at util/async.c:261
        #6  0x00007fffde71de52 in g_main_context_dispatch () at /lib64/libglib-2.0.so.0
        #7  0x0000555555b34353 in glib_pollfds_poll () at util/main-loop.c:213
        #8  0x0000555555b34353 in os_host_main_loop_wait (timeout=<optimized out>) at util/main-loop.c:261
        #9  0x0000555555b34353 in main_loop_wait (nonblocking=<optimized out>) at util/main-loop.c:517
        #10 0x0000555555773207 in main_loop () at vl.c:1917
        #11 0x0000555555773207 in main (argc=<optimized out>, argv=<optimized out>, envp=<optimized out>) at vl.c:4751
      
      The do_flush_queued_data() function does not anticipate chardev close
      events during vsc->have_data().  It expects port->elem to remain
      non-NULL for the duration its for loop.
      
      The fix is simply to return from do_flush_queued_data() if the port
      closes because the close event already frees port->elem and drains the
      virtqueue - there is nothing left for do_flush_queued_data() to do.
      Reported-by: NSitong Liu <siliu@redhat.com>
      Reported-by: NMin Deng <mdeng@redhat.com>
      Signed-off-by: NStefan Hajnoczi <stefanha@redhat.com>
      Reviewed-by: NMichael S. Tsirkin <mst@redhat.com>
      Signed-off-by: NMichael S. Tsirkin <mst@redhat.com>
      46764fe0
    • P
      virtio: add virtqueue_alloc_element tracepoint · b0ac429f
      Paolo Bonzini 提交于
      This tracepoint can help diagnosing failures due to memory
      fragmentation in the guest.
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      Reviewed-by: NMichael S. Tsirkin <mst@redhat.com>
      Signed-off-by: NMichael S. Tsirkin <mst@redhat.com>
      b0ac429f
    • L
      virtio-serial-bus: Unset hotplug handler when unrealize · f811f970
      Ladi Prosek 提交于
      Virtio serial device controls the lifetime of virtio-serial-bus and
      virtio-serial-bus links back to the device via its hotplug-handler
      property. This extra ref-count prevents the device from getting
      finalized, leaving the VirtIODevice memory listener registered and
      leading to use-after-free later on.
      
      This patch addresses the same issue as Fam Zheng's
      "virtio-scsi: Unset hotplug handler when unrealize"
      only for a different virtio device.
      
      Cc: qemu-stable@nongnu.org
      Signed-off-by: NLadi Prosek <lprosek@redhat.com>
      Reviewed-by: NMichael S. Tsirkin <mst@redhat.com>
      Signed-off-by: NMichael S. Tsirkin <mst@redhat.com>
      Reviewed-by: NPaolo Bonzini <pbonzini@redhat.com>
      Reviewed-by: NFam Zheng <famz@redhat.com>
      f811f970
    • P
      Merge remote-tracking branch 'remotes/cody/tags/block-pull-request' into staging · e32fb6da
      Peter Maydell 提交于
      # gpg: Signature made Fri 02 Jun 2017 16:32:39 BST
      # gpg:                using RSA key 0xBDBE7B27C0DE3057
      # gpg: Good signature from "Jeffrey Cody <jcody@redhat.com>"
      # gpg:                 aka "Jeffrey Cody <jeff@codyprime.org>"
      # gpg:                 aka "Jeffrey Cody <codyprime@gmail.com>"
      # Primary key fingerprint: 9957 4B4D 3474 90E7 9D98  D624 BDBE 7B27 C0DE 3057
      
      * remotes/cody/tags/block-pull-request:
        gluster: add support for PREALLOC_MODE_FALLOC
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      e32fb6da
    • N
      gluster: add support for PREALLOC_MODE_FALLOC · df3a429a
      Niels de Vos 提交于
      Add missing support for "preallocation=falloc" to the Gluster block
      driver. This change bases its logic on that of block/file-posix.c and
      removed the gluster_supports_zerofill() and qemu_gluster_zerofill()
      functions in favour of #ifdef checks in an easy to read
      switch-statement.
      
      Both glfs_zerofill() and glfs_fallocate() have been introduced with
      GlusterFS 3.5.0 (pkg-config glusterfs-api = 6). A #define for the
      availability of glfs_fallocate() has been added to ./configure.
      Reported-by: NSatheesaran Sundaramoorthi <sasundar@redhat.com>
      Signed-off-by: NNiels de Vos <ndevos@redhat.com>
      Message-id: 20170528063114.28691-1-ndevos@redhat.com
      URL: https://bugzilla.redhat.com/1450759Signed-off-by: NNiels de Vos <ndevos@redhat.com>
      Signed-off-by: NJeff Cody <jcody@redhat.com>
      df3a429a
    • P
      Merge remote-tracking branch 'remotes/mcayland/tags/qemu-sparc-signed' into staging · 1448228a
      Peter Maydell 提交于
      qemu-sparc update
      
      # gpg: Signature made Fri 02 Jun 2017 06:09:17 BST
      # gpg:                using RSA key 0x5BC2C56FAE0F321F
      # gpg: Good signature from "Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>"
      # Primary key fingerprint: CC62 1AB9 8E82 200D 915C  C9C4 5BC2 C56F AE0F 321F
      
      * remotes/mcayland/tags/qemu-sparc-signed:
        hw/sparc64: QOM'ify sun4u.c
        hw/sparc: QOM'ify sun4m.c
        hw/timer: QOM'ify slavio_timer
        hw/timer: QOM'ify m48txx_sysbus
        hw/misc: QOM'ify slavio_misc.c
        hw/dma: QOM'ify sun4m_iommu.c
        hw/dma: QOM'ify sparc32_dma.c
        hw/misc: QOM'ify eccmemctl.c
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      1448228a
    • P
      Merge remote-tracking branch 'remotes/juanquintela/tags/migration/20170601' into staging · d47a851c
      Peter Maydell 提交于
      migration/next for 20170601
      
      # gpg: Signature made Thu 01 Jun 2017 17:51:04 BST
      # gpg:                using RSA key 0xF487EF185872D723
      # gpg: Good signature from "Juan Quintela <quintela@redhat.com>"
      # gpg:                 aka "Juan Quintela <quintela@trasno.org>"
      # Primary key fingerprint: 1899 FF8E DEBF 58CC EE03  4B82 F487 EF18 5872 D723
      
      * remotes/juanquintela/tags/migration/20170601:
        migration: Move include/migration/block.h into migration/
        migration: Export ram.c functions in its own file
        migration: Create include for migration snapshots
        migration: Export rdma.c functions in its own file
        migration: Export tls.c functions in its own file
        migration: Export socket.c functions in its own file
        migration: Export fd.c functions in its own file
        migration: Export exec.c functions in its own file
        migration: Split qemu-file.h
        migration: Remove unneeded includes of migration/vmstate.h
        migration: shut src return path unconditionally
        migration: fix leak of src file on dst
        migration: Remove section_id parameter from vmstate_load
        migration: loadvm handlers are not used
        migration: Use savevm_handlers instead of loadvm copy
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      d47a851c
    • P
      Merge remote-tracking branch 'remotes/pmaydell/tags/pull-target-arm-20170602' into staging · 7693cd7c
      Peter Maydell 提交于
      target-arm queue:
       * virt: numa: provide ACPI distance info when needed
       * aspeed: fix i2c controller bugs
       * M profile: support MPU
       * gicv3: fix mishandling of BPR1, VBPR1
       * load_uboot_image: don't assume a full header read
       * libvixl: Correct build failures on NetBSD
      
      # gpg: Signature made Fri 02 Jun 2017 12:00:42 BST
      # gpg:                using RSA key 0x3C2525ED14360CDE
      # gpg: Good signature from "Peter Maydell <peter.maydell@linaro.org>"
      # gpg:                 aka "Peter Maydell <pmaydell@gmail.com>"
      # gpg:                 aka "Peter Maydell <pmaydell@chiark.greenend.org.uk>"
      # Primary key fingerprint: E1A5 C593 CD41 9DE2 8E83  15CF 3C25 25ED 1436 0CDE
      
      * remotes/pmaydell/tags/pull-target-arm-20170602: (25 commits)
        hw/arm/virt: fdt: generate distance-map when needed
        hw/arm/virt-acpi-build: build SLIT when needed
        aspeed: add some I2C devices to the Aspeed machines
        aspeed/i2c: introduce a state machine
        aspeed/i2c: handle LAST command under the RX command
        aspeed/i2c: improve command handling
        arm: Implement HFNMIENA support for M profile MPU
        arm: add MPU support to M profile CPUs
        armv7m: Classify faults as MemManage or BusFault
        arm: All M profile cores are PMSA
        armv7m: Implement M profile default memory map
        armv7m: Improve "-d mmu" tracing for PMSAv7 MPU
        arm: Remove unnecessary check on cpu->pmsav7_dregion
        arm: Don't let no-MPU PMSA cores write to SCTLR.M
        arm: Don't clear ARM_FEATURE_PMSA for no-mpu configs
        arm: Clean up handling of no-MPU PMSA CPUs
        arm: Use different ARMMMUIdx values for M profile
        arm: Add support for M profile CPUs having different MMU index semantics
        arm: Use the mmu_idx we're passed in arm_cpu_do_unaligned_access()
        target/arm: clear PMUVER field of AA64DFR0 when vPMU=off
        ...
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      7693cd7c