Ver código fonte

Merge tag 'pull-request-2022-04-20' of https://gitlab.com/thuth/qemu into staging

* Drop perl-Test-Harness from the CI containers / VMs
* Some qtest fixes
* Convert ccid doc to restructuredText
* Add compat machines for 7.1
* Allow overwrite smp and memory size in avocado tests

# -----BEGIN PGP SIGNATURE-----
#
# iQJFBAABCAAvFiEEJ7iIR+7gJQEY8+q5LtnXdP5wLbUFAmJf32MRHHRodXRoQHJl
# ZGhhdC5jb20ACgkQLtnXdP5wLbXEHQ//e4S4rlETwKwIQR6SqaOGl9wQr8yPX80r
# V6UFMt+MhTdtItBDa+cDrWY7xkBU3DpIPcfDRfg4P7F/WB5LFaXfYPQHIB28cmkQ
# f5nX4dIVfas/wS+2zk8uvaZEsuv0QiVCKldF2+Z49rE/1UMDfJkHJI+c3MvJToe7
# CPuzR9SL7wfb3gFV5YrDqyZFRtpUurNhQ3j7sfmh+9P+9QVZg118pDI/lE2WIIBT
# HwrB0/keRdgepEv/n+6bwIhf+XRPnKyK8ETRo5vaVaj5BxKDHDVaevNYABp1kBB5
# udyCrEtS4KjPmyNgsMc1ZnIdG2R2pGyRPPYvVUXVpODkAQFoprjTS4yc5Gauqeuj
# EtrDJDnV+EFtZZlnd2T4Uj+ZxTR9suXWF+kJU8R7vXX5Dffu7C7tAw88FqQoG1GR
# mlhtN4fng2PJ/wEZUc+OESVjLUW/3H8yA6rRsbD21gMFaPVxrxc5iXrJoPEWoz1q
# BPbc+1v+lf3PgIDTMokogV0HFaxl8Xoq7T1TaXhQHEbEchfPib55VAHnN7rXKJgs
# eQt7FBqRTCZdFgRnKNZ71NMGdW2suHRk2lpabGPcuGb/bxyJWc6lcdOM8uEMDUlq
# vzAZwbXx3mlGArx7jaGERTrColCgMa0WLbQZ54eP1qCJnqUbzadaIQxmlMaPFWgm
# 2imKnvET5PM=
# =vsLu
# -----END PGP SIGNATURE-----
# gpg: Signature made Wed 20 Apr 2022 03:24:35 AM PDT
# gpg:                using RSA key 27B88847EEE0250118F3EAB92ED9D774FE702DB5
# gpg:                issuer "thuth@redhat.com"
# gpg: Good signature from "Thomas Huth <th.huth@gmx.de>" [undefined]
# gpg:                 aka "Thomas Huth <thuth@redhat.com>" [undefined]
# gpg:                 aka "Thomas Huth <th.huth@posteo.de>" [unknown]
# gpg:                 aka "Thomas Huth <huth@tuxfamily.org>" [undefined]
# 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: 27B8 8847 EEE0 2501 18F3  EAB9 2ED9 D774 FE70 2DB5

* tag 'pull-request-2022-04-20' of https://gitlab.com/thuth/qemu:
  tests/avocado: Allow overwrite smp and memory size command line options
  hw: Add compat machines for 7.1
  docs/ccid: convert to restructuredText
  tests/qtest: properly initialise the vring used idx
  tests/qtest: Move the fuzz tests to x86 only
  tests/qtest: Enable more tests for the "mipsel" target
  tests: Drop perl-Test-Harness from the CI containers / VMs

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Richard Henderson 3 anos atrás
pai
commit
591e7bb5fd
40 arquivos alterados com 289 adições e 265 exclusões
  1. 1 1
      .gitlab-ci.d/cirrus/freebsd-12.vars
  2. 1 1
      .gitlab-ci.d/cirrus/freebsd-13.vars
  3. 2 2
      .gitlab-ci.d/cirrus/macos-11.vars
  4. 0 182
      docs/ccid.txt
  5. 1 0
      docs/system/device-emulation.rst
  6. 171 0
      docs/system/devices/ccid.rst
  7. 8 1
      hw/arm/virt.c
  8. 3 0
      hw/core/machine.c
  9. 3 0
      hw/i386/pc.c
  10. 13 1
      hw/i386/pc_piix.c
  11. 12 1
      hw/i386/pc_q35.c
  12. 8 1
      hw/m68k/virt.c
  13. 13 2
      hw/ppc/spapr.c
  14. 13 1
      hw/s390x/s390-virtio-ccw.c
  15. 3 0
      include/hw/boards.h
  16. 3 0
      include/hw/i386/pc.h
  17. 4 2
      tests/avocado/avocado_qemu/__init__.py
  18. 0 1
      tests/docker/dockerfiles/alpine.docker
  19. 0 1
      tests/docker/dockerfiles/centos8.docker
  20. 0 1
      tests/docker/dockerfiles/debian-arm64-cross.docker
  21. 0 1
      tests/docker/dockerfiles/debian-s390x-cross.docker
  22. 0 1
      tests/docker/dockerfiles/debian-tricore-cross.docker
  23. 0 1
      tests/docker/dockerfiles/fedora-i386-cross.docker
  24. 0 1
      tests/docker/dockerfiles/fedora-win32-cross.docker
  25. 0 1
      tests/docker/dockerfiles/fedora-win64-cross.docker
  26. 0 1
      tests/docker/dockerfiles/fedora.docker
  27. 0 1
      tests/docker/dockerfiles/opensuse-leap.docker
  28. 0 1
      tests/docker/dockerfiles/ubuntu1804.docker
  29. 0 1
      tests/docker/dockerfiles/ubuntu2004.docker
  30. 0 1
      tests/lcitool/projects/qemu.yml
  31. 1 0
      tests/qtest/endianness-test.c
  32. 2 6
      tests/qtest/fuzz-lsi53c895a-test.c
  33. 4 8
      tests/qtest/fuzz-megasas-test.c
  34. 4 8
      tests/qtest/fuzz-sb16-test.c
  35. 4 8
      tests/qtest/fuzz-sdcard-test.c
  36. 2 6
      tests/qtest/fuzz-virtio-scsi-test.c
  37. 2 0
      tests/qtest/libqos/virtio.c
  38. 9 18
      tests/qtest/meson.build
  39. 1 2
      tests/vm/centos.aarch64
  40. 1 1
      tests/vm/fedora

+ 1 - 1
.gitlab-ci.d/cirrus/freebsd-12.vars

@@ -11,6 +11,6 @@ MAKE='/usr/local/bin/gmake'
 NINJA='/usr/local/bin/ninja'
 NINJA='/usr/local/bin/ninja'
 PACKAGING_COMMAND='pkg'
 PACKAGING_COMMAND='pkg'
 PIP3='/usr/local/bin/pip-3.8'
 PIP3='/usr/local/bin/pip-3.8'
