1. 08 1月, 2020 26 次提交
  2. 07 1月, 2020 14 次提交
    • P
      tests/iothread: Always connect iothread GSource to a GMainContext · 0cb04061
      Peter Maydell 提交于
      On older versions of glib (anything prior to glib commit 0f056ebe
      from May 2019), the implementation of g_source_ref() and
      g_source_unref() is not threadsafe for a GSource which is not
      attached to a GMainContext.
      
      QEMU's real iothread.c implementation always attaches its
      iothread->ctx's GSource to a GMainContext created for that iothread,
      so it is OK, but the simple test framework implementation in
      tests/iothread.c was not doing this.  This was causing intermittent
      assertion failures in the test-aio-multithread subtest
      "/aio/multi/mutex/contended" test on the BSD hosts.  (It's unclear
      why only BSD seems to have been affected -- perhaps a combination of
      the specific glib version being used in the VMs and their happening
      to run on a host with a lot of CPUs).
      
      Borrow the iothread_init_gcontext() from the real iothread.c
      and add the corresponding cleanup code and the calls to
      g_main_context_push/pop_thread_default() so we actually use
      the GMainContext we create.
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      Reviewed-by: NMarc-André Lureau <marcandre.lureau@redhat.com>
      Reviewed-by: NPeter Xu <peterx@redhat.com>
      Message-id: 20200106144552.7205-1-peter.maydell@linaro.org
      0cb04061
    • L
      target/m68k: only change valid bits in CACR · 18b6102e
      Laurent Vivier 提交于
      This is used by netBSD (and MacOS ROM) to detect the MMU type
      Signed-off-by: NLaurent Vivier <laurent@vivier.eu>
      Reviewed-by: NThomas Huth <huth@tuxfamily.org>
      Message-Id: <20191220172415.35838-1-laurent@vivier.eu>
      [lv: add a comment before m680x0_cpu_common()]
      Signed-off-by: NLaurent Vivier <laurent@vivier.eu>
      18b6102e
    • J
      q800: implement mac rom reset function for BIOS-less mode · e24e58e8
      Jason A. Donenfeld 提交于
      On Linux, calling `reboot(RB_AUTOBOOT);` will result in
      arch/m68k/mac/misc.c's mac_reset function being called. That in turn
      looks at the rombase (or uses 0x40800000 is there's no rombase), adds
      0xa, and jumps to that address. At the moment, there's nothing there, so
      the kernel just crashes when trying to reboot. So, this commit adds a
      very simple implementation at that location, which just writes to via2
      to power down. We also correct the value of ROMBASE while we're at it.
      Signed-off-by: NJason A. Donenfeld <Jason@zx2c4.com>
      Reviewed-by: NLaurent Vivier <laurent@vivier.eu>
      Message-Id: <20200102120150.281082-1-Jason@zx2c4.com>
      Signed-off-by: NLaurent Vivier <laurent@vivier.eu>
      e24e58e8
    • L
      q800: add a block backend to the PRAM · eb064db9
      Laurent Vivier 提交于
      This allows to save and restore the content of the PRAM.
      It may be useful if we want to check the configuration or to change it.
      
      The backend is added using mtd interface, for instance:
      
          ... -drive file=pram.img,format=raw,if=mtd ...
      
      where pram.img is the file where the data will be stored, its size must
      be 256 bytes.
      Signed-off-by: NLaurent Vivier <laurent@vivier.eu>
      Message-Id: <20191219201439.84804-3-laurent@vivier.eu>
      eb064db9
    • L
      q800: fix mac_via RTC PRAM commands · b2619c15
      Laurent Vivier 提交于
      The command byte is not decoded correctly.
      
      This patch reworks the RTC/PRAM interface and fixes the problem.
      It adds a comment before the function to explain how are encoded commands
      and some trace-events to ease debugging.
      
      Bug: https://bugs.launchpad.net/qemu/+bug/1856549
      Fixes: 6dca62a0 ("hw/m68k: add VIA support")
      Signed-off-by: NLaurent Vivier <laurent@vivier.eu>
      Reviewed-by: NMark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
      Message-Id: <20191219201439.84804-2-laurent@vivier.eu>
      b2619c15
    • P
      Merge remote-tracking branch 'remotes/awilliam/tags/vfio-fixes-20200106.0' into staging · a8f2c60c
      Peter Maydell 提交于
      VFIO fixes 2020-01-06
      
       - Fix irqchip notifier de-registration if not registered (Peter Xu)
      
      # gpg: Signature made Mon 06 Jan 2020 21:58:17 GMT
      # gpg:                using RSA key 239B9B6E3BB08B22
      # gpg: Good signature from "Alex Williamson <alex.williamson@redhat.com>" [full]
      # gpg:                 aka "Alex Williamson <alex@shazbot.org>" [full]
      # gpg:                 aka "Alex Williamson <alwillia@redhat.com>" [full]
      # gpg:                 aka "Alex Williamson <alex.l.williamson@gmail.com>" [full]
      # Primary key fingerprint: 42F6 C04E 540B D1A9 9E7B  8A90 239B 9B6E 3BB0 8B22
      
      * remotes/awilliam/tags/vfio-fixes-20200106.0:
        vfio/pci: Don't remove irqchip notifier if not registered
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      a8f2c60c
    • P
      Merge remote-tracking branch 'remotes/xtensa/tags/20200106-xtensa' into staging · cdbc5c51
      Peter Maydell 提交于
      target/xtensa improvements for v5.0:
      
      - fix ps.ring use in MPU configs;
      - use MPU background map from the configuration overlay.
      
      # gpg: Signature made Mon 06 Jan 2020 20:00:33 GMT
      # gpg:                using RSA key 2B67854B98E5327DCDEB17D851F9CC91F83FA044
      # gpg:                issuer "jcmvbkbc@gmail.com"
      # gpg: Good signature from "Max Filippov <filippov@cadence.com>" [unknown]
      # gpg:                 aka "Max Filippov <max.filippov@cogentembedded.com>" [full]
      # gpg:                 aka "Max Filippov <jcmvbkbc@gmail.com>" [full]
      # Primary key fingerprint: 2B67 854B 98E5 327D CDEB  17D8 51F9 CC91 F83F A044
      
      * remotes/xtensa/tags/20200106-xtensa:
        target/xtensa: use MPU background map from core configuration
        target/xtensa: import xtensa/config/core-isa.h
        target/xtensa: fix ps.ring use in MPU configs
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      cdbc5c51
    • P
      vfio/pci: Don't remove irqchip notifier if not registered · 0446f812
      Peter Xu 提交于
      The kvm irqchip notifier is only registered if the device supports
      INTx, however it's unconditionally removed.  If the assigned device
      does not support INTx, this will cause QEMU to crash when unplugging
      the device from the system.  Change it to conditionally remove the
      notifier only if the notify hook is setup.
      
      CC: Eduardo Habkost <ehabkost@redhat.com>
      CC: David Gibson <david@gibson.dropbear.id.au>
      CC: Alex Williamson <alex.williamson@redhat.com>
      Cc: qemu-stable@nongnu.org # v4.2
      Reported-by: yanghliu@redhat.com
      Debugged-by: NEduardo Habkost <ehabkost@redhat.com>
      Fixes: c5478fea ("vfio/pci: Respond to KVM irqchip change notifier")
      Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1782678Signed-off-by: NPeter Xu <peterx@redhat.com>
      Reviewed-by: NDavid Gibson <david@gibson.dropbear.id.au>
      Reviewed-by: NGreg Kurz <groug@kaod.org>
      Signed-off-by: NAlex Williamson <alex.williamson@redhat.com>
      0446f812
    • M
      target/xtensa: use MPU background map from core configuration · a153a3f7
      Max Filippov 提交于
      Configuration overlay may define MPU background map. Import
      core-matmap.h from the overlay and use XCHAL_MPU_BACKGROUND_MAP macro
      if it's defined.
      Signed-off-by: NMax Filippov <jcmvbkbc@gmail.com>
      a153a3f7
    • M
      target/xtensa: import xtensa/config/core-isa.h · ca3c979d
      Max Filippov 提交于
      Import core-isa.h from its canonical place in the configuration overlay.
      Drop --xform option from the tar command line.
      Signed-off-by: NMax Filippov <jcmvbkbc@gmail.com>
      ca3c979d
    • M
      target/xtensa: fix ps.ring use in MPU configs · 6c438056
      Max Filippov 提交于
      Allow ps.ring modification by wsr.ps/xsr.ps and use ps.ring value in
      xtensa_get_[c]ring on configurations with MPU.
      Signed-off-by: NMax Filippov <jcmvbkbc@gmail.com>
      6c438056
    • P
      Merge remote-tracking branch 'remotes/elmarco/tags/dbus-vmstate7-pull-request' into staging · c4d1069c
      Peter Maydell 提交于
      Add dbus-vmstate
      
      Hi,
      
      With external processes or helpers participating to the VM support, it
      becomes necessary to handle their migration. Various options exist to
      transfer their state:
      1) as the VM memory, RAM or devices (we could say that's how
         vhost-user devices can be handled today, they are expected to
         restore from ring state)
      2) other "vmstate" (as with TPM emulator state blobs)
      3) left to be handled by management layer
      
      1) is not practical, since an external processes may legitimatelly
      need arbitrary state date to back a device or a service, or may not
      even have an associated device.
      
      2) needs ad-hoc code for each helper, but is simple and working
      
      3) is complicated for management layer, QEMU has the migration timing
      
      The proposed "dbus-vmstate" object will connect to a given D-Bus
      address, and save/load from org.qemu.VMState1 owners on migration.
      
      Thus helpers can easily have their state migrated with QEMU, without
      implementing ad-hoc support (such as done for TPM emulation)
      
      D-Bus is ubiquitous on Linux (it is systemd IPC), and can be made to
      work on various other OSes. There are several implementations and good
      bindings for various languages.  (the tests/dbus-vmstate-test.c is a
      good example of how simple the implementation of services can be, even
      in C)
      
      dbus-vmstate is put into use by the libvirt series "[PATCH 00/23] Use
      a slirp helper process".
      
      v2:
       - fix build with broken mingw-glib
      
      # gpg: Signature made Mon 06 Jan 2020 14:43:35 GMT
      # gpg:                using RSA key 87A9BD933F87C606D276F62DDAE8E10975969CE5
      # gpg:                issuer "marcandre.lureau@redhat.com"
      # gpg: Good signature from "Marc-André Lureau <marcandre.lureau@redhat.com>" [full]
      # gpg:                 aka "Marc-André Lureau <marcandre.lureau@gmail.com>" [full]
      # Primary key fingerprint: 87A9 BD93 3F87 C606 D276  F62D DAE8 E109 7596 9CE5
      
      * remotes/elmarco/tags/dbus-vmstate7-pull-request:
        tests: add dbus-vmstate-test
        tests: add migration-helpers unit
        dockerfiles: add dbus-daemon to some of latest distributions
        configure: add GDBUS_CODEGEN
        Add dbus-vmstate object
        util: add dbus helper unit
        docs: start a document to describe D-Bus usage
        vmstate: replace DeviceState with VMStateIf
        vmstate: add qom interface to get id
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      c4d1069c
    • P
      Merge remote-tracking branch 'remotes/maxreitz/tags/pull-block-2020-01-06' into staging · f4d8cf14
      Peter Maydell 提交于
      Block patches:
      - Minor fixes and tests from the freeze period (too minor to be included
        in 4.2)
      - Allow many bash iotests to test qcow2's external data file feature
      - Add compress filter driver
      - Fix Python iotests after 6f6e1698
      - Fix for the backup job
      
      # gpg: Signature made Mon 06 Jan 2020 14:33:06 GMT
      # gpg:                using RSA key 91BEB60A30DB3E8857D11829F407DB0061D5CF40
      # gpg:                issuer "mreitz@redhat.com"
      # gpg: Good signature from "Max Reitz <mreitz@redhat.com>" [full]
      # Primary key fingerprint: 91BE B60A 30DB 3E88 57D1  1829 F407 DB00 61D5 CF40
      
      * remotes/maxreitz/tags/pull-block-2020-01-06: (34 commits)
        backup-top: Begin drain earlier
        tests/qemu-iotests: Update tests to recent desugarized -accel option
        tests/qemu-iotests: add case to write compressed data of multiple clusters
        qcow2: Allow writing compressed data of multiple clusters
        block: introduce compress filter driver
        iotests: Allow check -o data_file
        iotests: Disable data_file where it cannot be used
        iotests: Make 198 work with data_file
        iotests: Make 137 work with data_file
        iotests: Make 110 work with data_file
        iotests: Make 091 work with data_file
        iotests: Avoid cp/mv of test images
        iotests: Use _rm_test_img for deleting test images
        iotests: Avoid qemu-img create
        iotests: Drop IMGOPTS use in 267
        iotests: Replace IMGOPTS='' by --no-opts
        iotests: Replace IMGOPTS= by -o
        iotests: Inject space into -ocompat=0.10 in 051
        iotests: Add -o and --no-opts to _make_test_img
        iotests: Let _make_test_img parse its parameters
        ...
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      f4d8cf14
    • L
      intel_iommu: add present bit check for pasid table entries · 56fc1e6a
      Liu Yi L 提交于
      The present bit check for pasid entry (pe) and pasid directory
      entry (pdire) were missed in previous commits as fpd bit check
      doesn't require present bit as "Set". This patch adds the present
      bit check for callers which wants to get a valid pe/pdire.
      
      Cc: qemu-stable@nongnu.org
      Cc: Kevin Tian <kevin.tian@intel.com>
      Cc: Jacob Pan <jacob.jun.pan@linux.intel.com>
      Cc: Peter Xu <peterx@redhat.com>
      Cc: Yi Sun <yi.y.sun@linux.intel.com>
      Reviewed-by: NPeter Xu <peterx@redhat.com>
      Signed-off-by: NLiu Yi L <yi.l.liu@intel.com>
      Message-Id: <1578058086-4288-3-git-send-email-yi.l.liu@intel.com>
      Reviewed-by: NPeter Xu <peterx@redhat.com>
      Reviewed-by: NMichael S. Tsirkin <mst@redhat.com>
      Signed-off-by: NMichael S. Tsirkin <mst@redhat.com>
      56fc1e6a