Commit Graph

91847 Commits

Author SHA1 Message Date
Fernando Eckhardt Valle dcb4e5b72c target/ppc: Implement PLFS, PLFD, PSTFS and PSTFD instructions
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Fernando Eckhardt Valle <fernando.valle@eldorado.org.br>
Signed-off-by: Matheus Ferst <matheus.ferst@eldorado.org.br>
Message-Id: <20211029202424.175401-5-matheus.ferst@eldorado.org.br>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2021-11-09 10:32:51 +11:00
Fernando Eckhardt Valle fbd2e60ef1 target/ppc: Move load and store floating point instructions to decodetree
Move load floating point instructions (lfs, lfsu, lfsx, lfsux, lfd, lfdu, lfdx, lfdux)
and store floating point instructions(stfs, stfsu, stfsx, stfsux, stfd, stfdu, stfdx,
stfdux) from legacy system to decodetree.

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Fernando Eckhardt Valle <fernando.valle@eldorado.org.br>
Signed-off-by: Matheus Ferst <matheus.ferst@eldorado.org.br>
Message-Id: <20211029202424.175401-4-matheus.ferst@eldorado.org.br>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2021-11-09 10:32:51 +11:00
Fernando Eckhardt Valle 725b2d4dac target/ppc: move resolve_PLS_D to translate.c
Move resolve_PLS_D from fixedpoint-impl.c.inc to translate.c
because this way the function can be used not only by fixed
point instructions.

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Fernando Eckhardt Valle <phervalle@gmail.com>
Signed-off-by: Matheus Ferst <matheus.ferst@eldorado.org.br>
Message-Id: <20211029202424.175401-3-matheus.ferst@eldorado.org.br>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2021-11-09 10:32:51 +11:00
Fernando Eckhardt Valle eb63efd9f6 target/ppc: introduce do_ea_calc
The do_ea_calc function will calculate the effective address(EA)
according to PowerIsa 3.1. With that, it was replaced part of
do_ldst() that calculates the EA by this new function.

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Fernando Eckhardt Valle (pherde) <phervalle@gmail.com>
Signed-off-by: Matheus Ferst <matheus.ferst@eldorado.org.br>
Message-Id: <20211029202424.175401-2-matheus.ferst@eldorado.org.br>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2021-11-09 10:32:51 +11:00
Richard Henderson 114f3c8cc4 Integration testing patches
- Rename tests/acceptance/ -> tests/avocado/
 - Rename avocado_qemu.Test -> avocado_qemu.QemuSystemTest
 - Introduce QemuUserTest class
 - Add the first linux-user test, covering the bFLT loader
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCAAdFiEE+qvnXhKRciHc/Wuy4+MsLN6twN4FAmGJTW4ACgkQ4+MsLN6t
 wN7D0w/+NgsGxkruLDWNTK5lOFljh2L+oF/WjQLwK0e9wLDN+nRcTlBkHMMVFndC
 Rfaox26gcwv0HkpBGLWdmsVed7zeZwvh6nMQtE8upB2nf2ltyYG9Bi7dt352/B4L
 NjS8OT/hFvuszD4+aJFrkcCVKkPUfcWasoBBoy4mtJt/1TzH972uHYksRCjqPEwe
 bN88V8GJfW5xcVzCvsc63jsdmamWpPdrWgX1VcL8eBrkScoyhdokE56pZ0vGR4d5
 ecGekTbfnJWl9Wy60im9Upg29WcGfJRcWgxnRHgEU7E1WNaVmQ2UlndEmhveATnH
 UcztfItir8iS58FsaJpKxlAmxv+SrivrYWQ5bLz88tIWoU7m8o90kzmM69DYOFfK
 AP440p7N5nF1nz9NGUT+5P5rEIYNncnYuwKgUiqQ9p2FOYeO6F6i4894QyB6Ebwo
 WpUgroSmOnUFEdXOixwyZYVswhXHp7Zfws+g+JTjCmyyeD7qF8Dd1ZeNqREPiLk/
 2GDe757b07qzXriN6/7YXeIvkCFoe65mCxkFWha45C13wfLyqP+1wML5utj3YpdA
 vqU2soQzGdH56cebpmqxxmVSAuZOPKNgQpNJ7UR+r7gFHXMHuqrTDQ+wldFnEKjT
 s2VoAeHdXJmO/+WDQgKKJCrBYmCmlEwObYS+clkN8HZtsr0purk=
 =6oPo
 -----END PGP SIGNATURE-----

Merge remote-tracking branch 'remotes/philmd/tags/avocado-20211108' into staging

Integration testing patches

- Rename tests/acceptance/ -> tests/avocado/
- Rename avocado_qemu.Test -> avocado_qemu.QemuSystemTest
- Introduce QemuUserTest class
- Add the first linux-user test, covering the bFLT loader

# gpg: Signature made Mon 08 Nov 2021 05:16:46 PM CET
# gpg:                using RSA key FAABE75E12917221DCFD6BB2E3E32C2CDEADC0DE
# gpg: Good signature from "Philippe Mathieu-Daudé (F4BUG) <f4bug@amsat.org>" [full]

