Commit Graph

80200 Commits

Author SHA1 Message Date
Paolo Bonzini d322e84eef mtest2make: hide output of successful tests
The softfloat tests are quite noisy; before the Meson conversion
they buffered the output in a file and emitted the output only
if the test failed.  Tweak mtest2make.py so that the courtesy
is extended to all non-TAP tests.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2020-09-08 07:17:09 +02:00
Paolo Bonzini 42d729e12c mtest2make: split working directory from test command
Pass the working directory and test command in separate macro arguments,
so that we will be able to insert a test driver in the next patch.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2020-09-08 07:17:09 +02:00
Paolo Bonzini 555b27a750 mtest2make: split environment from test command
Pass the environment and test command in separate macro arguments,
so that we will be able to insert a test driver in the next patch.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2020-09-08 07:17:09 +02:00
Paolo Bonzini e781190cda qemu-iotests: move check-block back to Makefiles
check-block has its own test harness, unlike every other test.  If
we capture its output, as is in general nicer to do without V=1,
there will be no sign of progress.  So for lack of a better option
just move the invocation of the test back to Makefile rules.

As a side effect, this will also fix "make check" in --disable-tools
builds, as they were trying to run qemu-iotests without having
made qemu-img before.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2020-09-08 07:17:09 +02:00
Peter Maydell e11bd71f89 * Fixes for cross-compiling with MinGW / compiling with MSYS2
* Enable cross-compiler builds in the Gitlab CI
 * Improvements / fixes for the crypto tests in the Gitlab CI
 * Fix for the "make check-acceptance" microblaze failure
   (required to get the Gitlab CI green again)
 -----BEGIN PGP SIGNATURE-----
 
 iQJFBAABCAAvFiEEJ7iIR+7gJQEY8+q5LtnXdP5wLbUFAl9WIZMRHHRodXRoQHJl
 ZGhhdC5jb20ACgkQLtnXdP5wLbUaFg//T5/yuRz8TitZBJ7som5DgyhUHaFnOgA+
 uFeI3aDbqooRroAmElEMSzjas5oFVNaNUuk0OduYbXB8ZnQyZwD0ePfGvCHtNq1M
 YIYidNZQhf4D0m0r2WsjdnP2Yq1/J44WqyS2DmGWNgGp/80Ns4OVsm1sEgWowIsS
 3RmQi/u7G3KulNkuCD9f1raAXodYPqYuhnxK6wBeaf0QnScsoGSoYkirrgu3Vjp9
 mO78x5j6DrkCwwh2p3BP7rtORX3pZzjkBcqrL3buwLcuDiYMVtZbEf41uThlwLzd
 AyrQa1FoNJnQWafk6tZda52QhmVAUvoOhrxamzupWNPJeg2fkjKA3hfBSp+ic7yV
 5+1MmWaXlULNFjHSeSmsCZBhSh+i0Q3Lij7bLRQ5iuJcP/+pNWUIv7Csn07OBrg1
 aodc6APg510I6af3sf1VXRh20pqN2gBXEsYOODv/yuCmUR9k0dI9xecxSQEEntKk
 utY7HZGL1lQMU5kagR+VtZmRoBhloI3ie33wCaE0FzjLEdNDWMEr/xm3x/mB1eSn
 8qeqssdpvUT3cdxWGHWMpKUiE7bVsjsxEE4Ozx3rTLnzHHUMrgTAaBCpJHb7uzwi
 1XP5Scd0wPJmsoyFSfswIKQoeMdXqlGvUYTihk5Iin63lkDtlEP9wY8CVUrzYp4v
 3+y8hjkxWCg=
 =fpyA
 -----END PGP SIGNATURE-----

Merge remote-tracking branch 'remotes/huth-gitlab/tags/pull-request-2020-09-07' into staging

* Fixes for cross-compiling with MinGW / compiling with MSYS2
* Enable cross-compiler builds in the Gitlab CI
* Improvements / fixes for the crypto tests in the Gitlab CI
* Fix for the "make check-acceptance" microblaze failure
  (required to get the Gitlab CI green again)

# gpg: Signature made Mon 07 Sep 2020 13:03:31 BST
# gpg:                using RSA key 27B88847EEE0250118F3EAB92ED9D774FE702DB5
# gpg:                issuer "thuth@redhat.com"
# gpg: Good signature from "Thomas Huth <th.huth@gmx.de>" [full]
# gpg:                 aka "Thomas Huth <thuth@redhat.com>" [full]
# gpg:                 aka "Thomas Huth <huth@tuxfamily.org>" [full]
# gpg:                 aka "Thomas Huth <th.huth@posteo.de>" [unknown]
# Primary key fingerprint: 27B8 8847 EEE0 2501 18F3  EAB9 2ED9 D774 FE70 2DB5

* remotes/huth-gitlab/tags/pull-request-2020-09-07:
  target/microblaze: Collected fixes for env->iflags
  tests/qtest: do not list ahci-test twice
  gitlab: expand test coverage for crypto builds
  crypto: fix build with gcrypt enabled
  gitlab-ci: Add cross-compiling build tests
  stubs: Move qemu_fd_register stub to util/main-loop.c
  stubs: Move qemu_timer_notify_cb() and remove qemu_notify_event() stub
  configure: Allow automatic WHPX detection
  dockerfiles/debian-win64-cross: Download WHPX MinGW headers
  tests/Makefile: test-image-locking needs CONFIG_POSIX
  tests: Fixes building test-util-filemonitor.c on msys2/mingw
  tests: fixes test-vmstate.c compile error on msys2
  tests: handling signal on win32 properly
  tests/docker: add python3-setuptools the docker images

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2020-09-07 16:51:00 +01:00
Peter Maydell 9d5589bb3f Add ppoll_time64() and pselect6_time64()
Some fixes for for elfload, fcntl, termbits and btrfs
 -----BEGIN PGP SIGNATURE-----
 
 iQJGBAABCAAwFiEEzS913cjjpNwuT1Fz8ww4vT8vvjwFAl9V+qQSHGxhdXJlbnRA
 dml2aWVyLmV1AAoJEPMMOL0/L748fSwQAJJFV7a9zFDGA2wmiu4mLffFN4FUwkE6
 Ov4/pzE8O6By5AnaBN8JiuoIYLKD5vdIjz/vuMwxxVUbwqBeqLGir+LmrGMhGNWO
 Ghu/SyDhGiot+WU3rAvn3cr2ceZgn+eZtDHdYO3pFcthe18JP1wJIYtYISL7I4Tm
 ulsp0JiL0+UqBQeJHwA+ttmL1kNDqnvwJqDLLX2cZ4QaMhmg/c825CXmvaP7gXUO
 FOhBBdSrCl8sPr/A4Lem8lvCJpZSPt3cZvmpRm/7H9Oe2FRMhaizIDuPhrJoWqui
 NH1UwOig0Sy9vBTAzpNCNjKOwXYFTePOB3QQcmaQSqWjSSReUHdcD/Fx2Dw9BYot
 9mv8QWZukyYOaO6Py4LmtFOc2uupDIEqkOnD0mVlGYjMlCd2LI6AG3eI1VDZNtiL
 mc4Mv6nZfn+/c7jXMg9ZrhR5Hm7lbBEtSSLs7hczgMoE2o9RyD4mILLdUKm+VZYn
 DfnwlrLtDAQvP3ANYemdSuMODQnFzcbz348m6MQr/6p98+9q9yxehE1SoDIBLSmk
 3xfSiTTv1nolTYdBG6/5h3pI7r3b76iHICKJVU0XTCd+XFs9o+MfRrtQ95f7T5hJ
 BRkyDHi/HDD8XFYbmCd3Zdy+/SlyL4TYsNLflSP9wwcFOX4odL7L9RN4T2bpcS1a
 t4qgCgCJxrNH
 =edT0
 -----END PGP SIGNATURE-----