-PKGS='alsa-lib bash bzip2 ca_root_nss capstone4 ccache cdrkit-genisoimage ctags curl cyrus-sasl dbus diffutils dtc fusefs-libs3 gettext git glib gmake gnutls gsed gtk3 libepoxy libffi libgcrypt libjpeg-turbo libnfs libspice-server libssh libtasn1 llvm lzo2 meson ncurses nettle ninja opencv p5-Test-Harness perl5 pixman pkgconf png py38-numpy py38-pillow py38-pip py38-sphinx py38-sphinx_rtd_theme py38-virtualenv py38-yaml python3 rpm2cpio sdl2 sdl2_image snappy spice-protocol tesseract texinfo usbredir virglrenderer vte3 zstd'
+PKGS='alsa-lib bash bzip2 ca_root_nss capstone4 ccache cdrkit-genisoimage ctags curl cyrus-sasl dbus diffutils dtc fusefs-libs3 gettext git glib gmake gnutls gsed gtk3 libepoxy libffi libgcrypt libjpeg-turbo libnfs libspice-server libssh libtasn1 llvm lzo2 meson ncurses nettle ninja opencv perl5 pixman pkgconf png py38-numpy py38-pillow py38-pip py38-sphinx py38-sphinx_rtd_theme py38-virtualenv py38-yaml python3 rpm2cpio sdl2 sdl2_image snappy spice-protocol tesseract texinfo usbredir virglrenderer vte3 zstd'
 PYPI_PKGS=''
 PYPI_PKGS=''
 PYTHON='/usr/local/bin/python3'
 PYTHON='/usr/local/bin/python3'

+ 1 - 1
.gitlab-ci.d/cirrus/freebsd-13.vars

@@ -11,6 +11,6 @@ MAKE='/usr/local/bin/gmake'
 NINJA='/usr/local/bin/ninja'
 NINJA='/usr/local/bin/ninja'
 PACKAGING_COMMAND='pkg'
 PACKAGING_COMMAND='pkg'
 PIP3='/usr/local/bin/pip-3.8'
 PIP3='/usr/local/bin/pip-3.8'
-PKGS='alsa-lib bash bzip2 ca_root_nss capstone4 ccache cdrkit-genisoimage ctags curl cyrus-sasl dbus diffutils dtc fusefs-libs3 gettext git glib gmake gnutls gsed gtk3 libepoxy libffi libgcrypt libjpeg-turbo libnfs libspice-server libssh libtasn1 llvm lzo2 meson ncurses nettle ninja opencv p5-Test-Harness perl5 pixman pkgconf png py38-numpy py38-pillow py38-pip py38-sphinx py38-sphinx_rtd_theme py38-virtualenv py38-yaml python3 rpm2cpio sdl2 sdl2_image snappy spice-protocol tesseract texinfo usbredir virglrenderer vte3 zstd'
+PKGS='alsa-lib bash bzip2 ca_root_nss capstone4 ccache cdrkit-genisoimage ctags curl cyrus-sasl dbus diffutils dtc fusefs-libs3 gettext git glib gmake gnutls gsed gtk3 libepoxy libffi libgcrypt libjpeg-turbo libnfs libspice-server libssh libtasn1 llvm lzo2 meson ncurses nettle ninja opencv perl5 pixman pkgconf png py38-numpy py38-pillow py38-pip py38-sphinx py38-sphinx_rtd_theme py38-virtualenv py38-yaml python3 rpm2cpio sdl2 sdl2_image snappy spice-protocol tesseract texinfo usbredir virglrenderer vte3 zstd'
 PYPI_PKGS=''
 PYPI_PKGS=''
 PYTHON='/usr/local/bin/python3'
 PYTHON='/usr/local/bin/python3'

+ 2 - 2
.gitlab-ci.d/cirrus/macos-11.vars

@@ -5,12 +5,12 @@
 # https://gitlab.com/libvirt/libvirt-ci
 # https://gitlab.com/libvirt/libvirt-ci
 
 
 CCACHE='/usr/local/bin/ccache'
 CCACHE='/usr/local/bin/ccache'
-CPAN_PKGS='Test::Harness'
+CPAN_PKGS=''
 CROSS_PKGS=''
 CROSS_PKGS=''
 MAKE='/usr/local/bin/gmake'
 MAKE='/usr/local/bin/gmake'
 NINJA='/usr/local/bin/ninja'
 NINJA='/usr/local/bin/ninja'
 PACKAGING_COMMAND='brew'
 PACKAGING_COMMAND='brew'
 PIP3='/usr/local/bin/pip3'
 PIP3='/usr/local/bin/pip3'
-PKGS='bash bc bzip2 capstone ccache cpanminus ctags curl dbus diffutils dtc gcovr gettext git glib gnu-sed gnutls gtk+3 jemalloc jpeg-turbo libepoxy libffi libgcrypt libiscsi libnfs libpng libslirp libssh libtasn1 libusb llvm lzo make meson ncurses nettle ninja perl pixman pkg-config python3 rpm2cpio sdl2 sdl2_image snappy sparse spice-protocol tesseract texinfo usbredir vde vte3 zlib zstd'
+PKGS='bash bc bzip2 capstone ccache ctags curl dbus diffutils dtc gcovr gettext git glib gnu-sed gnutls gtk+3 jemalloc jpeg-turbo libepoxy libffi libgcrypt libiscsi libnfs libpng libslirp libssh libtasn1 libusb llvm lzo make meson ncurses nettle ninja perl pixman pkg-config python3 rpm2cpio sdl2 sdl2_image snappy sparse spice-protocol tesseract texinfo usbredir vde vte3 zlib zstd'
 PYPI_PKGS='PyYAML numpy pillow sphinx sphinx-rtd-theme virtualenv'
 PYPI_PKGS='PyYAML numpy pillow sphinx sphinx-rtd-theme virtualenv'
 PYTHON='/usr/local/bin/python3'
 PYTHON='/usr/local/bin/python3'

+ 0 - 182
docs/ccid.txt

