1. 08 4月, 2015 1 次提交
  2. 04 4月, 2015 1 次提交
  3. 02 4月, 2015 2 次提交
  4. 01 4月, 2015 2 次提交
    • P
      rcu: do not create thread in pthread_atfork callback · a59629fc
      Paolo Bonzini 提交于
      If QEMU forks after the CPU threads have been created, qemu_mutex_lock_iothread
      will not be able to do qemu_cpu_kick_thread.  There is no solution other than
      assuming that forks after the CPU threads have been created will end up in an
      exec.  Forks before the CPU threads have been created (such as -daemonize)
      have to call rcu_after_fork manually.
      
      Notably, the oxygen theme for GTK+ forks and shows a "No such process" error
      without this patch.
      
      This patch can be reverted once the iothread loses the "kick the TCG thread"
      magic.
      
      User-mode emulation does not use the iothread, so it can also call
      rcu_after_fork.
      
      Reported by: Dr. David Alan Gilbert <dgilbert@redhat.com>
      Tested by: Dr. David Alan Gilbert <dgilbert@redhat.com>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      a59629fc
    • L
      qom: Add can_be_deleted callback to UserCreatableClass · d6edb155
      Lin Ma 提交于
      If backends implement the can_be_deleted and it returns false,
      Then the qmp_object_del won't delete the given backends.
      Signed-off-by: NLin Ma <lma@suse.com>
      Message-Id: <1427704589-7688-2-git-send-email-lma@suse.com>
      Reviewed-by: NIgor Mammedov <imammedo@redhat.com>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      d6edb155
  5. 26 3月, 2015 1 次提交
  6. 20 3月, 2015 1 次提交
  7. 19 3月, 2015 3 次提交
    • A
      virtio: serial: expose a 'guest_writable' callback for users · 4add73aa
      Amit Shah 提交于
      Users of virtio-serial may want to know when a port becomes writable.  A
      port can stop accepting writes if the guest port is open but not being
      read from.  In this case, data gets queued up in the virtqueue, and
      after the vq is full, writes to the port do not succeed.
      
      When the guest reads off a vq element, and adds a new one for the host
      to put data in, we can tell users the port is available for more writes,
      via the new ->guest_writable() callback.
      Reviewed-by: NMarkus Armbruster <armbru@redhat.com>
      Signed-off-by: NAmit Shah <amit.shah@redhat.com>
      4add73aa
    • S
      elf-loader: Add missing error handling for call of lseek · 23bf2e76
      Stefan Weil 提交于
      This fixes a warning from Coverity.
      Signed-off-by: NStefan Weil <sw@weilnetz.de>
      Reviewed-by: NThomas Huth <thuth@linux.vnet.ibm.com>
      Signed-off-by: NMichael Tokarev <mjt@tls.msk.ru>
      23bf2e76
    • S
      Fix remaining warnings from Sparse (void return) · e7ae771f
      Stefan Weil 提交于
      Sparse report:
      
      hw/display/vga.c:2000:5: warning: returning void-valued expression
      hw/intc/arm_gic.c:707:9: warning: returning void-valued expression
      hw/intc/etraxfs_pic.c:138:9: warning: returning void-valued expression
      hw/nvram/fw_cfg.c:475:5: warning: returning void-valued expression
      hw/timer/a9gtimer.c:124:5: warning: returning void-valued expression
      hw/tpm/tpm_tis.c:794:5: warning: returning void-valued expression
      hw/usb/hcd-musb.c:558:9: warning: returning void-valued expression
      hw/usb/hcd-musb.c:776:13: warning: returning void-valued expression
      hw/usb/hcd-musb.c:867:5: warning: returning void-valued expression
      hw/usb/hcd-musb.c:932:5: warning: returning void-valued expression
      include/qom/cpu.h:584:5: warning: returning void-valued expression
      monitor.c:4686:13: warning: returning void-valued expression
      monitor.c:4690:13: warning: returning void-valued expression
      
      Cc: Edgar E. Iglesias <edgar.iglesias@gmail.com>
      Cc: Gerd Hoffmann <kraxel@redhat.com>
      Cc: Andreas Färber <afaerber@suse.de>
      Cc: Luiz Capitulino <lcapitulino@redhat.com>
      Signed-off-by: NStefan Weil <sw@weilnetz.de>
      Signed-off-by: NMichael Tokarev <mjt@tls.msk.ru>
      e7ae771f
  8. 18 3月, 2015 6 次提交
  9. 17 3月, 2015 4 次提交
  10. 16 3月, 2015 3 次提交
  11. 14 3月, 2015 1 次提交
    • R
      tcg: Change translator-side labels to a pointer · 42a268c2
      Richard Henderson 提交于
      This is improved type checking for the translators -- it's no longer
      possible to accidentally swap arguments to the branch functions.
      
      Note that the code generating backends still manipulate labels as int.
      
      With notable exceptions, the scope of the change is just a few lines
      for each target, so it's not worth building extra machinery to do this
      change in per-target increments.
      
      Cc: Peter Maydell <peter.maydell@linaro.org>
      Cc: Edgar E. Iglesias <edgar.iglesias@gmail.com>
      Cc: Michael Walle <michael@walle.cc>
      Cc: Leon Alrae <leon.alrae@imgtec.com>
      Cc: Anthony Green <green@moxielogic.com>
      Cc: Jia Liu <proljc@gmail.com>
      Cc: Alexander Graf <agraf@suse.de>
      Cc: Aurelien Jarno <aurelien@aurel32.net>
      Cc: Blue Swirl <blauwirbel@gmail.com>
      Cc: Guan Xuetao <gxt@mprc.pku.edu.cn>
      Cc: Paolo Bonzini <pbonzini@redhat.com>
      Cc: Max Filippov <jcmvbkbc@gmail.com>
      Reviewed-by: NBastian Koppelmann <kbastian@mail.uni-paderborn.de>
      Signed-off-by: NRichard Henderson <rth@twiddle.net>
      42a268c2
  12. 13 3月, 2015 1 次提交
    • P
      queue: fix QSLIST_INSERT_HEAD_ATOMIC race · 2120465f
      Paolo Bonzini 提交于
      There is a not-so-subtle race in QSLIST_INSERT_HEAD_ATOMIC.
      
      Because atomic_cmpxchg returns the old value instead of a success flag,
      QSLIST_INSERT_HEAD_ATOMIC was checking for success by comparing against
      the second argument to atomic_cmpxchg.  Unfortunately, this only works
      if the second argument is a local or thread-local variable.
      
      If it is in memory, it can be subject to common subexpression elimination
      (and then everything's fine) or reloaded after the atomic_cmpxchg,
      depending on the compiler's whims.  If the latter happens, the race can
      happen.  A thread can sneak in, doing something on elm->field.sle_next
      after the atomic_cmpxchg and before the comparison.  This causes a wrong
      failure, and then two threads are using "elm" at the same time.  In the
      case discovered by Christian, the sequence was likely something like this:
      
          thread 1                   | thread 2
          QSLIST_INSERT_HEAD_ATOMIC  |
            atomic_cmpxchg succeeds  |
            elm added to list        |
                                     | steal release_pool
                                     | QSLIST_REMOVE_HEAD
                                     | elm removed from list
                                     | ...
                                     | QSLIST_INSERT_HEAD_ATOMIC
                                     |   (overwrites sle_next)
            spurious failure         |
            atomic_cmpxchg succeeds  |
            elm added to list again  |
                                     |
          steal release_pool         |
          QSLIST_REMOVE_HEAD         |
          elm removed again          |
      
      The last three steps could be done by a third thread as well.
      A reproducer that failed in a matter of seconds is as follows:
      
      - the guest has 32 VCPUs on a 28 core host (hyperthreading was enabled),
        memory was 16G just to err on the safe side (the host has 64G, but hey
        at least you need no s390)
      
      - the guest has 24 null-aio virtio-blk devices using dataplane
        (-object iothread,id=ioN -drive if=none,id=blkN,driver=null-aio,size=500G
        -device virtio-blk-pci,iothread=ioN,drive=blkN)
      
      - the guest also has a single network interface.  It's only doing loopback
        tests so slirp vs. tap and the model doesn't matter.
      
      - the guest is running fio with the following script:
      
           [global]
           rw=randread
           blocksize=16k
           ioengine=libaio
           runtime=10m
           buffered=0
           fallocate=none
           time_based
           iodepth=32
      
           [virtio1a]
           filename=/dev/block/252\:16
      
           [virtio1b]
           filename=/dev/block/252\:16
      
           ...
      
           [virtio24a]
           filename=/dev/block/252\:384
      
           [virtio24b]
           filename=/dev/block/252\:384
      
           [listen1]
           protocol=tcp
           ioengine=net
           port=12345
           listen
           rw=read
           bs=4k
           size=1000g
      
           [connect1]
           protocol=tcp
           hostname=localhost
           ioengine=net
           port=12345
           protocol=tcp
           rw=write
           startdelay=1
           size=1000g
      
           ...
      
           [listen8]
           protocol=tcp
           ioengine=net
           port=12352
           listen
           rw=read
           bs=4k
           size=1000g
      
           [connect8]
           protocol=tcp
           hostname=localhost
           ioengine=net
           port=12352
           rw=write
           startdelay=1
           size=1000g
      
      Moral of the story: I should refrain from writing more clever stuff.
      At least it looks like it is not too clever to be undebuggable.
      Reported-by: NChristian Borntraeger <borntraeger@de.ibm.com>
      Tested-by: NChristian Borntraeger <borntraeger@de.ibm.com>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      Message-id: 1426002357-6889-1-git-send-email-pbonzini@redhat.com
      Fixes: c740ad92Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      Signed-off-by: NStefan Hajnoczi <stefanha@redhat.com>
      2120465f
  13. 12 3月, 2015 14 次提交