Merge remote-tracking branch 'remotes/vivier2/tags/linux-user-for-5.2-pull-request' into staging

Add ppoll_time64() and pselect6_time64()
Some fixes for for elfload, fcntl, termbits and btrfs

# gpg: Signature made Mon 07 Sep 2020 10:17:24 BST
# gpg:                using RSA key CD2F75DDC8E3A4DC2E4F5173F30C38BD3F2FBE3C
# gpg:                issuer "laurent@vivier.eu"
# gpg: Good signature from "Laurent Vivier <lvivier@redhat.com>" [full]
# gpg:                 aka "Laurent Vivier <laurent@vivier.eu>" [full]
# gpg:                 aka "Laurent Vivier (Red Hat) <lvivier@redhat.com>" [full]
# Primary key fingerprint: CD2F 75DD C8E3 A4DC 2E4F  5173 F30C 38BD 3F2F BE3C

* remotes/vivier2/tags/linux-user-for-5.2-pull-request:
  linux-user: Protect btrfs ioctl target definitions
  linux-user: fix ppc/termbits.h
  linux-user: Map signal numbers in fcntl
  linux-user: Correctly start brk after executable
  linux-user: Add support for ppoll_time64() and pselect6_time64()

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2020-09-07 15:31:04 +01:00
Peter Maydell 62f9256052 vga: fixes for cirrus and virtio-gpu.
-----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2.0.22 (GNU/Linux)
 
 iQIcBAABCgAGBQJfUiRsAAoJEEy22O7T6HE4Tv4QAIhkJ8uyt4Z6OZYZclAs86Ny
 3z96+WCsuzCmI+qP8JAnLnegSxdqJgKWpBOQ6I/BdST6hsLJ5+56q+SYkOt27ry9
 CJF7l+xZgYuutl8dF4GXR6M8sDjWlKJtMwjFTZvo9/RQ9jm3DHsfFz0zi87oOyhr
 3XJM36aR/OMXSouxaPGhrw8tmi+AU0ditOa95NKK8qu872v4fHn2s/L0GKi61Qh9
 YoE3N141gFFmkPuWjalSFERc6ozQEf0DzOLK3efTSMHmjBRnzI8SmKUoXBd77+tj
 enLvRQW0vrGMFziV2sxCs4jJXvvY1QbW+7IOvry6hnRr7sIU+GsRcrBxWlKgCHrR
 1Gn2qY+9ALJTBbiGSWXiCfhoAqjZnv4MYWS4bZTuih3SlWgk8An+vIanM5YkVZg0
 1JMmEuSwfSFhet12fmR8SOStIGwXHACYTkVr6ITGvThaoAEaBG76wd80kv920ruW
 F892hq7Al6rm7rZ/hH5FZwXHOqEn8bomOZtl6DN2q5w5waZfzk6FnAVS86b79/18
 LvR1pf8xYAhUcckkJWKvk2kDghOjVsNun0o6FY7L3+8MBDHRGcSgJaZ2feAkH2S9
 ywUrYSItn0lvmVTvl9WWApRp8uR42f8R2Luf9kSWCzetBn1XAfGHjOiT20WO7jBB
 tx1oz5kE7sO5FwKXZJE0
 =inDV
 -----END PGP SIGNATURE-----

Merge remote-tracking branch 'remotes/kraxel/tags/vga-20200904-pull-request' into staging

vga: fixes for cirrus and virtio-gpu.

# gpg: Signature made Fri 04 Sep 2020 12:26:36 BST
# gpg:                using RSA key 4CB6D8EED3E87138
# 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]
# Primary key fingerprint: A032 8CFF B93A 17A7 9901  FE7D 4CB6 D8EE D3E8 7138

* remotes/kraxel/tags/vga-20200904-pull-request:
  cirrus: handle wraparound in cirrus_invalidate_region
  virtio-gpu: fix unmap the already mapped items

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2020-09-07 13:27:20 +01:00
Richard Henderson 88e74b6122 target/microblaze: Collected fixes for env->iflags
There are several problems here that can result in soft lockup,
depending on exactly where an interrupt or exception is delivered:

Include BIMM_FLAG in IFLAGS_TB_MASK, since it needs to follow D_FLAG.
Ensure that iflags is 0 when entering an interrupt/exception handler.
Add mb_cpu_synchronize_from_tb to restore iflags from tb->flags.
The change to t_sync_flags is cosmetic, but makes the code clearer.

This fixes the reported regression in acceptance/replay_kernel.py.

Fixes: 683a247ed7 ("target/microblaze: Store "current" iflags in insn_start")
Tested-by: Thomas Huth <thuth@redhat.com>
Reported-by: Thomas Huth <thuth@redhat.com>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20200904190842.2282109-2-richard.henderson@linaro.org>
Signed-off-by: Thomas Huth <thuth@redhat.com>
2020-09-07 12:34:17 +02:00
Paolo Bonzini cc9962d8ea tests/qtest: do not list ahci-test twice
This is caught by "meson test", which complains about two tests with the
same name.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Message-Id: <20200904120342.11370-1-pbonzini@redhat.com>
Fixes: a2ce7dbd91 ("meson: convert tests/qtest to meson")
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
2020-09-07 12:34:17 +02:00
Daniel P. Berrangé affcc09c2d gitlab: expand test coverage for crypto builds
Most jobs test the latest nettle library. This adds explicit coverage
for latest gcrypt using Fedora, and old gcrypt and nettle using
CentOS-7. The latter does a minimal tools-only build, as we only need to
validate that the crypto code builds and unit tests pass. Finally a job
disabling both nettle and gcrypt is provided to validate that gnutls
still works.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
Message-Id: <20200901133050.381844-3-berrange@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
2020-09-07 12:34:17 +02:00
Daniel P. Berrangé 46859d9398 crypto: fix build with gcrypt enabled
If nettle is disabled and gcrypt enabled, the compiler and linker flags
needed for gcrypt are not passed.

Gnutls was also not added as a dependancy when gcrypt is enabled.

Attempting to add the library dependencies at the same time as the
source dependencies is error prone, as there are alot of different
rules for picking which sources to use, and some of the source files
use code level conditionals intead. It is thus clearer to add the
library dependencies separately.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
Message-Id: <20200901133050.381844-2-berrange@redhat.com>
Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Tested-by: Alex Bennée <alex.bennee@linaro.org>
Tested-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Thomas Huth <thuth@redhat.com>
2020-09-07 12:34:17 +02:00
Thomas Huth 6bcb5fc0f7 gitlab-ci: Add cross-compiling build tests
Now that we can use all our QEMU test containers in the gitlab-CI, we can
easily add some jobs that test cross-compilation for various architectures.
There is just only small ugliness: Since the shared runners on gitlab.com
are single-threaded, we have to split each compilation job into two parts
(--disable-user and --disable-system), and exclude some additional targets,
to avoid that the jobs are running too long and hitting the timeout of 1 h.