@@ -1,182 +0,0 @@
-QEMU CCID Device Documentation.
-
-Contents
-1. USB CCID device
-2. Building
-3. Using ccid-card-emulated with hardware
-4. Using ccid-card-emulated with certificates
-5. Using ccid-card-passthru with client side hardware
-6. Using ccid-card-passthru with client side certificates
-7. Passthrough protocol scenario
-8. libcacard
-
-1. USB CCID device
-
-The USB CCID device is a USB device implementing the CCID specification, which
-lets one connect smart card readers that implement the same spec. For more
-information see the specification:
-
- Universal Serial Bus
- Device Class: Smart Card
- CCID
- Specification for
- Integrated Circuit(s) Cards Interface Devices
- Revision 1.1
- April 22rd, 2005
-
-Smartcards are used for authentication, single sign on, decryption in
-public/private schemes and digital signatures. A smartcard reader on the client
-cannot be used on a guest with simple usb passthrough since it will then not be
-available on the client, possibly locking the computer when it is "removed". On
-the other hand this device can let you use the smartcard on both the client and
-the guest machine. It is also possible to have a completely virtual smart card
-reader and smart card (i.e. not backed by a physical device) using this device.
-
-2. Building
-
-The cryptographic functions and access to the physical card is done via the
-libcacard library, whose development package must be installed prior to
-building QEMU:
-
-In redhat/fedora:
-    yum install libcacard-devel
-In ubuntu:
-    apt-get install libcacard-dev
-
-Configuring and building:
-    ./configure --enable-smartcard && make
-
-
-3. Using ccid-card-emulated with hardware
-
-Assuming you have a working smartcard on the host with the current
-user, using libcacard, QEMU acts as another client using ccid-card-emulated:
-
-    qemu -usb -device usb-ccid -device ccid-card-emulated
-
-
-4. Using ccid-card-emulated with certificates stored in files
-
-You must create the CA and card certificates. This is a one time process.
-We use NSS certificates:
-
-    mkdir fake-smartcard
-    cd fake-smartcard
-    certutil -N -d sql:$PWD
-    certutil -S -d sql:$PWD -s "CN=Fake Smart Card CA" -x -t TC,TC,TC -n fake-smartcard-ca
-    certutil -S -d sql:$PWD -t ,, -s "CN=John Doe" -n id-cert -c fake-smartcard-ca
-    certutil -S -d sql:$PWD -t ,, -s "CN=John Doe (signing)" --nsCertType smime -n signing-cert -c fake-smartcard-ca
-    certutil -S -d sql:$PWD -t ,, -s "CN=John Doe (encryption)" --nsCertType sslClient -n encryption-cert -c fake-smartcard-ca
-
-Note: you must have exactly three certificates.
-
-You can use the emulated card type with the certificates backend:
-
-    qemu -usb -device usb-ccid -device ccid-card-emulated,backend=certificates,db=sql:$PWD,cert1=id-cert,cert2=signing-cert,cert3=encryption-cert
-
-To use the certificates in the guest, export the CA certificate:
-
-    certutil -L -r -d sql:$PWD -o fake-smartcard-ca.cer -n fake-smartcard-ca
-
-and import it in the guest:
-
-    certutil -A -d /etc/pki/nssdb -i fake-smartcard-ca.cer -t TC,TC,TC -n fake-smartcard-ca
-
-In a Linux guest you can then use the CoolKey PKCS #11 module to access
-the card:
-
-    certutil -d /etc/pki/nssdb -L -h all
-
-It will prompt you for the PIN (which is the password you assigned to the
-certificate database early on), and then show you all three certificates
-together with the manually imported CA cert:
-
-    Certificate Nickname                        Trust Attributes
-    fake-smartcard-ca                           CT,C,C
-    John Doe:CAC ID Certificate                 u,u,u
-    John Doe:CAC Email Signature Certificate    u,u,u
-    John Doe:CAC Email Encryption Certificate   u,u,u
-
-If this does not happen, CoolKey is not installed or not registered with
-NSS.  Registration can be done from Firefox or the command line:
-
-    modutil -dbdir /etc/pki/nssdb -add "CAC Module" -libfile /usr/lib64/pkcs11/libcoolkeypk11.so
-    modutil -dbdir /etc/pki/nssdb -list
-
-
-5. Using ccid-card-passthru with client side hardware
-
-on the host specify the ccid-card-passthru device with a suitable chardev:
-
-    qemu -chardev socket,server=on,host=0.0.0.0,port=2001,id=ccid,wait=off \
-         -usb -device usb-ccid -device ccid-card-passthru,chardev=ccid
-
-on the client run vscclient, built when you built QEMU:
-
-    vscclient <qemu-host> 2001
-
-
-6. Using ccid-card-passthru with client side certificates
-
-This case is not particularly useful, but you can use it to debug
-your setup if #4 works but #5 does not.
-
-Follow instructions as per #4, except run QEMU and vscclient as follows:
-Run qemu as per #5, and run vscclient from the "fake-smartcard"
-directory as follows:
-
-    qemu -chardev socket,server=on,host=0.0.0.0,port=2001,id=ccid,wait=off \
-         -usb -device usb-ccid -device ccid-card-passthru,chardev=ccid
-    vscclient -e "db=\"sql:$PWD\" use_hw=no soft=(,Test,CAC,,id-cert,signing-cert,encryption-cert)" <qemu-host> 2001
-
-
-7. Passthrough protocol scenario
-
-This is a typical interchange of messages when using the passthru card device.
-usb-ccid is a usb device. It defaults to an unattached usb device on startup.
-usb-ccid expects a chardev and expects the protocol defined in
-cac_card/vscard_common.h to be passed over that.
-The usb-ccid device can be in one of three modes:
- * detached
- * attached with no card
- * attached with card
-
-A typical interchange is: (the arrow shows who started each exchange, it can be client
-originated or guest originated)
-
-client event      |      vscclient           |    passthru    |     usb-ccid  |  guest event
-----------------------------------------------------------------------------------------------
-                  |      VSC_Init            |                |               |
-                  |      VSC_ReaderAdd       |                |     attach    |
-                  |                          |                |               |  sees new usb device.
-card inserted ->  |                          |                |               |
-                  |      VSC_ATR             |   insert       |     insert    |  see new card
-                  |                          |                |               |
-                  |      VSC_APDU            |   VSC_APDU     |               | <- guest sends APDU
-client<->physical |                          |                |               |
-card APDU exchange|                          |                |               |
-client response ->|      VSC_APDU            |   VSC_APDU     |               |  receive APDU response
-                                                    ...
-                                    [APDU<->APDU repeats several times]
-                                                    ...
-card removed  ->  |                          |                |               |
-                  |      VSC_CardRemove      |   remove       |    remove     |   card removed
-                                                    ...
-                                    [(card insert, apdu's, card remove) repeat]
-                                                    ...
-kill/quit         |                          |                |               |
-  vscclient       |                          |                |               |
-                  |      VSC_ReaderRemove    |                |    detach     |
-                  |                          |                |               |   usb device removed.
-
-
-8. libcacard
-
-Both ccid-card-emulated and vscclient use libcacard as the card emulator.
-libcacard implements a completely virtual CAC (DoD standard for smart
-cards) compliant card and uses NSS to retrieve certificates and do
-any encryption.  The backend can then be a real reader and card, or
-certificates stored in files.
-
-For documentation of the library see docs/libcacard.txt.
-

+ 1 - 0
docs/system/device-emulation.rst

@@ -83,6 +83,7 @@ Emulated Devices
    :maxdepth: 1
    :maxdepth: 1
 
 
    devices/can.rst
    devices/can.rst
+   devices/ccid.rst
    devices/ivshmem.rst
    devices/ivshmem.rst
    devices/net.rst
    devices/net.rst
    devices/nvme.rst
    devices/nvme.rst

+ 171 - 0
docs/system/devices/ccid.rst

@@ -0,0 +1,171 @@
+Chip Card Interface Device (CCID)
+=================================
+
+USB CCID device
+---------------
+The USB CCID device is a USB device implementing the CCID specification, which
+lets one connect smart card readers that implement the same spec. For more
+information see the specification::
+
+  Universal Serial Bus
+  Device Class: Smart Card
+  CCID
+  Specification for
+  Integrated Circuit(s) Cards Interface Devices
+  Revision 1.1
+  April 22rd, 2005
+
+Smartcards are used for authentication, single sign on, decryption in
+public/private schemes and digital signatures. A smartcard reader on the client
+cannot be used on a guest with simple usb passthrough since it will then not be
+available on the client, possibly locking the computer when it is "removed". On
+the other hand this device can let you use the smartcard on both the client and
+the guest machine. It is also possible to have a completely virtual smart card
+reader and smart card (i.e. not backed by a physical device) using this device.
+
+Building
+--------
+The cryptographic functions and access to the physical card is done via the
+libcacard library, whose development package must be installed prior to
+building QEMU:
+
+In redhat/fedora::
+
+  yum install libcacard-devel
+
+In ubuntu::
+
+  apt-get install libcacard-dev
+
+Configuring and building::
+
+  ./configure --enable-smartcard && make
+
+Using ccid-card-emulated with hardware
+--------------------------------------
+Assuming you have a working smartcard on the host with the current
+user, using libcacard, QEMU acts as another client using ccid-card-emulated::
+
+  qemu -usb -device usb-ccid -device ccid-card-emulated
+
+Using ccid-card-emulated with certificates stored in files
+----------------------------------------------------------
+You must create the CA and card certificates. This is a one time process.
+We use NSS certificates::
+
+  mkdir fake-smartcard
+  cd fake-smartcard
+  certutil -N -d sql:$PWD
+  certutil -S -d sql:$PWD -s "CN=Fake Smart Card CA" -x -t TC,TC,TC -n fake-smartcard-ca
+  certutil -S -d sql:$PWD -t ,, -s "CN=John Doe" -n id-cert -c fake-smartcard-ca
+  certutil -S -d sql:$PWD -t ,, -s "CN=John Doe (signing)" --nsCertType smime -n signing-cert -c fake-smartcard-ca
+  certutil -S -d sql:$PWD -t ,, -s "CN=John Doe (encryption)" --nsCertType sslClient -n encryption-cert -c fake-smartcard-ca
+
+Note: you must have exactly three certificates.
+
+You can use the emulated card type with the certificates backend::
+
+  qemu -usb -device usb-ccid -device ccid-card-emulated,backend=certificates,db=sql:$PWD,cert1=id-cert,cert2=signing-cert,cert3=encryption-cert
+
+To use the certificates in the guest, export the CA certificate::
+
+  certutil -L -r -d sql:$PWD -o fake-smartcard-ca.cer -n fake-smartcard-ca
+
+and import it in the guest::
+
+  certutil -A -d /etc/pki/nssdb -i fake-smartcard-ca.cer -t TC,TC,TC -n fake-smartcard-ca
+
+In a Linux guest you can then use the CoolKey PKCS #11 module to access
+the card::
+
+  certutil -d /etc/pki/nssdb -L -h all
+
+It will prompt you for the PIN (which is the password you assigned to the
+certificate database early on), and then show you all three certificates
+together with the manually imported CA cert::
+
+  Certificate Nickname                        Trust Attributes
+  fake-smartcard-ca                           CT,C,C
+  John Doe:CAC ID Certificate                 u,u,u
+  John Doe:CAC Email Signature Certificate    u,u,u
+  John Doe:CAC Email Encryption Certificate   u,u,u
+
+If this does not happen, CoolKey is not installed or not registered with
+NSS. Registration can be done from Firefox or the command line::
+
+  modutil -dbdir /etc/pki/nssdb -add "CAC Module" -libfile /usr/lib64/pkcs11/libcoolkeypk11.so
+  modutil -dbdir /etc/pki/nssdb -list
+
+Using ccid-card-passthru with client side hardware
+--------------------------------------------------
+On the host specify the ccid-card-passthru device with a suitable chardev::
+
+  qemu -chardev socket,server=on,host=0.0.0.0,port=2001,id=ccid,wait=off \
+       -usb -device usb-ccid -device ccid-card-passthru,chardev=ccid
+
+On the client run vscclient, built when you built QEMU::
+
+  vscclient <qemu-host> 2001
+
+Using ccid-card-passthru with client side certificates
+------------------------------------------------------
+This case is not particularly useful, but you can use it to debug
+your setup.
+
+Follow instructions above, except run QEMU and vscclient as follows.
+
+Run qemu as per above, and run vscclient from the "fake-smartcard"
+directory as follows::
+
+  qemu -chardev socket,server=on,host=0.0.0.0,port=2001,id=ccid,wait=off \
+       -usb -device usb-ccid -device ccid-card-passthru,chardev=ccid
+  vscclient -e "db=\"sql:$PWD\" use_hw=no soft=(,Test,CAC,,id-cert,signing-cert,encryption-cert)" <qemu-host> 2001
+
+
+Passthrough protocol scenario
+-----------------------------
+This is a typical interchange of messages when using the passthru card device.
+usb-ccid is a usb device. It defaults to an unattached usb device on startup.
+usb-ccid expects a chardev and expects the protocol defined in
+cac_card/vscard_common.h to be passed over that.
+The usb-ccid device can be in one of three modes:
+
+* detached
+* attached with no card
+* attached with card
+
+A typical interchange is (the arrow shows who started each exchange, it can be client
+originated or guest originated)::
+
+  client event        |    vscclient           |    passthru    |    usb-ccid  |  guest event
+  ------------------------------------------------------------------------------------------------
+                      |    VSC_Init            |                |              |
+                      |    VSC_ReaderAdd       |                |    attach    |
+                      |                        |                |              |  sees new usb device.
+    card inserted ->  |                        |                |              |
+                      |    VSC_ATR             |   insert       |    insert    |  see new card
+                      |                        |                |              |
+                      |    VSC_APDU            |   VSC_APDU     |              | <- guest sends APDU
+  client <-> physical |                        |                |              |
+   card APDU exchange |                        |                |              |
+   client response -> |    VSC_APDU            |   VSC_APDU     |              |  receive APDU response
+                                                      ...
+                                      [APDU<->APDU repeats several times]
+                                                      ...
+     card removed  -> |                        |                |              |
+                      |    VSC_CardRemove      |   remove       |   remove     |   card removed
+                                                      ...
+                                      [(card insert, apdu's, card remove) repeat]
+                                                      ...
+    kill/quit         |                        |                |              |
+      vscclient       |                        |                |              |
+                      |    VSC_ReaderRemove    |                |   detach     |
+                      |                        |                |              |   usb device removed.
+
+libcacard
+---------
+Both ccid-card-emulated and vscclient use libcacard as the card emulator.
+libcacard implements a completely virtual CAC (DoD standard for smart
+cards) compliant card and uses NSS to retrieve certificates and do
+any encryption. The backend can then be a real reader and card, or
+certificates stored in files.

+ 8 - 1
hw/arm/virt.c

@@ -3022,10 +3022,17 @@ static void machvirt_machine_init(void)
 }
 }
 type_init(machvirt_machine_init);
 type_init(machvirt_machine_init);
 
 
+static void virt_machine_7_1_options(MachineClass *mc)
+{
+}
+DEFINE_VIRT_MACHINE_AS_LATEST(7, 1)
+
 static void virt_machine_7_0_options(MachineClass *mc)
 static void virt_machine_7_0_options(MachineClass *mc)
 {
 {
+    virt_machine_7_1_options(mc);
+    compat_props_add(mc->compat_props, hw_compat_7_0, hw_compat_7_0_len);
 }
 }
-DEFINE_VIRT_MACHINE_AS_LATEST(7, 0)
+DEFINE_VIRT_MACHINE(7, 0)
 
 
 static void virt_machine_6_2_options(MachineClass *mc)
 static void virt_machine_6_2_options(MachineClass *mc)
 {
 {

+ 3 - 0
hw/core/machine.c

@@ -37,6 +37,9 @@
 #include "hw/virtio/virtio.h"
 #include "hw/virtio/virtio.h"
 #include "hw/virtio/virtio-pci.h"
 #include "hw/virtio/virtio-pci.h"
 
 
+GlobalProperty hw_compat_7_0[] = {};
+const size_t hw_compat_7_0_len = G_N_ELEMENTS(hw_compat_7_0);
+
 GlobalProperty hw_compat_6_2[] = {
 GlobalProperty hw_compat_6_2[] = {
     { "PIIX4_PM", "x-not-migrate-acpi-index", "on"},
     { "PIIX4_PM", "x-not-migrate-acpi-index", "on"},
 };
 };

+ 3 - 0
hw/i386/pc.c

@@ -95,6 +95,9 @@
 #include "trace.h"
 #include "trace.h"
 #include CONFIG_DEVICES
 #include CONFIG_DEVICES
 
 
+GlobalProperty pc_compat_7_0[] = {};
+const size_t pc_compat_7_0_len = G_N_ELEMENTS(pc_compat_7_0);
+
 GlobalProperty pc_compat_6_2[] = {
 GlobalProperty pc_compat_6_2[] = {
     { "virtio-mem", "unplugged-inaccessible", "off" },
     { "virtio-mem", "unplugged-inaccessible", "off" },
 };
 };

+ 13 - 1
hw/i386/pc_piix.c

@@ -415,7 +415,7 @@ static void pc_i440fx_machine_options(MachineClass *m)
     machine_class_allow_dynamic_sysbus_dev(m, TYPE_VMBUS_BRIDGE);
     machine_class_allow_dynamic_sysbus_dev(m, TYPE_VMBUS_BRIDGE);
 }
 }
 
 
-static void pc_i440fx_7_0_machine_options(MachineClass *m)
+static void pc_i440fx_7_1_machine_options(MachineClass *m)
 {
 {
     PCMachineClass *pcmc = PC_MACHINE_CLASS(m);
     PCMachineClass *pcmc = PC_MACHINE_CLASS(m);
     pc_i440fx_machine_options(m);
     pc_i440fx_machine_options(m);
@@ -424,6 +424,18 @@ static void pc_i440fx_7_0_machine_options(MachineClass *m)
     pcmc->default_cpu_version = 1;
     pcmc->default_cpu_version = 1;
 }
 }
 
 
+DEFINE_I440FX_MACHINE(v7_1, "pc-i440fx-7.1", NULL,
+                      pc_i440fx_7_1_machine_options);
+
+static void pc_i440fx_7_0_machine_options(MachineClass *m)
+{
+    pc_i440fx_7_1_machine_options(m);
+    m->alias = NULL;
+    m->is_default = false;
+    compat_props_add(m->compat_props, hw_compat_7_0, hw_compat_7_0_len);
+    compat_props_add(m->compat_props, pc_compat_7_0, pc_compat_7_0_len);
+}
+
 DEFINE_I440FX_MACHINE(v7_0, "pc-i440fx-7.0", NULL,
 DEFINE_I440FX_MACHINE(v7_0, "pc-i440fx-7.0", NULL,
                       pc_i440fx_7_0_machine_options);
                       pc_i440fx_7_0_machine_options);
 
 

+ 12 - 1
hw/i386/pc_q35.c

@@ -360,7 +360,7 @@ static void pc_q35_machine_options(MachineClass *m)
     m->max_cpus = 288;
     m->max_cpus = 288;
 }
 }
 
 