* remotes/philmd/tags/avocado-20211108:
  tests/avocado: Remove p7zip binary availability check
  tests/avocado: Rename avocado_qemu.Test -> QemuSystemTest
  tests/avocado: Add bFLT loader linux-user test
  tests/avocado: Share useful helpers from virtiofs_submounts test
  tests/avocado: Introduce QemuUserTest base class
  tests/avocado: Make pick_default_qemu_bin() more generic
  tests/avocado: Extract QemuBaseTest from Test
  tests/acceptance: rename tests acceptance to tests avocado
  tests/acceptance: introduce new check-avocado target

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
2021-11-08 18:50:09 +01:00
Philippe Mathieu-Daudé b94d00898a tests/avocado: Remove p7zip binary availability check
The single use of the 7z binary has been removed in commit a30e114f3
("tests/acceptance: remove Armbian 19.11.3 test for orangepi-pc"),
we don't need to check for this binary availability anymore.

Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Reviewed-by: Joaquin de Andres <me@xcancerberox.com.ar>
Reviewed-by: Willian Rampazzo <willianr@redhat.com>
Message-Id: <20211106091059.465109-1-philmd@redhat.com>
2021-11-08 17:00:22 +01:00
Philippe Mathieu-Daudé 2283b627bc tests/avocado: Rename avocado_qemu.Test -> QemuSystemTest
To run user-mode emulation tests, we introduced the
avocado_qemu.QemuUserTest which inherits from avocado_qemu.QemuBaseTest.
System-mode emulation tests are based on the avocado_qemu.Test class,
which also inherits avocado_qemu.QemuBaseTest. To avoid confusion,
rename it as avocado_qemu.QemuSystemTest.

Suggested-by: Wainer dos Santos Moschetta <wainersm@redhat.com>
Reviewed-by: Willian Rampazzo <willianr@redhat.com>
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Message-Id: <20211105143416.148332-7-f4bug@amsat.org>
2021-11-08 17:00:22 +01:00
Philippe Mathieu-Daudé 8011837a01 tests/avocado: Add bFLT loader linux-user test
Add a very quick test that runs a busybox binary in bFLT format:

  $ AVOCADO_ALLOW_UNTRUSTED_CODE=1 \
    avocado --show=app run -t linux_user tests/avocado/load_bflt.py
  JOB ID     : db94d5960ce564c50904d666a7e259148c27e88f
  JOB LOG    : ~/avocado/job-results/job-2019-06-25T10.52-db94d59/job.log
   (1/1) tests/avocado/load_bflt.py:LoadBFLT.test_stm32: PASS (0.15 s)
  RESULTS    : PASS 1 | ERROR 0 | FAIL 0 | SKIP 0 | WARN 0 | INTERRUPT 0 | CANCEL 0
  JOB TIME   : 0.54 s

Reviewed-by: Willian Rampazzo <willianr@redhat.com>
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Message-Id: <20211105143416.148332-6-f4bug@amsat.org>
2021-11-08 17:00:22 +01:00
Philippe Mathieu-Daudé 0e4b1c9435 tests/avocado: Share useful helpers from virtiofs_submounts test
Move the useful has_cmd()/has_cmds() helpers from the virtiofs
test to the avocado_qemu public class.

Reviewed-by: Wainer dos Santos Moschetta <wainersm@redhat.com>
Reviewed-by: Willian Rampazzo <willianr@redhat.com>
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Message-Id: <20211105143416.148332-5-f4bug@amsat.org>
2021-11-08 17:00:22 +01:00
Philippe Mathieu-Daudé 5334df4822 tests/avocado: Introduce QemuUserTest base class
Similarly to the 'System' Test base class with methods for testing
system emulation, the QemuUserTest class contains methods useful to
test user-mode emulation.

Reviewed-by: Wainer dos Santos Moschetta <wainersm@redhat.com>
Reviewed-by: Willian Rampazzo <willianr@redhat.com>
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Message-Id: <20211105143416.148332-4-f4bug@amsat.org>
2021-11-08 17:00:22 +01:00
Philippe Mathieu-Daudé 9112d4fd49 tests/avocado: Make pick_default_qemu_bin() more generic
Make pick_default_qemu_bin() generic to find qemu-system or
qemu-user binaries.

Reviewed-by: Willian Rampazzo <willianr@redhat.com>
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Message-Id: <20211105143416.148332-3-f4bug@amsat.org>
2021-11-08 17:00:22 +01:00
Philippe Mathieu-Daudé 3982feb476 tests/avocado: Extract QemuBaseTest from Test
The Avocado Test::fetch_asset() is handy to download artifacts
before running tests. The current class is named Test but only
tests system emulation. As we want to test user emulation,
refactor the common code as QemuBaseTest.

Reviewed-by: Willian Rampazzo <willianr@redhat.com>
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Message-Id: <20211105143416.148332-2-f4bug@amsat.org>
2021-11-08 17:00:22 +01:00
Willian Rampazzo bbbd9b6ec6 tests/acceptance: rename tests acceptance to tests avocado
In the discussion about renaming the `tests/acceptance` [1], the
conclusion was that the folders inside `tests` are related to the
framework running the tests and not directly related to the type of
the tests.

This changes the folder to `tests/avocado` and adjusts the MAKEFILE, the
CI related files and the documentation.

[1] https://lists.gnu.org/archive/html/qemu-devel/2021-05/msg06553.html

