1. 08 3月, 2015 3 次提交
    • P
      Merge remote-tracking branch 'remotes/kraxel/tags/pull-usb-20150303-1' into staging · b6d527fb
      Peter Maydell 提交于
      xhci: generate a Transfer Event for each Transfer TRB with the IOC bit set
      
      # gpg: Signature made Tue Mar  3 07:38:43 2015 GMT using RSA key ID D3E87138
      # gpg: Good signature from "Gerd Hoffmann (work) <kraxel@redhat.com>"
      # gpg:                 aka "Gerd Hoffmann <gerd@kraxel.org>"
      # gpg:                 aka "Gerd Hoffmann (private) <kraxel@gmail.com>"
      
      * remotes/kraxel/tags/pull-usb-20150303-1:
        xhci: generate a Transfer Event for each Transfer TRB with the IOC bit set
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      b6d527fb
    • P
      Merge remote-tracking branch 'remotes/gonglei/tags/bootdevice-next-20150303' into staging · fff795ab
      Peter Maydell 提交于
      bootdevice: bug fixes
      
      # gpg: Signature made Tue Mar  3 05:18:39 2015 GMT using RSA key ID DDE30FBB
      # gpg: Good signature from "Gonglei <arei.gonglei@huawei.com>"
      # gpg: WARNING: This key is not certified with a trusted signature!
      # gpg:          There is no indication that the signature belongs to the owner.
      # Primary key fingerprint: 5178 9C82 617F 2F58 8693  63B1 BA7A 65B0 DDE3 0FBB
      
      * remotes/gonglei/tags/bootdevice-next-20150303:
        bootdevice: add check in restore_boot_order()
        bootdevice: check boot order argument validation before vm running
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      fff795ab
    • P
      Merge remote-tracking branch 'remotes/bkoppelmann/tags/pull-tricore-20150303' into staging · cff6abd6
      Peter Maydell 提交于
      TriCore RRR1, RRR2 instructions and bugfixes
      
      # gpg: Signature made Tue Mar  3 01:12:02 2015 GMT using RSA key ID 6B69CA14
      # gpg: Good signature from "Bastian Koppelmann <kbastian@mail.uni-paderborn.de>"
      
      * remotes/bkoppelmann/tags/pull-tricore-20150303:
        target-tricore: Add instructions of RRR1 opcode format, which have 0xc3 as first opcode
        target-tricore: Add instructions of RRR1 opcode format, which have 0x43 as first opcode
        target-tricore: Add instructions of RRR1 opcode format, which have 0x83 as first opcode
        target-tricore: Add instructions of RRR2 opcode format
        target-tricore: fix msub32_suov return wrong results
        target-tricore: Fix RLC_ADDI, RLC_ADDIH using wrong microcode helper
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      cff6abd6
  2. 04 3月, 2015 2 次提交
    • P
      Merge remote-tracking branch 'remotes/stefanha/tags/tracing-pull-request' into staging · c10b0283
      Peter Maydell 提交于
      # gpg: Signature made Mon Mar  2 21:45:18 2015 GMT using RSA key ID 81AB73C8
      # gpg: Good signature from "Stefan Hajnoczi <stefanha@redhat.com>"
      # gpg:                 aka "Stefan Hajnoczi <stefanha@gmail.com>"
      
      * remotes/stefanha/tags/tracing-pull-request:
        trace: add DTrace reserved words for .d files
        unbreak dtrace tracing due to double _ in rdma names
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      c10b0283
    • P
      Merge remote-tracking branch 'remotes/awilliam/tags/vfio-update-20150302.0' into staging · 3539bbb9
      Peter Maydell 提交于
      Updates for QEMU 2.3-rc0:
       - Error reporting and static cleanup (Alexey Kardashevskiy)
       - Runtime mmap disable for tracing (Samuel Pitoiset)
       - Support for host directed device request (Alex Williamson)
      
      # gpg: Signature made Mon Mar  2 18:42:50 2015 GMT using RSA key ID 3BB08B22
      # gpg: Good signature from "Alex Williamson <alex.williamson@redhat.com>"
      # gpg:                 aka "Alex Williamson <alex@shazbot.org>"
      # gpg:                 aka "Alex Williamson <alwillia@redhat.com>"
      # gpg:                 aka "Alex Williamson <alex.l.williamson@gmail.com>"
      
      * remotes/awilliam/tags/vfio-update-20150302.0:
        vfio-pci: Enable device request notification support
        vfio: allow to disable MMAP per device with -x-mmap=off option
        vfio: Make type1 listener symbols static
        vfio: Add ioctl number to error report
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      3539bbb9
  3. 03 3月, 2015 19 次提交
    • P
      vl: take iothread lock very early · 576a94d8
      Paolo Bonzini 提交于
      If the iothread lock isn't taken by the main thread, the RCU callbacks
      might run concurrently with the main thread.  QEMU's not ready for that.
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      Tested-by: NChristian Borntraeger <borntraeger@de.ibm.com>
      Tested-by: NGonglei <arei.gonglei@huawei.com>
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      576a94d8
    • P
      Merge remote-tracking branch 'remotes/bonzini/tags/for-upstream' into staging · 3180aadb
      Peter Maydell 提交于
      - more config options
      - bootdevice, iscsi, virtio-scsi fixes
      - build system patches for MinGW and config-devices.mak
      - qemu_mutex_lock_iothread deadlock fixes
      - another tiny patch from the record/replay series
      
      # gpg: Signature made Mon Mar  2 09:59:14 2015 GMT using RSA key ID 78C7AE83
      # gpg: Good signature from "Paolo Bonzini <bonzini@gnu.org>"
      # gpg:                 aka "Paolo Bonzini <pbonzini@redhat.com>"
      # gpg: WARNING: This key is not certified with a trusted signature!
      # gpg:          There is no indication that the signature belongs to the owner.
      # Primary key fingerprint: 46F5 9FBD 57D6 12E7 BFD4  E2F7 7E15 100C CD36 69B1
      #      Subkey fingerprint: F133 3857 4B66 2389 866C  7682 BFFB D25F 78C7 AE83
      
      * remotes/bonzini/tags/for-upstream:
        cpus: be more paranoid in avoiding deadlocks
        cpus: fix deadlock and segfault in qemu_mutex_lock_iothread
        virtio-scsi: Allocate op blocker reason before blocking
        Makefile.target: binary depends on config-devices
        Makefile: don't silence mak file test with V=1
        Makefile: fix up parallel building under MSYS+MinGW
        iscsi: Handle write protected case in reopen
        Give ivshmem its own config option
        Create specific config option for "platform-bus"
        Add specific config options for PCI-E bridges
        bootdevice: fix segment fault when booting guest with '-kernel' and '-initrd'
        timer: replace time() with QEMU_CLOCK_HOST
        virtio-scsi-dataplane: Call blk_set_aio_context within BQL
        block: Forbid bdrv_set_aio_context outside BQL
        scsi: give device a parent before setting properties
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      3180aadb
    • L
      xhci: generate a Transfer Event for each Transfer TRB with the IOC bit set · aa685789
      Laszlo Ersek 提交于
      At the moment, when the XHCI driver in edk2
      (MdeModulePkg/Bus/Pci/XhciDxe/XhciDxe.inf) runs on QEMU, with the options
      
        -device nec-usb-xhci -device usb-kbd
      
      it crashes with:
      
        ASSERT MdeModulePkg/Bus/Pci/XhciDxe/XhciSched.c(1759):
        TrsRing != ((void*) 0)
      
      The crash hits in the following edk2 call sequence (all files under
      MdeModulePkg/Bus/):
      
      UsbEnumerateNewDev()                         [Usb/UsbBusDxe/UsbEnumer.c]
        UsbBuildDescTable()                        [Usb/UsbBusDxe/UsbDesc.c]
          UsbGetDevDesc()                          [Usb/UsbBusDxe/UsbDesc.c]
            UsbCtrlGetDesc(USB_REQ_GET_DESCRIPTOR) [Usb/UsbBusDxe/UsbDesc.c]
              UsbCtrlRequest()                     [Usb/UsbBusDxe/UsbDesc.c]
                UsbHcControlTransfer()             [Usb/UsbBusDxe/UsbUtility.c]
                  XhcControlTransfer()             [Pci/XhciDxe/Xhci.c]
                    XhcCreateUrb()                 [Pci/XhciDxe/XhciSched.c]
                      XhcCreateTransferTrb()       [Pci/XhciDxe/XhciSched.c]
                    XhcExecTransfer()              [Pci/XhciDxe/XhciSched.c]
                      XhcCheckUrbResult()          [Pci/XhciDxe/XhciSched.c]
                        //
                        // look for TRB_TYPE_DATA_STAGE event [1]
                        //
                    //
                    // Store a copy of the device descriptor, as the hub device
                    // needs this info to configure endpoint. [2]
                    //
        UsbSetConfig()                             [Usb/UsbBusDxe/UsbDesc.c]
          UsbCtrlRequest(USB_REQ_SET_CONFIG)       [Usb/UsbBusDxe/UsbDesc.c]
            UsbHcControlTransfer()                 [Usb/UsbBusDxe/UsbUtility.c]
              XhcControlTransfer()                 [Pci/XhciDxe/Xhci.c]
                XhcSetConfigCmd()                  [Pci/XhciDxe/XhciSched.c]
                  XhcInitializeEndpointContext()   [Pci/XhciDxe/XhciSched.c]
                    //
                    // allocate transfer ring for the endpoint [3]
                    //
      
      USBKeyboardDriverBindingStart()              [Usb/UsbKbDxe/EfiKey.c]
        UsbIoAsyncInterruptTransfer()              [Usb/UsbBusDxe/UsbBus.c]
          UsbHcAsyncInterruptTransfer()            [Usb/UsbBusDxe/UsbUtility.c]
            XhcAsyncInterruptTransfer()            [Pci/XhciDxe/Xhci.c]
              XhcCreateUrb()                       [Pci/XhciDxe/Xhci.c]
                XhcCreateTransferTrb()             [Pci/XhciDxe/XhciSched.c]
                  XhcSyncTrsRing()                 [Pci/XhciDxe/XhciSched.c]
                    ASSERT (TrsRing != NULL) [4]
      
      UsbEnumerateNewDev() in the USB bus driver issues a GET_DESCRIPTOR
      request, in order to determine the number of configurations that the
      endpoint supports. The requests consists of three stages (three TRBs),
      setup, data, and status. The length of the response is determined in [1],
      namely from the transfer event that the host controller generates in
      response to the request's middle stage (ie. the data stage).
      
      If the length of the answer is correct (a full GET_DESCRIPTOR request
      takes 18 bytes), then the XHCI driver that underlies the USB bus driver
      "snoops" (caches) the descriptor data for later [2].
      
      Later, the USB bus driver sends a SET_CONFIG request. The underlying XHCI
      driver allocates a transfer ring for the endpoint, relying on the data
      snooped and cached in step [2].
      
      Finally, the USB keyboard driver submits an asynchronous interrupt
      transfer to manage the keyboard. As part of this it asserts [4] that the
      ring has been allocated in step [3].
      
      And this ASSERT() fires. The root cause can be found in the way QEMU
      handles the initial GET_DESCRIPTOR request.
      
      Again, that request consists of three stages (TRBs, Transfer Request
      Blocks), "setup", "data", and "status". The XhcCreateTransferTrb()
      function sets the IOC ("Interrupt on Completion") flag in each of these
      TRBs.
      
      According to the XHCI specification, the host controller shall generate a
      Transfer Event in response to *each* individual TRB of the request that
      had the IOC flag set. This means that QEMU should queue three events:
      setup, data, and status, for edk2's XHCI driver.
      
      However, QEMU only generates two events:
      - one for the setup (ie. 1st) stage,
      - another for the status (ie. 3rd) stage.
      
      No event is generated for the middle (ie. data) stage. The loop in QEMU's
      xhci_xfer_report() function runs three times, but due to the "reported"
      variable, only the first and the last TRBs elicit events, the middle (data
      stage) results in no event queued.
      
      As a consequence:
      - When handling the GET_DESCRIPTOR request, XhcCheckUrbResult() in [1]
        does not update the response length from zero.
      
      - XhcControlTransfer() thinks that the response is invalid (it has zero
        length payload instead of 18 bytes), hence [2] is not reached; the
        device descriptor is not stashed for later, and the number of possible
        configurations is left at zero.
      
      - When handling the SET_CONFIG request, (NumConfigurations == 0) from
        above prevents the allocation of the endpoint's transfer ring.
      
      - When the keyboard driver tries to use the endpoint, the ASSERT() blows
        up.
      
      The solution is to correct the emulation in QEMU, and to generate a
      transfer event whenever IOC is set in a TRB.
      
      The patch replaces
      
        !reported && (IOC || foo)    == !reported && IOC ||
                                        !reported && foo
      
      with
      
        IOC || (!reported && foo)    == IOC ||
                                        !reported && foo
      
      which only changes how
      
        reported && IOC
      
      is handled. (Namely, it now generates an event.)
      
      Tested with edk2 built for "qemu-system-aarch64 -M virt" (ie.
      "ArmVirtualizationQemu.dsc", aka "AAVMF"), and guest Linux.
      Signed-off-by: NLaszlo Ersek <lersek@redhat.com>
      Signed-off-by: NGerd Hoffmann <kraxel@redhat.com>
      aa685789
    • G
      bootdevice: add check in restore_boot_order() · 76349f5b
      Gonglei 提交于
      qemu_boot_set() can't fail in restore_boot_order(),
      then simply assert it doesn't fail, by passing
      &error_abort if boot_set_handler set.
      Suggested-by: NMarkus Armbruster <armbru@redhat.com>
      Signed-off-by: NGonglei <arei.gonglei@huawei.com>
      Reviewed-by: NMarkus Armbruster <armbru@redhat.com>
      76349f5b
    • G
      bootdevice: check boot order argument validation before vm running · f05f47bb
      Gonglei 提交于
      Either 'once' option or 'order' option can take effect for -boot at
      the same time, that is say initial startup processing can check only
      one. And pc.c's set_boot_dev() fails when its boot order argument
      is invalid. This patch provide a solution fix this problem:
      
       1. If "once" is given, register reset handler to restore boot order.
      
       2. Pass the normal boot order to machine creation.  Should fail when
         the normal boot order is invalid.
      
       3. If "once" is given, set it with qemu_boot_set().  Fails when the
         once boot order is invalid.
      
       4. Start the machine.
      
       5. On reset, the reset handler calls qemu_boot_set() to restore boot
         order.  Should never fail.
      Suggested-by: NMarkus Armbruster <armbru@redhat.com>
      Signed-off-by: NGonglei <arei.gonglei@huawei.com>
      Reviewed-by: NMarkus Armbruster <armbru@redhat.com>
      f05f47bb
    • P
      Merge remote-tracking branch 'remotes/armbru/tags/pull-error-2015-02-26' into staging · 5efde22a
      Peter Maydell 提交于
      QemuOpts: Convert various setters to Error
      
      # gpg: Signature made Thu Feb 26 13:56:43 2015 GMT using RSA key ID EB918653
      # gpg: Good signature from "Markus Armbruster <armbru@redhat.com>"
      # gpg:                 aka "Markus Armbruster <armbru@pond.sub.org>"
      
      * remotes/armbru/tags/pull-error-2015-02-26:
        qtest: Use qemu_opt_set() instead of qemu_opts_parse()
        pc: Use qemu_opt_set() instead of qemu_opts_parse()
        qemu-sockets: Simplify setting numeric and boolean options
        block: Simplify setting numeric options
        qemu-img: Suppress unhelpful extra errors in convert, amend
        QemuOpts: Propagate errors through opts_parse()
        QemuOpts: Propagate errors through opts_do_parse()
        QemuOpts: Drop qemu_opt_set(), rename qemu_opt_set_err(), fix use
        block: Suppress unhelpful extra errors in bdrv_img_create()
        qemu-img: Suppress unhelpful extra errors in convert, resize
        QemuOpts: Convert qemu_opts_set() to Error, fix its use
        QemuOpts: Convert qemu_opt_set_number() to Error, fix its use
        QemuOpts: Convert qemu_opt_set_bool() to Error, fix its use
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      5efde22a
    • B
      target-tricore: Add instructions of RRR1 opcode format, which have 0xc3 as first opcode · bebe80fc
      Bastian Koppelmann 提交于
      Add helpers helper_addsur_h/_ssov which adds one halfword and subtracts one
      halfword, rounds / and saturates each half word independently.
      
      Add microcode helper functions:
          * gen_maddsu_h/sus_h: multiply two halfwords left justified and add to the
                                first one word and subtract from the second one word
                                / and saturate each resulting word independetly.
          * gen_maddsum_h/sums_h: multiply two halfwords in q-format left justified
                                  and add to the first one word and subtract from
                                  the second one word / and saturate each resulting
                                  word independetly.
          * gen_maddsur32_h/32s_h: multiply two halfwords in q-format left justified
                                   and add to the first one word and subtract from
                                   the second one word, round both results / and
                                   saturate each resulting word independetly.
      Signed-off-by: NBastian Koppelmann <kbastian@mail.uni-paderborn.de>
      Reviewed-by: NRichard Henderson <rth@twiddle.net>
      bebe80fc
    • B
      target-tricore: Add instructions of RRR1 opcode format, which have 0x43 as first opcode · b00aa8ec
      Bastian Koppelmann 提交于
      Add helpers:
          * madd64_q_ssov: multiply two 32 bit q-format number, add them with a
                           64 bit q-format number and saturate.
          * madd32_q_add_ssov: add two 64 bit q-format numbers and return a 32 bit
                               result.
          * maddr_q_ssov: multiplay two 32 bit q-format numbers, add a 32 bit
                          q-format number and saturate.
          * maddr_q: multiplay two 32 bit q-format numbers and add a 32 bit
                     q-format number.
      
      Note: madd instructions in the q format can behave strange, e.g.
      0x1 + (0x80000000 * 0x80000000) << 1 for 32 bit signed values does not cause an
      overflow on the guest, because all intermediate results should be handled as if
      they are indefinitely precise. We handle this by inverting the overflow bit for
      all cases: a + (0x80000000 * 0x80000000) << 1.
      Signed-off-by: NBastian Koppelmann <kbastian@mail.uni-paderborn.de>
      Reviewed-by: NRichard Henderson <rth@twiddle.net>
      b00aa8ec
    • B
      target-tricore: Add instructions of RRR1 opcode format, which have 0x83 as first opcode · 2e430e1c
      Bastian Koppelmann 提交于
      Add helpers:
          * add64_ssov: adds two 64 bit values and saturates the result.
          * addr_h/_ssov: adds two halfwords with two words in q-format with rounding
                          / and saturates each result independetly.
      
      Add microcode generator:
          * gen_add64_d: adds two 64 bit values.
          * gen_addsub64_h: adds/subtracts one halfwords with a word and adds/
                            subtracts another halftword with another word.
          * gen_madd_h/s_h: multiply four halfwords, add each result left justfied
                            to two word values / and saturate each result.
          * gen_maddm_h/s_h: multiply four halfwords, add each result left justfied
                             to two words values in q-format / and saturate each
                             result.
          * gen_maddr32/64_h/s_h: multiply four halfwords, add each result left
                                  justfied to two halftwords/words values in q-format
                                  / and saturate each result.
      Signed-off-by: NBastian Koppelmann <kbastian@mail.uni-paderborn.de>
      Reviewed-by: NRichard Henderson <rth@twiddle.net>
      2e430e1c
    • B
    • B
      target-tricore: fix msub32_suov return wrong results · 3debbb5a
      Bastian Koppelmann 提交于
      If the signed result of the multiplication overflows, we would get a negative
      value, which would result in a addition instead of a subtraction.
      
      Now we do the overflow calculation and saturation by hand instead of using
      suov32_neg.
      Signed-off-by: NBastian Koppelmann <kbastian@mail.uni-paderborn.de>
      Reviewed-by: NRichard Henderson <rth@twiddle.net>
      3debbb5a
    • B
    • P
      Revert "Merge remote-tracking branch 'remotes/ehabkost/tags/x86-pull-request' into staging" · 0856579c
      Peter Maydell 提交于
      This reverts commit b8a173b2, reversing
      changes made to 5de09046.
      
      (I applied this pull request when I should not have done so, and
      am now immediately reverting it.)
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      0856579c
    • S
      trace: add DTrace reserved words for .d files · 0b7e89b1
      Stefan Hajnoczi 提交于
      DTrace on Mac OS X fails due to trace events using 'self' as an argument
      name:
      
        GEN   trace/generated-tracers-dtrace.h
      dtrace: failed to compile script trace/generated-tracers-dtrace.dtrace: line 1330: syntax error, unexpected DT_KEY_SELF, expecting ) near "self"
      make: *** [trace/generated-tracers-dtrace.h] Error 1
      
      Filter argument names according to the list of DTrace .d file reserved
      keywords.
      
      Note that DTrace on Mac and Linux still do not work after this patch.
      There are additional build issues remaining.
      Reported-by: NHenk Poley <henkpoley@gmail.com>
      Tested-by: NHenk Poley <henkpoley@gmail.com>
      Cc: Lluís Vilanova <vilanova@ac.upc.edu>
      Signed-off-by: NStefan Hajnoczi <stefanha@redhat.com>
      0b7e89b1
    • D
      unbreak dtrace tracing due to double _ in rdma names · ba795761
      Dr. David Alan Gilbert 提交于
      It looks like the dtrace trace code gets upset if you have trace names
      with __ in, which the migration/rdma.c code does.
      
      Rename the functions and the associated traces.
      
      Fixes: 733252deSigned-off-by: NDr. David Alan Gilbert <dgilbert@redhat.com>
      Reported-by: NAndreas Färber <afaerber@suse.de>
      Reviewed-by: NPaolo Bonzini <pbonzini@redhat.com>
      Tested-by: NAndreas Färber <afaerber@suse.de>
      Message-id: 1424105885-12149-1-git-send-email-dgilbert@redhat.com
      Signed-off-by: NStefan Hajnoczi <stefanha@redhat.com>
      ba795761
    • A
      vfio-pci: Enable device request notification support · 47cbe50c
      Alex Williamson 提交于
      Linux v4.0-rc1 vfio-pci introduced a new virtual interrupt to allow
      the kernel to request a device from the user.  When signaled, QEMU
      will by default attmempt to hot-unplug the device.  This is a one-
      shot attempt with the expectation that the kernel will continue to
      poll for the device if it is not returned.  Returning the device when
      requested is the expected standard model of cooperative usage, but we
      also add an option option to disable this feature.  Initially this
      opt-out is set as an experimental option because we really should
      honor kernel requests for the device.
      Signed-off-by: NAlex Williamson <alex.williamson@redhat.com>
      47cbe50c
    • S
      vfio: allow to disable MMAP per device with -x-mmap=off option · 6ee47c90
      Samuel Pitoiset 提交于
      Disabling MMAP support uses the slower read/write accesses but allows to
      trace all MMIO accesses, which is not good for performance, but very
      useful for reverse engineering PCI drivers. This option allows to
      disable MMAP per device without a compile-time change.
      Signed-off-by: NSamuel Pitoiset <samuel.pitoiset@gmail.com>
      Signed-off-by: NAlex Williamson <alex.williamson@redhat.com>
      6ee47c90
    • A
      vfio: Make type1 listener symbols static · 51b833f4
      Alexey Kardashevskiy 提交于
      They are not used from anywhere but common.c which is where these are
      defined so make them static.
      Signed-off-by: NAlexey Kardashevskiy <aik@ozlabs.ru>
      Signed-off-by: NAlex Williamson <alex.williamson@redhat.com>
      51b833f4
    • A
      vfio: Add ioctl number to error report · 46f770d4
      Alexey Kardashevskiy 提交于
      This makes the error report more informative.
      Signed-off-by: NAlexey Kardashevskiy <aik@ozlabs.ru>
      Signed-off-by: NAlex Williamson <alex.williamson@redhat.com>
      46f770d4
  4. 02 3月, 2015 6 次提交
    • P
      Merge remote-tracking branch 'remotes/ehabkost/tags/x86-pull-request' into staging · b8a173b2
      Peter Maydell 提交于
      * remotes/ehabkost/tags/x86-pull-request:
        target-i386: Move APIC ID compatibility code to pc.c
        target-i386: Require APIC ID to be explicitly set before CPU realize
        target-i386: Set APIC ID using cpu_index on CONFIG_USER
        linux-user: Check for cpu_init() errors
        target-i386: Move CPUX86State.cpuid_apic_id to X86CPU.apic_id
        target-i386: Simplify error handling on cpu_x86_init_user()
        target-i386: Eliminate cpu_init() function
        target-i386: Rename cpu_x86_init() to cpu_x86_init_user()
        target-i386: Move topology.h to include/hw/i386
        target-i386: Eliminate unnecessary get_cpuid_vendor() function
        target-i386: Simplify listflags() function
      
      Conflicts:
      	target-i386/cpu.c
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      b8a173b2
    • P
      Merge remote-tracking branch 'remotes/afaerber/tags/qom-devices-for-peter' into staging · 5de09046
      Peter Maydell 提交于
      QOM infrastructure fixes and device conversions
      
      * Assertion fix for device_add with non-device types
      * Documentation fix
      * qdev_init() error reporting cleanups
      
      # gpg: Signature made Tue Feb 24 13:56:33 2015 GMT 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-devices-for-peter:
        parallel: parallel_hds_isa_init() shouldn't fail
        parallel: Factor out common parallel_hds_isa_init()
        serial: serial_hds_isa_init() shouldn't fail
        serial: Factor out common serial_hds_isa_init()
        etsec: Replace qdev_init() by qdev_init_nofail()
        leon3: Replace unchecked qdev_init() by qdev_init_nofail()
        ide/isa: Replace unchecked qdev_init() by qdev_init_nofail()
        qdev: Improve qdev_init_nofail()'s error reporting
        qom: Fix typo, 'my_class_init' -> 'derived_class_init'
        qdev: Avoid type assertion in qdev_build_hotpluggable_device_list()
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      5de09046
    • P
      Merge remote-tracking branch 'remotes/ehabkost/tags/numa-pull-request' into staging · 2dffe551
      Peter Maydell 提交于
      NUMA fixes queue
      
      # gpg: Signature made Mon Feb 23 19:28:42 2015 GMT using RSA key ID 984DC5A6
      # gpg: Can't check signature: public key not found
      
      * remotes/ehabkost/tags/numa-pull-request:
        numa: Rename set_numa_modes() to numa_post_machine_init()
        numa: Rename option parsing functions
        numa: Move QemuOpts parsing to set_numa_nodes()
        numa: Make max_numa_nodeid static
        numa: Move NUMA globals to numa.c
        vl.c: Remove unnecessary zero-initialization of NUMA globals
        numa: Move NUMA declarations from sysemu.h to numa.h
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      2dffe551
    • P
      cpus: be more paranoid in avoiding deadlocks · 21618b3e
      Paolo Bonzini 提交于
      For good measure, ensure that the following sequence:
      
         thread 1 calls qemu_mutex_lock_iothread
         thread 2 calls qemu_mutex_lock_iothread
         VCPU thread are created
         VCPU thread enters execution loop
      
      results in the VCPU threads letting the other two threads run
      and obeying iothread_requesting_mutex even if the VCPUs are
      not halted.  To do this, check iothread_requesting_mutex
      before execution starts.
      Tested-by: NLeon Alrae <leon.alrae@imgtec.com>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      21618b3e
    • P
      cpus: fix deadlock and segfault in qemu_mutex_lock_iothread · 6b49809c
      Paolo Bonzini 提交于
      When two threads (other than the low-priority TCG VCPU thread)
      are competing for the iothread lock, a deadlock can happen.  This
      is because iothread_requesting_mutex is set to false by the first
      thread that gets the mutex, and then the VCPU thread might never
      yield from the execution loop.  If iothread_requesting_mutex is
      changed from a bool to a counter, the deadlock is fixed.
      
      However, there is another bug in qemu_mutex_lock_iothread that
      can be triggered by the new call_rcu thread.  The bug happens
      if qemu_mutex_lock_iothread is called before the CPUs are
      created.  In that case, first_cpu is NULL and the caller
      segfaults in qemu_mutex_lock_iothread.  To fix this, just
      do not do the kick if first_cpu is NULL.
      Reported-by: NLeon Alrae <leon.alrae@imgtec.com>
      Reported-by: NAndreas Gustafsson <gson@gson.org>
      Tested-by: NLeon Alrae <leon.alrae@imgtec.com>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      6b49809c
    • M
      virtio-scsi: Allocate op blocker reason before blocking · f6758f7d
      Max Reitz 提交于
      s->blocker is really only used in hw/scsi/virtio-scsi.c; the only places
      where it is used in hw/scsi/virtio-scsi-dataplane.c is when it is
      allocated and when it is freed. That does not make a whole lot of sense
      (and is actually wrong because this leads to s->blocker potentially
      being NULL when blk_op_block_all() is called in virtio-scsi.c), so move
      the allocation and destruction of s->blocker to the device realization
      and unrealization in virtio-scsi.c, respectively.
      
      Case in point:
      
      $ echo -e 'eject drv\nquit' | \
          x86_64-softmmu/qemu-system-x86_64 \
              -monitor stdio -machine accel=qtest -display none \
              -object iothread,id=thr -device virtio-scsi-pci,iothread=thr \
              -drive if=none,file=test.qcow2,format=qcow2,id=drv \
              -device scsi-cd,drive=drv
      
      Without this patch:
      
      (qemu) eject drv
      [1]    10102 done
             10103 segmentation fault (core dumped)
      
      With this patch:
      
      (qemu) eject drv
      Device 'drv' is busy: block device is in use by data plane
      (qemu) quit
      Signed-off-by: NMax Reitz <mreitz@redhat.com>
      Message-Id: <1425057113-26940-1-git-send-email-mreitz@redhat.com>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      f6758f7d
  5. 28 2月, 2015 4 次提交
  6. 27 2月, 2015 6 次提交