1. 13 Apr, 2015 4 commits
    • Peter Maydell's avatar
      v2.3.0-rc3
      b8df9208
    • Peter Maydell's avatar
      Revert seccomp tests that allow it to be used on non-x86 architectures · ae6e8ef1
      Peter Maydell authored
      Unfortunately it turns out that libseccomp 2.2 still does not work
      correctly on non-x86 architectures; return to the previous configure
      setup of insisting on libseccomp 2.1 or better and i386/x86_64 and
      disabling seccomp support in all other situations.
      
      This reverts the two commits:
       * "seccomp: libseccomp version varying according to arch"
         (commit 896848f0)
       * "seccomp: update libseccomp version and remove arch restriction"
         (commit 8e27fc20
      
      )
      
      Signed-off-by: default avatarPeter Maydell <peter.maydell@linaro.org>
      Message-id: 1428670681-23032-1-git-send-email-peter.maydell@linaro.org
      ae6e8ef1
    • Thomas Huth's avatar
      pci: Fix crash with illegal "-net nic, model=xxx" option · 4d0ecde4
      Thomas Huth authored
      
      Current QEMU crashes when specifying an illegal model with the
      "-net nic,model=xxx" option, e.g.:
      
       $ qemu-system-x86_64 -net nic,model=n/a
       qemu-system-x86_64: Unsupported NIC model: n/a
      
       Program received signal SIGSEGV, Segmentation fault.
      
      The gdb backtrace looks like this:
      
      0x0000555555965fe0 in error_get_pretty (err=0x0) at util/error.c:152
      152	    return err->msg;
      (gdb) bt
       0  0x0000555555965fe0 in error_get_pretty (err=0x0) at util/error.c:152
       1  0x0000555555965ffd in error_report_err (err=0x0) at util/error.c:157
       2  0x0000555555809c90 in pci_nic_init_nofail (nd=0x555555e49860 <nd_table>, rootbus=0x5555564409b0,
          default_model=0x55555598c37b "e1000", default_devaddr=0x0) at hw/pci/pci.c:1663
       3  0x0000555555691e42 in pc_nic_init (isa_bus=0x555556f71900, pci_bus=0x5555564409b0)
          at hw/i386/pc.c:1506
       4  0x000055555569396b in pc_init1 (machine=0x5555562abbf0, pci_enabled=1, kvmclock_enabled=1)
          at hw/i386/pc_piix.c:248
       5  0x0000555555693d27 in pc_init_pci (machine=0x5555562abbf0) at hw/i386/pc_piix.c:310
       6  0x000055555572ddf5 in main (argc=3, argv=0x7fffffffe018, envp=0x7fffffffe038) at vl.c:4226
      
      The problem is that pci_nic_init_nofail() does not check whether the err
      parameter from pci_nic_init has been set up and thus passes a NULL pointer
      to error_report_err(). Fix it by correctly checking the err parameter.
      
      Signed-off-by: default avatarThomas Huth <thuth@redhat.com>
      Reviewed-by: default avatarMichael S. Tsirkin <mst@redhat.com>
      Reviewed-by: default avatarJason Wang <jasowang@redhat.com>
      Signed-off-by: default avatarPeter Maydell <peter.maydell@linaro.org>
      4d0ecde4
    • Andreas Färber's avatar
      stm32f205: Fix SoC type name · 342b0711
      Andreas Färber authored
      
      The type name for the SoC device, unlike those of its sub-devices,
      did not follow the QOM naming conventions. While the usage is internal
      only, this is exposed through QMP and HMP, so fix it before release.
      
      Cc: Alistair Francis <alistair.francis@xilinx.com>
      Signed-off-by: default avatarAndreas Färber <afaerber@suse.de>
      Reviewed-by: default avatarAlistair Francis <alistair@alistair23.me>
      Message-id: 1428676676-23056-1-git-send-email-afaerber@suse.de
      Signed-off-by: default avatarPeter Maydell <peter.maydell@linaro.org>
      342b0711
  2. 11 Apr, 2015 1 commit
  3. 10 Apr, 2015 2 commits
  4. 09 Apr, 2015 6 commits
    • Jan Beulich's avatar
      xen: limit guest control of PCI command register · 81b23ef8
      Jan Beulich authored
      
      Otherwise the guest can abuse that control to cause e.g. PCIe
      Unsupported Request responses (by disabling memory and/or I/O decoding
      and subsequently causing [CPU side] accesses to the respective address
      ranges), which (depending on system configuration) may be fatal to the
      host.
      
      This is CVE-2015-2756 / XSA-126.
      
      Signed-off-by: default avatarJan Beulich <jbeulich@suse.com>
      Reviewed-by: default avatarStefano Stabellini <stefano.stabellini@eu.citrix.com>
      Acked-by: default avatarIan Campbell <ian.campbell@citrix.com>
      Message-id: alpine.DEB.2.02.1503311510300.7690@kaball.uk.xensource.com
      Signed-off-by: default avatarPeter Maydell <peter.maydell@linaro.org>
      81b23ef8
    • Stefan Hajnoczi's avatar
      configure: disable Archipelago by default and warn about libxseg GPLv3 license · 6a460ed1
      Stefan Hajnoczi authored
      
      libxseg has changed license to GPLv3.  QEMU includes GPL "v2 only" code
      which is not compatible with GPLv3.  This means the resulting binaries
      may not be redistributable!
      
      Disable Archipelago (libxseg) by default to prevent accidental license
      violations.  Also warn if linking against libxseg is enabled to remind
      the user.
      
      Note that this commit does not constitute any advice about software
      licensing.  If you have doubts you should consult a lawyer.
      
      Cc: Chrysostomos Nanakos <cnanakos@grnet.gr>
      Suggested-by: default avatarKevin Wolf <kwolf@redhat.com>
      Reported-by: default avatarAndreas Färber <afaerber@suse.de>
      Signed-off-by: default avatarStefan Hajnoczi <stefanha@redhat.com>
      Reviewed-by: default avatarAndreas Färber <afaerber@suse.de>
      Message-id: 1428587538-8765-1-git-send-email-stefanha@redhat.com
      Signed-off-by: default avatarPeter Maydell <peter.maydell@linaro.org>
      6a460ed1
    • Peter Maydell's avatar
      Merge remote-tracking branch 'remotes/stefanha/tags/block-pull-request' into staging · a6f2cb03
      Peter Maydell authored
      
      # gpg: Signature made Thu Apr  9 10:55:11 2015 BST using RSA key ID 81AB73C8
      # gpg: Good signature from "Stefan Hajnoczi <stefanha@redhat.com>"
      # gpg:                 aka "Stefan Hajnoczi <stefanha@gmail.com>"
      
      * remotes/stefanha/tags/block-pull-request:
        block/iscsi: handle zero events from iscsi_which_events
        aio: strengthen memory barriers for bottom half scheduling
        virtio-blk: correctly dirty guest memory
        qcow2: Fix header update with overridden backing file
      
      Signed-off-by: default avatarPeter Maydell <peter.maydell@linaro.org>
      a6f2cb03
    • Peter Maydell's avatar
      tcg/tcg-op.c: Fix ld/st of 64 bit values on 32-bit bigendian hosts · cf811fff
      Peter Maydell authored
      Commit 951c6300
      
       out-of-lined the 32-bit-host versions of
      tcg_gen_{ld,st}_i64, but in the process it inadvertently changed
      an #ifdef HOST_WORDS_BIGENDIAN to #ifdef TCG_TARGET_WORDS_BIGENDIAN.
      Since the latter doesn't get defined anywhere this meant we always
      took the "LE host" codepath, and stored the two halves of the value
      in the wrong order on BE hosts. This typically breaks any 64-bit
      guest on a 32-bit BE host completely, and will have possibly more
      subtle effects even for 32-bit guests.
      
      Switch the ifdef back to HOST_WORDS_BIGENDIAN.
      
      Signed-off-by: default avatarPeter Maydell <peter.maydell@linaro.org>
      Reviewed-by: default avatarRichard Henderson <rth@twiddle.net>
      Tested-by: default avatarAndreas Färber <afaerber@suse.de>
      Message-id: 1428523029-13620-1-git-send-email-peter.maydell@linaro.org
      cf811fff
    • Peter Lieven's avatar
      block/iscsi: handle zero events from iscsi_which_events · 05b685fb
      Peter Lieven authored
      
      newer libiscsi versions may return zero events from iscsi_which_events.
      
      In this case iscsi_service will return immediately without any progress.
      To avoid busy waiting for iscsi_which_events to change we deregister all
      read and write handlers in this case and schedule a timer to periodically
      check iscsi_which_events for changed events.
      
      Next libiscsi version will introduce async reconnects and zero events
      are returned while libiscsi is waiting for a reconnect retry.
      
      Signed-off-by: default avatarPeter Lieven <pl@kamp.de>
      Message-id: 1428437295-29577-1-git-send-email-pl@kamp.de
      Signed-off-by: default avatarStefan Hajnoczi <stefanha@redhat.com>
      05b685fb
    • Paolo Bonzini's avatar
      aio: strengthen memory barriers for bottom half scheduling · e8d3b1a2
      Paolo Bonzini authored
      There are two problems with memory barriers in async.c.  The fix is
      to use atomic_xchg in order to achieve sequential consistency between
      the scheduling of a bottom half and the corresponding execution.
      
      First, if bh->scheduled is already 1 in qemu_bh_schedule, QEMU does
      not execute a memory barrier to order any writes needed by the callback
      before the read of bh->scheduled.  If the other side sees req->state as
      THREAD_ACTIVE, the callback is not invoked and you get deadlock.
      
      Second, the memory barrier in aio_bh_poll is too weak.  Without this
      patch, it is possible that bh->scheduled = 0 is not "published" until
      after the callback has returned.  Another thread wants to schedule the
      bottom half, but it sees bh->scheduled = 1 and does nothing.  This causes
      a lost wakeup.  The memory barrier should have been changed to smp_mb()
      in commit 924fe129
      
       (aio: fix qemu_bh_schedule() bh->ctx race condition,
      2014-06-03) together with qemu_bh_schedule()'s.  Guess who reviewed
      that patch?
      
      Both of these involve a store and a load, so they are reproducible on
      x86_64 as well.  It is however much easier on aarch64, where the
      libguestfs test suite triggers the bug fairly easily.  Even there the
      failure can go away or appear depending on compiler optimization level,
      tracing options, or even kernel debugging options.
      
      Paul Leveille however reported how to trigger the problem within 15
      minutes on x86_64 as well.  His (untested) recipe, reproduced here
      for reference, is the following:
      
         1) Qcow2 (or 3) is critical – raw files alone seem to avoid the problem.
      
         2) Use “cache=directsync” rather than the default of
         “cache=none” to make it happen easier.
      
         3) Use a server with a write-back RAID controller to allow for rapid
         IO rates.
      
         4) Run a random-access load that (mostly) writes chunks to various
         files on the virtual block device.
      
            a. I use ‘diskload.exe c:25’, a Microsoft HCT load
               generator, on Windows VMs.
      
            b. Iometer can probably be configured to generate a similar load.
      
         5) Run multiple VMs in parallel, against the same storage device,
         to shake the failure out sooner.
      
         6) IvyBridge and Haswell processors for certain; not sure about others.
      
      A similar patch survived over 12 hours of testing, where an unpatched
      QEMU would fail within 15 minutes.
      
      This bug is, most likely, also the cause of failures in the libguestfs
      testsuite on AArch64.
      
      Thanks to Laszlo Ersek for initially reporting this bug, to Stefan
      Hajnoczi for suggesting closer examination of qemu_bh_schedule, and to
      Paul for providing test input and a prototype patch.
      
      Reported-by: default avatarLaszlo Ersek <lersek@redhat.com>
      Reported-by: default avatarPaul Leveille <Paul.Leveille@stratus.com>
      Reported-by: default avatarJohn Snow <jsnow@redhat.com>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      Message-id: 1428419779-26062-1-git-send-email-pbonzini@redhat.com
      Suggested-by: default avatarPaul Leveille <Paul.Leveille@stratus.com>
      Suggested-by: default avatarStefan Hajnoczi <stefanha@redhat.com>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      Signed-off-by: default avatarStefan Hajnoczi <stefanha@redhat.com>
      e8d3b1a2
  5. 08 Apr, 2015 3 commits
  6. 07 Apr, 2015 1 commit
    • Peter Maydell's avatar
      Merge remote-tracking branch 'remotes/mjt/tags/pull-trivial-patches-2015-04-04' into staging · 5a24f20a
      Peter Maydell authored
      
      trivial patches for 2015-04-04
      
      # gpg: Signature made Sat Apr  4 08:07:49 2015 BST using RSA key ID A4C3D7DB
      # gpg: Good signature from "Michael Tokarev <mjt@tls.msk.ru>"
      # gpg:                 aka "Michael Tokarev <mjt@corpit.ru>"
      # gpg:                 aka "Michael Tokarev <mjt@debian.org>"
      
      * remotes/mjt/tags/pull-trivial-patches-2015-04-04:
        vhost: fix typo in vq_index description
        gitignore: Ignore more .pod files.
        target-tricore: Fix check which was always false
        target-i386: remove superfluous TARGET_HAS_SMC macro
        pcspk: Fix I/O port name
      
      Signed-off-by: default avatarPeter Maydell <peter.maydell@linaro.org>
      5a24f20a
  7. 04 Apr, 2015 5 commits
  8. 02 Apr, 2015 17 commits
    • Peter Maydell's avatar
      v2.3.0-rc2
      f2155a08
    • Cornelia Huck's avatar
      glib-compat: fix problems with not-quite glib 2.22 · 14655e9a
      Cornelia Huck authored
      Commit 89b516d8
      
       ("glib: add
      compatibility interface for g_get_monotonic_time()") aimed
      at making qemu build with old glib versions. At least SLES11SP3,
      however, contains a backport of g_get_monotonic_time() while
      keeping the reported glib version at 2.22.
      
      Let's work around this by a strategically placed #define.
      
      Signed-off-by: default avatarCornelia Huck <cornelia.huck@de.ibm.com>
      Message-id: 1427987865-433-2-git-send-email-cornelia.huck@de.ibm.com
      Signed-off-by: default avatarPeter Maydell <peter.maydell@linaro.org>
      14655e9a
    • Peter Maydell's avatar
      Merge remote-tracking branch 'remotes/bonzini/tags/for-upstream' into staging · a8a7ef14
      Peter Maydell authored
      
      Another round of small fixes.  I am not including the
      virtio-blk fix, because Wen only posted a prototype and the changes
      I made were pretty large.  It definitely needs another pair of eyes
      (but it is a 2.3 regression and a blocker).
      
      # gpg: Signature made Thu Apr  2 14:59:56 2015 BST 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 sufficiently trusted signatures!
      # gpg:          It is not certain 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:
        Use $(MAKE) for recursive make
        kvm-all: Sync dirty-bitmap from kvm before kvm destroy the corresponding dirty_bitmap
        util/qemu-config: fix regression of qmp_query_command_line_options
        target-i386: clear bsp bit when designating bsp
        qga: fitering out -fstack-protector-strong
        target-i386: save 64-bit CR3 in 64-bit SMM state save area
      
      Signed-off-by: default avatarPeter Maydell <peter.maydell@linaro.org>
      a8a7ef14
    • Ed Maste's avatar
      Use $(MAKE) for recursive make · fb8597bb
      Ed Maste authored
      
      On BSDs "make" is typically BSD make, while "gmake" is GNU make.
      
      Signed-off-by: default avatarEd Maste <emaste@freebsd.org>
      Message-Id: <1427911118-21905-1-git-send-email-emaste@freebsd.org>
      [Fix $(INSTALLER) too as reported by Fam Zheng. - Paolo]
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      fb8597bb
    • zhanghailiang's avatar
      kvm-all: Sync dirty-bitmap from kvm before kvm destroy the corresponding dirty_bitmap · 4cc856fa
      zhanghailiang authored
      
      Sometimes, we destroy the dirty_bitmap in kvm_memory_slot before any sync action
      occur, this bit in dirty_bitmap will be missed, and which will lead the corresponding
      dirty pages to be missed in migration.
      
      This usually happens when do migration during VM's Start-up or Reboot.
      
      Signed-off-by: default avatarzhanghailiang <zhang.zhanghailiang@huawei.com>
      [Use s->migration_log instead of exec.c's in_migration. - Paolo]
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      4cc856fa
    • Marcel Apfelbaum's avatar
      util/qemu-config: fix regression of qmp_query_command_line_options · 0a7cf217
      Marcel Apfelbaum authored
      Commit 49d2e648
      
       (machine: remove qemu_machine_opts global list)
      made machine options specific to machine sub-type, leaving
      the qemu_machine_opts desc array empty. Sadly this is the place
      qmp_query_command_line_options is looking for supported options.
      
      As a fix for for 2.3 the machine_qemu_opts (the generic ones)
      are restored only for qemu-config scope.
      We need to find a better fix for 2.4.
      
      Reported-by: default avatarTony Krowiak <akrowiak@linux.vnet.ibm.com>
      Signed-off-by: default avatarMarcel Apfelbaum <marcel@redhat.com>
      Message-Id: <1427906841-1576-1-git-send-email-marcel@redhat.com>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      0a7cf217
    • Nadav Amit's avatar
      target-i386: clear bsp bit when designating bsp · 9cb11fd7
      Nadav Amit authored
      
      Since the BSP bit is writable on real hardware, during reset all the CPUs which
      were not chosen to be the BSP should have their BSP bit cleared. This fix is
      required for KVM to work correctly when it changes the BSP bit.
      
      An additional fix is required for QEMU tcg to allow software to change the BSP
      bit.
      
      Signed-off-by: default avatarNadav Amit <namit@cs.technion.ac.il>
      Message-Id: <1427932716-11800-1-git-send-email-namit@cs.technion.ac.il>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      9cb11fd7
    • Joseph Hindin's avatar
      qga: fitering out -fstack-protector-strong · 420957a5
      Joseph Hindin authored
      configure script may add -fstack-protector-strong option instead
      of -fstack-protector-all, depending on availability ( see
      commit 63678e17
      
       ). Both options have to by filtered out for
      qga-vss.dll, otherwise MinGW cross-compilation fails at linking
      stage.
      
      Signed-off-by: default avatarJoseph Hindin <jhindin@daynix.com>
      Message-Id: <1427906337-20805-2-git-send-email-jhindin@daynix.com>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      420957a5
    • Paolo Bonzini's avatar
      target-i386: save 64-bit CR3 in 64-bit SMM state save area · cbea0c26
      Paolo Bonzini authored
      
      The x86_64 CR3 register is 64 bits wide, save all of them!
      
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      cbea0c26
    • Peter Maydell's avatar
      Merge remote-tracking branch 'remotes/armbru/tags/pull-hw-2015-04-02' into staging · 913fbe9a
      Peter Maydell authored
      
      hw: Contain drive, serial, parallel, net misuse
      
      # gpg: Signature made Thu Apr  2 14:32:00 2015 BST 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-hw-2015-04-02:
        sysbus: Make devices picking up backends unavailable with -device
        sdhci: Make device "sdhci-pci" unavailable with -device
        hw: Mark device misusing nd_table[] FIXME
        hw: Mark devices picking up char backends actively FIXME
        hw: Mark devices picking up block backends actively FIXME
      
      Signed-off-by: default avatarPeter Maydell <peter.maydell@linaro.org>
      913fbe9a
    • Markus Armbruster's avatar
      sysbus: Make devices picking up backends unavailable with -device · 9f9bdf43
      Markus Armbruster authored
      
      Device models aren't supposed to go on fishing expeditions for
      backends.  They should expose suitable properties for the user to set.
      For onboard devices, board code sets them.
      
      A number of sysbus devices pick up block backends in their init() /
      instance_init() methods with drive_get_next() instead: sl-nand,
      milkymist-memcard, pl181, generic-sdhci.
      
      Likewise, a number of sysbus devices pick up character backends in
      their init() / realize() methods with qemu_char_get_next_serial():
      cadence_uart, digic-uart, etraxfs,serial, lm32-juart, lm32-uart,
      milkymist-uart, pl011, stm32f2xx-usart, xlnx.xps-uartlite.
      
      All these mistakes are already marked FIXME.  See the commit that
      added these FIXMEs for a more detailed explanation of what's wrong.
      
      Fortunately, only machines ppce500 and pseries-* support -device with
      sysbus devices, and none of the devices above is supported with these
      machines.
      
      Set cannot_instantiate_with_device_add_yet to preserve our luck.
      
      Cc: Andrzej Zaborowski <balrogg@gmail.com>
      Cc: Peter Crosthwaite <peter.crosthwaite@xilinx.com>
      Cc: Antony Pavlov <antonynpavlov@gmail.com>
      Cc: "Edgar E. Iglesias" <edgar.iglesias@gmail.com>
      Cc: Michael Walle <michael@walle.cc>
      Signed-off-by: default avatarMarkus Armbruster <armbru@redhat.com>
      9f9bdf43
    • Markus Armbruster's avatar
      sdhci: Make device "sdhci-pci" unavailable with -device · 19109131
      Markus Armbruster authored
      
      Device models aren't supposed to go on fishing expeditions for
      backends.  They should expose suitable properties for the user to set.
      For onboard devices, board code sets them.
      
      "sdhci-pci" picks up its block backend in its realize() method with
      drive_get_next() instead.  Already marked FIXME.  See the commit that
      added the FIXME for a more detailed explanation of what's wrong.
      
      We can't fix this in time for the release, but since the device is new
      in 2.3, we can set cannot_instantiate_with_device_add_yet to disable
      it before this mistake becomes ABI, and we have to support command
      lines like
      
          $ qemu -drive if=sd -drive if=sd,file=sd.img -device sdhci-pci -device sdhci-pci
      
      forever.
      
      Signed-off-by: default avatarMarkus Armbruster <armbru@redhat.com>
      19109131
    • Markus Armbruster's avatar
      hw: Mark device misusing nd_table[] FIXME · 19f33f16
      Markus Armbruster authored
      
      NICs defined with -net nic are for board initialization to wire up.
      Board code examines nd_table[] to find them, and creates devices with
      their qdev NIC properties set accordingly.
      
      Except "allwinner-a10" goes on a fishing expedition for NIC
      configuration instead of exposing the usual NIC properties for board
      code to set: it uses nd_table[0] in its instance_init() method.
      
      Picking up the first -net nic option's configuration that way works
      when the device is created by board code.  But it's inappropriate for
      -device and device_add.  Not only is it inconsistent with how the
      other block device models work (they get their configuration from
      properties "mac", "vlan", "netdev"), it breaks when nd_table[0] has
      been picked up by the board or a previous -device / device_add
      already.
      
      Example:
      
          $ qemu-system-arm -S -M cubieboard -device allwinner-a10
          qemu-system-arm: -device allwinner-a10: Property 'allwinner-emac.netdev' can't take value 'hub0port0', it's in use
          Aborted (core dumped)
      
      It also breaks in other entertaining ways:
      
          $ qemu-system-arm -M highbank -device allwinner-a10
          qemu-system-arm: -device allwinner-a10: Unsupported NIC model: xgmac
          $ qemu-system-arm -M highbank -net nic,model=allwinner-emac -device allwinner-a10
          qemu-system-arm: Unsupported NIC model: allwinner-emac
      
      Mark the mistake with a FIXME comment.
      
      Cc: Li Guang <lig.fnst@cn.fujitsu.com>
      Signed-off-by: default avatarMarkus Armbruster <armbru@redhat.com>
      19f33f16
    • Markus Armbruster's avatar
      hw: Mark devices picking up char backends actively FIXME · d71b22bb
      Markus Armbruster authored
      
      Character devices defined with -serial and -parallel are for board
      initialization to wire up.  Board code examines serial_hds[] and
      parallel_hds[] to find them, and creates devices with their qdev
      chardev properties set accordingly.
      
      Except a few devices go on a fishing expedition for a suitable backend
      instead of exposing a chardev property for board code to set: they use
      serial_hds[] (often via qemu_char_get_next_serial()) or parallel_hds[]
      in their realize() or init() method to connect to a backend.
      
      Picking up backends that way works when the devices are created by
      board code.  But it's inappropriate for -device or device_add.  Not
      only is it inconsistent with how the other characrer device models
      work (they connect to a backend explicitly identified by a "chardev"
      property), it breaks when the backend has been picked up by the board
      or a previous -device / device_add already.
      
      Example:
      
          $ qemu-system-ppc64 -M bamboo -S -device i82378 -device pc87312 -device pc87312
          qemu-system-ppc64: -device pc87312: Property 'isa-parallel.chardev' can't take value 'parallel0', it's in use
      
      Mark them with suitable FIXME comments.
      
      Cc: Li Guang <lig.fnst@cn.fujitsu.com>
      Cc: Peter Crosthwaite <peter.crosthwaite@xilinx.com>
      Cc: Antony Pavlov <antonynpavlov@gmail.com>
      Cc: "Edgar E. Iglesias" <edgar.iglesias@gmail.com>
      Cc: Michael Walle <michael@walle.cc>
      Cc: Peter Crosthwaite <peter.crosthwaite@xilinx.com>
      Cc: "Andreas Färber" <andreas.faerber@web.de>
      Signed-off-by: default avatarMarkus Armbruster <armbru@redhat.com>
      d71b22bb
    • Markus Armbruster's avatar
      hw: Mark devices picking up block backends actively FIXME · af9e40aa
      Markus Armbruster authored
      
      Drives defined with if!=none are for board initialization to wire up.
      Board code calls drive_get() or similar to find them, and creates
      devices with their qdev drive properties set accordingly.
      
      Except a few devices go on a fishing expedition for a suitable backend
      instead of exposing a drive property for board code to set: they call
      driver_get() or drive_get_next() in their realize() or init() method
      to implicitly connect to the "next" backend with a certain interface
      type.
      
      Picking up backends that way works when the devices are created by
      board code.  But it's inappropriate for -device or device_add.  Not
      only is this inconsistent with how the other block device models work
      (they connect to a backend explicitly identified by a "drive"
      property), it breaks when the "next" backend has been picked up by the
      board already.
      
      Example:
      
          $ qemu-system-arm -S -M connex -pflash flash.img -device ssi-sd
          Aborted (core dumped)
      
      Mark them with suitable FIXME comments.
      
      Cc: Andrzej Zaborowski <balrogg@gmail.com>
      Cc: Peter Crosthwaite <peter.crosthwaite@xilinx.com>
      Cc: "Andreas Färber" <andreas.faerber@web.de>
      Cc: Michael Walle <michael@walle.cc>
      Signed-off-by: default avatarMarkus Armbruster <armbru@redhat.com>
      af9e40aa
    • Peter Maydell's avatar
      hw/arm/vexpress: Don't double-free flash filename · 11f10cf8
      Peter Maydell authored
      Commits 6e05a12f and db25a158
      
       both attempt to fix the
      same "failed to free memory containing flash filename" bug,
      with the effect that when they were both applied we ended
      up freeing the memory twice. Delete the spurious extra free.
      
      Signed-off-by: default avatarPeter Maydell <peter.maydell@linaro.org>
      Reviewed-by: default avatarStefan Weil <sw@weilnetz.de>
      Message-id: 1427968334-14527-1-git-send-email-peter.maydell@linaro.org
      11f10cf8
    • Shannon Zhao's avatar
      hw/arm/virt: Fix corruption due to double free · c408d27a
      Shannon Zhao authored
      As 4de9a883(hw/arm/virt: Fix memory leak reported by Coverity)
      and 6e05a12f
      
      (arm: fix memory leak) both handle the memory leak
      reported by Coverity, this cause qemu corruption due to
      double free.
      
      Signed-off-by: default avatarShannon Zhao <zhaoshenglong@huawei.com>
      Signed-off-by: default avatarShannon Zhao <shannon.zhao@linaro.org>
      Reviewed-by: default avatarStefan Weil <sw@weilnetz.de>
      Message-id: 1427944026-8968-1-git-send-email-zhaoshenglong@huawei.com
      Signed-off-by: default avatarPeter Maydell <peter.maydell@linaro.org>
      c408d27a
  9. 01 Apr, 2015 1 commit
    • Peter Maydell's avatar
      Merge remote-tracking branch 'remotes/pmaydell/tags/pull-target-arm-20150401' into staging · 289494da
      Peter Maydell authored
      
      target-arm:
       * Fix broken migration on AArch64 KVM
       * Fix minor memory leaks in virt, vexpress, highbank
       * Honour requested filename when loading highbank rom image
      
      # gpg: Signature made Wed Apr  1 18:06:09 2015 BST using RSA key ID 14360CDE
      # gpg: Good signature from "Peter Maydell <peter.maydell@linaro.org>"
      
      * remotes/pmaydell/tags/pull-target-arm-20150401:
        target-arm: kvm64 fix save/restore of SPSR regs
        target-arm: kvm64 sync FP register state
        hw/intc: arm_gic_kvm.c restore config first
        target-arm: kvm: save/restore mp state
        target-arm: Store SPSR_EL1 state in banked_spsr[1] (SPSR_svc)
        hw/arm/virt: Fix memory leak reported by Coverity
        hw/arm/vexpress: Fix memory leak reported by Coverity
        hw/arm/highbank: Fix resource leak and wrong image loading
      
      Signed-off-by: default avatarPeter Maydell <peter.maydell@linaro.org>
      289494da