Commit Graph

82680 Commits

Author SHA1 Message Date
Philippe Mathieu-Daudé 155e1c82ed docs/system: Deprecate raspi2/raspi3 machine aliases
Since commit aa35ec2213 ("hw/arm/raspi: Use more specific
machine names") the raspi2/raspi3 machines have been renamed
as raspi2b/raspi3b.

Note, rather than the raspi3b, the raspi3ap introduced in
commit 5be94252d3 ("hw/arm/raspi: Add the Raspberry Pi 3
model A+") is a closer match to what QEMU models, but only
provides 512 MB of RAM.

As more Raspberry Pi 2/3 models are emulated, in order
to avoid confusion, deprecate the raspi2/raspi3 machine
aliases.

ACKed-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Message-id: 20201120173953.2539469-2-f4bug@amsat.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2020-11-23 10:52:12 +00:00
Philippe Mathieu-Daudé 66278f8aeb MAINTAINERS: Cover system/arm/sx1.rst with OMAP machines
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Message-id: 20201120154545.2504625-7-f4bug@amsat.org
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2020-11-23 10:51:17 +00:00
Philippe Mathieu-Daudé 9eeeb80ad4 MAINTAINERS: Cover system/arm/sbsa.rst with SBSA-REF machine
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Message-id: 20201120154545.2504625-6-f4bug@amsat.org
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2020-11-23 10:51:13 +00:00
Philippe Mathieu-Daudé c67d732c39 MAINTAINERS: Fix system/arm/orangepi.rst path
Fixes: 0553ef4257 ("docs: add Orange Pi PC document")
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Niek Linnenbank <nieklinnenbank@gmail.com>
Message-id: 20201120154545.2504625-5-f4bug@amsat.org
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2020-11-23 10:51:06 +00:00
Philippe Mathieu-Daudé 7170311674 MAINTAINERS: Cover system/arm/nuvoton.rst with Nuvoton NPCM7xx
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Message-id: 20201120154545.2504625-4-f4bug@amsat.org
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2020-11-23 10:50:59 +00:00
Philippe Mathieu-Daudé de8ee7d47c MAINTAINERS: Cover system/arm/aspeed.rst with ASPEED BMC machines
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Cédric Le Goater <clg@kaod.org>
Message-id: 20201120154545.2504625-3-f4bug@amsat.org
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2020-11-23 10:50:52 +00:00
Philippe Mathieu-Daudé 6e84a91477 MAINTAINERS: Cover system/arm/cpu-features.rst with ARM TCG CPUs
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Message-id: 20201120154545.2504625-2-f4bug@amsat.org
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2020-11-23 10:48:44 +00:00
Chen Qun 57bdec5c46 hw/intc: fix heap-buffer-overflow in rxicu_realize()
When 'j = icu->nr_sense – 1', the 'j < icu->nr_sense' condition is true,
then 'j = icu->nr_sense', the'icu->init_sense[j]' has out-of-bounds access.

The asan showed stack:
ERROR: AddressSanitizer: heap-buffer-overflow on address 0x604000004d7d at pc 0x55852cd26a76 bp 0x7ffe39f26200 sp 0x7ffe39f261f0
READ of size 1 at 0x604000004d7d thread T0
    #0 0x55852cd26a75 in rxicu_realize ../hw/intc/rx_icu.c:311
    #1 0x55852cf075f7 in device_set_realized ../hw/core/qdev.c:886
    #2 0x55852cd4a32f in property_set_bool ../qom/object.c:2251
    #3 0x55852cd4f9bb in object_property_set ../qom/object.c:1398
    #4 0x55852cd54f3f in object_property_set_qobject ../qom/qom-qobject.c:28
    #5 0x55852cd4fc3f in object_property_set_bool ../qom/object.c:1465
    #6 0x55852cbf0b27 in register_icu ../hw/rx/rx62n.c:156
    #7 0x55852cbf12a6 in rx62n_realize ../hw/rx/rx62n.c:261
    #8 0x55852cf075f7 in device_set_realized ../hw/core/qdev.c:886
    #9 0x55852cd4a32f in property_set_bool ../qom/object.c:2251
    #10 0x55852cd4f9bb in object_property_set ../qom/object.c:1398
    #11 0x55852cd54f3f in object_property_set_qobject ../qom/qom-qobject.c:28
    #12 0x55852cd4fc3f in object_property_set_bool ../qom/object.c:1465
    #13 0x55852cbf1a85 in rx_gdbsim_init ../hw/rx/rx-gdbsim.c:109
    #14 0x55852cd22de0 in qemu_init ../softmmu/vl.c:4380
    #15 0x55852ca57088 in main ../softmmu/main.c:49
    #16 0x7feefafa5d42 in __libc_start_main (/lib64/libc.so.6+0x26d42)

Add the 'ice->src[i].sense' initialize to the default value, and then
process init_sense array to identify which irqs should be level-triggered.

Suggested-by: Peter Maydell <peter.maydell@linaro.org>
Reported-by: Euler Robot <euler.robot@huawei.com>
Signed-off-by: Chen Qun <kuhn.chenqun@huawei.com>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Message-id: 20201111141733.2358800-1-kuhn.chenqun@huawei.com
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2020-11-23 10:41:58 +00:00
AlexChen 98554b3b56 hw/arm: Fix bad print format specifiers
We should use printf format specifier "%u" instead of "%i" for
argument of type "unsigned int".

Reported-by: Euler Robot <euler.robot@huawei.com>
Signed-off-by: Alex Chen <alex.chen@huawei.com>
Message-id: 5F9FD78B.8000300@huawei.com
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2020-11-23 10:41:58 +00:00
Rémi Denis-Courmont 98e8779770 target/arm: fix stage 2 page-walks in 32-bit emulation
Using a target unsigned long would limit the Input Address to a LPAE
page-walk to 32 bits on AArch32 and 64 bits on AArch64. This is okay
for stage 1 or on AArch64, but it is insufficient for stage 2 on
AArch32. In that later case, the Input Address can have up to 40 bits.

Signed-off-by: Rémi Denis-Courmont <remi.denis.courmont@huawei.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20201118150414.18360-1-remi@remlab.net
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2020-11-23 10:41:58 +00:00
Alex Bennée 534f80e1df .cirrus.yml: bump timeout period for MacOS builds
These seem to trigger timeouts with some regularity.

Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Message-Id: <20201118140739.18377-1-alex.bennee@linaro.org>
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
2020-11-23 09:55:25 +00:00
Philippe Mathieu-Daudé 1352d5688d gitlab-ci: Move trace backend tests across to gitlab
Similarly to commit 8cdb2cef3f, move the trace backend
tests to GitLab.

Note the User-Space Tracer backend is still tested on
Ubuntu by the s390x jobs on Travis-CI.

Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Acked-by: Thomas Huth <thuth@redhat.com>
Message-Id: <20201111121234.3246812-3-philmd@redhat.com>
Message-Id: <20201117173635.29101-7-alex.bennee@linaro.org>
2020-11-23 09:55:23 +00:00
Philippe Mathieu-Daudé 8e9419b790 tests/docker: Install liblttng-ust-dev package in Ubuntu 20.04 image
Install the liblttng-ust-dev package to be able to
build QEMU using the User-Space Tracer trace backend
(configure --enable-trace-backends=ust).

Suggested-by: Wainer dos Santos Moschetta <wainersm@redhat.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Message-Id: <20201111121234.3246812-2-philmd@redhat.com>
Message-Id: <20201117173635.29101-6-alex.bennee@linaro.org>
2020-11-23 09:55:20 +00:00
Alex Bennée ac74e282d4 gitlab: move remaining x86 check-tcg targets to gitlab
The GCC check-tcg (user) test in particular was very prone to timing
out on Travis. We only actually need to move the some-softmmu builds
across as we already have coverage for linux-user.

As --enable-debug-tcg does increase the run time somewhat as more
debug is put in let's restrict that to just the plugins build. It's
unlikely that a plugins enabled build is going to hide a sanity
failure in core TCG code so let the plugin builds do the heavy lifting
on checking TCG sanity so the non-plugin builds can run swiftly.

Now the only remaining check-tcg builds on Travis are for the various
non-x86 arches.

Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Reviewed-by: Wainer dos Santos Moschetta <wainersm@redhat.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Message-Id: <20201117173635.29101-5-alex.bennee@linaro.org>
2020-11-23 09:52:57 +00:00
Alex Bennée 69272bec1a tests/avocado: clean-up socket directory after run
Previously we were leaving temporary directories behind. While the
QEMUMachine does make efforts to clean up after itself the directory
belongs to the calling function. We use TemporaryDirectory to wrap
this although we explicitly clear the reference in tearDown() as it
doesn't get cleaned up otherwise.

Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Message-Id: <20201117173635.29101-4-alex.bennee@linaro.org>
2020-11-23 09:52:24 +00:00
Alex Bennée 8c175c63ee tests: add prefixes to the bare mkdtemp calls
The first step to debug a thing is to know what created the thing in
the first place. Add some prefixes so random tmpdir's have something
grep in the code.

Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Reviewed-by: Wainer dos Santos Moschetta <wainersm@redhat.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Message-Id: <20201117173635.29101-3-alex.bennee@linaro.org>
2020-11-23 09:51:43 +00:00
Alex Bennée e4b937d3c4 scripts/ci: clean up default args logic a little
This allows us to do:

  ./scripts/ci/gitlab-pipeline-status -w -b HEAD -p 2961854

to check out own pipeline status of a recently pushed branch.

Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Reviewed-by: Wainer dos Santos Moschetta <wainersm@redhat.com>
Message-Id: <20201117173635.29101-2-alex.bennee@linaro.org>
2020-11-23 09:48:25 +00:00
Thomas Huth 7a3d37a3f2 pc-bios/s390: Update the s390-ccw bios binaries
Update the binaries with the two reboot fixes from Eric Farman.

Signed-off-by: Thomas Huth <thuth@redhat.com>
2020-11-23 10:16:09 +01:00
Eric Farman 3d6519968b pc-bios: s390x: Clear out leftover S390EP string
A Linux binary will have the string "S390EP" at address 0x10008,
which is important in getting the guest up off the ground. In the
case of a reboot (specifically chreipl going to a new device),
we should defer to the PSW at address zero for the new config,
which will re-write "S390EP" from the new image.

Let's clear it out at this point so that a reipl to, say, a DASD
passthrough device drives the IPL path from scratch without disrupting
disrupting the order of operations for other boots.

Rather than hardcoding the address of this magic (again), let's
define it somewhere so that the two users are visibly related.

Signed-off-by: Eric Farman <farman@linux.ibm.com>
Message-Id: <20201120160117.59366-3-farman@linux.ibm.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
2020-11-23 09:48:45 +01:00
Eric Farman d8e5bbdd0d pc-bios: s390x: Ensure Read IPL memory is clean
If, for example, we boot off a virtio device and chreipl to a vfio-ccw
device, the space at lowcore will be non-zero. We build a Read IPL CCW
at address zero, but it will have leftover PSW data that will conflict
with the Format-0 CCW being generated:

0x0: 00080000 80010000
       ------ Ccw0.cda
              -- Ccw0.chainData
                -- Reserved bits

The data address will be overwritten with the correct value (0x0), but
the apparent data chain bit will cause subsequent memory to be used as
the target of the data store, which may not be where we expect (0x0).

Clear out this space when we boot from DASD, so that we know it exists
exactly as we expect.

Signed-off-by: Eric Farman <farman@linux.ibm.com>
Reviewed-by: Jason J. Herne <jjherne@linux.ibm.com>
Reviewed-by: Janosch Frank <frankja@de.ibm.com>
Acked-by: Christian Borntraeger <borntraeger@de.ibm.com>
Acked-by: Cornelia Huck <cohuck@redhat.com>
Message-Id: <20201120160117.59366-2-farman@linux.ibm.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
2020-11-23 09:48:44 +01:00
Peter Maydell 8cc30eb140 qemu-sparc queue
-----BEGIN PGP SIGNATURE-----
 
 iQFSBAABCgA8FiEEzGIauY6CIA2RXMnEW8LFb64PMh8FAl+6c98eHG1hcmsuY2F2
 ZS1heWxhbmRAaWxhbmRlLmNvLnVrAAoJEFvCxW+uDzIfxBcH/0S8fbR6axoKrzSB
 uQO6HGDpoIQzI+B2vM5jL+rFwZY04rEh2SBMNF2z4ISPutcL0+KmJJSb/iBpw0E4
 ENg7EVicl5q0V+VV2nP/0R+Mrg9uNi/wD+Q7DEmUENYwCfyjB2I1rAWIP0z11T/H
 6wel4BNCO3PfdYCT64FsVuGjfTVqi44cKUOXdFalYeT9ViVhfJo+Cq7WOLnXbMHF
 vGtX6NGTF/SY2u/hFNxi08nLrjmsWtmZkDEHMjUX9yAmsaiLhbbfwZ8J+feK+Y5q
 x/6CHHtgr3RCrvTHHpzxnHr564G7OVWpKldp8MxXyIb078lsF/F6jox19/IKu4iW
 HrwaJg0=
 =jiyB
 -----END PGP SIGNATURE-----

Merge remote-tracking branch 'remotes/mcayland/tags/qemu-sparc-20201122' into staging

qemu-sparc queue

# gpg: Signature made Sun 22 Nov 2020 14:21:19 GMT
# gpg:                using RSA key CC621AB98E82200D915CC9C45BC2C56FAE0F321F
# gpg:                issuer "mark.cave-ayland@ilande.co.uk"
# gpg: Good signature from "Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>" [full]
# Primary key fingerprint: CC62 1AB9 8E82 200D 915C  C9C4 5BC2 C56F AE0F 321F

* remotes/mcayland/tags/qemu-sparc-20201122:
  hw/display/tcx: add missing 64-bit access for framebuffer blitter

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2020-11-22 15:02:52 +00:00
Mark Cave-Ayland 48e5c7f34c hw/display/tcx: add missing 64-bit access for framebuffer blitter
Commit ae5643ecc6 "hw/display/tcx: Allow 64-bit accesses to framebuffer stippler
and blitter" enabled 64-bit access for the TCX framebuffer stippler and blitter
but missed applying the change to one of the blitter MemoryRegions.

Whilst the original change works for me on my local NetBSD test image, the latest
NetBSD ISO panics on startup without this fix.

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Fixes: ae5643ecc6 ("hw/display/tcx: Allow 64-bit accesses to framebuffer stippler and blitter")
Buglink: https://bugs.launchpad.net/bugs/1892540
Message-Id: <20201120081754.18250-1-mark.cave-ayland@ilande.co.uk>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
2020-11-22 10:43:30 +00:00
Peter Maydell e3a232cccd Bug fixes
-----BEGIN PGP SIGNATURE-----
 
 iQFIBAABCAAyFiEE8TM4V0tmI4mGbHaCv/vSX3jHroMFAl+35XkUHHBib256aW5p
 QHJlZGhhdC5jb20ACgkQv/vSX3jHroN5jgf+I9Mc9OI2x28nsn/iZ55vvxamox1m
 ipouPyRQnWdiMi2gXgxCicva1c5k9Xk8GZc47AluEEk70a0VzV4Jv1GWGbiJDRTe
 Q+Iiht2OOm7hszVvrveZgK/v2VLTrwiJLy5LsehQ7anVQCro7PVFRDgXl64CU3Dn
 0wLwyqhLa8SfxlNgi8MArcNCP/xYpDqJtOqTQ9nK1gHyG0Cze18oz7iVc2WRg/C1
 UrUWeXVqVFKE9XwTwRrtqd9pWQbbkbyzKFGTKpJVplRDQvtyOFmrHoITW9BUyBu3
 fcQoaCPlwD5l6K8wTRz3k3nAUyT6qXWaLfKC68E+OislnURLtuTR/D0XWg==
 =j3rw
 -----END PGP SIGNATURE-----

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

Bug fixes

# gpg: Signature made Fri 20 Nov 2020 15:49:13 GMT
# 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]
# Primary key fingerprint: 46F5 9FBD 57D6 12E7 BFD4  E2F7 7E15 100C CD36 69B1
#      Subkey fingerprint: F133 3857 4B66 2389 866C  7682 BFFB D25F 78C7 AE83

* remotes/bonzini-gitlab/tags/for-upstream:
  qboot: update to latest upstream
  usb: fix kconfig for usb-xhci-sysbus

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2020-11-20 22:30:51 +00:00
Peter Maydell 7761e07c3f * Some small qtest fixes
* One documentation update
 -----BEGIN PGP SIGNATURE-----
 
 iQJFBAABCAAvFiEEJ7iIR+7gJQEY8+q5LtnXdP5wLbUFAl+34jMRHHRodXRoQHJl
 ZGhhdC5jb20ACgkQLtnXdP5wLbWQ3g//Tm8qr8HVoCZ+8mSFLR3WBAyEqxMeAgSD
 rAtoYXto3UkAjnSyg5xUXO1TCNqMtDnP/T9dZ8sK1bFF3r43KDMeAIAmvvJcPUqf
 AOg4ud2Wc2ELsqldyIPAS/47lC9cWZC6UQuj5Ov/LIphm3+SdXNr065Vuae0t3Z5
 Y55K4GHP6mqtDzKqQidWb1kPgwktWZtvccPlbBJ+ZL+BlxWCzTIIqsFHchXjN5Cc
 0xlEwIE8w6aC59r+KkESLBw9UAGdmZSGEkQ11x8pe2LqdeulKRu9FOpbWpJU5rGH
 myb7Dt4nAYOtexGp5PZNC+5guIfSJHydKuXZdSu10QqRA/0q97nyDqQkZfVYdlc0
 ReFidIjDA0Af8l9vqdlUXDmUdjMXHI3VD+9Pdhft8UzAIRegGNrAEMLAM7tR901n
 DYCoHOosK7zQ4utzr0CBsCQ32g+IXn2nL+GGjjfAGpSd/tnu5wB5Pr2GcePOqzci
 DjS5/t4fuiJb/w43PUt+JMOkfx2NRSn8yk8AATeBSRJ6sSQAWDYwq/C0tIqyGOCw
 BdBnYTnX+FhhO0jcrHsq07UsLBGADmWgYwni2txvf9cXMSmVRCgun9Yk2FOrmDBq
 RE7R5fs4KjNhLb62H/TT4xeT7P8yN1s82n3koTEHn2qsr/R0DRljxtK0u+XVSckE
 F/XnaGTZhRs=
 =1VEG
 -----END PGP SIGNATURE-----

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

* Some small qtest fixes
* One documentation update

# gpg: Signature made Fri 20 Nov 2020 15:35:15 GMT
# 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-11-20:
  qtest: do not return freed argument vector from qtest_rsp
  tests/qtest: fix memleak in npcm7xx_watchdog_timer-test
  tests/qtest: variable defined by g_autofree need to be initialized
  docs: Get rid of the weird _005f links in the man page

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2020-11-20 17:19:33 +00:00
Paolo Bonzini 5983021eb6 qboot: update to latest upstream
This also brings in two patches that Debian had to include,
qboot_stop_using_inttypes.patch and qboot_no_jump_tables.diff.

Reported-by: Michael Tokarev <mjt@tls.msk.ru>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Message-Id: <20201120152408.164346-1-pbonzini@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2020-11-20 10:48:53 -05:00
Paolo Bonzini 6ca2aa5cfb usb: fix kconfig for usb-xhci-sysbus
Remove the "default y" for USB_XHCI_SYSBUS because
sysbus devices are not user creatable; boards that use them will
specify them manually with "imply" or "select" clauses.

It would be nice to keep the ability to remove PCIe and USB from microvm,
since thos can be disabled on the command line and therefore should not
be included if QEMU is configured --without-default-devices.  However
it's too late for 5.2 to figure out a place for the DSDT creation code.

Reported-by: Bruce Rogers <brogers@suse.com>
Cc: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2020-11-20 10:43:41 -05:00
Paolo Bonzini 88a8b27e55 qtest: do not return freed argument vector from qtest_rsp
If expected_args is 0, qtest frees the argument vector and then returns it
nevertheless.  Coverity complains; in practice this is not an issue because
expected_args == 0 means that the caller is not interested in the argument
vector, but it would be a potential problem if somebody wanted to add
commands with optional arguments to qtest.

Suggested-by: Kamil Dudka <kdudka@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Message-Id: <20201120073149.99079-1-pbonzini@redhat.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
2020-11-20 15:04:16 +01:00
Chen Qun 7aed584ca6 tests/qtest: fix memleak in npcm7xx_watchdog_timer-test
Properly free resp for get_watchdog_action() to avoid memory leak.
ASAN shows memory leak stack:

Indirect leak of 12360 byte(s) in 3 object(s) allocated from:
    #0 0x7f41ab6cbd4e in __interceptor_calloc (/lib64/libasan.so.5+0x112d4e)
    #1 0x7f41ab4eaa50 in g_malloc0 (/lib64/libglib-2.0.so.0+0x55a50)
    #2 0x556487d5374b in qdict_new ../qobject/qdict.c:29
    #3 0x556487d65e1a in parse_object ../qobject/json-parser.c:318
    #4 0x556487d65cb6 in parse_pair ../qobject/json-parser.c:287
    #5 0x556487d65ebd in parse_object ../qobject/json-parser.c:343
    #6 0x556487d661d5 in json_parser_parse ../qobject/json-parser.c:580
    #7 0x556487d513df in json_message_process_token ../qobject/json-streamer.c:92
    #8 0x556487d63919 in json_lexer_feed_char ../qobject/json-lexer.c:313
    #9 0x556487d63d75 in json_lexer_feed ../qobject/json-lexer.c:350
    #10 0x556487d28b2a in qmp_fd_receive ../tests/qtest/libqtest.c:613
    #11 0x556487d2a16f in qtest_qmp_eventwait_ref ../tests/qtest/libqtest.c:827
    #12 0x556487d248e2 in get_watchdog_action ../tests/qtest/npcm7xx_watchdog_timer-test.c:94
    #13 0x556487d25765 in test_enabling_flags ../tests/qtest/npcm7xx_watchdog_timer-test.c:243

Reported-by: Euler Robot <euler.robot@huawei.com>
Signed-off-by: Chen Qun <kuhn.chenqun@huawei.com>
Message-Id: <20201118115646.2461726-3-kuhn.chenqun@huawei.com>
Reviewed-by: Havard Skinnemoen <hskinnemoen@google.com>
Reviewed-by: Hao Wu <wuhaotsh@google.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
2020-11-20 13:35:33 +01:00
Chen Qun f369797617 tests/qtest: variable defined by g_autofree need to be initialized
According to the glib function requirements, we need initialise
 the variable. Otherwise there will be compilation warnings:

glib-autocleanups.h:28:3: warning: ‘full_name’ may be
used uninitialized in this function [-Wmaybe-uninitialized]
   28 |   g_free (*pp);
      |   ^~~~~~~~~~~~

Reported-by: Euler Robot <euler.robot@huawei.com>
Signed-off-by: Chen Qun <kuhn.chenqun@huawei.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Reviewed-by: Havard Skinnemoen <hskinnemoen@google.com>
Message-Id: <20201118115646.2461726-2-kuhn.chenqun@huawei.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
2020-11-20 13:34:22 +01:00
Thomas Huth 923e931188 docs: Get rid of the weird _005f links in the man page
The man page does not contain all the chapters from the System Emulation
Users Guide, so some of the links that we've put into the qemu options
descriptions can not be resolved and thus the link names are used in the
man pages instead. These link names currently contain weird "_005f" letters
in the middle and just do not make any sense for the users. To avoid this
situation, replace the link names with more descriptive, natural text.

Message-Id: <20201116145341.91606-1-thuth@redhat.com>
Resolves: https://gitlab.com/qemu-project/qemu/-/issues/3
Buglink: https://bugs.launchpad.net/qemu/+bug/1453608
Signed-off-by: Thomas Huth <thuth@redhat.com>
2020-11-20 13:19:08 +01:00
Peter Maydell 7fbd7e7103 Pull request
Fix --enable-modules --enable-trace-backends=dtrace with recent SystemTap
 releases.
 -----BEGIN PGP SIGNATURE-----
 
 iQEzBAABCAAdFiEEhpWov9P5fNqsNXdanKSrs4Grc8gFAl+2oaUACgkQnKSrs4Gr
 c8jk2wf/SatkefAwjsp10/4RdIUxa5SqiqIGfXA43ImZXlVu+f9uicoFF6UJ1kDH
 6n20fRzgs+tbu0iNhVM8Ok9jqM8NW/ryevr2dGShElpq90Cp0C7hz3/sYnTzzF42
 aQiYgkMLSRQnNilEwt4OB4WrXOGOgQEVYkaLPzPyUFWRqf4GwcsAuC1oSZIHh9Im
 6LvAanGZBvl/OD+COlvOuSdlqfyv0xe3YLysWkXxtSvGB2hjJ47AZ+py4kc2gUrn
 v30oXg8RoQ991W4/y4foUa4Zdjj2WHXsEkSoiyfjYeMfC7hWHZYiCfBfRprk9YHU
 YTitnI1DhMqPSJs3YRa+bNeaa6hJmA==
 =7Ikq
 -----END PGP SIGNATURE-----

Merge remote-tracking branch 'remotes/stefanha-gitlab/tags/tracing-pull-request' into staging

Pull request

Fix --enable-modules --enable-trace-backends=dtrace with recent SystemTap
releases.

# gpg: Signature made Thu 19 Nov 2020 16:47:33 GMT
# gpg:                using RSA key 8695A8BFD3F97CDAAC35775A9CA4ABB381AB73C8
# gpg: Good signature from "Stefan Hajnoczi <stefanha@redhat.com>" [full]
# gpg:                 aka "Stefan Hajnoczi <stefanha@gmail.com>" [full]
# Primary key fingerprint: 8695 A8BF D3F9 7CDA AC35  775A 9CA4 ABB3 81AB 73C8

* remotes/stefanha-gitlab/tags/tracing-pull-request:
  trace: use STAP_SDT_V2 to work around symbol visibility

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2020-11-19 17:08:42 +00:00
Stefan Hajnoczi 4b265c79a8 trace: use STAP_SDT_V2 to work around symbol visibility
QEMU binaries no longer launch successfully with recent SystemTap
releases. This is because modular QEMU builds link the sdt semaphores
into the main binary instead of into the shared objects where they are
used. The symbol visibility of semaphores is 'hidden' and the dynamic
linker prints an error during module loading:

  $ ./configure --enable-trace-backends=dtrace --enable-modules ...
  ...
  Failed to open module: /builddir/build/BUILD/qemu-4.2.0/s390x-softmmu/../block-curl.so: undefined symbol: qemu_curl_close_semaphore

The long-term solution is to generate per-module dtrace .o files and
link them into the module instead of the main binary.

In the short term we can define STAP_SDT_V2 so dtrace(1) produces a .o
file with 'default' symbol visibility instead of 'hidden'. This
workaround is small and easier to merge for QEMU 5.2 and downstream
backports.

Buglink: https://bugzilla.redhat.com/show_bug.cgi?id=1898700
Cc: wcohen@redhat.com
Cc: fche@redhat.com
Cc: kraxel@redhat.com
Cc: rjones@redhat.com
Cc: ddepaula@redhat.com
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Reviewed-by: Miroslav Rezanina <mrezanin@redhat.com>
Message-id: 20201119141457.844452-1-stefanha@redhat.com
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2020-11-19 16:41:09 +00:00
Peter Maydell ff85db769f s390x fixes:
- fix propagation and reset for the new diag318 call
 - fix hot-unplug for vfio-pci devices
 - fix endianness issues in zPCI (regression fix)
 -----BEGIN PGP SIGNATURE-----
 
 iQJGBAABCAAwFiEEw9DWbcNiT/aowBjO3s9rk8bwL68FAl+2Rd4SHGNvaHVja0By
 ZWRoYXQuY29tAAoJEN7Pa5PG8C+vu78P/1JQjFRdtbT5tKsO1/BXBsO+s4++9LSL
 1pvo+FerMWrZhiHxtlQQWPWkRBVUxrz9pSM1rzJfYzTjITLp6uQROQmUz8UKE9d4
 fGrmqai6S5S8/3F2D0+/Yg8BU+j1Cn56mQ9bO4f1YSVIrj0nYCll9jv29TEcCD/g
 CQQE9WPH6PEY1VJqM4IDU2b51CWfDUwC/N6iBXmexMpEioq7LeLJ2WfE3j+0q4p+
 BmJK6mVLNKqhQLXiZIBbs3b9kzLmzlLhbLuax5asRR/3e5CUBY7cDXGxQq/ERfed
 5Kotv0wxeHYQ93F1oe+liGjG+dpLIkBAonSYOWP1QJnz6okr23nVX6vd3TrGLQD2
 iF0Y7YYC4qaGMlEyUszP3dzt15s0cmaBPlBZuqbekeOWMrUuWT0oI7T8lWQeq3Xe
 O23JabhRSpN1kVmP/eu4UDXFIwUdHJL9e7rKUqwnduJEILMl0FbL0X6Wu62viEAv
 4h3S71XkxMVWHDQs2JcUi60SFlUWRBjshwChqKAFW7KZ6I6gfN+V8MOjlRSeDxkl
 KVTbnLkdT0ejFdvM6KbrGHX9b04edHeTN1xxU7Il26WzFboPTrPI7jTD0qp29Rjz
 Hq67TtJGq7Y9QCMIyQthVfAJFK+6Z6myM0jkfWZHvZHllbRSCmpAPMQy/p2hC89X
 E3cIsHNzs0WT
 =WD4X
 -----END PGP SIGNATURE-----

Merge remote-tracking branch 'remotes/cohuck/tags/s390x-20201119' into staging

s390x fixes:
- fix propagation and reset for the new diag318 call
- fix hot-unplug for vfio-pci devices
- fix endianness issues in zPCI (regression fix)

# gpg: Signature made Thu 19 Nov 2020 10:15:58 GMT
# gpg:                using RSA key C3D0D66DC3624FF6A8C018CEDECF6B93C6F02FAF
# gpg:                issuer "cohuck@redhat.com"
# gpg: Good signature from "Cornelia Huck <conny@cornelia-huck.de>" [unknown]
# gpg:                 aka "Cornelia Huck <huckc@linux.vnet.ibm.com>" [full]
# gpg:                 aka "Cornelia Huck <cornelia.huck@de.ibm.com>" [full]
# gpg:                 aka "Cornelia Huck <cohuck@kernel.org>" [unknown]
# gpg:                 aka "Cornelia Huck <cohuck@redhat.com>" [unknown]
# Primary key fingerprint: C3D0 D66D C362 4FF6 A8C0  18CE DECF 6B93 C6F0 2FAF

* remotes/cohuck/tags/s390x-20201119:
  s390x/pci: fix endianness issues
  s390x/pci: Unregister listeners before destroying IOMMU address space
  s390/kvm: fix diag318 propagation and reset functionality

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2020-11-19 10:36:53 +00:00
Cornelia Huck a4e2fff1b1 s390x/pci: fix endianness issues
The zPCI group and function structures are big endian. However, we do
not consistently store them as big endian locally, and are missing some
conversions.

Let's just store the structures as host endian instead and convert to
big endian when actually handling the instructions retrieving the data.

Also fix the layout of ClpReqQueryPciGrp: g is actually only 8 bit. This
also fixes accesses on little endian hosts, and makes accesses on big
endian hosts consistent.

Fixes: 28dc86a072 ("s390x/pci: use a PCI Group structure")
Fixes: 9670ee7527 ("s390x/pci: use a PCI Function structure")
Fixes: 1e7552ff5c ("s390x/pci: get zPCI function info from host")
Signed-off-by: Cornelia Huck <cohuck@redhat.com>
Tested-by: Matthew Rosato <mjrosato@linux.ibm.com>
Tested-by: Thomas Huth <thuth@redhat.com>
Reviewed-by: Matthew Rosato <mjrosato@linux.ibm.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Message-Id: <20201118104202.1301363-1-cohuck@redhat.com>
2020-11-18 16:59:29 +01:00
Matthew Rosato e67ad058e4 s390x/pci: Unregister listeners before destroying IOMMU address space
Hot-unplugging a vfio-pci device on s390x causes a QEMU crash:

qemu-system-s390x: ../softmmu/memory.c:2772:
 do_address_space_destroy: Assertion `QTAILQ_EMPTY(&as->listeners)' failed.

In s390, the IOMMU address space is freed during device unplug but the
associated vfio-pci device may not yet be finalized and therefore may
still have a listener registered to the IOMMU address space.

Commit a2166410ad ("spapr_pci: Unregister listeners before destroying
the IOMMU address space") previously resolved this issue for spapr_pci.
We are now seeing this in s390x; it would seem the possibility for this
issue was already present but based on a bisect commit 2d24a64661
("device-core: use RCU for list of children of a bus") has now changed
the timing such that it is now readily reproducible.

Add logic to ensure listeners are removed before destroying the address
space.

Reported-by: Niklas Schnelle <schnelle@linux.ibm.com>
Signed-off-by: Matthew Rosato <mjrosato@linux.ibm.com>
Tested-by: Niklas Schnelle <schnelle@linux.ibm.com>
Reviewed-by: Pierre Morel <pmorel@linux.ibm.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Message-Id: <1605562955-21152-1-git-send-email-mjrosato@linux.ibm.com>
Signed-off-by: Cornelia Huck <cohuck@redhat.com>
2020-11-18 16:57:49 +01:00
Collin Walling e2c6cd5674 s390/kvm: fix diag318 propagation and reset functionality
The Control Program Name Code (CPNC) portion of the diag318
info must be set within the SIE block of each VCPU in the
configuration. The handler will iterate through each VCPU
and dirty the diag318_info reg to be synced with KVM on a
subsequent sync_regs call.

Additionally, the diag318 info resets must be handled via
userspace. As such, QEMU will reset this value for each
VCPU during a modified clear, load normal, and load clear
reset event.

Fixes: fabdada935 ("s390: guest support for diagnose 0x318")
Signed-off-by: Collin Walling <walling@linux.ibm.com>
Message-Id: <20201113221022.257054-1-walling@linux.ibm.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Reviewed-by: Janosch Frank <frankja@de.ibm.com>
Signed-off-by: Cornelia Huck <cohuck@redhat.com>
2020-11-18 16:57:48 +01:00
Peter Maydell 3d275bd17c ppc patch queue for 2020-11-18
This fixes a regression that badly breaks some guest setups because
 IPIs end up misconfigured in the XIVE interrupt controller. Hopefully,
 the last fix for sPAPR. I'm sending this PR with the blessing of David
 who is currently on holidays.
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCAAdFiEEtIKLr5QxQM7yo0kQcdTV5YIvc9YFAl+09tcACgkQcdTV5YIv
 c9aW+xAAn0H219o6zfbJSkWnFcqq3vVLGhAva/QoQHzy2oeusbTgo968J4p9zwZb
 rS+jRo1uA+U6cuRo+1PPh+iMP+t8ZLlN9AQIqdqtIIeUxpKTGUKUpX7AvZcknpvN
 VNvcUsGJGIl/mOjHPXbP29PGi0hWv8+kvESoOOqGfxkv0bY8L1+PItEMK22+n3n2
 aaPiWtxsx6UtRoFpyj82bMM/Y5PsKlP0ZvrVChvF8VZZu0kWe8KWKsR7do2/RLAX
 tb5J4BN9gWPC2KERsrBWsGn0A4pE5n1NXnERH6BlwEBU/AhUM9d80N6280SSge0k
 noE2U1pVAva78NJzAWAiweP1ZGR3yt71MWP2i7ndCxcbFG9IQ7Su48nSmzwKfutT
 +SEuoP0fmTSRXmWiKkrOT+9ZdC4+Vpn0IvCGFHzoPTyNlhaOZRIoqhqxTlvrSYwx
 /DDwechCwPhidpZ+RYaQudX4yUtZIh+Y33LH879aDxkWW8HcaA98XSXXQ+iOiofu
 SY25HisfZjj1xHNuipjoGyMCdPZh4rdspaAGWzJVkOUjjFnzY9PeOxh7bYHz32eN
 xFr3f/1woPYHacqQE5lP2aWmyUvWHkvJsEW3yVix1j+luzn1UmXOwRm1P7tGC1o5
 gtMgQXR3ZodyLxO20slZjt/G77aFz3bpetWcHxoxaksPua3RZoc=
 =zUP3
 -----END PGP SIGNATURE-----

Merge remote-tracking branch 'remotes/gkurz/tags/ppc-for-5.2-20201118' into staging

ppc patch queue for 2020-11-18

This fixes a regression that badly breaks some guest setups because
IPIs end up misconfigured in the XIVE interrupt controller. Hopefully,
the last fix for sPAPR. I'm sending this PR with the blessing of David
who is currently on holidays.

# gpg: Signature made Wed 18 Nov 2020 10:26:31 GMT
# gpg:                using RSA key B4828BAF943140CEF2A3491071D4D5E5822F73D6
# gpg: Good signature from "Greg Kurz <groug@kaod.org>" [full]
# gpg:                 aka "Gregory Kurz <gregory.kurz@free.fr>" [full]
# gpg:                 aka "[jpeg image of size 3330]" [full]
# Primary key fingerprint: B482 8BAF 9431 40CE F2A3  4910 71D4 D5E5 822F 73D6

* remotes/gkurz/tags/ppc-for-5.2-20201118:
  Revert series "spapr/xive: Allocate vCPU IPIs from the vCPU contexts"

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2020-11-18 15:28:38 +00:00
Peter Maydell b696f2c6ba Misc error reporting and checking fixes to authorization objects
-----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCAAdFiEE2vOm/bJrYpEtDo4/vobrtBUQT98FAl+1GDUACgkQvobrtBUQ
 T9/P/g/9GzZdihsBMvd65LRPzz94iVoPLENQdeJsxq2ioeU9NA4HzkvSXpZCr8+4
 bdu7Yvu76xQN1O5mlUeMo6tAXQHxKpW/PSo+bQIp7Pfu05YaYyuyuSJxsYBRdfcs
 d3TKHmyqOekVYbZiKbma52+pzZ2oVV1iyaHi9CQIB2W5RPBbPn4dNJxu7gDlG124
 gdrDlUr0a79rbke+bBXYjSiHvo7Fmc3eMxvBsRupej3RCQNQ57xxOo7JBq3SdhQB
 EuzOdNfQUjVeaA9FPSCVv2rhuUAyJY/M3XThKoNxzvkhVSHMdD97QyT4+QOOLSkB
 zZFE7dG9zju5d3feXhj377jP1c5TRfbEnLVVi8Zh9oDnMELM/Lgwg5KisOcEHaSq
 CREgXxkvH2VI1f3b/eMz/DckXLn52G0kUfiY2KIzwapObJMlohOfDy7c0K/SZ0oG
 /ZuCNtxoYtKg/5W3/VsOsSLo9jjjnuJxGHb4uIf1Wz2Fm8P71xfLnX0w3o+VCVgH
 /KkafYAAg0xFnlf8M+K7+ei+VeQIb4y3RrAqCyH0CMalfS2EuoYrxLJ2HucBiGaG
 fFn9B550r4vSyZOwOnNWKXX/I21l//1UFKsODJTBYBTfPna+gu+D/JXzu2E+hJeE
 K+WfSJJlVtzCXFC53cJGOlQYdcX3gh6UAdMeTFcN8wFitQz+kDI=
 =2PYf
 -----END PGP SIGNATURE-----

Merge remote-tracking branch 'remotes/berrange-gitlab/tags/misc-fixes-pull-request' into staging

Misc error reporting and checking fixes to authorization objects

# gpg: Signature made Wed 18 Nov 2020 12:48:53 GMT
# gpg:                using RSA key DAF3A6FDB26B62912D0E8E3FBE86EBB415104FDF
# gpg: Good signature from "Daniel P. Berrange <dan@berrange.com>" [full]
# gpg:                 aka "Daniel P. Berrange <berrange@redhat.com>" [full]
# Primary key fingerprint: DAF3 A6FD B26B 6291 2D0E  8E3F BE86 EBB4 1510 4FDF

* remotes/berrange-gitlab/tags/misc-fixes-pull-request:
  authz-simple: Check that 'identity' property is set
  authz-pam: Check that 'service' property is set
  authz-list-file: Improve an error message
  authz-list-file: Fix file read error handling

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2020-11-18 13:42:42 +00:00
Peter Maydell 269ff671c5 Bugfixes for HVF and Windows builds.
-----BEGIN PGP SIGNATURE-----
 
 iQFIBAABCAAyFiEE8TM4V0tmI4mGbHaCv/vSX3jHroMFAl+03H0UHHBib256aW5p
 QHJlZGhhdC5jb20ACgkQv/vSX3jHroNc3Af/S1z8GW2K7jAwXKUNLmJO4sX3uhan
 hps/VDEYV2qHANztrmXTx4wnsVj+hcHRK0ytGQd+FZFy+MefsHrjv8/hbCae7xji
 7Pb07W4yI8FV7OZDW6+tU0gGbvlh9rR4gy4so6NFyZy8QLpc1MHjqPZvRhpzWZxB
 sAquqJvPno4JYuWCmiW34ldMRa72MNaSbkpndLVDikcMWkvLx62HqLy0kiHrnUTf
 mohRD6+YGQViL7/3ms8bJNP6ddslc9pyzFUakE5XM4/f4hwtnJ5RauGnL8vouAUi
 iaCkg5mF+6uJdgwWPXUefVLsr7xEo+w2MR4+leS4TAJ7Arc11qujMw2pMQ==
 =g7br
 -----END PGP SIGNATURE-----

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

Bugfixes for HVF and Windows builds.

# gpg: Signature made Wed 18 Nov 2020 08:34:05 GMT
# 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]
# Primary key fingerprint: 46F5 9FBD 57D6 12E7 BFD4  E2F7 7E15 100C CD36 69B1
#      Subkey fingerprint: F133 3857 4B66 2389 866C  7682 BFFB D25F 78C7 AE83

* remotes/bonzini-gitlab/tags/for-upstream:
  buildsys: Help git-diff adding .gitattributes config file
  hvf: Fix segment selector format
  hvf: Gate RDTSCP on CPU_BASED2_RDTSCP, not just CPU_BASED_TSC_OFFSET
  meson: Fixes curses detection on msys2
  meson: Fix build with --disable-guest-agent-msi
  docs: Fix some typos (found by codespell)
  meson: Fix argument for makensis (build regression)

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2020-11-18 11:13:14 +00:00
Kevin Wolf c2aa8a3d7e authz-simple: Check that 'identity' property is set
If the 'identify' property is not set, we'll pass a NULL pointer to
g_str_equal() and crash. Catch the error condition during the creation
of the object.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2020-11-18 10:51:35 +00:00
Kevin Wolf 3428455df9 authz-pam: Check that 'service' property is set
If the 'service' property is not set, we'll call pam_start() with a NULL
pointer for the service name. This fails and leaves a message like this
in the syslog:

qemu-storage-daemon[294015]: PAM pam_start: invalid argument: service == NULL

Make specifying the property mandatory and catch the error already
during the creation of the object.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2020-11-18 10:51:35 +00:00
Markus Armbruster 8e26ae7bb5 authz-list-file: Improve an error message
When qauthz_list_file_load() rejects JSON values other than JSON
object with a rather confusing error message:

    $ echo 1 | qemu-system-x86_64 -nodefaults -S -display none  -object authz-list-file,id=authz0,filename=/dev/stdin
    qemu-system-x86_64: -object authz-list-file,id=authz0,filename=/dev/stdin: Invalid parameter type for 'obj', expected: dict

Improve to

    qemu-system-x86_64: -object authz-list-file,id=authz0,filename=/dev/stdin: File '/dev/stdin' must contain a JSON object

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2020-11-18 10:51:35 +00:00
Markus Armbruster 2b37e9f843 authz-list-file: Fix file read error handling
The Error ** argument must be NULL, &error_abort, &error_fatal, or a
pointer to a variable containing NULL.  Passing an argument of the
latter kind twice without clearing it in between is wrong: if the
first call sets an error, it no longer points to NULL for the second
call.

qauthz_list_file_complete() is wrong that way: it passes @errp to
qauthz_list_file_complete() without checking for failure.  If it runs
into another failure, it trips error_setv()'s assertion.  Reproducer:

    $ qemu-system-x86_64 -nodefaults -S -display none -object authz-list-file,id=authz0,filename=
    qemu-system-x86_64: ../util/error.c:59: error_setv: Assertion `*errp == NULL' failed.
    Aborted (core dumped)

Fix it to check for failure.

Fixes: 55d869846d
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2020-11-18 10:51:35 +00:00
Greg Kurz 6d24795ee7 Revert series "spapr/xive: Allocate vCPU IPIs from the vCPU contexts"
This series was largely built on the assumption that IPI numbers are
numerically equal to vCPU ids. Even if this happens to be the case
in practice with the default machine settings, this ceases to be true
if VSMT is set to a different value than the number of vCPUs per core.
This causes bogus IPI numbers to be created in KVM from a guest stand
point. This leads to unknow results in the guest, including crashes
or missing vCPUs (see BugLink) and even non-fatal oopses in current
KVM that lacks a check before accessing misconfigured HW (see [1]).

A tentative patch was sent (see [2]) but it seems too complex to be
merged in an RC. Since the original changes are essentially an
optimization, it seems safer to revert them for now. The damage is
done by commit acbdb9956f ("spapr/xive: Allocate IPIs independently
from the other sources") but the previous patches in the series are
really preparatory patches. So this reverts the whole series:

eab0a2d06e ("spapr/xive: Allocate vCPU IPIs from the vCPU contexts")
acbdb9956f ("spapr/xive: Allocate IPIs independently from the other sources")
fa94447a2c ("spapr/xive: Use kvmppc_xive_source_reset() in post_load")
235d3b1162 ("spapr/xive: Modify kvm_cpu_is_enabled() interface")

[1] https://marc.info/?l=kvm-ppc&m=160458409722959&w=4
[2] https://lists.gnu.org/archive/html/qemu-devel/2020-11/msg03626.html

Reported-by: Satheesh Rajendran <sathnaga@linux.vnet.ibm.com>
Fixes: acbdb9956f ("spapr/xive: Allocate IPIs independently from the other sources")
BugLink: https://bugs.launchpad.net/qemu/+bug/1900241
Signed-off-by: Greg Kurz <groug@kaod.org>
Acked-by: Cédric Le Goater <clg@kaod.org>
Message-Id: <160554086275.1325084.12110142252189044646.stgit@bahia.lan>
2020-11-18 11:05:56 +01:00
Philippe Mathieu-Daudé 29cf16db23 buildsys: Help git-diff adding .gitattributes config file
Since commits 0979ed017f ("meson: rename .inc.h files to .h.inc")
and 139c1837db ("meson: rename included C source files to .c.inc")
'git-diff --function-context' stopped displaying C function context
correctly.
We can help git-diff by providing attributes to the .[ch].inc path
names. See:
https://git-scm.com/docs/gitattributes#_generating_diff_text

Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Message-Id: <20201014082209.3712625-1-philmd@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2020-11-18 09:33:16 +01:00
Jessica Clarke c6a89b45bd hvf: Fix segment selector format
The Requested Privilege Level field is 2 bits, the Table Indicator field
is 1 bit and the Index field is the remaining 15 bits, with TI=0 meaning
GDT and TI=1 meaning LDT.

Signed-off-by: Jessica Clarke <jrtc27@jrtc27.com>
Message-Id: <20201116200414.28286-1-jrtc27@jrtc27.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2020-11-18 09:32:17 +01:00
Jessica Clarke 65baabca22 hvf: Gate RDTSCP on CPU_BASED2_RDTSCP, not just CPU_BASED_TSC_OFFSET
Buglink: https://bugs.launchpad.net/qemu/+bug/1894836
Signed-off-by: Jessica Clarke <jrtc27@jrtc27.com>
Message-Id: <20201116200319.28138-1-jrtc27@jrtc27.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2020-11-18 09:31:46 +01:00
Yonggang Luo ca31e3072f meson: Fixes curses detection on msys2
Fixes regression on curses detection in msys2
by commit#925a40df2828d32d3aaaf022282cba81082fb263

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Message-Id: <20201116213106.589-1-luoyonggang@gmail.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2020-11-18 09:31:00 +01:00
Stefan Weil dccdb0f82a meson: Fix build with --disable-guest-agent-msi
The QGA MSI target requires several macros which are only available
without --disable-guest-agent-msi.

Don't define that target if configure was called with --disable-guest-agent-msi.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
Message-Id: <20201117201834.408892-1-sw@weilnetz.de>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2020-11-18 09:30:07 +01:00
Stefan Weil ac9574bc87 docs: Fix some typos (found by codespell)
Fix also a similar typo in a code comment.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
Message-Id: <20201117193448.393472-1-sw@weilnetz.de>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2020-11-18 09:29:41 +01:00