Skip to content
Snippets Groups Projects
  1. Jun 27, 2014
  2. Jun 26, 2014
    • Peter Maydell's avatar
      coroutine-win32.c: Add noinline attribute to work around gcc bug · ff4873cb
      Peter Maydell authored
      
      A gcc codegen bug in x86_64-w64-mingw32-gcc (GCC) 4.6.3 means that
      non-debug builds of QEMU for Windows tend to assert when using
      coroutines. Work around this by marking qemu_coroutine_switch
      as noinline.
      
      If we allow gcc to inline qemu_coroutine_switch into
      coroutine_trampoline, then it hoists the code to get the
      address of the TLS variable "current" out of the while() loop.
      This is an invalid transformation because the SwitchToFiber()
      call may be called when running thread A but return in thread B,
      and so we might be in a different thread context each time
      round the loop. This can happen quite often.  Typically.
      a coroutine is started when a VCPU thread does bdrv_aio_readv:
      
           VCPU thread
      
           main VCPU thread coroutine      I/O coroutine
              bdrv_aio_readv ----->
                                           start I/O operation
                                             thread_pool_submit_co
                             <------------ yields
              back to emulation
      
      Then I/O finishes and the thread-pool.c event notifier triggers in
      the I/O thread.  event_notifier_ready calls thread_pool_co_cb, and
      the I/O coroutine now restarts *in another thread*:
      
           iothread
      
           main iothread coroutine         I/O coroutine (formerly in VCPU thread)
              event_notifier_ready
                thread_pool_co_cb ----->   current = I/O coroutine;
                                           call AIO callback
      
      But on Win32, because of the bug, the "current" being set here the
      current coroutine of the VCPU thread, not the iothread.
      
      noinline is a good-enough workaround, and quite unlikely to break in
      the future.
      
      (Thanks to Paolo Bonzini for assistance in diagnosing the problem
      and providing the detailed example/ascii art quoted above.)
      
      Signed-off-by: default avatarPeter Maydell <peter.maydell@linaro.org>
      Message-id: 1403535303-14939-1-git-send-email-peter.maydell@linaro.org
      Reviewed-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      Reviewed-by: default avatarRichard Henderson <rth@twiddle.net>
      ff4873cb
    • Peter Maydell's avatar
      Merge remote-tracking branch 'remotes/afaerber/tags/qom-cpu-for-2.1' into staging · 8589744a
      Peter Maydell authored
      
      X86CPU
      
      * Filter out MONITOR for KVM
      * Fix filtering for TCG
      * -cpu foo,check and -cpu foo,enforce support for TCG
      * -cpu host migration support (-cpu host,migratable=no to disable)
      * Add invtsc feature support
      * New model: Broadwell
      
      # gpg: Signature made Wed 25 Jun 2014 22:55:04 BST using RSA key ID 3E7E013F
      # gpg: Good signature from "Andreas Färber <afaerber@suse.de>"
      # gpg:                 aka "Andreas Färber <afaerber@suse.com>"
      
      * remotes/afaerber/tags/qom-cpu-for-2.1:
        target-i386: Broadwell CPU model
        target-i386: Fix indentation of CPU model definitions
        target-i386: Support "invariant tsc" flag
        target-i386: block migration and savevm if invariant tsc is exposed
        savevm: check vmsd for migratability status
        target-i386: Set migratable=yes by default on "host" CPU mooel
        target-i386: Add "migratable" property to "host" CPU model
        target-i386: Support check/enforce flags in TCG mode, too
        target-i386: Loop-based feature word filtering in TCG mode
        target-i386: Loop-based copying and setting/unsetting of feature words
        target-i386: Define TCG_*_FEATURES earlier in cpu.c
        target-i386: Filter KVM and 0xC0000001 features on TCG
        target-i386: Filter FEAT_7_0_EBX TCG features too
        target-i386: Make TCG feature filtering more readable
        target-i386: Isolate KVM-specific code on CPU feature filtering logic
        target-i386: Pass FeatureWord argument to report_unavailable_features()
        target-i386: Merge feature filtering/checking functions
        target-i386: Simplify reporting of unavailable features
        target-i386: kvm: Don't enable MONITOR by default on any CPU model
      
      Signed-off-by: default avatarPeter Maydell <peter.maydell@linaro.org>
      8589744a
    • Paolo Bonzini's avatar
      qemu-char: initialize chr_write_lock · f3db17b9
      Paolo Bonzini authored
      
      Otherwise, Windows fails with a deadlock.
      
      Reported-by: default avatarStefan Weil <sw@weilnetz.de>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      Message-id: 1403679897-11480-1-git-send-email-pbonzini@redhat.com
      Tested-by: default avatarStefan Weil <sw@weilnetz.de>
      Signed-off-by: default avatarPeter Maydell <peter.maydell@linaro.org>
      f3db17b9
    • Igor Mammedov's avatar
      qemu-char: fix warning 'res' may be used uninitialized · 09313047
      Igor Mammedov authored
      
      Signed-off-by: default avatarIgor Mammedov <imammedo@redhat.com>
      Message-id: 1403683241-20678-1-git-send-email-imammedo@redhat.com
      Reviewed-by: default avatarMarkus Armbruster <armbru@redhat.com>
      Reviewed-by: default avatarStefan Weil <sw@weilnetz.de>
      Signed-off-by: default avatarPeter Maydell <peter.maydell@linaro.org>
      09313047
  3. Jun 25, 2014
  4. Jun 24, 2014
Loading