-static void pc_q35_7_0_machine_options(MachineClass *m)
+static void pc_q35_7_1_machine_options(MachineClass *m)
 {
 {
     PCMachineClass *pcmc = PC_MACHINE_CLASS(m);
     PCMachineClass *pcmc = PC_MACHINE_CLASS(m);
     pc_q35_machine_options(m);
     pc_q35_machine_options(m);
@@ -368,6 +368,17 @@ static void pc_q35_7_0_machine_options(MachineClass *m)
     pcmc->default_cpu_version = 1;
     pcmc->default_cpu_version = 1;
 }
 }
 
 
+DEFINE_Q35_MACHINE(v7_1, "pc-q35-7.1", NULL,
+                   pc_q35_7_1_machine_options);
+
+static void pc_q35_7_0_machine_options(MachineClass *m)
+{
+    pc_q35_7_1_machine_options(m);
+    m->alias = NULL;
+    compat_props_add(m->compat_props, hw_compat_7_0, hw_compat_7_0_len);
+    compat_props_add(m->compat_props, pc_compat_7_0, pc_compat_7_0_len);
+}
+
 DEFINE_Q35_MACHINE(v7_0, "pc-q35-7.0", NULL,
 DEFINE_Q35_MACHINE(v7_0, "pc-q35-7.0", NULL,
                    pc_q35_7_0_machine_options);
                    pc_q35_7_0_machine_options);
 
 