Message-Id: <20200823111757.72002-8-thuth@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
2020-09-07 12:34:17 +02:00
Thomas Huth 8c2787629e stubs: Move qemu_fd_register stub to util/main-loop.c
The linker of MinGW sometimes runs into the following problem:

libqemuutil.a(util_main-loop.c.obj): In function `qemu_fd_register':
/builds/huth/qemu/build/../util/main-loop.c:331: multiple definition of
 `qemu_fd_register'
libqemuutil.a(stubs_fd-register.c.obj):/builds/huth/qemu/stubs/fd-register.c:5:
 first defined here
collect2: error: ld returned 1 exit status
/builds/huth/qemu/rules.mak:88: recipe for target 'tests/test-timed-average.exe'
 failed

qemu_fd_register() is defined in util/main-loop.c for WIN32, so let's simply
move the stub also there in the #else part of the corresponding #ifndef
to fix this problem.

Message-Id: <20200903054503.425435-1-thuth@redhat.com>
Acked-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
2020-09-07 12:34:17 +02:00
Thomas Huth b0476d6602 stubs: Move qemu_timer_notify_cb() and remove qemu_notify_event() stub
When cross-compiling with MinGW, there are sometimes some weird linker
errors like:

ibqemuutil.a(util_main-loop.c.obj): In function `qemu_notify_event':
/builds/huth/qemu/build/../util/main-loop.c:139: multiple definition of
 `qemu_notify_event'
libqemuutil.a(stubs_notify-event.c.obj):/builds/huth/qemu/stubs/notify-event.c:5:
 first defined here
collect2: error: ld returned 1 exit status
/builds/huth/qemu/rules.mak:88: recipe for target 'tests/test-timed-average.exe'
 failed

It seems like it works better when the qemu_timer_notify_cb() stub (which
calls qemu_notify_event()) is in a separate file - then we can also even
remove the qemu_notify_event() stub now.

This patch is based on ideas from the patch "stubs: Remove qemu_notify_event()"
by Philippe Mathieu-Daudé and the patch "cpu-timers, icount: new modules" from
Claudio Fontana.

Message-Id: <20200902102433.304737-1-thuth@redhat.com>
Acked-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
2020-09-07 12:34:17 +02:00
Thomas Huth e7a222aeb8 configure: Allow automatic WHPX detection
The whpx variable is currently initialized to "no" which causes the WHPX
check to skip the detection unless the user specified --enable-whpx.
Since the detection code should be able to figure it out correctly, let's
initialized the variable to "" on MinGW-builds for proper auto-detection
instead.

Message-Id: <20200804170055.2851-11-thuth@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Stefan Weil <sw@weilnetz.de>
Message-Id: <20200823111757.72002-7-thuth@redhat.com>
Acked-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
2020-09-07 12:34:17 +02:00
Thomas Huth d3dd34a1e5 dockerfiles/debian-win64-cross: Download WHPX MinGW headers
To compile-test the WHPX accelerator, we need to download these system
headers first (they are unfortunately not part of any released and
packaged MinGW toolchain yet).

Idea taken from another patch by Stefan Weil.

Message-Id: <20200804170055.2851-12-thuth@redhat.com>
Message-Id: <20200823111757.72002-6-thuth@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
2020-09-07 12:34:17 +02:00
Thomas Huth ce4e510ac7 tests/Makefile: test-image-locking needs CONFIG_POSIX
test-image-locking.c uses the qemu_lock_fd_test() function which is
only available on POSIX-like systems.