Reviewed-by: Niek Linnenbank <nieklinnenbank@gmail.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Tested-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Signed-off-by: Willian Rampazzo <willianr@redhat.com>
Message-Id: <20211105155354.154864-3-willianr@redhat.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
2021-11-08 17:00:22 +01:00
Willian Rampazzo 333d7036ef tests/acceptance: introduce new check-avocado target
This introduces a new `make` target, `check-avocado`, and adds a
deprecation message about the `check-acceptance` target. This is
a preparation for renaming the `tests/acceptance` folder to
`tests/avocado`.

The plan is to remove the call to the `check-avocado` target one
or two months after the release and leave the warning to force
people to move to the new `check-avocado` target.

Later, the `check-acceptance` target can be removed. The intent
is to avoid a direct impact during the current soft freeze.

Suggested-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Signed-off-by: Willian Rampazzo <willianr@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Tested-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Acked-by: Thomas Huth <thuth@redhat.com>
Message-Id: <20211105155354.154864-2-willianr@redhat.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
2021-11-08 17:00:22 +01:00
Richard Henderson 5e10ccc270 * Fix off-by-one in MODE SELECT commands
* extend --extra-*flags behavior to meson-based tests
 * allow using snappy in static builds
 * i386 TCG fixes
 * fix build failure when libgbm is not available
 -----BEGIN PGP SIGNATURE-----
 
 iQFIBAABCAAyFiEE8TM4V0tmI4mGbHaCv/vSX3jHroMFAmGJB/gUHHBib256aW5p
 QHJlZGhhdC5jb20ACgkQv/vSX3jHroM0+gf/STwGM2h7I/1V/rAQnLzpA4Y9iMwB
 urMjz5rBqSpBSvyxA83JAj7a/6V70U+gm+03Nh4zdKyvKKzVmsSHtLU6EbZFUy5y
 +agY6AoB/3VLIWSf8zJ5KsxLS3r030mvu6XBbs94AEDbQ5O4YjO+Tb5r/dIOVhJb
 W1B59cPvkSmmBoFnJe2/CNcHf0AMDQ96ge2su+Sx909Lyo94r6kibFb1bkjep/ke
 0f21o3nAXSN/GBoZutLyZvMdEpwddrYwjVIyV2zCKL2XjTVXDKIphHM2iLyJxNli
 mnsQY51ZVdNkNAVy76nUWQ4+nJ/kT8Dhcl+6kWvI373PgokmEVpgZ0QKHQ==
 =GH6j
 -----END PGP SIGNATURE-----

Merge remote-tracking branch 'remotes/bonzini/tags/for-upstream' into staging

* Fix off-by-one in MODE SELECT commands
* extend --extra-*flags behavior to meson-based tests
* allow using snappy in static builds
* i386 TCG fixes
* fix build failure when libgbm is not available

# gpg: Signature made Mon 08 Nov 2021 12:20:24 PM CET
# gpg:                using RSA key F13338574B662389866C7682BFFBD25F78C7AE83
# gpg:                issuer "pbonzini@redhat.com"
# gpg: Good signature from "Paolo Bonzini <bonzini@gnu.org>" [full]
# gpg:                 aka "Paolo Bonzini <pbonzini@redhat.com>" [full]

* remotes/bonzini/tags/for-upstream:
  ui/gtk-egl: Fix build failure when libgbm is not available
  configure: ignore preexisting QEMU_*FLAGS envvars
  configure: propagate --extra-cflags and --extra-ldflags to meson compile tests
  configure: preserve CFLAGS, CXXFLAGS and LDFLAGS in config.status
  configure: simplify calls to meson_quote
  docs: adjust for demise of scripts/create_config
  meson: perform snappy test with the C++ compiler if used
  hw/scsi/scsi-disk: MODE_PAGE_ALLS not allowed in MODE SELECT commands
  target-i386: mmu: fix handling of noncanonical virtual addresses
  target-i386: mmu: use pg_mode instead of HF_LMA_MASK

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
2021-11-08 16:23:32 +01:00
Richard Henderson 260f9210d2 Some Sphinx improvements
PR for 2 series:
 https://patchew.org/QEMU/20211015105344.152591-1-marcandre.lureau@redhat.com/
 https://patchew.org/QEMU/20211004215238.1523082-1-jsnow@redhat.com/
 -----BEGIN PGP SIGNATURE-----
 
 iQJQBAABCAA6FiEEh6m9kz+HxgbSdvYt2ujhCXWWnOUFAmGI508cHG1hcmNhbmRy
 ZS5sdXJlYXVAcmVkaGF0LmNvbQAKCRDa6OEJdZac5axBD/4oyGvcEiuN6PfqR5Er
 dCO8K2rOpeBgdpP88N26sdnP8xUAXfkijxPNbqv0MfRTxXPnEMDu6vHF6zH/2q63
 kL9Qhjz6LZuRM9q2HgnTnJUM2Xnmsvp9QQyHI2M6vF+YHl/KVliGD8ICdPRm4zCb
 iYXJTnsCN8Fohc+mX0XiKD42lRv1GMpbuqPCKhjKNSwDDDo+wg6ByycPKa9iLe5S
 F3Peo1Sr/UkmGQ1icfRheXk9fZvVtoFVG68TWZzB41A+QOai63QkgjlcT7ELtoe/
 bzOf6xZfIcKs1jHOVDKDnA5YzkAZlHKg+7tZpXdND62bRt2p1lLeeYiRTQAGnd+e
 wzKcWkBcwdtnN8ow/BUVwkdGoyXspJHhChhxZMSaaDIsk0oTKhjH4xE+rNu2Nscb
 E0G5+DwgP5m1rReLqGtbpD3AkndbnLE/AglxhVABbHlfI8ieB1GWc+8AXqaXIjBs
 ed7wGL+pOsdKMU+2PIKjc/4uuOwdLjiGK6UGAEZLS1XN9N3Kz9+PlTDGHPMw9Fw3
 wYLMXvfwMfS/myVI7oYF9QvQjX9yMxjES2JHHZ+IMqAwleLXlr2wk119fZ5Vce/M
 eqaXgGwQ6hWFJW6HDvAk7RGCzwuL4MASMvxwV85HyLPdHv2UH/LVpFYjzL/nECt0
 6zZyOdhsM84jdG81SknrMXx/dg==
 =khZf
 -----END PGP SIGNATURE-----