+ 8 - 1
hw/m68k/virt.c

@@ -315,10 +315,17 @@ type_init(virt_machine_register_types)
     } \
     } \
     type_init(machvirt_machine_##major##_##minor##_init);
     type_init(machvirt_machine_##major##_##minor##_init);
 
 
+static void virt_machine_7_1_options(MachineClass *mc)
+{
+}
+DEFINE_VIRT_MACHINE(7, 1, true)
+
 static void virt_machine_7_0_options(MachineClass *mc)
 static void virt_machine_7_0_options(MachineClass *mc)
 {
 {
+    virt_machine_7_1_options(mc);
+    compat_props_add(mc->compat_props, hw_compat_7_0, hw_compat_7_0_len);
 }
 }
-DEFINE_VIRT_MACHINE(7, 0, true)
+DEFINE_VIRT_MACHINE(7, 0, false)
 
 
 static void virt_machine_6_2_options(MachineClass *mc)
 static void virt_machine_6_2_options(MachineClass *mc)
 {
 {

+ 13 - 2
hw/ppc/spapr.c

@@ -4702,15 +4702,26 @@ static void spapr_machine_latest_class_options(MachineClass *mc)
     }                                                                \
     }                                                                \
     type_init(spapr_machine_register_##suffix)
     type_init(spapr_machine_register_##suffix)
 
 
+/*
+ * pseries-7.1
+ */
+static void spapr_machine_7_1_class_options(MachineClass *mc)
+{
+    /* Defaults for the latest behaviour inherited from the base class */
+}
+
+DEFINE_SPAPR_MACHINE(7_1, "7.1", true);
+
 /*
 /*
  * pseries-7.0
  * pseries-7.0
  */
  */
 static void spapr_machine_7_0_class_options(MachineClass *mc)
 static void spapr_machine_7_0_class_options(MachineClass *mc)
 {
 {
-    /* Defaults for the latest behaviour inherited from the base class */
+    spapr_machine_7_1_class_options(mc);
+    compat_props_add(mc->compat_props, hw_compat_7_0, hw_compat_7_0_len);
 }
 }
 
 
-DEFINE_SPAPR_MACHINE(7_0, "7.0", true);
+DEFINE_SPAPR_MACHINE(7_0, "7.0", false);
 
 
 /*
 /*
  * pseries-6.2
  * pseries-6.2

+ 13 - 1
hw/s390x/s390-virtio-ccw.c

@@ -792,14 +792,26 @@ bool css_migration_enabled(void)
     }                                                                         \
     }                                                                         \
     type_init(ccw_machine_register_##suffix)
     type_init(ccw_machine_register_##suffix)
 
 
+static void ccw_machine_7_1_instance_options(MachineState *machine)
+{
+}
+
+static void ccw_machine_7_1_class_options(MachineClass *mc)
+{
+}
+DEFINE_CCW_MACHINE(7_1, "7.1", true);
+
 static void ccw_machine_7_0_instance_options(MachineState *machine)
 static void ccw_machine_7_0_instance_options(MachineState *machine)
 {
 {
+    ccw_machine_7_1_instance_options(machine);
 }
 }
 
 
 static void ccw_machine_7_0_class_options(MachineClass *mc)
 static void ccw_machine_7_0_class_options(MachineClass *mc)
 {
 {
+    ccw_machine_7_1_class_options(mc);
+    compat_props_add(mc->compat_props, hw_compat_7_0, hw_compat_7_0_len);
 }
 }
-DEFINE_CCW_MACHINE(7_0, "7.0", true);
+DEFINE_CCW_MACHINE(7_0, "7.0", false);
 
 
 static void ccw_machine_6_2_instance_options(MachineState *machine)
 static void ccw_machine_6_2_instance_options(MachineState *machine)
 {
 {

+ 3 - 0
include/hw/boards.h

@@ -380,6 +380,9 @@ struct MachineState {
     } \
     } \
     type_init(machine_initfn##_register_types)
     type_init(machine_initfn##_register_types)
 
 
+extern GlobalProperty hw_compat_7_0[];
+extern const size_t hw_compat_7_0_len;
+
 extern GlobalProperty hw_compat_6_2[];
 extern GlobalProperty hw_compat_6_2[];
 extern const size_t hw_compat_6_2_len;
 extern const size_t hw_compat_6_2_len;
 
 

+ 3 - 0
include/hw/i386/pc.h

@@ -202,6 +202,9 @@ void pc_madt_cpu_entry(AcpiDeviceIf *adev, int uid,
 /* sgx.c */
 /* sgx.c */
 void pc_machine_init_sgx_epc(PCMachineState *pcms);
 void pc_machine_init_sgx_epc(PCMachineState *pcms);
 
 
+extern GlobalProperty pc_compat_7_0[];
+extern const size_t pc_compat_7_0_len;
+
 extern GlobalProperty pc_compat_6_2[];
 extern GlobalProperty pc_compat_6_2[];
 extern const size_t pc_compat_6_2_len;
 extern const size_t pc_compat_6_2_len;
 
 

+ 4 - 2
tests/avocado/avocado_qemu/__init__.py

@@ -516,6 +516,8 @@ class LinuxTest(LinuxSSHMixIn, QemuSystemTest):
     distro = None
     distro = None
     username = 'root'
     username = 'root'
     password = 'password'
     password = 'password'
+    smp = '2'
+    memory = '1024'
 
 
     def _set_distro(self):
     def _set_distro(self):
         distro_name = self.params.get(
         distro_name = self.params.get(
@@ -546,8 +548,8 @@ def _set_distro(self):
     def setUp(self, ssh_pubkey=None, network_device_type='virtio-net'):
     def setUp(self, ssh_pubkey=None, network_device_type='virtio-net'):
         super().setUp()
         super().setUp()
         self._set_distro()
         self._set_distro()
-        self.vm.add_args('-smp', '2')
-        self.vm.add_args('-m', '1024')
+        self.vm.add_args('-smp', self.smp)
+        self.vm.add_args('-m', self.memory)
         # The following network device allows for SSH connections
         # The following network device allows for SSH connections
         self.vm.add_args('-netdev', 'user,id=vnet,hostfwd=:127.0.0.1:0-:22',
         self.vm.add_args('-netdev', 'user,id=vnet,hostfwd=:127.0.0.1:0-:22',
                          '-device', '%s,netdev=vnet' % network_device_type)
                          '-device', '%s,netdev=vnet' % network_device_type)

+ 0 - 1
tests/docker/dockerfiles/alpine.docker

@@ -73,7 +73,6 @@ RUN apk update && \
         openssh-client \
         openssh-client \
         pcre-dev \
         pcre-dev \
         perl \
         perl \
-        perl-test-harness \
         pixman-dev \
         pixman-dev \
         pkgconf \
         pkgconf \
         pulseaudio-dev \
         pulseaudio-dev \

+ 0 - 1
tests/docker/dockerfiles/centos8.docker

@@ -87,7 +87,6 @@ RUN dnf update -y && \
         pam-devel \
         pam-devel \
         pcre-static \
         pcre-static \
         perl \
         perl \
-        perl-Test-Harness \
         pixman-devel \
         pixman-devel \
         pkgconfig \
         pkgconfig \
         pulseaudio-libs-devel \
         pulseaudio-libs-devel \

+ 0 - 1
tests/docker/dockerfiles/debian-arm64-cross.docker

@@ -29,7 +29,6 @@ RUN export DEBIAN_FRONTEND=noninteractive && \
             hostname \
             hostname \
             libpcre2-dev \
             libpcre2-dev \
             libspice-protocol-dev \
             libspice-protocol-dev \
-            libtest-harness-perl \
             llvm \
             llvm \
             locales \
             locales \
             make \
             make \

+ 0 - 1
tests/docker/dockerfiles/debian-s390x-cross.docker

@@ -29,7 +29,6 @@ RUN export DEBIAN_FRONTEND=noninteractive && \
             hostname \
             hostname \
             libpcre2-dev \
             libpcre2-dev \
             libspice-protocol-dev \
             libspice-protocol-dev \
-            libtest-harness-perl \
             llvm \
             llvm \
             locales \
             locales \
             make \
             make \

+ 0 - 1
tests/docker/dockerfiles/debian-tricore-cross.docker

@@ -25,7 +25,6 @@ RUN apt update && \
        git \
        git \
        libglib2.0-dev \
        libglib2.0-dev \
        libpixman-1-dev \
        libpixman-1-dev \
-       libtest-harness-perl \
        locales \
        locales \
        make \
        make \
        ninja-build \
        ninja-build \

+ 0 - 1
tests/docker/dockerfiles/fedora-i386-cross.docker

@@ -20,7 +20,6 @@ ENV PACKAGES \
     gnutls-devel.i686 \
     gnutls-devel.i686 \
     nettle-devel.i686 \
     nettle-devel.i686 \
     pcre-devel.i686 \
     pcre-devel.i686 \
-    perl-Test-Harness \
     pixman-devel.i686 \
     pixman-devel.i686 \
     sysprof-capture-devel.i686 \
     sysprof-capture-devel.i686 \
     zlib-devel.i686
     zlib-devel.i686

+ 0 - 1
tests/docker/dockerfiles/fedora-win32-cross.docker

@@ -31,7 +31,6 @@ ENV PACKAGES \
     mingw32-SDL2 \
     mingw32-SDL2 \
     msitools \
     msitools \
     perl \
     perl \
-    perl-Test-Harness \
     python3 \
     python3 \
     python3-PyYAML \
     python3-PyYAML \
     tar \
     tar \

+ 0 - 1
tests/docker/dockerfiles/fedora-win64-cross.docker

@@ -28,7 +28,6 @@ ENV PACKAGES \
     mingw64-pkg-config \
     mingw64-pkg-config \
     msitools \
     msitools \
     perl \
     perl \
-    perl-Test-Harness \
     python3 \
     python3 \
     python3-PyYAML \
     python3-PyYAML \
     tar \
     tar \

+ 0 - 1
tests/docker/dockerfiles/fedora.docker

@@ -94,7 +94,6 @@ exec "$@"' > /usr/bin/nosync && \
         openssh-clients \
         openssh-clients \
         pam-devel \
         pam-devel \
         pcre-static \
         pcre-static \
-        perl-Test-Harness \
         perl-base \
         perl-base \
         pixman-devel \
         pixman-devel \
         pkgconfig \
         pkgconfig \

+ 0 - 1
tests/docker/dockerfiles/opensuse-leap.docker

@@ -83,7 +83,6 @@ RUN zypper update -y && \
            openssh \
            openssh \
            pam-devel \
            pam-devel \
            pcre-devel-static \
            pcre-devel-static \
-           perl-Test-Harness \
            perl-base \
            perl-base \
            pkgconfig \
            pkgconfig \
            python3-Pillow \
            python3-Pillow \

+ 0 - 1
tests/docker/dockerfiles/ubuntu1804.docker

@@ -81,7 +81,6 @@ RUN export DEBIAN_FRONTEND=noninteractive && \
             libssh-dev \
             libssh-dev \
             libsystemd-dev \
             libsystemd-dev \
             libtasn1-6-dev \
             libtasn1-6-dev \
-            libtest-harness-perl \
             libubsan1 \
             libubsan1 \
             libudev-dev \
             libudev-dev \
             libusb-1.0-0-dev \
             libusb-1.0-0-dev \

+ 0 - 1
tests/docker/dockerfiles/ubuntu2004.docker

@@ -83,7 +83,6 @@ RUN export DEBIAN_FRONTEND=noninteractive && \
             libssh-dev \
             libssh-dev \
             libsystemd-dev \
             libsystemd-dev \
             libtasn1-6-dev \
             libtasn1-6-dev \
-            libtest-harness-perl \
             libubsan1 \
             libubsan1 \
             libudev-dev \
             libudev-dev \
             libusb-1.0-0-dev \
             libusb-1.0-0-dev \

+ 0 - 1
tests/lcitool/projects/qemu.yml

@@ -79,7 +79,6 @@ packages:
  - pam
  - pam
  - pcre-static
  - pcre-static
  - perl
  - perl
- - perl-Test-Harness
  - pixman
  - pixman
  - pkg-config
  - pkg-config
  - pulseaudio
  - pulseaudio

+ 1 - 0
tests/qtest/endianness-test.c

@@ -28,6 +28,7 @@ struct TestCase {
 static const TestCase test_cases[] = {
 static const TestCase test_cases[] = {
     { "i386", "pc", -1 },
     { "i386", "pc", -1 },
     { "mips", "malta", 0x10000000, .bswap = true },
     { "mips", "malta", 0x10000000, .bswap = true },
+    { "mipsel", "malta", 0x10000000 },
     { "mips64", "magnum", 0x90000000, .bswap = true },
     { "mips64", "magnum", 0x90000000, .bswap = true },
     { "mips64", "pica61", 0x90000000, .bswap = true },
     { "mips64", "pica61", 0x90000000, .bswap = true },
     { "mips64", "malta", 0x10000000, .bswap = true },
     { "mips64", "malta", 0x10000000, .bswap = true },

+ 2 - 6
tests/qtest/fuzz-lsi53c895a-test.c

@@ -39,14 +39,10 @@ static void test_lsi_do_dma_empty_queue(void)
 
 
 int main(int argc, char **argv)
 int main(int argc, char **argv)
 {
 {
-    const char *arch = qtest_get_arch();
-
     g_test_init(&argc, &argv, NULL);
     g_test_init(&argc, &argv, NULL);
 
 
-    if (strcmp(arch, "i386") == 0 || strcmp(arch, "x86_64") == 0) {
-        qtest_add_func("fuzz/lsi53c895a/lsi_do_dma_empty_queue",
-                       test_lsi_do_dma_empty_queue);
-    }
+    qtest_add_func("fuzz/lsi53c895a/lsi_do_dma_empty_queue",
+                   test_lsi_do_dma_empty_queue);
 
 
     return g_test_run();
     return g_test_run();
 }
 }

+ 4 - 8
tests/qtest/fuzz-megasas-test.c

@@ -64,16 +64,12 @@ static void test_gitlab_issue521_megasas_sgl_ovf(void)
 
 
 int main(int argc, char **argv)
 int main(int argc, char **argv)
 {
 {
-    const char *arch = qtest_get_arch();
-
     g_test_init(&argc, &argv, NULL);
     g_test_init(&argc, &argv, NULL);
 
 
-    if (strcmp(arch, "i386") == 0 || strcmp(arch, "x86_64") == 0) {
-        qtest_add_func("fuzz/test_lp1878263_megasas_zero_iov_cnt",
-                       test_lp1878263_megasas_zero_iov_cnt);
-        qtest_add_func("fuzz/gitlab_issue521_megasas_sgl_ovf",
-                       test_gitlab_issue521_megasas_sgl_ovf);
-    }
+    qtest_add_func("fuzz/test_lp1878263_megasas_zero_iov_cnt",
+                   test_lp1878263_megasas_zero_iov_cnt);
+    qtest_add_func("fuzz/gitlab_issue521_megasas_sgl_ovf",
+                   test_gitlab_issue521_megasas_sgl_ovf);
 
 
     return g_test_run();
     return g_test_run();
 }
 }

+ 4 - 8
tests/qtest/fuzz-sb16-test.c

@@ -55,15 +55,11 @@ static void test_fuzz_sb16_0xd4(void)
 
 
 int main(int argc, char **argv)
 int main(int argc, char **argv)
 {
 {
-    const char *arch = qtest_get_arch();
-
     g_test_init(&argc, &argv, NULL);
     g_test_init(&argc, &argv, NULL);
 
 
-   if (strcmp(arch, "i386") == 0) {
-        qtest_add_func("fuzz/test_fuzz_sb16/1c", test_fuzz_sb16_0x1c);
-        qtest_add_func("fuzz/test_fuzz_sb16/91", test_fuzz_sb16_0x91);
-        qtest_add_func("fuzz/test_fuzz_sb16/d4", test_fuzz_sb16_0xd4);
-   }
+    qtest_add_func("fuzz/test_fuzz_sb16/1c", test_fuzz_sb16_0x1c);
+    qtest_add_func("fuzz/test_fuzz_sb16/91", test_fuzz_sb16_0x91);
+    qtest_add_func("fuzz/test_fuzz_sb16/d4", test_fuzz_sb16_0xd4);
 
 
-   return g_test_run();
+    return g_test_run();
 }
 }

+ 4 - 8
tests/qtest/fuzz-sdcard-test.c

@@ -164,15 +164,11 @@ static void oss_fuzz_36391(void)
 
 
 int main(int argc, char **argv)
 int main(int argc, char **argv)
 {
 {
-    const char *arch = qtest_get_arch();
-
     g_test_init(&argc, &argv, NULL);
     g_test_init(&argc, &argv, NULL);
 
 
-   if (strcmp(arch, "i386") == 0) {
-        qtest_add_func("fuzz/sdcard/oss_fuzz_29225", oss_fuzz_29225);
-        qtest_add_func("fuzz/sdcard/oss_fuzz_36217", oss_fuzz_36217);
-        qtest_add_func("fuzz/sdcard/oss_fuzz_36391", oss_fuzz_36391);
-   }
+    qtest_add_func("fuzz/sdcard/oss_fuzz_29225", oss_fuzz_29225);
+    qtest_add_func("fuzz/sdcard/oss_fuzz_36217", oss_fuzz_36217);
+    qtest_add_func("fuzz/sdcard/oss_fuzz_36391", oss_fuzz_36391);
 
 
-   return g_test_run();
+    return g_test_run();
 }
 }

+ 2 - 6
tests/qtest/fuzz-virtio-scsi-test.c

@@ -62,14 +62,10 @@ static void test_mmio_oob_from_memory_region_cache(void)
 
 
 int main(int argc, char **argv)
 int main(int argc, char **argv)
 {
 {
-    const char *arch = qtest_get_arch();
-
     g_test_init(&argc, &argv, NULL);
     g_test_init(&argc, &argv, NULL);
 
 
-    if (strcmp(arch, "i386") == 0 || strcmp(arch, "x86_64") == 0) {
-        qtest_add_func("fuzz/test_mmio_oob_from_memory_region_cache",
-                       test_mmio_oob_from_memory_region_cache);
-    }
+    qtest_add_func("fuzz/test_mmio_oob_from_memory_region_cache",
+                   test_mmio_oob_from_memory_region_cache);
 
 
     return g_test_run();
     return g_test_run();
 }
 }

+ 2 - 0
tests/qtest/libqos/virtio.c

@@ -260,6 +260,8 @@ void qvring_init(QTestState *qts, const QGuestAllocator *alloc, QVirtQueue *vq,
 
 
     /* vq->used->flags */
     /* vq->used->flags */
     qvirtio_writew(vq->vdev, qts, vq->used, 0);
     qvirtio_writew(vq->vdev, qts, vq->used, 0);
+    /* vq->used->idx */
+    qvirtio_writew(vq->vdev, qts, vq->used + 2, 0);
     /* vq->used->avail_event */
     /* vq->used->avail_event */
     qvirtio_writew(vq->vdev, qts, vq->used + 2 +
     qvirtio_writew(vq->vdev, qts, vq->used + 2 +
                    sizeof(struct vring_used_elem) * vq->size, 0);
                    sizeof(struct vring_used_elem) * vq->size, 0);

+ 9 - 18
tests/qtest/meson.build

@@ -17,13 +17,7 @@ slow_qtests = {
   'test-hmp' : 120,
   'test-hmp' : 120,
 }
 }
 
 
-qtests_generic = \
-  (config_all_devices.has_key('CONFIG_MEGASAS_SCSI_PCI') ? ['fuzz-megasas-test'] : []) + \
-  (config_all_devices.has_key('CONFIG_LSI_SCSI_PCI') ? ['fuzz-lsi53c895a-test'] : []) + \
-  (config_all_devices.has_key('CONFIG_VIRTIO_SCSI') ? ['fuzz-virtio-scsi-test'] : []) + \
-  (config_all_devices.has_key('CONFIG_SB16') ? ['fuzz-sb16-test'] : []) + \
-  (config_all_devices.has_key('CONFIG_SDHCI_PCI') ? ['fuzz-sdcard-test'] : []) + \
-  [
+qtests_generic = [
   'cdrom-test',
   'cdrom-test',
   'device-introspect-test',
   'device-introspect-test',
   'machine-none-test',
   'machine-none-test',
@@ -67,6 +61,11 @@ qtests_i386 = \
   (config_all_devices.has_key('CONFIG_TPM_TIS_ISA') ? ['tpm-tis-swtpm-test'] : []) +        \
   (config_all_devices.has_key('CONFIG_TPM_TIS_ISA') ? ['tpm-tis-swtpm-test'] : []) +        \
   (config_all_devices.has_key('CONFIG_RTL8139_PCI') ? ['rtl8139-test'] : []) +              \
   (config_all_devices.has_key('CONFIG_RTL8139_PCI') ? ['rtl8139-test'] : []) +              \
   (config_all_devices.has_key('CONFIG_E1000E_PCI_EXPRESS') ? ['fuzz-e1000e-test'] : []) +   \
   (config_all_devices.has_key('CONFIG_E1000E_PCI_EXPRESS') ? ['fuzz-e1000e-test'] : []) +   \
+  (config_all_devices.has_key('CONFIG_MEGASAS_SCSI_PCI') ? ['fuzz-megasas-test'] : []) +    \
+  (config_all_devices.has_key('CONFIG_LSI_SCSI_PCI') ? ['fuzz-lsi53c895a-test'] : []) +     \
+  (config_all_devices.has_key('CONFIG_VIRTIO_SCSI') ? ['fuzz-virtio-scsi-test'] : []) +     \
+  (config_all_devices.has_key('CONFIG_SB16') ? ['fuzz-sb16-test'] : []) +                   \
+  (config_all_devices.has_key('CONFIG_SDHCI_PCI') ? ['fuzz-sdcard-test'] : []) +            \
   (config_all_devices.has_key('CONFIG_ESP_PCI') ? ['am53c974-test'] : []) +                 \
   (config_all_devices.has_key('CONFIG_ESP_PCI') ? ['am53c974-test'] : []) +                 \
   (config_all_devices.has_key('CONFIG_ACPI_ERST') ? ['erst-test'] : []) +                        \
   (config_all_devices.has_key('CONFIG_ACPI_ERST') ? ['erst-test'] : []) +                        \
   (config_all_devices.has_key('CONFIG_VIRTIO_NET') and                                      \
   (config_all_devices.has_key('CONFIG_VIRTIO_NET') and                                      \
@@ -143,17 +142,9 @@ qtests_mips = \
   (config_all_devices.has_key('CONFIG_ISA_TESTDEV') ? ['endianness-test'] : []) +            \
   (config_all_devices.has_key('CONFIG_ISA_TESTDEV') ? ['endianness-test'] : []) +            \
   (config_all_devices.has_key('CONFIG_VGA') ? ['display-vga-test'] : [])
   (config_all_devices.has_key('CONFIG_VGA') ? ['display-vga-test'] : [])
 
 
-qtests_mips64 = \
-  ['test-filter-mirror', 'test-filter-redirector'] + \
-  (slirp.found() ? ['test-netfilter'] : []) + \
-  (config_all_devices.has_key('CONFIG_ISA_TESTDEV') ? ['endianness-test'] : []) +            \
-  (config_all_devices.has_key('CONFIG_VGA') ? ['display-vga-test'] : [])
-
-qtests_mips64el = \
-  ['test-filter-mirror', 'test-filter-redirector'] + \
-  (slirp.found() ? ['test-netfilter'] : []) + \
-  (config_all_devices.has_key('CONFIG_ISA_TESTDEV') ? ['endianness-test'] : []) +            \
-  (config_all_devices.has_key('CONFIG_VGA') ? ['display-vga-test'] : [])
+qtests_mipsel = qtests_mips
+qtests_mips64 = qtests_mips
+qtests_mips64el = qtests_mips
 
 
 qtests_ppc = \
 qtests_ppc = \
   ['test-filter-mirror', 'test-filter-redirector'] + \
   ['test-filter-mirror', 'test-filter-redirector'] + \

+ 1 - 2
tests/vm/centos.aarch64

@@ -24,8 +24,7 @@ DEFAULT_CONFIG = {
     'cpu'          : "max",
     'cpu'          : "max",
     'machine'      : "virt,gic-version=max",
     'machine'      : "virt,gic-version=max",
     'install_cmds' : "yum install -y make ninja-build git python3 gcc gcc-c++ flex bison, "\
     'install_cmds' : "yum install -y make ninja-build git python3 gcc gcc-c++ flex bison, "\
-        "yum install -y glib2-devel pixman-devel zlib-devel, "\
-        "yum install -y perl-Test-Harness, "\
+        "yum install -y glib2-devel perl pixman-devel zlib-devel, "\
         "alternatives --set python /usr/bin/python3, "\
         "alternatives --set python /usr/bin/python3, "\
         "sudo dnf config-manager "\
         "sudo dnf config-manager "\
         "--add-repo=https://download.docker.com/linux/centos/docker-ce.repo,"\
         "--add-repo=https://download.docker.com/linux/centos/docker-ce.repo,"\

+ 1 - 1
tests/vm/fedora

@@ -35,7 +35,7 @@ class FedoraVM(basevm.BaseVM):
         'gcc', 'binutils', 'make', 'ninja-build',
         'gcc', 'binutils', 'make', 'ninja-build',
 
 
         # perl
         # perl
-        'perl-Test-Harness',
+        'perl',
 
 
         # libs: usb
         # libs: usb
         '"pkgconfig(libusb-1.0)"',
         '"pkgconfig(libusb-1.0)"',