Message-Id: <20200804170055.2851-4-thuth@redhat.com>
Reviewed-by: John Snow <jsnow@redhat.com>
Message-Id: <20200823111757.72002-4-thuth@redhat.com>
Acked-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
2020-09-07 12:34:17 +02:00
Yonggang Luo 0fdc1f2f5e tests: Fixes building test-util-filemonitor.c on msys2/mingw
Fixes the following compiling error:
../tests/test-util-filemonitor.c: In function 'test_file_monitor_events':
../tests/test-util-filemonitor.c:620:17: error: too many arguments to function 'mkdir'
  620 |             if (mkdir(pathsrc, 0700) < 0) {
      |                 ^~~~~
In file included from C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/unistd.h:10,
                 from C:/work/xemu/qemu/include/qemu/osdep.h:93,
                 from ../tests/test-util-filemonitor.c:21:
C:/CI-Tools/msys64/mingw64/x86_64-w64-mingw32/include/io.h:282:15: note: declared here
  282 |   int __cdecl mkdir (const char *) __MINGW_ATTRIB_DEPRECATED_MSVC2005;
      |               ^~~~~

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Message-Id: <20200905203425.1470-1-luoyonggang@gmail.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Thomas Huth <thuth@redhat.com>
2020-09-07 12:34:17 +02:00
Yonggang Luo 85c93c57f1 tests: fixes test-vmstate.c compile error on msys2
../tests/test-vmstate.c: In function 'int_cmp':
../tests/test-vmstate.c:884:5: error: unknown type name 'uint'; did you mean 'uInt'?
  884 |     uint ua = GPOINTER_TO_UINT(a);
      |     ^~~~
      |     uInt
../tests/test-vmstate.c:885:5: error: unknown type name 'uint'; did you mean 'uInt'?
  885 |     uint ub = GPOINTER_TO_UINT(b);
      |     ^~~~
      |     uInt
make: *** [Makefile.ninja:5461:tests/test-vmstate.exe.p/test-vmstate.c.obj] 错误 1

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Message-Id: <20200905063813.1875-1-luoyonggang@gmail.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>

Signed-off-by: Thomas Huth <thuth@redhat.com>
2020-09-07 12:34:17 +02:00
Yonggang Luo fec7bcf16b tests: handling signal on win32 properly
SIGABRT should use signal(SIGABRT, sigabrt_handler) to handle on win32

The error:
E:/CI-Cor-Ready/xemu/qemu.org/tests/test-replication.c:559:33: error: invalid use of undefined type 'struct sigaction'
  559 |     sigact = (struct sigaction) {
      |                                 ^

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Message-Id: <20200902170054.810-6-luoyonggang@gmail.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
2020-09-06 20:26:43 +02:00
Alex Bennée 90843750e3 tests/docker: add python3-setuptools the docker images
We need these now for builds to work.

Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Message-Id: <20200903112107.27367-4-alex.bennee@linaro.org>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Signed-off-by: Thomas Huth <thuth@redhat.com>
2020-09-06 20:26:43 +02:00
Peter Maydell 7c37270b3f ui: memleak fixes.
gtk: refresh interval fix.
 spice: add mouse buttons.
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2.0.22 (GNU/Linux)
 
 iQIcBAABCgAGBQJfUeYnAAoJEEy22O7T6HE4NbkP/1jTXWNh/D9niG4eW2x2Oasc
 /hUtW70sKfRaIvsnrY5avSMS9PmligvuBi0OlqUx1mSmq6bicnKsengvZCmx8kja
 w7yetoaElngm7Ycho9dED0uXi9Czk33Do3UZycxz6WwsacSKnh4SFM11wOjKjm5n
 6XmgobBmDe4DPlmiW84I9yYnpWH3DeMZyCg6lkODT0k0/fIF6h7r8gbwKLznyO9X
 JSVaAPNQ2m4CJYWRvOcIylnyD7e2GnZn+4EGZt7vpmdSvhy0sFSNQQFFd1pvCTig
 pyYtETunq5xaMSrJCuUQoejvaPbuTnlmUh7SjcfPcxe0SZKj9gOFUGRM89Ghn4O2
 f2TYFKVJLXLVpbKzsHPhbX5OBdiC3+kT2b/eHARRmzRH6/74982esrC+bHe3dWkY
 hjfNY/dQ6vWMg09NFmR9SOuZ9yvRRX2znnYb1FE/QQ6qDLaQwryiVhTB654jztEK
 IGhPjh+3Is8iqYp25Ls1CWODu9Hd5AgGFTvc/rQ95rpHqJu3GXRK+4zfzat0eUKi
 Ahx1vraJjjCFIhzetkKHVtdQd4c+f0m96hwcqEUF9rN/o6dQr/rsJ6IruxK1lRPE
 6m8XPKBK6K2jbUdHTrDSHPLcy1iXRukNPS7gdxgJzjl/FG6GXyCfrapJBkpDmWyK
 daB6kvPtKj9s4JBhuOp5
 =7Z4z
 -----END PGP SIGNATURE-----

Merge remote-tracking branch 'remotes/kraxel/tags/ui-20200904-pull-request' into staging

ui: memleak fixes.
gtk: refresh interval fix.
spice: add mouse buttons.

# gpg: Signature made Fri 04 Sep 2020 08:00:55 BST
# gpg:                using RSA key 4CB6D8EED3E87138
# 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]
# Primary key fingerprint: A032 8CFF B93A 17A7 9901  FE7D 4CB6 D8EE D3E8 7138

* remotes/kraxel/tags/ui-20200904-pull-request:
  ui/gtk: Update refresh interval after widget is realized
  ui: Add more mouse buttons to SPICE
  vnc-auth-sasl: Plug memleak in vnc_socket_ip_addr_string
  ui/gtk-gl-area: Plug memleak in gd_gl_area_create_context()

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2020-09-06 16:23:55 +01:00
Filip Bozuta 5d5d17522f linux-user: Protect btrfs ioctl target definitions
Target definitions of btrfs ioctls in 'syscall_defs.h' use
the value BTRFS_IOCTL_MAGIC that is defined header 'btrfs.h'.
This header is not available in kernel versions before 3.9.
For that reason, these target ioctl definitions should be
enwrapped in an #ifdef directive to check whether the 'btrfs.h'
header is available as to not cause build errors on older
Linux systems.

Signed-off-by: Filip Bozuta <Filip.Bozuta@syrmia.com>
Reviewed-by: Laurent Vivier <laurent@vivier.eu>
Message-Id: <20200905163802.2666-1-Filip.Bozuta@syrmia.com>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
2020-09-06 12:29:19 +02:00
Laurent Vivier 4d6e318af0 linux-user: fix ppc/termbits.h
On ppc, in termios, c_line is after c_cc, not before .

Fixes: c218b4ede4 ("linux-user: Add missing termbits types and values definitions")
Cc: Filip.Bozuta@syrmia.com
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
Message-Id: <20200830181620.422036-1-laurent@vivier.eu>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
2020-09-06 12:29:19 +02:00
Timothy Baldwin a7b4c9b1b4 linux-user: Map signal numbers in fcntl
Map signal numbers in fcntl F_SETSIG and F_GETSIG.

Signed-off-by: Timothy E Baldwin <T.E.Baldwin99@members.leeds.ac.uk>
Reviewed-by: Laurent Vivier <laurent@vivier.eu>
Message-Id: <72cc725c-f344-b7f1-d559-401867067d80@members.leeds.ac.uk>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
2020-09-06 12:29:16 +02:00
Timothy E Baldwin 8a04518868 linux-user: Correctly start brk after executable
info->brk was erroneously set to the end of highest addressed
writable segment which could result it in overlapping the executable.

As per load_elf_binary in fs/binfmt_elf.c in Linux, it should be
set to end of highest addressed segment.

Signed-off-by: Timothy E Baldwin <T.E.Baldwin99@members.leeds.ac.uk>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20200728224615.326675-1-T.E.Baldwin99@members.leeds.ac.uk>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
2020-09-05 22:51:07 +02:00
Filip Bozuta e5ce9688b4 linux-user: Add support for ppoll_time64() and pselect6_time64()
This patch introduces functionality for following time64 syscalls:

*ppoll_time64

    This is a year 2038 safe variant of:

    int poll(struct pollfd *fds, nfds_t nfds, int timeout)
    -- wait for some event on a file descriptor --
    man page: https://man7.org/linux/man-pages/man2/ppoll.2.html

*pselect6_time64

    This is a year 2038 safe variant of:

    int pselect6(int nfds, fd_set *readfds, fd_set *writefds,
                 fd_set *exceptfds, const struct timespec *timeout,
                 const sigset_t *sigmask);
    -- synchronous I/O multiplexing --
    man page: https://man7.org/linux/man-pages/man2/pselect6.2.html

Implementation notes:

    Year 2038 safe syscalls in this patch were implemented
    with the same code as their regular variants (ppoll() and pselect()).
    This code was moved to new functions ('do_ppoll()' and 'do_pselect6()')
    that take a 'bool time64' from which a right 'struct timespec' converting
    function is called.
    (target_to_host/host_to_target_timespec() for regular and
     target_to_host/host_to_target_timespec64() for time64 variants)

Signed-off-by: Filip Bozuta <Filip.Bozuta@syrmia.com>
Reviewed-by: Laurent Vivier <laurent@vivier.eu>
Message-Id: <20200824223050.92032-2-Filip.Bozuta@syrmia.com>
[lv: rebase and fix do_pselect6()]
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
2020-09-05 22:40:43 +02:00
Peter Maydell 227de21ed0 Improve inlining in cputlb.c.
Fix vector abs fallback.
 Only set parallel_cpus for SMP.
 Add vector dupm for 256-bit elements.
 -----BEGIN PGP SIGNATURE-----
 
 iQFRBAABCgA7FiEEekgeeIaLTbaoWgXAZN846K9+IV8FAl9RYlEdHHJpY2hhcmQu
 aGVuZGVyc29uQGxpbmFyby5vcmcACgkQZN846K9+IV/A+ggAri5v3tr1JqjPGcE0
 6+yvUmhA9vyFH4QN1LS8abW9LWIhjLwiOQCqQWD6o5YDOs+YlHnr5JQCsHSmmhf/
 NlipyNrHXs2L0ClPFbvNyUnmTHFG5tjkedv3v4lTbAUfJP7/slVEiK1QzWrlyF2c
 61RLDvhNa/mWLZ+IbsCUKRDN05dc++XczBUghqGffWequR4oRegnDnJcNa1OvF3A
 DcH0U8dw4wG1yqW4NNJpQWrGOMfXTXJcHO9FSurrjH68TJxZqeMsjlw+VfN+D8a1
 AU3WpKhomtSjF6mgebBdOuy4lYC0UoZ+TTY/ycRXM47C9q1s6ccLO1FtGyj/Vo6b
 nxPOFQ==
 =j/GJ
 -----END PGP SIGNATURE-----

Merge remote-tracking branch 'remotes/rth/tags/pull-tcg-20200903' into staging

Improve inlining in cputlb.c.
Fix vector abs fallback.
Only set parallel_cpus for SMP.
Add vector dupm for 256-bit elements.

# gpg: Signature made Thu 03 Sep 2020 22:38:25 BST
# gpg:                using RSA key 7A481E78868B4DB6A85A05C064DF38E8AF7E215F
# gpg:                issuer "richard.henderson@linaro.org"
# gpg: Good signature from "Richard Henderson <richard.henderson@linaro.org>" [full]
# Primary key fingerprint: 7A48 1E78 868B 4DB6 A85A  05C0 64DF 38E8 AF7E 215F

* remotes/rth/tags/pull-tcg-20200903:
  tcg: Implement 256-bit dup for tcg_gen_gvec_dup_mem
  tcg: Eliminate one store for in-place 128-bit dup_mem
  softmmu/cpus: Only set parallel_cpus for SMP
  tcg: Fix tcg gen for vectorized absolute value
  cputlb: Make store_helper less fragile to compiler optimizations

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2020-09-05 15:30:41 +01:00
Peter Maydell 8ca019b9c9 QAPI patches patches for 2020-09-03
-----BEGIN PGP SIGNATURE-----
 
 iQJGBAABCAAwFiEENUvIs9frKmtoZ05fOHC0AOuRhlMFAl9QoqUSHGFybWJydUBy
 ZWRoYXQuY29tAAoJEDhwtADrkYZT2R0QAJJ4HVmHYAfbImC4EPiA26zesITxphaD
 323prQJqR0mKzNf+i4fS4HF36ngCTP1iqaBLU51zTmMt9W7ailQt+jrZhvL3mt25
 eURTTtP31gh3OPkp/jhLS6Ei4eKG1pel/eyNhlFyDgZaIwIs08tVZO9itlNRRnMZ
 xl+CVeCgyVhd5TdBs7HU2koY2lUCWL8SOQltGEFMYGxMRvW4sZZ9Rmckj/VR5iSM
 1xH7CD7xvVCwJcO93cHmqFx7aFaXGEZiBrwmkRSnfbT2xB8tiJrrhV1u6XXQglpS
 8lT+HbNH/2U6Ru9ci3sQGV+t8ZuJcsR/xjvBYYAZ6To5TOmD4S59TqnbG7YmRB7f
 Vqpg52Tm7JO4C4kKeMbYA4msDMb6n5azJURpFjFVg9oUms7tNdur+p7Gh4g2Ngr1
 tCZjXGbDTlbsjlF7xtF/73ff3sNJoxcnok4dptEKdVlwhOZ6McOMgt3s7tF4B/ca
 vAbnwepuUtILgXzqDBg15eViJdrsGvc2nl+sz4D3AxvPuNc2PloBUcrqWYpXX60+
 qxRJydE18T6ag2qCvjAHC5qZ2qOTr1bPZ3iCVwVZc3tSj/MR1FC76SjEe4JlN05x
 3FTZ+hVsn3VOrfZYd9ziwB05LXHp0uv04TVAWgw8dmzFv9mNMciVoY+EjAVYiDfW
 9cd6cV3W2tjx
 =HUiH
 -----END PGP SIGNATURE-----

Merge remote-tracking branch 'remotes/armbru/tags/pull-qapi-2020-09-03' into staging

QAPI patches patches for 2020-09-03

# gpg: Signature made Thu 03 Sep 2020 09:00:37 BST
# gpg:                using RSA key 354BC8B3D7EB2A6B68674E5F3870B400EB918653
# gpg:                issuer "armbru@redhat.com"
# gpg: Good signature from "Markus Armbruster <armbru@redhat.com>" [full]
# gpg:                 aka "Markus Armbruster <armbru@pond.sub.org>" [full]
# Primary key fingerprint: 354B C8B3 D7EB 2A6B 6867  4E5F 3870 B400 EB91 8653

* remotes/armbru/tags/pull-qapi-2020-09-03:
  docs/qdev-device-use: Don't suggest -drive and -net can do USB
  qapi: Document event VSERPORT_CHANGE is rate-limited
  docs/interop/qmp-spec: Point to the QEMU QMP reference manual
  scripts/qmp/qom-fuse: Fix getattr(), read() for files in /
  scripts/qmp/qom-fuse: Port to current Python module fuse
  scripts/qmp/qom-fuse: Unbreak import of QEMUMonitorProtocol
  qapi/block-core.json: Remove stale description of 'blockdev-add'
  qapi: enable use of g_autoptr with QAPI types

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2020-09-04 23:24:03 +01:00
Peter Maydell 1133ce5ec9 Add btrfs support
Fix MK_ARRAY()
 -----BEGIN PGP SIGNATURE-----
 
 iQJGBAABCAAwFiEEzS913cjjpNwuT1Fz8ww4vT8vvjwFAl9QKi0SHGxhdXJlbnRA
 dml2aWVyLmV1AAoJEPMMOL0/L748fnMP/iOEIiotDBW7TQ6f2iOejvlSOsYN3Wtz
 735srtaD5og/0oaYH+nQ9kVV0cY6ZObe2KA9JeyodogkhuwzXHPjKlKWHBNGUMtB
 fdur65/1I9tNQDW+FfVc+4uT3Vk3lBoHEMCmmtVVRcB+coa7kAXtntqAQPAkjmow
 lA7WeGg1sIKVd1Hg+gM9qkboxqi9t90sbd+bhhHy2lPcCJvGFIWFRcgwwvJzIP49
 K6h551/zXe7mLQ1dG4dPvNHnpnS+0HhgVzUGuERjx1wNgoQN1adKPO8R3aQl1mr7
 ZIPWmZw6blw6neG3rMYEaSvfS+AItPCxE5zlpsJibni34sYHRIrukDhtxj1UMrJX
 mZmJgFQthUbd1vGYBTJNy6gb0IHc8TyrIhsjclSWDcdZytaEKALm6OmgEqT8VCVA
 KvWg7gnxi2nuCHWCaGjslBSiH7PjtzeY5g4AOeEYGfi3IBaRYdUDdB4jr1x7zfqT
 66ROoi9Uwg5+vnlRenTFX3f0gXFXuqpIJf4AB8HXv3R6dDw+lpeCZM1MFOtNOFCK
 hKrRF/Jz+g69DqvFbM6L6qSEjsco0PoXVMscyqKJOV8XZdycf3wtEbFofLiV6cPH
 TyiebOKQjOGszxmQVXkdC7LD8h+jI6ZJb1ox2j9boXBVNTNUpV3ydVDnErfwKNxs
 1Xx8F/bOVLlX
 =Pr4V
 -----END PGP SIGNATURE-----

Merge remote-tracking branch 'remotes/vivier2/tags/linux-user-for-5.2-pull-request' into staging

Add btrfs support
Fix MK_ARRAY()

# gpg: Signature made Thu 03 Sep 2020 00:26:37 BST
# gpg:                using RSA key CD2F75DDC8E3A4DC2E4F5173F30C38BD3F2FBE3C
# gpg:                issuer "laurent@vivier.eu"
# gpg: Good signature from "Laurent Vivier <lvivier@redhat.com>" [full]
# gpg:                 aka "Laurent Vivier <laurent@vivier.eu>" [full]
# gpg:                 aka "Laurent Vivier (Red Hat) <lvivier@redhat.com>" [full]
# Primary key fingerprint: CD2F 75DD C8E3 A4DC 2E4F  5173 F30C 38BD 3F2F BE3C

* remotes/vivier2/tags/linux-user-for-5.2-pull-request:
  linux-user: Add support for btrfs ioctls used to scrub a filesystem
  linux-user: Add support for btrfs ioctls used to manage quota
  linux-user: Add support for two btrfs ioctls used for subvolume
  linux-user: Add support for a group of btrfs inode ioctls
  linux-user: Add support for btrfs ioctls used to get/set features
  linux-user: Add support for btrfs ioctls used to manipulate with devices
  linux-user: Add support for a group of btrfs ioctls used for snapshots
  linux-user: Add support for a group of btrfs ioctls used for subvolumes
  linux-user: fix implicit conversion from enumeration type error

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2020-09-04 15:53:56 +01:00
Gerd Hoffmann 5fcf787582 cirrus: handle wraparound in cirrus_invalidate_region
Code simply asserts that there is no wraparound instead of handling
it properly.  The assert() can be triggered by the guest (must be
privilidged inside the guest though).  Fix it.

Buglink: https://bugs.launchpad.net/qemu/+bug/1880189
Cc: Li Qiang <liq3ea@163.com>
Reported-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Reviewed-by: Li Qiang <liq3ea@163.com>
Message-id: 20200901140944.24101-1-kraxel@redhat.com
2020-09-04 10:12:56 +02:00
Li Zhijian eb398a54e3 virtio-gpu: fix unmap the already mapped items
we go here either (!(*iov)[i].iov_base) or (len != l), so we need to consider
to unmap the 'i'th item as well when the 'i'th item is not nil

CC: Li Qiang <liq3ea@gmail.com>
Signed-off-by: Li Zhijian <lizhijian@cn.fujitsu.com>
Message-id: 20200827035855.24354-1-lizhijian@cn.fujitsu.com
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2020-09-04 10:12:56 +02:00
Philippe Mathieu-Daudé dc26435edb ui/gtk: Update refresh interval after widget is realized
Nikola reported on Windows when gd_vc_gfx_init() is called, the
window is not yet realized, so we run gd_refresh_rate_millihz(NULL)
which returns 0 milli-Hertz.
When a Widget is realized, it fires a 'realized' event. We already
have the gd_draw_event() handler registered for this even, so simply
move the gd_refresh_rate_millihz() there. When the event fires, the
window is known to exist.
This completes commit c4c00922cc original intention.

Reported-by: Nikola Pavlica <pavlica.nikola@gmail.com>
Tested-by: Nikola Pavlica <pavlica.nikola@gmail.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Message-id: 20200817172331.598255-1-philmd@redhat.com
Suggested-by: Nikola Pavlica <pavlica.nikola@gmail.com>
Tested-by: Nikola Pavlica <pavlica.nikola@gmail.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2020-09-04 07:32:28 +02:00
Frediano Ziglio 5b57a87e4e ui: Add more mouse buttons to SPICE
Add support for SIDE and EXTRA buttons.

The constants for buttons in both SPICE and QEMU are defined as
  LEFT
  MIDDLE
  RIGHT
  UP
  DOWN
  SIDE
  EXTRA
(same order).

"button_mask" contains for each bit the state of a button. Qemu currently
uses bits 0, 1, 2 respectively as LEFT, RIGHT, MIDDLE; also add bits 4
and 5 as UP and DOWN (using wheel movements). SPICE protocol uses
a bitmask based on the order above where LEFT is bit 0, MIDDLE is
bit 1 and so on till EXTRA being bit 6. To avoid clash with Qemu usage
SPICE bitmask from SIDE are move a bit more resulting respectively
in 0x40 and 0x80 values.

Signed-off-by: Frediano Ziglio <freddy77@gmail.com>
Message-id: 20200820145851.50846-1-fziglio@redhat.com
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2020-09-04 07:32:28 +02:00
Pan Nengyuan 7791acaf3d vnc-auth-sasl: Plug memleak in vnc_socket_ip_addr_string
'addr' is forgot to free in vnc_socket_ip_addr_string error path. Fix that.

Reported-by: Euler Robot <euler.robot@huawei.com>
Signed-off-by: Pan Nengyuan <pannengyuan@huawei.com>
Reviewed-by: Li Qiang <liq3ea@gmail.com>
Message-Id: <20200831134315.1221-11-pannengyuan@huawei.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2020-09-04 07:30:57 +02:00
Pan Nengyuan 2cd1e3f915 ui/gtk-gl-area: Plug memleak in gd_gl_area_create_context()
Receiving error in local variable err, and forgot to free it.
This patch check the return value of 'gdk_window_create_gl_context'
and 'gdk_gl_context_realize', then free err to fix it.

Reported-by: Euler Robot <euler.robot@huawei.com>
Signed-off-by: Pan Nengyuan <pannengyuan@huawei.com>
Message-Id: <20200831134315.1221-6-pannengyuan@huawei.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2020-09-04 07:30:57 +02:00
Peter Maydell df8176274a nbd patches for 2020-09-02
- fix a few iotests affected by earlier nbd changes
 - avoid blocking qemu by nbd client in connect()
 - build qemu-nbd for mingw
 -----BEGIN PGP SIGNATURE-----
 
 iQEzBAABCAAdFiEEccLMIrHEYCkn0vOqp6FrSiUnQ2oFAl9QFB8ACgkQp6FrSiUn
 Q2pTwggArPN7dRwm1KD9jL8X6PV01uhLuLRFzrrofFX22Blroj5XPbR24BdKeN8V
 uDSFGzzoz2Vx3vKPHyZdx7bbeEL0pF9dzjZX6JwzT0McbVuge5aG2zC/ARdfc4PN
 1Yf2FB/nY8Xt5G12usu3FIz7JBoQNm4mlPnqVqf7t0LQxgUFvO7F2LernyqEOYKS
 uSpXHNFqddZcax7etXeldJOlSGJBQTaCmplrJbw2ilVhLZJD+0OglY4SAsrrenN+
 gb/KD4REjhtQsmoTaqthGCnGXipEoJYDfEOMhbkl0UK+9Mx0t+3cj3tflG0eGldM
 ERk1d4d7VSlyqIy7w43v3+IB8M99ag==
 =7Cn5
 -----END PGP SIGNATURE-----

Merge remote-tracking branch 'remotes/ericb/tags/pull-nbd-2020-09-02' into staging

nbd patches for 2020-09-02

- fix a few iotests affected by earlier nbd changes
- avoid blocking qemu by nbd client in connect()
- build qemu-nbd for mingw

# gpg: Signature made Wed 02 Sep 2020 22:52:31 BST
# gpg:                using RSA key 71C2CC22B1C4602927D2F3AAA7A16B4A2527436A
# gpg: Good signature from "Eric Blake <eblake@redhat.com>" [full]
# gpg:                 aka "Eric Blake (Free Software Programmer) <ebb9@byu.net>" [full]
# gpg:                 aka "[jpeg image of size 6874]" [full]
# Primary key fingerprint: 71C2 CC22 B1C4 6029 27D2  F3AA A7A1 6B4A 2527 436A

* remotes/ericb/tags/pull-nbd-2020-09-02:
  nbd: disable signals and forking on Windows builds
  nbd: skip SIGTERM handler if NBD device support is not built
  block: add missing socket_init() calls to tools
  block/nbd: use non-blocking connect: fix vm hang on connect()
  iotests/259: Fix reference output
  iotests/059: Fix reference output

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2020-09-03 21:35:01 +01:00
Richard Henderson fe4b0b5bfa tcg: Implement 256-bit dup for tcg_gen_gvec_dup_mem
We already support duplication of 128-bit blocks.  This extends
that support to 256-bit blocks.  This will be needed by SVE2.

Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
2020-09-03 13:13:58 -07:00
Richard Henderson 6a17646176 tcg: Eliminate one store for in-place 128-bit dup_mem
Do not store back to the exact memory from which we just loaded.

Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
2020-09-03 13:13:58 -07:00
Richard Henderson 4ca3d09cd9 softmmu/cpus: Only set parallel_cpus for SMP
Do not set parallel_cpus if there is only one cpu instantiated.
This will allow tcg to use serial code to implement atomics.

Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
2020-09-03 13:13:58 -07:00
Stephen Long e7e8f33fb6 tcg: Fix tcg gen for vectorized absolute value
The fallback inline expansion for vectorized absolute value,
when the host doesn't support such an insn was flawed.

E.g. when a vector of bytes has all elements negative, mask
will be 0xffff_ffff_ffff_ffff.  Subtracting mask only adds 1
to the low element instead of all elements becase -mask is 1
and not 0x0101_0101_0101_0101.

Signed-off-by: Stephen Long <steplong@quicinc.com>
Message-Id: <20200813161818.190-1-steplong@quicinc.com>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
2020-09-03 13:13:58 -07:00
Richard Henderson 6b8b622e87 cputlb: Make store_helper less fragile to compiler optimizations
This has no functional change.

The current function structure is:

    inline QEMU_ALWAYSINLINE
    store_memop() {
        switch () {
            ...
        default:
            qemu_build_not_reached();
        }
    }
    inline QEMU_ALWAYSINLINE
    store_helper() {
        ...
        if (span_two_pages_or_io) {
            ...
            helper_ret_stb_mmu();
        }
        store_memop();
    }
    helper_ret_stb_mmu() {
        store_helper();
    }

Whereas GCC will generate an error at compile-time when an always_inline
function is not inlined, Clang does not.  Nor does Clang prioritize the
inlining of always_inline functions.  Both of these are arguably bugs.

Both `store_memop` and `store_helper` need to be inlined and allow
constant propogations to eliminate the `qemu_build_not_reached` call.

However, if the compiler instead chooses to inline helper_ret_stb_mmu
into store_helper, then store_helper is now self-recursive and the
compiler is no longer able to propagate the constant in the same way.

This does not produce at current QEMU head, but was reproducible
at v4.2.0 with `clang-10 -O2 -fexperimental-new-pass-manager`.

The inline recursion problem can be fixed solely by marking
helper_ret_stb_mmu as noinline, so the compiler does not make an
incorrect decision about which functions to inline.

In addition, extract store_helper_unaligned as a noinline subroutine
that can be shared by all of the helpers.  This saves about 6k code
size in an optimized x86_64 build.

Reported-by: Shu-Chun Weng <scw@google.com>
Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
2020-09-03 13:13:58 -07:00
Peter Maydell 67a7bfe560 * Cirrus-CI improvements and fixes (compile with -Werror & fix for 1h problem)
* Two build system fixes to fix some failures the CI
 * One m68k QOMification patch
 * Some trivial qtest patches
 * Some small improvements for the Gitlab CI
 -----BEGIN PGP SIGNATURE-----
 
 iQJFBAABCAAvFiEEJ7iIR+7gJQEY8+q5LtnXdP5wLbUFAl9QzcARHHRodXRoQHJl
 ZGhhdC5jb20ACgkQLtnXdP5wLbWfIQ//TqpTDJzS0qs3m/cvl8nJNbe/DqwSx2U5
 gUgpLiLU0UVO8xOw0WwrdIIdRlEdV9QclG+kjq3VTNfPBpZ7llTsPlWuXduDvrrQ
 LhVaYCtOkl3eA1dvujQOAud04DQlo73NS5H1FeJzpK5UAQNhW/HSHZRgkNfZxCSj
 WRFQbXu2Sp+WKstvgoaBvIfr2yqdoToicuRL12IGkIYNdDzHVR82gouDrsxdO7Ig
 VDr0fUL2t4cylUAmNrmctV3Fe0WcbI8HXH1S825TvaoYofo6LmrkKBXj5IIoTK9s
 zCKIh+prMnWhXupCE4uCvDLESqptq6YvY5mt4a6c3om1U0qUvFxsaJeR0lS6sXHc
 xoIYdBTw1ETWfOgfT8ZpJRiogBoi7AkQrjWXUsUUR9KFYSRaOIIUujCnTyJuIVm1
 spKxlwikVoIa9onJD+or4LC1HI79lS8i537lHjPWHgsZuzzjkT/cCIUvTcax/Rjz
 itpqi8sJrOlS4rP9u84qL/xz7wOixehriLUnBVb/Q6i7LaLMyDaLg+5+r8sPb6jx
 VzKLpDQ6YtigzRZ/PKOe1BQun4jGBT4oyautu+5Z7GSnkXqrR1NNnacOWGhJztzt
 S+IhC08boN4C8KqjynF1xazZXtkfYgya4p2SU6AQG0dxhvf9cEr1AWj0tBSXpRc/
 3jx4Ev24kZk=
 =kPTJ
 -----END PGP SIGNATURE-----

Merge remote-tracking branch 'remotes/huth-gitlab/tags/pull-request-2020-09-03' into staging

* Cirrus-CI improvements and fixes (compile with -Werror & fix for 1h problem)
* Two build system fixes to fix some failures the CI
* One m68k QOMification patch
* Some trivial qtest patches
* Some small improvements for the Gitlab CI

# gpg: Signature made Thu 03 Sep 2020 12:04:32 BST
# gpg:                using RSA key 27B88847EEE0250118F3EAB92ED9D774FE702DB5
# gpg:                issuer "thuth@redhat.com"
# gpg: Good signature from "Thomas Huth <th.huth@gmx.de>" [full]
# gpg:                 aka "Thomas Huth <thuth@redhat.com>" [full]
# gpg:                 aka "Thomas Huth <huth@tuxfamily.org>" [full]
# gpg:                 aka "Thomas Huth <th.huth@posteo.de>" [unknown]
# Primary key fingerprint: 27B8 8847 EEE0 2501 18F3  EAB9 2ED9 D774 FE70 2DB5

* remotes/huth-gitlab/tags/pull-request-2020-09-03:
  gitlab-ci.yml: Set artifacts expiration time
  gitlab-ci.yml: Run check-qtest and check-unit at the end of the fuzzer job
  gitlab/travis: Rework the disabled features tests
  libqtest: Rename qmp_assert_error_class() to qmp_expect_error_and_unref()
  tests/qtest/ipmi-kcs: Fix assert side-effect
  tests/qtest/tpm: Declare input buffers const and static
  tests/qtest/ahci: Improve error handling (NEGATIVE_RETURNS)
  hw/m68k: QOMify the mcf5206 system integration module
  configure: Add system = 'linux' for meson when cross-compiling
  meson: fix keymaps without qemu-keymap
  cirrus.yml: Split FreeBSD job into two parts
  cirrus.yml: Update the macOS jobs to Catalina
  cirrus.yml: Compile macOS with -Werror
  cirrus.yml: Compile FreeBSD with -Werror
  configure: Fix atomic64 test for --enable-werror on macOS

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2020-09-03 16:58:25 +01:00
Peter Maydell 3dd23a4fb8 Various fixes of Aspeed machines :
* New Supermicro X11 BMC machine (Erik)
 * Fixed valid access size on AST2400 SCU
 * Improved robustness of the ftgmac100 model.
 * New flash models in m25p80 (Igor)
 * Fixed reset sequence of SDHCI/eMMC controllers
 * Improved support of the AST2600 SDMC  (Joel)
 * Couple of SMC cleanups
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCAAdFiEEoPZlSPBIlev+awtgUaNDx8/77KEFAl9OQPgACgkQUaNDx8/7
 7KHzsRAAmXw6963D3wIuE2Nzb1G5Zvn6nup3AsF5Xs1IZU/cLqNijiz220KslFtQ
 y8KrTO/eyBmAsEjrg1f6bWwCTZsouKq/2vWPtmTx3eU4HgeJdPbkln7E1YGmMfBR
 T4WJU6mNqkWfFT3WAW3IbB4qCoH3l0DRkgawYPWbdJmTs5CBtXOYCT14TijDVWQ5
 p8S4QjTtfRPwG9csHJ1W93t8jadTzderefkN6Zcmf9y6iOCif6SVDFvF769hzg6e
 Pzp3xxRV3ewxhSLrGdCK+fQk/IcPaLVUnh+mM3mGLk2rDQoomFXBpaz1N94rw43s
 lGuIyLkUGiHbgONmlZMXj03WWQbgGqjYpDWme1rAKJSX6CRJRixucejsRFTG5Evx
 odgY1MGNrdg0K8L0O1SQEx7O+URZZO68WrtrMTwLbOHErE7pWAR+h5RqzclwMr3v
 0hwQxDeNjhDBj+nUwoPUjXsgfVafzeywFfKuMymnygGog5hFSWiqAFIqyxj+u6YI
 HUG8kMHdLqzAgX1NWAomn2cxUEc4Q2wxDlzUgvjcvBwa6HZD+3nrjMRStHTmeVy5
 yPKWmRanXH6xIUJoRd2dMEU6SrwGjmjfnKAbG3vgxJ6B5sk4BrfKOFeaCF9M2zP6
 ZePWf6XrsPQY7aZgQRTexmXK83jqn73DOkavI2pM9s/6Ts61mdc=
 =ZQHA
 -----END PGP SIGNATURE-----

Merge remote-tracking branch 'remotes/legoater/tags/pull-aspeed-20200901' into staging

Various fixes of Aspeed machines :

* New Supermicro X11 BMC machine (Erik)
* Fixed valid access size on AST2400 SCU
* Improved robustness of the ftgmac100 model.
* New flash models in m25p80 (Igor)
* Fixed reset sequence of SDHCI/eMMC controllers
* Improved support of the AST2600 SDMC  (Joel)
* Couple of SMC cleanups

# gpg: Signature made Tue 01 Sep 2020 13:39:20 BST
# gpg:                using RSA key A0F66548F04895EBFE6B0B6051A343C7CFFBECA1
# gpg: Good signature from "Cédric Le Goater <clg@kaod.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: A0F6 6548 F048 95EB FE6B  0B60 51A3 43C7 CFFB ECA1

* remotes/legoater/tags/pull-aspeed-20200901:
  hw: add a number of SPI-flash's of m25p80 family
  arm: aspeed: add strap define `25HZ` of AST2500
  aspeed/smc: Open AHB window of the second chip of the AST2600 FMC controller
  aspeed/sdmc: Simplify calculation of RAM bits
  aspeed/sdmc: Allow writes to unprotected registers
  aspeed/sdmc: Perform memory training
  ftgmac100: Improve software reset
  ftgmac100: Fix integer overflow in ftgmac100_do_tx()
  ftgmac100: Check for invalid len and address before doing a DMA transfer
  ftgmac100: Change interrupt status when a DMA error occurs
  ftgmac100: Fix interrupt status "Packet moved to RX FIFO"
  ftgmac100: Fix interrupt status "Packet transmitted on ethernet"
  ftgmac100: Fix registers that can be read
  aspeed/sdhci: Fix reset sequence
  aspeed/smc: Fix max_slaves of the legacy SMC device
  aspeed/smc: Fix MemoryRegionOps definition
  hw/arm/aspeed: Add board model for Supermicro X11 BMC
  aspeed/scu: Fix valid access size on AST2400
  m25p80: Add support for n25q512ax3
  m25p80: Return the JEDEC ID twice for mx25l25635e

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2020-09-03 14:12:48 +01:00
Thomas Huth 0a796d63bc gitlab-ci.yml: Set artifacts expiration time
The default expiration time for artifacts seems to be very high (30 days?).
Since we only need the artifacts to pass the binaries from one stage to
the next one, we can decrease the expiration time to avoid to spam the
file server too much. Two days should be enough in case someone still wants
to have a look after the pipeline finished.

Message-Id: <20200806161546.15325-1-thuth@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
2020-09-03 12:47:33 +02:00
Thomas Huth 5ab04d5e6f gitlab-ci.yml: Run check-qtest and check-unit at the end of the fuzzer job
The fuzzer job finishes quite early, so we can run the unit tests and
qtests with -fsanitize=address here without extending the total test time.

Message-Id: <20200831153228.229185-1-thuth@redhat.com>
Reviewed-by: Alexander Bulekov <alxndr@bu.edu>
Signed-off-by: Thomas Huth <thuth@redhat.com>
2020-09-03 12:47:33 +02:00
Thomas Huth a7524adb41 gitlab/travis: Rework the disabled features tests
Let's focus on the gitlab-ci when testing the compilation with disabled
features, thus add more switches there (and while we're at it, sort them
also alphabetically). This should cover the test from the Travis CI now,
too, so that we can remove the now-redundant job from the Travis CI.

Message-Id: <20200806155306.13717-1-thuth@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
2020-09-03 12:47:33 +02:00
Markus Armbruster 3bc1b8ee8c libqtest: Rename qmp_assert_error_class() to qmp_expect_error_and_unref()
qmp_assert_error_class() does more than just assert: it also unrefs
the @rsp argument.  Rename to qmp_expect_error_and_unref() to reduce
confusion.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Message-Id: <20200902115733.1229537-1-armbru@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
2020-09-03 12:47:33 +02:00
Philippe Mathieu-Daudé 978382b453 tests/qtest/ipmi-kcs: Fix assert side-effect
Fix assert side-effect reported by Coverity:

  /qemu/tests/qtest/ipmi-kcs-test.c: 84 in kcs_wait_obf()
  83         while (IPMI_KCS_CMDREG_GET_OBF() == 0) {
  >>>     CID 1432368:  Incorrect expression  (ASSERT_SIDE_EFFECT)
  >>>     Argument "--count" of g_assert() has a side effect.  The containing function might work differently in a non-debug build.
  84             g_assert(--count != 0);

Reported-by: Coverity (CID 1432368)
Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Message-Id: <20200902080801.160652-2-philmd@redhat.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
2020-09-03 12:47:33 +02:00
Philippe Mathieu-Daudé ed943cc934 tests/qtest/tpm: Declare input buffers const and static
The functions using these arrays expect a "const unsigned char *"
argument, it is safe to declare these as 'static const'.

Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Message-Id: <20200902080909.161034-1-philmd@redhat.com>
Reviewed-by: Darren Kenny <darren.kenny@oracle.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
2020-09-03 12:47:33 +02:00