Skip to content
Snippets Groups Projects
  1. Apr 10, 2018
    • Peter Maydell's avatar
      Merge remote-tracking branch 'remotes/ericb/tags/pull-qapi-2018-04-10' into staging · 26d6a7c8
      Peter Maydell authored
      
      qapi patches for 2018-04-10
      
      - Peter Xu: iotests: fix wait_until_completed()
      - Peter Xu: iothread: workaround glib bug which hangs qmp-test
      - Peter Xu: monitor: bind dispatch bh to iohandler context
      
      # gpg: Signature made Tue 10 Apr 2018 14:15:09 BST
      # gpg:                using RSA key A7A16B4A2527436A
      # gpg: Good signature from "Eric Blake <eblake@redhat.com>"
      # gpg:                 aka "Eric Blake (Free Software Programmer) <ebb9@byu.net>"
      # gpg:                 aka "[jpeg image of size 6874]"
      # Primary key fingerprint: 71C2 CC22 B1C4 6029 27D2  F3AA A7A1 6B4A 2527 436A
      
      * remotes/ericb/tags/pull-qapi-2018-04-10:
        monitor: bind dispatch bh to iohandler context
        iothread: workaround glib bug which hangs qmp-test
        iotests: fix wait_until_completed()
      
      Signed-off-by: default avatarPeter Maydell <peter.maydell@linaro.org>
      26d6a7c8
    • Peter Maydell's avatar
      Merge remote-tracking branch 'remotes/dgibson/tags/ppc-for-2.12-20180410' into staging · 69550301
      Peter Maydell authored
      
      ppc patch queue 2018-04-10
      
      Here's a rather late pull request with a handful of fixes for 2.12.
      These have been blocked for some time, because I wasn't able to
      complete my usual test set due to the SCSI problem fixed in 37c51741
      "scsi-disk: Don't enlarge min_io_size to max_io_size".
      
      Since we're in hard freeze, these are all bugfixes.  Most are also
      regressions, although in one case it's only a "regression" because a
      longstanding bug has been exposed by a new machine type (sam460ex) in
      the testcases.  There are also a couple of sam460ex fixes that aren't
      regressions since the board didn't exist before.  On the flipside
      though, they're low risk because they only touch board specific code
      for a board that doesn't exist in any released version.
      
      # gpg: Signature made Tue 10 Apr 2018 08:13:52 BST
      # gpg:                using RSA key 6C38CACA20D9B392
      # gpg: Good signature from "David Gibson <david@gibson.dropbear.id.au>"
      # gpg:                 aka "David Gibson (Red Hat) <dgibson@redhat.com>"
      # gpg:                 aka "David Gibson (ozlabs.org) <dgibson@ozlabs.org>"
      # gpg:                 aka "David Gibson (kernel.org) <dwg@kernel.org>"
      # Primary key fingerprint: 75F4 6586 AE61 A66C C44E  87DC 6C38 CACA 20D9 B392
      
      * remotes/dgibson/tags/ppc-for-2.12-20180410:
        roms/u-boot-sam460ex: Change to qemu git mirror and update
        sam460ex: Fix timer frequency and clock multipliers
        tests/boot-serial: Test the sam460ex board
        spapr: Initialize reserved areas list in FDT in H_CAS handler
        target/ppc: Fix backwards migration of msr_mask
        hw/misc/macio: Fix crash when listing device properties of macio device
        target/ppc: Initialize lazy_tlb_flush correctly
      
      Signed-off-by: default avatarPeter Maydell <peter.maydell@linaro.org>
      69550301
    • Peter Maydell's avatar
      Merge remote-tracking branch 'remotes/pmaydell/tags/pull-target-arm-20180410' into staging · f41ee66d
      Peter Maydell authored
      
      target-arm queue:
       * fpu: Fix rounding mode for floatN_to_uintM_round_to_zero
       * tcg: Fix guest state corruption when running 64-bit Arm
         guests on a 32-bit host (especially when using icount)
       * linux-user/signal.c: Ensure AArch64 signal frame isn't too small
       * cpus.c: ensure running CPU recalculates icount deadlines on timer expiry
       * target/arm: Report unsupported MPU region sizes more clearly
       * hw/arm/fsl-imx: Fix introspection problem with fsl-imx6 and fsl-imx7
       * hw/arm/allwinner-a10: Do not use nd_table in instance_init function
       * hw/sd/bcm2835_sdhost: Don't raise spurious interrupts
       * hw/sd/bcm2835_sdhost: Add tracepoints
       * target-arm: Check undefined opcodes for SWP in A32 decoder
       * hw/arm/integratorcp: Don't do things that could be fatal in the instance_init
       * hw/arm: Allow manually specified /psci node
      
      # gpg: Signature made Tue 10 Apr 2018 13:16:12 BST
      # gpg:                using RSA key 3C2525ED14360CDE
      # 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-20180410:
        fpu: Fix rounding mode for floatN_to_uintM_round_to_zero
        tcg: Introduce tcg_set_insn_start_param
        linux-user/signal.c: Ensure AArch64 signal frame isn't too small
        cpus.c: ensure running CPU recalculates icount deadlines on timer expiry
        target/arm: Report unsupported MPU region sizes more clearly
        hw/arm/fsl-imx: Fix introspection problem with fsl-imx6 and fsl-imx7
        hw/arm/allwinner-a10: Do not use nd_table in instance_init function
        hw/sd/bcm2835_sdhost: Don't raise spurious interrupts
        hw/sd/bcm2835_sdhost: Add tracepoints
        target-arm: Check undefined opcodes for SWP in A32 decoder
        hw/arm/integratorcp: Don't do things that could be fatal in the instance_init
        hw/arm: Allow manually specified /psci node
      
      Signed-off-by: default avatarPeter Maydell <peter.maydell@linaro.org>
      f41ee66d
    • Peter Maydell's avatar
      Merge remote-tracking branch 'remotes/kraxel/tags/ui-20180410-pull-request' into staging · df6378eb
      Peter Maydell authored
      
      configure: don't warn on old sdl/gtk versions if disabled.
      keymap + gtk fixes.
      
      # gpg: Signature made Tue 10 Apr 2018 10:23:37 BST
      # gpg:                using RSA key 4CB6D8EED3E87138
      # 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>"
      # Primary key fingerprint: A032 8CFF B93A 17A7 9901  FE7D 4CB6 D8EE D3E8 7138
      
      * remotes/kraxel/tags/ui-20180410-pull-request:
        configure: don't warn SDL abi if disabled
        configure: don't warn GTK if disabled
        gtk: drop pointless code from gd_window_close
        ui: fix keymap detection under Xwayland
      
      Signed-off-by: default avatarPeter Maydell <peter.maydell@linaro.org>
      df6378eb
    • Peter Xu's avatar
      monitor: bind dispatch bh to iohandler context · 951702f3
      Peter Xu authored
      Eric Auger reported the problem days ago that OOB broke ARM when running
      with libvirt:
      
      http://lists.gnu.org/archive/html/qemu-devel/2018-03/msg06231.html
      
      
      
      The problem was that the monitor dispatcher bottom half was bound to
      qemu_aio_context now, which could be polled unexpectedly in block code.
      We should keep the dispatchers run in iohandler_ctx just like what we
      did before the Out-Of-Band series (chardev uses qio, and qio binds
      everything with iohandler_ctx).
      
      If without this change, QMP dispatcher might be run even before reaching
      main loop in block IO path, for example, in a stack like (the ARM case,
      "cont" command handler run even during machine init phase):
      
              #0  qmp_cont ()
              #1  0x00000000006bd210 in qmp_marshal_cont ()
              #2  0x0000000000ac05c4 in do_qmp_dispatch ()
              #3  0x0000000000ac07a0 in qmp_dispatch ()
              #4  0x0000000000472d60 in monitor_qmp_dispatch_one ()
              #5  0x000000000047302c in monitor_qmp_bh_dispatcher ()
              #6  0x0000000000acf374 in aio_bh_call ()
              #7  0x0000000000acf428 in aio_bh_poll ()
              #8  0x0000000000ad5110 in aio_poll ()
              #9  0x0000000000a08ab8 in blk_prw ()
              #10 0x0000000000a091c4 in blk_pread ()
              #11 0x0000000000734f94 in pflash_cfi01_realize ()
              #12 0x000000000075a3a4 in device_set_realized ()
              #13 0x00000000009a26cc in property_set_bool ()
              #14 0x00000000009a0a40 in object_property_set ()
              #15 0x00000000009a3a08 in object_property_set_qobject ()
              #16 0x00000000009a0c8c in object_property_set_bool ()
              #17 0x0000000000758f94 in qdev_init_nofail ()
              #18 0x000000000058e190 in create_one_flash ()
              #19 0x000000000058e2f4 in create_flash ()
              #20 0x00000000005902f0 in machvirt_init ()
              #21 0x00000000007635cc in machine_run_board_init ()
              #22 0x00000000006b135c in main ()
      
      Actually the problem is more severe than that.  After we switched to the
      qemu AIO handler it means the monitor dispatcher code can even be called
      with nested aio_poll(), then it can be an explicit aio_poll() inside
      another main loop aio_poll() which could be racy too; breaking code
      like TPM and 9p that use nested event loops.
      
      Switch to use the iohandler_ctx for monitor dispatchers.
      
      My sincere thanks to Eric Auger who offered great help during both
      debugging and verifying the problem.  The ARM test was carried out by
      applying this patch upon QEMU 2.12.0-rc0 and problem is gone after the
      patch.
      
      A quick test of mine shows that after this patch applied we can pass all
      raw iotests even with OOB on by default.
      
      CC: Eric Blake <eblake@redhat.com>
      CC: Markus Armbruster <armbru@redhat.com>
      CC: Stefan Hajnoczi <stefanha@redhat.com>
      CC: Fam Zheng <famz@redhat.com>
      Reported-by: default avatarEric Auger <eric.auger@redhat.com>
      Tested-by: default avatarEric Auger <eric.auger@redhat.com>
      Signed-off-by: default avatarPeter Xu <peterx@redhat.com>
      Message-Id: <20180410044942.17059-1-peterx@redhat.com>
      Reviewed-by: default avatarEric Blake <eblake@redhat.com>
      Reviewed-by: default avatarStefan Hajnoczi <stefanha@redhat.com>
      Signed-off-by: default avatarEric Blake <eblake@redhat.com>
      951702f3
    • Peter Xu's avatar
      iothread: workaround glib bug which hangs qmp-test · 15544349
      Peter Xu authored
      
      Free the AIO context earlier than the GMainContext (if we have) to
      workaround a glib2 bug that GSource context pointer is not cleared even
      if the context has already been destroyed (while it should).
      
      The patch itself only changed the order to destroy the objects, no
      functional change at all. Without this workaround, we can encounter
      qmp-test hang with oob (and possibly any other use case when iothread is
      used with GMainContexts):
      
        #0  0x00007f35ffe45334 in __lll_lock_wait () from /lib64/libpthread.so.0
        #1  0x00007f35ffe405d8 in _L_lock_854 () from /lib64/libpthread.so.0
        #2  0x00007f35ffe404a7 in pthread_mutex_lock () from /lib64/libpthread.so.0
        #3  0x00007f35fc5b9c9d in g_source_unref_internal (source=0x24f0600, context=0x7f35f0000960, have_lock=0) at gmain.c:1685
        #4  0x0000000000aa6672 in aio_context_unref (ctx=0x24f0600) at /root/qemu/util/async.c:497
        #5  0x000000000065851c in iothread_instance_finalize (obj=0x24f0380) at /root/qemu/iothread.c:129
        #6  0x0000000000962d79 in object_deinit (obj=0x24f0380, type=0x242e960) at /root/qemu/qom/object.c:462
        #7  0x0000000000962e0d in object_finalize (data=0x24f0380) at /root/qemu/qom/object.c:476
        #8  0x0000000000964146 in object_unref (obj=0x24f0380) at /root/qemu/qom/object.c:924
        #9  0x0000000000965880 in object_finalize_child_property (obj=0x24ec640, name=0x24efca0 "mon_iothread", opaque=0x24f0380) at /root/qemu/qom/object.c:1436
        #10 0x0000000000962c33 in object_property_del_child (obj=0x24ec640, child=0x24f0380, errp=0x0) at /root/qemu/qom/object.c:436
        #11 0x0000000000962d26 in object_unparent (obj=0x24f0380) at /root/qemu/qom/object.c:455
        #12 0x0000000000658f00 in iothread_destroy (iothread=0x24f0380) at /root/qemu/iothread.c:365
        #13 0x00000000004c67a8 in monitor_cleanup () at /root/qemu/monitor.c:4663
        #14 0x0000000000669e27 in main (argc=16, argv=0x7ffc8b1ae2f8, envp=0x7ffc8b1ae380) at /root/qemu/vl.c:4749
      
      The glib2 bug is fixed in commit 26056558b ("gmain: allow
      g_source_get_context() on destroyed sources", 2012-07-30), so the first
      good version is glib2 2.33.10. But we still support building with
      glib as old as 2.28, so we need the workaround.
      
      Let's make sure we destroy the GSources first before its owner context
      until we drop support for glib older than 2.33.10.
      
      Signed-off-by: default avatarPeter Xu <peterx@redhat.com>
      Message-Id: <20180409083956.1780-1-peterx@redhat.com>
      Reviewed-by: default avatarEric Blake <eblake@redhat.com>
      Reviewed-by: default avatarStefan Hajnoczi <stefanha@redhat.com>
      Signed-off-by: default avatarEric Blake <eblake@redhat.com>
      15544349
    • Peter Xu's avatar
      iotests: fix wait_until_completed() · c3988519
      Peter Xu authored
      
      If there are more than one events, wait_until_completed() might return
      the 2nd event even if the 1st event is JOB_COMPLETED, since the for loop
      will continue to run even if completed is set to True.
      
      It never happened before, but it can be triggered when OOB is enabled
      due to the RESUME startup message. Fix that up.
      
      Signed-off-by: default avatarPeter Xu <peterx@redhat.com>
      Message-Id: <20180408030542.17855-1-peterx@redhat.com>
      Reviewed-by: default avatarFam Zheng <famz@redhat.com>
      Reviewed-by: default avatarStefan Hajnoczi <stefanha@redhat.com>
      Signed-off-by: default avatarEric Blake <eblake@redhat.com>
      c3988519
    • Richard Henderson's avatar
      fpu: Fix rounding mode for floatN_to_uintM_round_to_zero · bd49e602
      Richard Henderson authored
      
      We incorrectly passed in the current rounding mode
      instead of float_round_to_zero.
      
      Signed-off-by: default avatarRichard Henderson <richard.henderson@linaro.org>
      Message-id: 20180410055912.934-1-richard.henderson@linaro.org
      Reviewed-by: default avatarPeter Maydell <peter.maydell@linaro.org>
      Signed-off-by: default avatarPeter Maydell <peter.maydell@linaro.org>
      bd49e602
    • Richard Henderson's avatar
      tcg: Introduce tcg_set_insn_start_param · 9743cd57
      Richard Henderson authored
      
      The parameters for tcg_gen_insn_start are target_ulong, which may be split
      into two TCGArg parameters for storage in the opcode on 32-bit hosts.
      
      Fixes the ARM target and its direct use of tcg_set_insn_param, which would
      set the wrong argument in the 64-on-32 case.
      
      Cc: qemu-stable@nongnu.org
      Reported-by: default avatar <alarson@ddci.com>
      Signed-off-by: default avatarRichard Henderson <richard.henderson@linaro.org>
      Message-id: 20180410003558.2470-1-richard.henderson@linaro.org
      Reviewed-by: default avatarPeter Maydell <peter.maydell@linaro.org>
      Signed-off-by: default avatarPeter Maydell <peter.maydell@linaro.org>
      9743cd57
    • Peter Maydell's avatar
      linux-user/signal.c: Ensure AArch64 signal frame isn't too small · 7f0f4208
      Peter Maydell authored
      
      The AArch64 signal frame design was extended for SVE in commit
      8c5931de, so that instead of having a fixed setup we
      now add various records to the frame, with some of them possibly
      overflowing into an extra space outside the original 4K reserved
      block in the target_sigcontext.  However, we failed to ensure that we
      always at least allocate the 4K reserved block.  This is ABI, and
      some userspace programs rely on it.  In particular the dash shell
      would segfault if the frame wasn't as big enough.
      
      (Compare the kernel's sigframe_size() function in
      arch/arm64/kernel/signal.c.)
      
      Reported-by: default avatarRichard Henwood <richard.henwood@arm.com>
      Reviewed-by: default avatarLaurent Vivier <laurent@vivier.eu>
      Reviewed-by: default avatarRichard Henderson <richard.henderson@linaro.org>
      Message-id: 20180409140714.26841-1-peter.maydell@linaro.org
      Fixes: https://bugs.launchpad.net/bugs/1761535
      
      
      Fixes: 8c5931de
      Signed-off-by: default avatarPeter Maydell <peter.maydell@linaro.org>
      7f0f4208
    • Peter Maydell's avatar
      cpus.c: ensure running CPU recalculates icount deadlines on timer expiry · c52e7132
      Peter Maydell authored
      When we run in TCG icount mode, we calculate the number of instructions
      to execute using tcg_get_icount_limit(), which ensures that we stop
      execution at the next timer deadline. However there is a bug where
      currently we do not recalculate that limit if the guest reprograms
      a timer so that the next deadline moves closer, and so we will
      continue execution until the original limit and fire the timer
      later than we should.
      
      Fix this bug in qemu_timer_notify_cb(): if we are currently running
      a VCPU in icount mode, we simply need to kick it out of the main
      loop and back to tcg_cpu_exec(), where it will recalculate the
      icount limit. If we are not currently running a VCPU, then we
      retain the existing logic for waking up a halted CPU.
      
      Cc: qemu-stable@nongnu.org
      Fixes: https://bugs.launchpad.net/qemu/+bug/1754038
      
      
      Signed-off-by: default avatarPeter Maydell <peter.maydell@linaro.org>
      Reviewed-by: default avatarRichard Henderson <richard.henderson@linaro.org>
      Reviewed-by: default avatarAlex Bennée <alex.bennee@linaro.org>
      Message-id: 20180406123838.21249-1-peter.maydell@linaro.org
      c52e7132
    • Peter Maydell's avatar
      target/arm: Report unsupported MPU region sizes more clearly · 8aec759b
      Peter Maydell authored
      
      Currently our PMSAv7 and ARMv7M MPU implementation cannot handle
      MPU region sizes smaller than our TARGET_PAGE_SIZE. However we
      report that in a slightly confusing way:
      
       DRSR[3]: No support for MPU (sub)region alignment of 9 bits. Minimum is 10
      
      The problem is not the alignment of the region, but its size;
      tweak the error message to say so:
       DRSR[3]: No support for MPU (sub)region size of 512 bytes. Minimum is 1024.
      
      Signed-off-by: default avatarPeter Maydell <peter.maydell@linaro.org>
      Reviewed-by: default avatarPhilippe Mathieu-Daudé <f4bug@amsat.org>
      Message-id: 20180405172554.27401-1-peter.maydell@linaro.org
      8aec759b
    • Thomas Huth's avatar
      hw/arm/fsl-imx: Fix introspection problem with fsl-imx6 and fsl-imx7 · f640a591
      Thomas Huth authored
      
      QEMU currently exits unexpectedly when trying to introspect the fsl-imx6
      and fsl-imx7 devices on systems with many SMP CPUs:
      
      $ echo "{'execute':'qmp_capabilities'}"\
             "{'execute':'device-list-properties',"\
             " 'arguments':{'typename':'fsl,imx6'}}" \
             | arm-softmmu/qemu-system-arm -M virt,accel=qtest -qmp stdio -smp 8
      {"QMP": {"version": {"qemu": {"micro": 91, "minor": 11, "major": 2},
       "package": "build-all"}, "capabilities": []}}
      {"return": {}}
      fsl,imx6: Only 4 CPUs are supported (8 requested)
      
      And:
      
      $ echo "{'execute':'qmp_capabilities'}"\
             "{'execute':'device-list-properties',"\
             " 'arguments':{'typename':'fsl,imx7'}}" \
             | arm-softmmu/qemu-system-arm -M raspi2,accel=qtest -qmp stdio
      {"QMP": {"version": {"qemu": {"micro": 91, "minor": 11, "major": 2},
       "package": "build-all"}, "capabilities": []}}
      {"return": {}}
      fsl,imx7: Only 2 CPUs are supported (4 requested)
      
      This happens because these devices are doing an exit() from their
      instance_init function - which should never be done since instance_init
      can be called at any time for device introspection! Fix it by moving
      the deadly check into the realize() function instead.
      
      Signed-off-by: default avatarThomas Huth <thuth@redhat.com>
      Message-id: 1522908551-14885-1-git-send-email-thuth@redhat.com
      Reviewed-by: default avatarPeter Maydell <peter.maydell@linaro.org>
      Signed-off-by: default avatarPeter Maydell <peter.maydell@linaro.org>
      f640a591
    • Thomas Huth's avatar
      hw/arm/allwinner-a10: Do not use nd_table in instance_init function · 8aabc543
      Thomas Huth authored
      
      The instance_init function of a device can be called at any time, even
      if the device is not going to be used (i.e. not going to be realized).
      So a instance_init function must not do things that could cause QEMU
      to exit, like calling qemu_check_nic_model(&nd_table[0], ...) for example.
      But this is what the instance_init function of the allwinner-a10 device
      is currently doing - and this causes QEMU to quit unexpectedly when
      you run the 'device-list-properties' QMP command for example:
      
      $ echo "{'execute':'qmp_capabilities'}"\
             "{'execute':'device-list-properties',"\
             " 'arguments':{'typename':'allwinner-a10'}}" \
             | arm-softmmu/qemu-system-arm -M mps2-an505,accel=qtest -qmp stdio
      {"QMP": {"version": {"qemu": {"micro": 91, "minor": 11, "major": 2},
       "package": "build-all"}, "capabilities": []}}
      {"return": {}}
      Unsupported NIC model: lan9118
      
      ... and QEMU quits after printing the last line (which should not happen
      just because of running 'device-list-properties' here).
      
      And with the cubieboard, this even causes QEMU to abort():
      
      $ echo "{'execute':'qmp_capabilities'}"\
             "{'execute':'device-list-properties',"\
             " 'arguments':{'typename':'allwinner-a10'}}" \
             | arm-softmmu/qemu-system-arm -M cubieboard,accel=qtest -qmp stdio
      {"QMP": {"version": {"qemu": {"micro": 91, "minor": 11, "major": 2},
       "package": "build-all"}, "capabilities": []}}
      {"return": {}}
      Unexpected error in error_set_from_qdev_prop_error() at hw/core/qdev-properties.c:1095:
      Property 'allwinner-emac.netdev' can't take value 'hub0port0', it's in use
      Aborted (core dumped)
      
      To fix the problem we've got to move the offending code to the realize
      function instead.
      
      Signed-off-by: default avatarThomas Huth <thuth@redhat.com>
      Message-id: 1522862420-7484-1-git-send-email-thuth@redhat.com
      Reviewed-by: default avatarPeter Maydell <peter.maydell@linaro.org>
      Signed-off-by: default avatarPeter Maydell <peter.maydell@linaro.org>
      8aabc543
    • Peter Maydell's avatar
      hw/sd/bcm2835_sdhost: Don't raise spurious interrupts · f3d9fe8f
      Peter Maydell authored
      
      The Linux bcm2835_sdhost driver doesn't work on QEMU, because our
      model raises spurious data interrupts.  Our function
      bcm2835_sdhost_fifo_run() will flag an interrupt any time it is
      called with s->datacnt == 0, even if the host hasn't actually issued
      a data read or write command yet.  This means that the driver gets a
      spurious data interrupt as soon as it enables IRQs and then does
      something else that causes us to call the fifo_run routine, like
      writing to SDHCFG, and before it does the write to SDCMD to issue the
      read.  The driver's IRQ handler then spins forever complaining that
      there's no data and the SD controller isn't in a state where there's
      going to be any data:
      
      [   41.040738] sdhost-bcm2835 3f202000.mmc: fsm 1, hsts 00000000
      [   41.042059] sdhost-bcm2835 3f202000.mmc: fsm 1, hsts 00000000
      (continues forever).
      
      Move the interrupt flag setting to more plausible places:
       * for BUSY, raise this as soon as a BUSYWAIT command has executed
       * for DATA, raise this when the FIFO has any space free (for a write)
         or any data in it (for a read)
       * for BLOCK, raise this when the data count is 0 and we've
         actually done some reading or writing
      
      This is pure guesswork since the documentation for this hardware is
      not public, but it is sufficient to get the Linux bcm2835_sdhost
      driver to work.
      
      Signed-off-by: default avatarPeter Maydell <peter.maydell@linaro.org>
      Reviewed-by: default avatarPhilippe Mathieu-Daudé <f4bug@amsat.org>
      Tested-by: default avatarGerd Hoffmann <kraxel@redhat.com>
      Message-id: 20180319161556.16446-3-peter.maydell@linaro.org
      f3d9fe8f
    • Peter Maydell's avatar
      hw/sd/bcm2835_sdhost: Add tracepoints · b318f326
      Peter Maydell authored
      
      Add some tracepoints to the bcm2835_sdhost driver, to assist
      debugging.
      
      Signed-off-by: default avatarPeter Maydell <peter.maydell@linaro.org>
      Reviewed-by: default avatarPhilippe Mathieu-Daudé <f4bug@amsat.org>
      Tested-by: default avatarGerd Hoffmann <kraxel@redhat.com>
      Message-id: 20180319161556.16446-2-peter.maydell@linaro.org
      b318f326
    • Onur Sahin's avatar
      target-arm: Check undefined opcodes for SWP in A32 decoder · c4869ca6
      Onur Sahin authored
      
      Make sure we are not treating architecturally Undefined instructions
      as a SWP, by verifying the opcodes as per section A8.8.229 of ARMv7-A
      specification. Bits [21:20] must be zero for this to be a SWP or SWPB.
      We also choose to UNDEF for the architecturally UNPREDICTABLE case of
      bits [11:8] not being zero.
      
      Signed-off-by: default avatarOnur Sahin <onursahin08@gmail.com>
      [PMM: tweaked commit message]
      Reviewed-by: default avatarPeter Maydell <peter.maydell@linaro.org>
      Signed-off-by: default avatarPeter Maydell <peter.maydell@linaro.org>
      c4869ca6
    • Thomas Huth's avatar
      hw/arm/integratorcp: Don't do things that could be fatal in the instance_init · 8720daad
      Thomas Huth authored
      
      An instance_init function must not fail - and might be called multiple times,
      e.g. during device introspection with the 'device-list-properties' QMP
      command. Since the integratorcm device ignores this rule, QEMU currently
      aborts in this case (though it really should not):
      
      echo "{'execute':'qmp_capabilities'}"\
           "{'execute':'device-list-properties',"\
           "'arguments':{'typename':'integrator_core'}}" \
           | arm-softmmu/qemu-system-arm -M integratorcp,accel=qtest -qmp stdio
      {"QMP": {"version": {"qemu": {"micro": 91, "minor": 11, "major": 2},
       "package": "build-all"}, "capabilities": []}}
      {"return": {}}
      RAMBlock "integrator.flash" already registered, abort!
      Aborted (core dumped)
      
      Move the problematic code to the realize() function instead to fix this
      problem.
      
      Reviewed-by: default avatarPhilippe Mathieu-Daudé <f4bug@amsat.org>
      Signed-off-by: default avatarThomas Huth <thuth@redhat.com>
      Message-id: 1522906473-11252-1-git-send-email-thuth@redhat.com
      Signed-off-by: default avatarPeter Maydell <peter.maydell@linaro.org>
      8720daad
    • Andrey Smirnov's avatar
      hw/arm: Allow manually specified /psci node · c39770cd
      Andrey Smirnov authored
      
      Change the code to avoid exiting QEMU if user provided DTB contains
      manually specified /psci node and skip any /psci related fixups
      instead.
      
      Fixes: 4cbca7d9 ("hw/arm: Move virt's PSCI DT fixup code to
      arm/boot.c")
      
      Signed-off-by: default avatarAndrey Smirnov <andrew.smirnov@gmail.com>
      Reported-by: default avatarMarc Zyngier <marc.zyngier@arm.com>
      Tested-by: default avatarMarc Zyngier <marc.zyngier@arm.com>
      Message-id: 20180402205654.14572-1-andrew.smirnov@gmail.com
      Reviewed-by: default avatarPeter Maydell <peter.maydell@linaro.org>
      Signed-off-by: default avatarPeter Maydell <peter.maydell@linaro.org>
      c39770cd
    • Peter Maydell's avatar
      Merge remote-tracking branch 'remotes/jasowang/tags/net-pull-request' into staging · daf6b59b
      Peter Maydell authored
      
      # gpg: Signature made Tue 10 Apr 2018 04:36:01 BST
      # gpg:                using RSA key EF04965B398D6211
      # gpg: Good signature from "Jason Wang (Jason Wang on RedHat) <jasowang@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: 215D 46F4 8246 689E C77F  3562 EF04 965B 398D 6211
      
      * remotes/jasowang/tags/net-pull-request:
        e1000: Old machine types, turn new subsection off
        e1000: Choose which set of props to migrate
        e1000: Migrate props via a temporary structure
        e1000: wire new subsection to property
        e1000: Dupe offload data on reading old stream
        e1000: Convert v3 fields to subsection
      
      Signed-off-by: default avatarPeter Maydell <peter.maydell@linaro.org>
      daf6b59b
    • Peter Maydell's avatar
      Merge remote-tracking branch 'remotes/xtensa/tags/20180409-xtensa' into staging · fb4fe32d
      Peter Maydell authored
      
      Fix file offset for preadv/pwritev linux-user syscalls.
      
      # gpg: Signature made Tue 10 Apr 2018 03:04:24 BST
      # gpg:                using RSA key 51F9CC91F83FA044
      # gpg: Good signature from "Max Filippov <filippov@cadence.com>"
      # gpg:                 aka "Max Filippov <max.filippov@cogentembedded.com>"
      # gpg:                 aka "Max Filippov <jcmvbkbc@gmail.com>"
      # Primary key fingerprint: 2B67 854B 98E5 327D CDEB  17D8 51F9 CC91 F83F A044
      
      * remotes/xtensa/tags/20180409-xtensa:
        linux-user: fix preadv/pwritev offsets
      
      Signed-off-by: default avatarPeter Maydell <peter.maydell@linaro.org>
      fb4fe32d
    • Peter Xu's avatar
      configure: don't warn SDL abi if disabled · c6093a05
      Peter Xu authored
      
      SDL has the same problem as GTK that we might get warnings on SDL ABI
      version even if SDL is disabled.  Fix that by only probing SDL if SDL is
      enabled.  Also this should let configure be a little bit faster since we
      don't really need to probe SDL stuff when it's off.
      
      CC: Paolo Bonzini <pbonzini@redhat.com>
      CC: Gerd Hoffmann <kraxel@redhat.com>
      CC: Peter Maydell <peter.maydell@linaro.org>
      CC: Daniel P. Berrange <berrange@redhat.com>
      CC: Fam Zheng <famz@redhat.com>
      CC: "Philippe Mathieu-Daudé" <f4bug@amsat.org>
      Signed-off-by: default avatarPeter Xu <peterx@redhat.com>
      Reviewed-by: default avatarDaniel P. Berrangé <berrange@redhat.com>
      Reviewed-by: default avatarFam Zheng <famz@redhat.com>
      Message-id: 20180410054034.20479-1-peterx@redhat.com
      Signed-off-by: default avatarGerd Hoffmann <kraxel@redhat.com>
      c6093a05
    • Peter Xu's avatar
      configure: don't warn GTK if disabled · 5a464e6c
      Peter Xu authored
      
      We don't need to detect GTK ABI if GTK is disabled in general.
      Otherwise we could get this warning (when host is installed with GTK ABI
      version 2) even when configure with "--disable-gtk":
      
          WARNING: Use of GTK 2.0 is deprecated and will be removed in
          WARNING: future releases. Please switch to using GTK 3.0
      
      CC: Paolo Bonzini <pbonzini@redhat.com>
      CC: Gerd Hoffmann <kraxel@redhat.com>
      CC: Peter Maydell <peter.maydell@linaro.org>
      CC: Fam Zheng <famz@redhat.com>
      CC: "Philippe Mathieu-Daudé" <f4bug@amsat.org>
      Signed-off-by: default avatarPeter Xu <peterx@redhat.com>
      Reviewed-by: default avatarDaniel P. Berrangé <berrange@redhat.com>
      Message-id: 20180409082323.29575-1-peterx@redhat.com
      Signed-off-by: default avatarGerd Hoffmann <kraxel@redhat.com>
      5a464e6c
    • Gerd Hoffmann's avatar
      gtk: drop pointless code from gd_window_close · fa2d039b
      Gerd Hoffmann authored
      
      Unregistering the display change listener looks like a pointless
      excercise given we'll exit in a moment.  When exiting qemu via
      menu/file/quit this will not happen either.  Just drop the code.
      
      Also return TRUE unconditionally.  This will tell gtk to ignore the
      close request, so gtk will not start destroying widgets and causing
      warnings due to UI code trying to talk to widgets which are gone.
      Just depend on qmp_quit() doing it's job instead.
      
      Reported-by: default avatarMark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
      Signed-off-by: default avatarGerd Hoffmann <kraxel@redhat.com>
      Message-Id: <20180314080439.4229-1-kraxel@redhat.com>
      fa2d039b
    • Daniel P. Berrangé's avatar
      ui: fix keymap detection under Xwayland · 1e70de67
      Daniel P. Berrangé authored
      
      The X11 code currently detects the keymap by looking for the keycode
      name property. Unfortunately due to the way Xwayland handles keyboards,
      this property gets unset almost immediately after the first application
      starts using Xwayland resulting in
      
        ** (qemu-system-x86_64:19644): WARNING **: Unknown X11 keycode mapping '(unnamed)'.
        Please report to qemu-devel@nongnu.org
        including the following information:
      
          - Operating system
          - X11 Server
          - xprop -root
          - xdpyinfo
      
      Fortunately people will only see this problem if they built QEMU with
      GTK2, or have told GTK3 to prefer X11 by setting the GDK_BACKEND=x11
      env variable.
      
      To workaround the problem, we add a heuristic that looks at what
      scancode the XK_Page_Up keysymbol maps to, to determine if we've
      likely got the X11 kbd or evdev driver.
      
      Signed-off-by: default avatarDaniel P. Berrangé <berrange@redhat.com>
      Message-Id: <20180313104235.20725-1-berrange@redhat.com>
      Signed-off-by: default avatarGerd Hoffmann <kraxel@redhat.com>
      1e70de67
    • Dr. David Alan Gilbert's avatar
      e1000: Old machine types, turn new subsection off · 5f523530
      Dr. David Alan Gilbert authored
      
      Turn the newly added subsection off for old machine types
      
      Signed-off-by: default avatarDr. David Alan Gilbert <dgilbert@redhat.com>
      Signed-off-by: default avatarJason Wang <jasowang@redhat.com>
      5f523530
    • Dr. David Alan Gilbert's avatar
      e1000: Choose which set of props to migrate · ff214d42
      Dr. David Alan Gilbert authored
      
      When we're using the subsection we migrate both
      the 'props' and 'tso_props' data; when we're not using
      the subsection (to migrate to 2.11 or old machine types) we've
      got to choose what to migrate in the main structure.
      
      If we're using the subsection migrate 'props' in the main structure.
      If we're not using the subsection then migrate the last one
      that changed, which gives behaviour similar to the old behaviour.
      
      Signed-off-by: default avatarDr. David Alan Gilbert <dgilbert@redhat.com>
      Signed-off-by: default avatarJason Wang <jasowang@redhat.com>
      ff214d42
    • Dr. David Alan Gilbert's avatar
      e1000: Migrate props via a temporary structure · 59354484
      Dr. David Alan Gilbert authored
      
      Swing the tx.props out via a temporary structure, so in future patches
      we can select what we're going to send.
      
      Signed-off-by: default avatarDr. David Alan Gilbert <dgilbert@redhat.com>
      Signed-off-by: default avatarJason Wang <jasowang@redhat.com>
      59354484
    • Dr. David Alan Gilbert's avatar
      e1000: wire new subsection to property · 46f2a9ec
      Dr. David Alan Gilbert authored
      
      Wire the new subsection from the previous commit to a property
      so we can turn it off easily.
      
      Signed-off-by: default avatarDr. David Alan Gilbert <dgilbert@redhat.com>
      Signed-off-by: default avatarJason Wang <jasowang@redhat.com>
      46f2a9ec
    • Dr. David Alan Gilbert's avatar
      e1000: Dupe offload data on reading old stream · 3c4053c5
      Dr. David Alan Gilbert authored
      
      Old QEMUs only had one set of offload data;  when we only receive
      one lot, dupe the received data - that should give us about the
      same bug level as the old version.
      
      Signed-off-by: default avatarDr. David Alan Gilbert <dgilbert@redhat.com>
      Signed-off-by: default avatarJason Wang <jasowang@redhat.com>
      3c4053c5
    • Dr. David Alan Gilbert's avatar
      e1000: Convert v3 fields to subsection · 4ae4bf5b
      Dr. David Alan Gilbert authored
      
      A bunch of new TSO fields were introduced by d62644b4 and this bumped
      the VMState version; however it's easier for those trying to keep
      backwards migration compatibility if these fields are added in a
      subsection instead.
      
      Move the new fields to a subsection.
      
      Since this was added after 2.11, this change will only affect
      compatbility with 2.12-rc0.
      
      Signed-off-by: default avatarDr. David Alan Gilbert <dgilbert@redhat.com>
      Signed-off-by: default avatarJason Wang <jasowang@redhat.com>
      4ae4bf5b
    • Max Filippov's avatar
      linux-user: fix preadv/pwritev offsets · 9ac22517
      Max Filippov authored
      
      preadv/pwritev accept low and high parts of file offset in two separate
      parameters. When host bitness doesn't match guest bitness these parts
      must be appropriately recombined.
      Introduce target_to_host_low_high that does this recombination and use
      it in preadv/pwritev syscalls.
      
      This fixes glibc testsuite test misc/tst-preadvwritev64.
      
      Reviewed-by: default avatarLaurent Vivier <laurent@vivier.eu>
      Reviewed-by: default avatarRichard Henderson <richard.henderson@linaro.org>
      Signed-off-by: default avatarMax Filippov <jcmvbkbc@gmail.com>
      9ac22517
    • BALATON Zoltan's avatar
      roms/u-boot-sam460ex: Change to qemu git mirror and update · 6b3913e0
      BALATON Zoltan authored
      
      Now that we have a mirror of this repo on git.qemu.org change the
      submodule to use that and update it to latest commit which fixes a
      dangling symlink and removes two big binaries that are not needed.
      
      Signed-off-by: default avatarBALATON Zoltan <balaton@eik.bme.hu>
      Signed-off-by: default avatarDavid Gibson <david@gibson.dropbear.id.au>
      6b3913e0
    • BALATON Zoltan's avatar
      sam460ex: Fix timer frequency and clock multipliers · f8815532
      BALATON Zoltan authored
      
      We only emulate timer running at CPU frequency which is what most
      guests expect so set the frequency to match real hardware. This also
      allows setting clock multipliers which caused slowdown previously due
      to wrong timer frequency.
      
      Signed-off-by: default avatarBALATON Zoltan <balaton@eik.bme.hu>
      Signed-off-by: default avatarDavid Gibson <david@gibson.dropbear.id.au>
      f8815532
    • Thomas Huth's avatar
      tests/boot-serial: Test the sam460ex board · 99b336cd
      Thomas Huth authored
      
      We've got a U-Boot firmware for this board in our repository, and
      the firmware prints some output to the serial console, so we can
      check this board in the boot-serial tester, too.
      
      Signed-off-by: default avatarThomas Huth <thuth@redhat.com>
      Signed-off-by: default avatarDavid Gibson <david@gibson.dropbear.id.au>
      99b336cd
    • Alexey Kardashevskiy's avatar
      spapr: Initialize reserved areas list in FDT in H_CAS handler · 127f03e4
      Alexey Kardashevskiy authored
      
      At the moment the device tree produced by the H_CAS handler has no
      reserved map initialized at all which is not correct as at least one
      empty record is required to be present as a marker of the end.
      This does not cause problems now as the only consumer is SLOF which
      does not look at the reserved map area.
      
      However when DTC's "Improve libfdt's memory safety" changeset hits
      the QEMU upstream, there will be errors reported and crashes observed.
      
      This fixes the problem by adding an empty entry to the reserved map,
      just like create_device_tree() does already.
      
      Signed-off-by: default avatarAlexey Kardashevskiy <aik@ozlabs.ru>
      Signed-off-by: default avatarDavid Gibson <david@gibson.dropbear.id.au>
      127f03e4
    • David Gibson's avatar
      target/ppc: Fix backwards migration of msr_mask · efb7db25
      David Gibson authored
      
      21b786f6 "PowerPC: Add TS bits into msr_mask" added the transaction states
      to msr_mask for recent POWER CPUs to allow correct migration of machines
      that are in certain interim transactional memory states.
      
      This was correct, but unfortunately breaks backwards of pseries-2.7 and
      earlier machine types which (stupidly) transferred the msr_mask in the
      migration stream and failed if it wasn't equal on each end.
      
      This works around the problem by masking out the new MSR bits in the
      compatibility code to send the msr_mask on old machine types.
      
      Signed-off-by: default avatarDavid Gibson <david@gibson.dropbear.id.au>
      Reviewed-by: default avatarGreg Kurz <groug@kaod.org>
      Tested-by: default avatarGreg Kurz <groug@kaod.org>
      Tested-by: default avatarLukáš Doktor <ldoktor@redhat.com>
      efb7db25
    • Thomas Huth's avatar
      hw/misc/macio: Fix crash when listing device properties of macio device · ddd835f3
      Thomas Huth authored
      
      The macio-newworld device can currently be used to abort QEMU unexpectedly:
      
      $ ppc-softmmu/qemu-system-ppc -S -M ref405ep,accel=qtest -qmp stdio
      {"QMP": {"version": {"qemu": {"micro": 50, "minor": 11, "major": 2},
       "package": "build-all"}, "capabilities": []}}
      { 'execute': 'qmp_capabilities' }
      {"return": {}}
      { 'execute': 'device-list-properties',
        'arguments': {'typename': 'macio-newworld'}}
      Unexpected error in qemu_chr_fe_init() at chardev/char-fe.c:222:
      Device 'serial0' is in use
      Aborted (core dumped)
      
      qdev properties should be set during realize(), not during instance_init(),
      so move the related code there to fix this problem.
      
      Signed-off-by: default avatarThomas Huth <thuth@redhat.com>
      Reviewed-by: default avatarPhilippe Mathieu-Daudé <f4bug@amsat.org>
      Acked-by: default avatarMark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
      Signed-off-by: default avatarDavid Gibson <david@gibson.dropbear.id.au>
      ddd835f3
    • David Gibson's avatar
      target/ppc: Initialize lazy_tlb_flush correctly · e69ba2b4
      David Gibson authored
      
      ppc_tr_init_disas_context() correctly sets lazy_tlb_flush to true on
      certain CPU models.  However, it leaves it uninitialized, instead of
      setting it to false on all others.
      
      It wasn't caught before now because we didn't have examples in the tests
      that exercised this path.  However it can now be caught using clang's
      undefined behaviour sanitizer and the sam460ex board.
      
      Suggested-by: default avatarPeter Maydell <peter.maydell@linaro.org>
      Signed-off-by: default avatarDavid Gibson <david@gibson.dropbear.id.au>
      Reviewed-by: default avatarThomas Huth <thuth@redhat.com>
      Reviewed-by: default avatarGreg Kurz <groug@kaod.org>
      e69ba2b4
  2. Apr 09, 2018
    • Peter Maydell's avatar
      Merge remote-tracking branch 'remotes/cohuck/tags/s390x-20180409' into staging · 1e7e92e2
      Peter Maydell authored
      
      Fixes for s390x: kvm, vfio-ccw, ipl code, bios. Includes a rebuild
      of s390-ccw.img and s390-netboot.img.
      
      # gpg: Signature made Mon 09 Apr 2018 16:08:19 BST
      # gpg:                using RSA key DECF6B93C6F02FAF
      # gpg: Good signature from "Cornelia Huck <conny@cornelia-huck.de>"
      # gpg:                 aka "Cornelia Huck <huckc@linux.vnet.ibm.com>"
      # gpg:                 aka "Cornelia Huck <cornelia.huck@de.ibm.com>"
      # gpg:                 aka "Cornelia Huck <cohuck@kernel.org>"
      # gpg:                 aka "Cornelia Huck <cohuck@redhat.com>"
      # Primary key fingerprint: C3D0 D66D C362 4FF6 A8C0  18CE DECF 6B93 C6F0 2FAF
      
      * remotes/cohuck/tags/s390x-20180409:
        s390x: load_psw() should only exchange the PSW for KVM
        s390x/mmu: don't overwrite pending exception in mmu translate
        vfio-ccw: fix memory leaks in vfio_ccw_realize()
        pc-bios/s390: update images
        s390: Do not pass inofficial IPL type to the guest
        s390: Ensure IPL from SCSI works as expected
        s390: Refactor IPL parameter block generation
        s390x/kvm: call cpu_synchronize_state() on every kvm_arch_handle_exit()
      
      Signed-off-by: default avatarPeter Maydell <peter.maydell@linaro.org>
      1e7e92e2
Loading