Merge remote-tracking branch 'remotes/marcandre.lureau/tags/sphinx-pull-request' into staging

Some Sphinx improvements

PR for 2 series:
https://patchew.org/QEMU/20211015105344.152591-1-marcandre.lureau@redhat.com/
https://patchew.org/QEMU/20211004215238.1523082-1-jsnow@redhat.com/

# gpg: Signature made Mon 08 Nov 2021 10:01:03 AM CET
# 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]

* remotes/marcandre.lureau/tags/sphinx-pull-request:
  docs/sphinx: change default role to "any"
  docs: (further) remove non-reference uses of single backticks
  docs: remove non-reference uses of single backticks
  docs/sphinx: add 's' keyboard binding to focus search
  docs/sphinx: set navigation_with_keys=True
  meson: drop sphinx_template_files
  meson: drop sphinx_extn_depends
  tests/qapi-schema/meson: add depfile to sphinx doc
  docs/sphinx: add templates files to generated depfile
  docs/sphinx: add static files to generated depfile
  docs/sphinx: add loaded modules to generated depfile

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
2021-11-08 14:56:10 +01:00
Philippe Mathieu-Daudé 8b4ed0daba ui/gtk-egl: Fix build failure when libgbm is not available
Since commit 4872a023a5 ("ui/gtk-egl: guest fb texture needs
to be regenerated when reinitializing egl") we get on Ubuntu
18.04.4 LTS and Debian Buster (oldstable):

  $ ../configure --enable-virglrenderer
  [...]
  ui/gtk-egl.c: In function 'gd_egl_refresh':
  ui/gtk-egl.c:159:13: error: implicit declaration of function 'egl_dmabuf_release_texture' [-Werror=implicit-function-declaration]
    159 |             egl_dmabuf_release_texture(vc->gfx.guest_fb.dmabuf);
        |             ^~~~~~~~~~~~~~~~~~~~~~~~~~
  ui/gtk-egl.c:159:13: error: this function declaration is not a prototype [-Werror,-Wstrict-prototypes]
  ui/gtk-egl.c:159:13: error: nested extern declaration of 'egl_dmabuf_release_texture' [-Werror=nested-externs]

Fix by restricting the egl_dmabuf_release_texture() call to the
availability of the generic buffer management library (libgbm).

Fixes: 4872a023a5
Cc: Dongwon Kim <dongwon.kim@intel.com>
Cc: Vivek Kasireddy <vivek.kasireddy@intel.com>
Reported-by: Laurent Vivier <laurent@vivier.eu>
Reviewed-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Laurent Vivier <laurent@vivier.eu>
Tested-by: Laurent Vivier <laurent@vivier.eu>
Message-Id: <20211108083129.1262040-1-f4bug@amsat.org>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2021-11-08 12:20:13 +01:00
Paolo Bonzini de38c0cc79 configure: ignore preexisting QEMU_*FLAGS envvars
User flags should be passed via CFLAGS/CXXFLAGS/LDFLAGS,
or --extra-cflags/extra-cxxflags/--extra-ldflags on the
command line.

QEMU_CFLAGS, QEMU_CXXFLAGS and QEMU_LDFLAGS are reserved
for flags detected by configure, so do not add to them
and clear them at the beginning of the script.

Reviewed-by: Thomas Huth <thuth@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2021-11-08 12:20:08 +01:00
Paolo Bonzini a286666044 configure: propagate --extra-cflags and --extra-ldflags to meson compile tests
Meson (intentionally) does not add QEMU_CFLAGS to cc.compiles/cc.links
tests, as they are supposed to be independent of the specific sets of
compilation flags used to build the programs.  However, the user can
still use CFLAGS or the toolchain file's LANG_args/LANG_link_args option
to specify -I or -L options that apply to cc.compiles/cc.links as well.

This is also the intended use of configure's --extra-cflags,
--extra-cxxflags and --extra-ldflags options.  For example, if
one has netmap's header in a nonstandard directory, up to commit
837b84b1c0 it used to work fine to do:

.../configure --enable-netmap \
     --extra-cflags=-I/path/to/netmap/sys

but since the test was converted to meson, this does not work anymore.

Pass these options to meson via the toolchain file instead of via
config-host.mak, since both have the same purpose.

Reported-by: Owen LaGarde
Reported-by: Thomas Huth <thuth@redhat.com>
Fixes: 47b30835e4 ("configure: consistently pass CFLAGS/CXXFLAGS/LDFLAGS to meson", 2020-10-06)
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2021-11-08 12:20:08 +01:00
Paolo Bonzini 8009da0374 configure: preserve CFLAGS, CXXFLAGS and LDFLAGS in config.status
CFLAGS, CXXFLAGS and LDFLAGS influence the tests (for example if they include
-L or -I options), so they should be kept from the invocation of configure
to the subsequent reinvocations via config.status.

Reviewed-by: Thomas Huth <thuth@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2021-11-08 12:20:05 +01:00
Paolo Bonzini ac7ebcc589 configure: simplify calls to meson_quote
meson_quote assumes a non-empty argument list, and incorrectly returns a
one-entry array if passed nothing.  Move the check for an empty argument
list from the invocations to the function itself.

Reviewed-by: Thomas Huth <thuth@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2021-11-08 12:19:55 +01:00
Paolo Bonzini 4933436f6a docs: adjust for demise of scripts/create_config
The config-host.h, $TARGET_NAME-config-target.h,
$TARGET_NAME-config-devices.h files are now generated by
configure_file() rather than scripts/create_config.  Adjust
he relevant paragraph in docs/devel/build-system.rst, and take
the occasion to fix a preexisting confusion of *.h vs *.mak.

Reported-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2021-11-08 10:55:59 +01:00
Paolo Bonzini 565174d08e meson: perform snappy test with the C++ compiler if used
Snappy is written in C++ and as such needs to link against libstdc++.  When
linking statically, this means that the compile test cannot succeed unless
performed with a C++ compiler.  Do so if link_language is set to C++; if it
is C, the test will usually fail and snappy will be disabled.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2021-11-08 10:55:58 +01:00
John Snow c11b3a1dd3 docs/sphinx: change default role to "any"
This interprets single-backtick syntax in all of our Sphinx docs as a
cross-reference to *something*, including Python symbols.

From here on out, new uses of `backticks` will cause a build failure if
the target cannot be referenced.

Signed-off-by: John Snow <jsnow@redhat.com>
Reviewed-by: Eduardo Habkost <ehabkost@redhat.com>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Message-Id: <20211004215238.1523082-4-jsnow@redhat.com>
2021-11-08 12:27:23 +04:00
John Snow ca0a0d122c docs: (further) remove non-reference uses of single backticks
The series rotted already. Here's the new changes.

Signed-off-by: John Snow <jsnow@redhat.com>
Reviewed-by: Damien Hedde <damien.hedde@greensocs.com>
[ extra backticks fixes ]
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Message-Id: <20211004215238.1523082-3-jsnow@redhat.com>
2021-11-08 12:27:23 +04:00
John Snow 450e0f28a4 docs: remove non-reference uses of single backticks
The single backtick markup in ReST is the "default role". Currently,
Sphinx's default role is called "content". Sphinx suggests you can use
the "Any" role instead to turn any single-backtick enclosed item into a
cross-reference.

This is useful for things like autodoc for Python docstrings, where it's
often nicer to reference other types with `foo` instead of the more
laborious :py:meth:`foo`. It's also useful in multi-domain cases to
easily reference definitions from other Sphinx domains, such as
referencing C code definitions from outside of kerneldoc comments.

Before we do that, though, we'll need to turn all existing usages of the
"content" role to inline verbatim markup wherever it does not correctly
resolve into a cross-refernece by using double backticks instead.

Signed-off-by: John Snow <jsnow@redhat.com>
Reviewed-by: Eduardo Habkost <ehabkost@redhat.com>
Reviewed-by: Alexander Bulekov <alxndr@bu.edu>
Message-Id: <20211004215238.1523082-2-jsnow@redhat.com>
2021-11-08 12:27:23 +04:00
Marc-André Lureau 9423751645 docs/sphinx: add 's' keyboard binding to focus search
This is pretty ubiquitous. ('/' is already taken by some browsers for
quick search)

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: John Snow <jsnow@redhat.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
2021-11-08 12:27:23 +04:00
Marc-André Lureau 96871b3854 docs/sphinx: set navigation_with_keys=True
Allow navigating to the previous/next page using the keyboard's left and
right arrows. I wish this would be the default, and that the themes
would provide more key navigation, but that doesn't seem on the roadmap.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: John Snow <jsnow@redhat.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
2021-11-08 12:27:23 +04:00
Marc-André Lureau ed9e6d65ed meson: drop sphinx_template_files
Static files dependencies is now handled by depfile.py.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: John Snow <jsnow@redhat.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
2021-11-08 12:27:23 +04:00
Marc-André Lureau 89bcfe780a meson: drop sphinx_extn_depends
Module dependencies is now handled by depfile.py.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: John Snow <jsnow@redhat.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
2021-11-08 12:27:23 +04:00
Marc-André Lureau 706bbad2ba tests/qapi-schema/meson: add depfile to sphinx doc
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: John Snow <jsnow@redhat.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
2021-11-08 12:27:23 +04:00
Marc-André Lureau 0dd35c1629 docs/sphinx: add templates files to generated depfile
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: John Snow <jsnow@redhat.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
2021-11-08 12:27:23 +04:00
Marc-André Lureau 905655ea6a docs/sphinx: add static files to generated depfile
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: John Snow <jsnow@redhat.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
2021-11-08 12:27:23 +04:00
Marc-André Lureau cd0a9e983c docs/sphinx: add loaded modules to generated depfile
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: John Snow <jsnow@redhat.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
2021-11-08 12:27:23 +04:00
Mauro Matteo Cascella b3af7fdf9c hw/scsi/scsi-disk: MODE_PAGE_ALLS not allowed in MODE SELECT commands
This avoids an off-by-one read of 'mode_sense_valid' buffer in
hw/scsi/scsi-disk.c:mode_sense_page().

Fixes: CVE-2021-3930
Cc: qemu-stable@nongnu.org
Reported-by: Alexander Bulekov <alxndr@bu.edu>
Fixes: a8f4bbe290 ("scsi-disk: store valid mode pages in a table")
Fixes: #546
Reported-by: Qiuhao Li <Qiuhao.Li@outlook.com>
Signed-off-by: Mauro Matteo Cascella <mcascell@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2021-11-08 08:55:29 +01:00
Paolo Bonzini b04dc92e01 target-i386: mmu: fix handling of noncanonical virtual addresses
mmu_translate is supposed to return an error code for page faults; it is
not able to handle other exceptions.  The #GP case for noncanonical
virtual addresses is not handled correctly, and incorrectly raised as
a page fault with error code 1.  Since it cannot happen for nested
page tables, move it directly to handle_mmu_fault, even before the
invocation of mmu_translate.

Fixes: #676
Fixes: 661ff4879e ("target/i386: extract mmu_translate", 2021-05-11)
Cc: qemu-stable@nongnu.org
Tested-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2021-11-08 08:55:20 +01:00
Paolo Bonzini 93eae35832 target-i386: mmu: use pg_mode instead of HF_LMA_MASK
Correctly look up the paging mode of the hypervisor when it is using 64-bit
mode but the guest is not.

Fixes: 68746930ae ("target/i386: use mmu_translate for NPT walk", 2021-05-11)
Cc: qemu-stable@nongnu.org
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2021-11-08 08:51:14 +01:00
Richard Henderson 63ed851de4 Migration Pull request
- fix vhost-user crash when using postcopy (me)
 - fix incorrect tag for docs (hyman)
 
 Please apply, Juan.
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCAAdFiEEGJn/jt6/WMzuA0uC9IfvGFhy1yMFAmGHD+EACgkQ9IfvGFhy
 1yMypxAAl3vLiZmmvla/Cln6cL/WhzS12QgAeCteIinNxV71vkAxz8b+bfCo9MMC
 mORh0uCZNpoX/iijJtM7pvhiAWACEY/80qGfdrpFZSbGexD5eQrar9rfUNjVvvm7
 OhXVP0Bk0mT2SRjXtOQAbagI6py03hX3ae5bGJU7v1dK2Rh8j/xY3CBzmBcfIi1X
 vbWhqpZO5Ji/S1ejk6y+fNaT/QH7oPUkzAAf/x1SDnS2TYp5oQjC3g/bmiWWkE0S
 XdLWoeyxy0HhSiEcz5dXpFqTioOJx/LtH7zg2nUt7q2t0zdNabh0008or0FDE2er
 LWSlvOjuSAtLiw209oLY1A6bLFSkeuR69nFSLJc1Z/Tr3uLk+U9gV3gBBz6cqWip
 uf2LOsDx5y/NRxSGk3oI7Rt16kAz9QGIKbgu1FS5izuGfuzLzflkBozg/aAsdDQl
 SDTJp2/sV/x6mS+U/WZOWh8SCHHce36qSFEvp2MkxoIPDJMiaVXcwlnMzNcVPOoC
 Kv6T3c4P61PsEeyfDAGufeZFa/RGNzxVkVK8jzpfGi4l9OrPnkFDP2tHXMvvjWte
 sK+3ueDV2UWuM19jb3VqUfuarHNtlX3l34YZjRmpJLsK2ORsGQrrQO/v0uXeRwep
 fIiCU8AnH2+yGcGTzP6zr8lIkk17d5aMjYNq/gvDwCWJQxZHZiU=
 =CGrl
 -----END PGP SIGNATURE-----

Merge remote-tracking branch 'remotes/juanquintela/tags/migration-20211106-pull-request' into staging

Migration Pull request

- fix vhost-user crash when using postcopy (me)
- fix incorrect tag for docs (hyman)

Please apply, Juan.

# gpg: Signature made Sat 06 Nov 2021 07:29:37 PM EDT
# gpg:                using RSA key 1899FF8EDEBF58CCEE034B82F487EF185872D723
# gpg: Good signature from "Juan Quintela <quintela@redhat.com>" [full]
# gpg:                 aka "Juan Quintela <quintela@trasno.org>" [full]

* remotes/juanquintela/tags/migration-20211106-pull-request:
  docs: fix qemu incorrect tag
  migration: Check that postcopy fd's are not NULL

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
2021-11-06 19:43:42 -04:00
Hyman Huang(黄勇) f78d4ed701 docs: fix qemu incorrect tag
The patchset merged in 71864eadd9 ("migration/dirtyrate:
introduce struct and adjust DirtyRateStat") was targeting
QEMU 6.1 but got merged later, so correct the tag for 6.2.

Signed-off-by: Hyman Huang(黄勇) <huangy81@chinatelecom.cn>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Reviewed-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Juan Quintela <quintela@redhat.com>
2021-11-06 12:35:38 +01:00
Juan Quintela 565599807f migration: Check that postcopy fd's are not NULL
If postcopy has finished, it frees the array.
But vhost-user unregister it at cleanup time.

fixes: c4f7538
Signed-off-by: Juan Quintela <quintela@redhat.com>
Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
2021-11-06 12:35:29 +01:00
Richard Henderson c39deb2181 gtk: a collection of egl fixes.
-----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEoDKM/7k6F6eZAf59TLbY7tPocTgFAmGFFc0ACgkQTLbY7tPo
 cTifABAA285RPpgwuI5RIo9rA6OfnPEAEC5z+NUX/g5X5hnMUXnfIGrPVG1mRU8r
 yPqM0mAoLoYcVQcpGJZCUxOnpm0cTmYJDPIjZ28D8wtQtwEpCDagapckj9L87Sec
 1HgGDoYqdtQoG1HvHRCwR5a35gt9Qi7JwdedT6DkCVy2Tk1NcrR2nfNIl+P/lsBy
 zHZbPwPpPtHP1GirMGL8eq8tDLq6ymMG4wAVytFOHJkfkUxlsK7oB6640jKxGAzB
 j5BW/XyrD2nbPNhtu7JdoKHr3MuP4rCSejllSqzNu0gPsxN7/eLbKj74bW8eaRO1
 FZRneQgmgHwipKDgGFve9RBDlRWpMSNdkuM4h8VVW3ZSb1bWgFFmwStcRpas3Vcw
 Cvg4V7pmO/980Dq7gnbwlmK+QTM2bTEfsUCR74pekgimqxT//85HK10i5/5fRWCo
 cjQUz5809XlFMv7IDjb1wv/uUmIoUAzVSBYxWQF3CzTNlRaHl77K5C5NXgLohxl5
 m+/drFZIVFWNJP8ERa8Y2W/Mlf6jwU9r35wy0UsGOHm4skYHETa/TSvkDGfMsWhu
 QVRG/XmpBjbKk08tGCvPlrS8zdbT8XMR86WsBQj8kpouawd+Uvo+lRitLfv3+oXd
 VnYyXck8Wx/atodOQC7IeFFWyKqkqhKVf4spqYKg9s12YA+LM3U=
 =O6Wg
 -----END PGP SIGNATURE-----

Merge remote-tracking branch 'remotes/kraxel/tags/egl-20211105-pull-request' into staging

gtk: a collection of egl fixes.

# gpg: Signature made Fri 05 Nov 2021 07:30:21 AM EDT
# gpg:                using RSA key A0328CFFB93A17A79901FE7D4CB6D8EED3E87138
# gpg: Good signature from "Gerd Hoffmann (work) <kraxel@redhat.com>" [full]
# gpg:                 aka "Gerd Hoffmann <gerd@kraxel.org>" [full]
# gpg:                 aka "Gerd Hoffmann (private) <kraxel@gmail.com>" [full]

* remotes/kraxel/tags/egl-20211105-pull-request:
  ui/gtk-egl: blitting partial guest fb to the proper scanout surface
  ui/gtk: gd_draw_event returns FALSE when no cairo surface is bound
  ui/gtk-egl: guest fb texture needs to be regenerated when reinitializing egl
  ui/gtk-egl: make sure the right context is set as the current
  ui/gtk-egl: un-tab and re-tab should destroy egl surface and context
  virtio-gpu: splitting one extended mode guest fb into n-scanouts

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
2021-11-05 11:42:06 -04:00
Richard Henderson e4d96a7eb8 -----BEGIN PGP SIGNATURE-----
Version: GnuPG v1
 
 iQEcBAABAgAGBQJhhKgIAAoJEO8Ells5jWIRi9QH/iMggQEHjoFXTU65+t0SRKkT
 OXLz164baNO+AFVjJo0I20Ee5uvVCUnOt1VX4PmJDF2WYsRSQcmMgTI+GBXtqm7B
 SjAit4FLWjGIrAsV+Lm/pbBzMjtO2p4Y1wpLqO5Rc7aMxdEgyA70tWd7AOIlyE7e
 w/YnDs6BF10KNLvI3BH+0Assl+W6ht7PyykIcNU680WqyV28E0M1kbnN9vR+7w8E
 BNHxqCaeV41PwoB641XAl0AQTbqZaVH0paiyVwUij8YOqJHqwQbXrN9SQwct0gsg
 PIAxiX1p9WNxjLwKv+icUWZLuZ+nZ6wCVYwGD4nd5B7zSNagO7Mdv5CORAMaygs=
 =4PLP
 -----END PGP SIGNATURE-----

Merge remote-tracking branch 'remotes/jasonwang/tags/net-pull-request' into staging

# gpg: Signature made Thu 04 Nov 2021 11:42:00 PM EDT
# gpg:                using RSA key EF04965B398D6211
# gpg: Good signature from "Jason Wang (Jason Wang on RedHat) <jasowang@redhat.com>" [marginal]
# 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/jasonwang/tags/net-pull-request:
  Fix virtio-net-pci* "vectors" compat
  e1000: fix tx re-entrancy problem

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
2021-11-05 09:59:19 -04:00
Dongwon Kim 1350ff156b ui/gtk-egl: blitting partial guest fb to the proper scanout surface
eb_fb_blit should be able to blit partial image of guest display (blob res)
in case multiple displays are configured for the guest and they are set as extended-
desktop mode.

v2: egl_fb includes dmabuf info then make egl_fb_blit position and size
    parameters programmed in dmabuf structure (previously position/size
    parameters were given to egl_fb_blit separately)
    (Vivek Kasireddy)

    changed the commit message as there is no interface change to egl_fb_blit

Cc: Gerd Hoffmann <kraxel@redhat.com>
Cc: Vivek Kasireddy <vivek.kasireddy@intel.com>
Signed-off-by: Dongwon Kim <dongwon.kim@intel.com>
Message-Id: <20211104065153.28897-6-dongwon.kim@intel.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2021-11-05 12:29:44 +01:00
Dongwon Kim 7cf87257f7 ui/gtk: gd_draw_event returns FALSE when no cairo surface is bound
gd_draw_event shouldn't try to repaint if surface does not exist
for the VC.

Cc: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Dongwon Kim <dongwon.kim@intel.com>
Message-Id: <20211104065153.28897-4-dongwon.kim@intel.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2021-11-05 12:29:39 +01:00
Dongwon Kim 4872a023a5 ui/gtk-egl: guest fb texture needs to be regenerated when reinitializing egl
If guest fb is backed by dmabuf (blob-resource), the texture bound to the
old context needs to be recreated in case the egl is re-initialized (e.g.
new window for vc is created in case of detaching/reattaching of the tab)

v2: call egl_dmabuf_release_texutre instead of putting 0 to dmabuf->texture
    (Vivek Kasireddy)

Cc: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Dongwon Kim <dongwon.kim@intel.com>
Message-Id: <20211104065153.28897-3-dongwon.kim@intel.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2021-11-05 12:29:34 +01:00
Dongwon Kim 01eb4749f0 ui/gtk-egl: make sure the right context is set as the current
Making the vc->gfx.ectx current before handling texture
associated with it

Cc: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Dongwon Kim <dongwon.kim@intel.com>
Message-Id: <20211104065153.28897-2-dongwon.kim@intel.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2021-11-05 12:29:29 +01:00
Dongwon Kim 1ab2628fc6 ui/gtk-egl: un-tab and re-tab should destroy egl surface and context
An old esurface should be destroyed and set to be NULL when doing
un-tab and re-tab so that a new esurface an context can be created
for the window widget that those will be bound to.

v2: enabling opengl specific routines only when CONFIG_OPENGL is set

Cc: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Dongwon Kim <dongwon.kim@intel.com>
Signed-off-by: Khairul Anuar Romli <khairul.anuar.romli@intel.com>
Message-Id: <20211104065153.28897-1-dongwon.kim@intel.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2021-11-05 12:29:23 +01:00
Dongwon Kim e86a93f554 virtio-gpu: splitting one extended mode guest fb into n-scanouts
When guest is running Linux/X11 with extended multiple displays mode enabled,
the guest shares one scanout resource each time containing whole surface
rather than sharing individual display output separately. This extended frame
is properly splited and rendered on the corresponding scanout surfaces but
not in case of blob-resource (zero copy).

This code change lets the qemu split this one large surface data into multiple
in case of blob-resource as well so that each sub frame then can be blitted
properly to each scanout.

v2: resizing qemu console in virtio_gpu_update_dmabuf to scanout's width and
    height

v3: updating stub function of virtio_gpu_update_dmabuf to match the type

Cc: Gerd Hoffmann <kraxel@redhat.com>
Cc: Vivek Kasireddy <vivek.kasireddy@intel.com>
Signed-off-by: Dongwon Kim <dongwon.kim@intel.com>
Message-Id: <20211104065153.28897-5-dongwon.kim@intel.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2021-11-05 12:29:19 +01:00
Eduardo Habkost 3fd641ac5e Fix virtio-net-pci* "vectors" compat
hw_compat_5_2 has an issue: it affects only "virtio-net-pci"
but not "virtio-net-pci-transitional" and
"virtio-net-pci-non-transitional".  The solution is to use the
"virtio-net-pci-base" type in compat_props.

Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1999141

Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
Signed-off-by: Jean-Louis Dupond <jean-louis@dupond.be>
Acked-by: Jason Wang <jasowang@redhat.com>
Acked-by: Jean-Louis Dupond <jean-louis@dupond.be>
Reviewed-by: Cornelia Huck <cohuck@redhat.com>
Signed-off-by: Jason Wang <jasowang@redhat.com>
2021-11-05 11:32:00 +08:00
Jon Maloy 25ddb946e6 e1000: fix tx re-entrancy problem
The fact that the MMIO handler is not re-entrant causes an infinite
loop under certain conditions:

Guest write to TDT ->  Loopback -> RX (DMA to TDT) -> TX

We now eliminate the effect of this problem locally in e1000, by adding
a boolean in struct E1000State indicating when the TX side is busy. This
will cause any entering new call to return early instead of interfering
with the ongoing work, and eliminates any risk of looping.

This is intended to address CVE-2021-20257.

Signed-off-by: Jon Maloy <jmaloy@redhat.com>
Signed-off-by: Jason Wang <jasowang@redhat.com>
2021-11-05 11:31:42 +08:00