]> git.proxmox.com Git - mirror_qemu.git/log
mirror_qemu.git
21 months agotests/avocado: apply a band aid to aspeed-evb login
Alex Bennée [Thu, 11 Aug 2022 15:14:12 +0000 (16:14 +0100)]
tests/avocado: apply a band aid to aspeed-evb login

This is really a limitation of the underlying console code which
doesn't allow us to detect the login: and following "#" prompts
because it reads input line wise. By adding a small delay we ensure
that the login prompt has appeared so we don't accidentally spaff the
shell commands to a confused getty in the guest.

Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Reviewed-by: Cédric Le Goater <clg@kaod.org>
Acked-by: John Snow <jsnow@redhat.com>
Message-Id: <20220811151413.3350684-8-alex.bennee@linaro.org>

21 months agotests/avocado: add timeout to the aspeed tests
Alex Bennée [Thu, 11 Aug 2022 15:14:11 +0000 (16:14 +0100)]
tests/avocado: add timeout to the aspeed tests

On some systems the test can hang. At least defining a timeout stops
it from hanging forever.

Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Message-Id: <20220811151413.3350684-7-alex.bennee@linaro.org>

21 months agolinux-user: un-parent OBJECT(cpu) when closing thread
Alex Bennée [Thu, 11 Aug 2022 15:14:06 +0000 (16:14 +0100)]
linux-user: un-parent OBJECT(cpu) when closing thread

While forcing the CPU to unrealize by hand does trigger the clean-up
code we never fully free resources because refcount never reaches
zero. This is because QOM automatically added objects without an
explicit parent to /unattached/, incrementing the refcount.

Instead of manually triggering unrealization just unparent the object
and let the device machinery deal with that for us.

Resolves: https://gitlab.com/qemu-project/qemu/-/issues/866
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Reviewed-by: Laurent Vivier <laurent@vivier.eu>
Message-Id: <20220811151413.3350684-2-alex.bennee@linaro.org>

21 months agoMerge tag 'pull-la-20220814' of https://gitlab.com/rth7680/qemu into staging
Richard Henderson [Sun, 14 Aug 2022 13:48:10 +0000 (08:48 -0500)]
Merge tag 'pull-la-20220814' of https://gitlab.com/rth7680/qemu into staging

Loongarch docs update

# -----BEGIN PGP SIGNATURE-----
#
# iQFRBAABCgA7FiEEekgeeIaLTbaoWgXAZN846K9+IV8FAmL4/I8dHHJpY2hhcmQu
# aGVuZGVyc29uQGxpbmFyby5vcmcACgkQZN846K9+IV/kCQf9HTiK6VSrbJXdOLQi
# iGfXwZTcRDxG4brzj+GQ2/nuag2Dg9McADUxs1/3zlb965+CuQdfqtjSzgfxCjzX
# iVvHq3wtCoOQZ5/T+XrFCaew0djkT6N/hBsa33oORXg5o5mAzCIFObuTMnusvjTu
# VPXWe65fxTv3dsHZgjWekRZLu8Bn/anLypJxHzzFbXL3+RTKJ5u6GGVMn0DEcvEq
# ooHYhETBEXmdKCbj2QpRmG1sldiKSMEcBQ6OXPM6ehOgWoucR00/LyKi1ucQq5JP
# gJIEhV4iCKfPHykoTiBcMlz8zqphcn6GgU71Ekv1GGmYxBWBLAj3tfmX4yiFh33p
# x25afA==
# =gfY0
# -----END PGP SIGNATURE-----
# gpg: Signature made Sun 14 Aug 2022 08:45:51 AM CDT
# gpg:                using RSA key 7A481E78868B4DB6A85A05C064DF38E8AF7E215F
# gpg:                issuer "richard.henderson@linaro.org"
# gpg: Good signature from "Richard Henderson <richard.henderson@linaro.org>" [ultimate]

* tag 'pull-la-20220814' of https://gitlab.com/rth7680/qemu:
  docs/system/loongarch: Update the LoongArch document

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
21 months agodocs/system/loongarch: Update the LoongArch document
Xiaojuan Yang [Fri, 12 Aug 2022 09:19:57 +0000 (17:19 +0800)]
docs/system/loongarch: Update the LoongArch document

1. Add some information about how to boot the LoongArch virt
machine by uefi bios and linux kernel and how to access the
source code or binary file.
2. Move the explanation of LoongArch system emulation in the
target/loongarch/README to docs/system/loongarch/loongson3.rst

Signed-off-by: Xiaojuan Yang <yangxiaojuan@loongson.cn>
Reviewed-by: Song Gao <gaosong@loongson.cn>
Message-Id: <20220812091957.3338126-1-yangxiaojuan@loongson.cn>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
21 months agoMerge tag 'pull-target-arm-20220812' of https://git.linaro.org/people/pmaydell/qemu...
Richard Henderson [Fri, 12 Aug 2022 17:46:43 +0000 (10:46 -0700)]
Merge tag 'pull-target-arm-20220812' of https://git.linaro.org/people/pmaydell/qemu-arm into staging

target-arm queue:
 * Don't report Statistical Profiling Extension in ID registers
 * virt ACPI tables: Present the GICR structure properly for GICv4
 * Fix some typos in documentation
 * tests/unit: fix a -Wformat-truncation warning
 * cutils: Add missing dyld(3) include on macOS

# -----BEGIN PGP SIGNATURE-----
#
# iQJNBAABCAA3FiEE4aXFk81BneKOgxXPPCUl7RQ2DN4FAmL2PP4ZHHBldGVyLm1h
# eWRlbGxAbGluYXJvLm9yZwAKCRA8JSXtFDYM3qLKD/964d9vRe9b1Upv5mTxM7+y
# JxgwvsgVe7HeWBTOIIHsP7y1F+5MduiDDf2BC5XBiwtkVNSeJB1J1QQWkas6baVr
# DiRPiP/D6gG3B9naujCWsI5QbnSlONeunE0R+gYfNK6J/Odidzu6DtNa4PZJ1tcP
# vmZA5eLSAjaCIVmzQYF/Ae7nSoFz/sVR+li+tLSb/ynC+3H+rCry4TrQ7HgGyhjO
# nz4hIOtiYdAqp6hklMeLl6yAPMwZrxCtq51LE+Oj90uh7xt3gs0d29Zlbdc/vQFw
# dSZM/Cm0X+TMV6HHjpKrHnoUH+o+yv/O1q7VFccC4UpLSj7jbB8o/fbCASsBV+Jg
# /Y87G9WjtS6EO5SEqnDTSw5cAEKAqpgzQe8HhEGFa3MymuzkrnBagj59TNa5t4hV
# +maoR2vRb8hnhYDtFsWDPbfhFSCP3MSHki6sP7IMFNQsaUxFDNu2mRn0TOtSx0NB
# n5a/JOby7AeYI5JWyAwQ2T5Hxgh8EeBrPsXDxyy1jA+t67nrlrqdYwyLL5564jU4
# ESuMnuRTWjUnXaF9yhKbe6g1QdVV3OAC6jikzMuYLEHmKC/1MUJT1W4MECzjx1FM
# b0tQ2Q+0mfSfm5YrJqbAIdDg3Cie88pvl/i0POtFBiwoOhPRH6QBzd/b6q6B6zw6
# MPV6QAwBfdQYxJId93shTQ==
# =/sV7
# -----END PGP SIGNATURE-----
# gpg: Signature made Fri 12 Aug 2022 04:43:58 AM PDT
# gpg:                using RSA key E1A5C593CD419DE28E8315CF3C2525ED14360CDE
# gpg:                issuer "peter.maydell@linaro.org"
# gpg: Good signature from "Peter Maydell <peter.maydell@linaro.org>" [full]
# gpg:                 aka "Peter Maydell <pmaydell@gmail.com>" [full]
# gpg:                 aka "Peter Maydell <pmaydell@chiark.greenend.org.uk>" [full]

* tag 'pull-target-arm-20220812' of https://git.linaro.org/people/pmaydell/qemu-arm:
  cutils: Add missing dyld(3) include on macOS
  hw/arm/virt-acpi-build: Present the GICR structure properly for GICv4
  tests/unit: fix a -Wformat-truncation warning
  Fix some typos in documentation (most of them found by codespell)
  target/arm: Don't report Statistical Profiling Extension in ID registers

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
21 months agoMerge tag 'linux-user-for-7.1-pull-request' of https://gitlab.com/laurent_vivier...
Richard Henderson [Fri, 12 Aug 2022 15:13:23 +0000 (08:13 -0700)]
Merge tag 'linux-user-for-7.1-pull-request' of https://gitlab.com/laurent_vivier/qemu into staging

Pull request linux-user 20220812

# -----BEGIN PGP SIGNATURE-----
#
# iQJGBAABCAAwFiEEzS913cjjpNwuT1Fz8ww4vT8vvjwFAmL2LIUSHGxhdXJlbnRA
# dml2aWVyLmV1AAoJEPMMOL0/L748L8QP/iHtv9fsHZe7ANCMd2UjpPo5CZTJxMEa
# T8muaNasIJPoZbQR5WJRsCT8j5lNriWYA/xEBYGYlzvn/ZBK+NnUlBYrRFUX3LwQ
# Oim9gBYReW7nkv2m1Vr5mYXeC1bth4GMqycHSjwJtosYJsp/oTpcQE22/iG3MFBW
# azu+yM/QV7yuoi6EFyuUq5hefQE139W333x01c3qsekVY4cr4Bc81cpsQhWw/4Y4
# e32byrT39vtBvRlC/CuikZXyMqbD+nK+hESkJ9oqI73raC4PaCg10WNHMr1m/pw1
# ITPeH6iphVmyOckidHsbBLDkC4FQEVNo9R4j13Nk2gqU3VyLk73Say2GGvXrUEBJ
# a50XvV897N1M8ZiRUifYnNgawtO7sIOuQViofQtCcIfal9h2AV5Zjnm/5tJXGpnB
# F0U7hi5bootHtJFMLCBOWLhWVT7SNrzi1ijCFs2irj6grSyvJ9LU7yRHj0pOVC43
# WopdzPuxBWye8jRo2YgDQx5BZkBtlmWJgfbhYL3QVFX5wp8vqAgdXl0dXqdid5RN
# 5RCdBj9HAFwEUqL8n4LVI0EbrjI/IQlVwhZmBjQx3lBh4o08d7AUGUSQnZHDcy3C
# W6dTkfqPleqdOw5xS9Rw3rHJPHcuGWQNA4MMyvztbMivU/TYN7fwBdXouI9KeeBk
# wfYTi+n/bkeR
# =4v8b
# -----END PGP SIGNATURE-----
# gpg: Signature made Fri 12 Aug 2022 03:33:41 AM PDT
# gpg:                using RSA key CD2F75DDC8E3A4DC2E4F5173F30C38BD3F2FBE3C
# gpg:                issuer "laurent@vivier.eu"
# gpg: Good signature from "Laurent Vivier <lvivier@redhat.com>" [undefined]
# gpg:                 aka "Laurent Vivier <laurent@vivier.eu>" [undefined]
# gpg:                 aka "Laurent Vivier (Red Hat) <lvivier@redhat.com>" [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: CD2F 75DD C8E3 A4DC 2E4F  5173 F30C 38BD 3F2F BE3C

* tag 'linux-user-for-7.1-pull-request' of https://gitlab.com/laurent_vivier/qemu:
  linux-user/aarch64: Reset target data on MADV_DONTNEED

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
21 months agocutils: Add missing dyld(3) include on macOS
Philippe Mathieu-Daudé [Tue, 9 Aug 2022 22:20:46 +0000 (00:20 +0200)]
cutils: Add missing dyld(3) include on macOS

Commit 06680b15b4 moved qemu_*_exec_dir() to cutils but forgot
to move the macOS dyld(3) include, resulting in the following
error (when building with Homebrew GCC on macOS Monterey 12.4):

  [313/1197] Compiling C object libqemuutil.a.p/util_cutils.c.o
  FAILED: libqemuutil.a.p/util_cutils.c.o
  ../../util/cutils.c:1039:13: error: implicit declaration of function '_NSGetExecutablePath' [-Werror=implicit-function-declaration]
   1039 |         if (_NSGetExecutablePath(fpath, &len) == 0) {
        |             ^~~~~~~~~~~~~~~~~~~~
  ../../util/cutils.c:1039:13: error: nested extern declaration of '_NSGetExecutablePath' [-Werror=nested-externs]

Fix by moving the include line to cutils.

Fixes: 06680b15b4 ("include: move qemu_*_exec_dir() to cutils")
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Message-id: 20220809222046.30812-1-f4bug@amsat.org
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
21 months agohw/arm/virt-acpi-build: Present the GICR structure properly for GICv4
Zenghui Yu [Fri, 12 Aug 2022 02:20:18 +0000 (10:20 +0800)]
hw/arm/virt-acpi-build: Present the GICR structure properly for GICv4

With the introduction of the new TCG GICv4, build_madt() is badly broken
as we do not present any GIC Redistributor structure in MADT for GICv4
guests, so that they have no idea about where the Redistributor
register frames are. This fixes a Linux guest crash at boot time with
ACPI enabled and '-machine gic-version=4'.

While at it, let's convert the remaining hard coded gic_version into
enumeration VIRT_GIC_VERSION_2 for consistency.

Signed-off-by: Zenghui Yu <yuzenghui@huawei.com>
Message-id: 20220812022018.1069-1-yuzenghui@huawei.com
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
21 months agotests/unit: fix a -Wformat-truncation warning
Marc-André Lureau [Wed, 10 Aug 2022 12:15:13 +0000 (16:15 +0400)]
tests/unit: fix a -Wformat-truncation warning

../tests/test-qobject-input-visitor.c: In function ‘test_visitor_in_list’:
../tests/test-qobject-input-visitor.c:454:49: warning: ‘%d’ directive output may be truncated writing between 1 and 10 bytes into a region of size 6 [-Wformat-truncation=]
  454 |         snprintf(string, sizeof(string), "string%d", i);
      |                                                 ^~
../tests/test-qobject-input-visitor.c:454:42: note: directive argument in the range [0, 2147483606]
  454 |         snprintf(string, sizeof(string), "string%d", i);
      |                                          ^~~~~~~~~~
../tests/test-qobject-input-visitor.c:454:9: note: ‘snprintf’ output between 8 and 17 bytes into a destination of size 12
  454 |         snprintf(string, sizeof(string), "string%d", i);
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Rather than trying to be clever, since this is called 3 times during
tests, let's simply use g_strdup_printf().

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Message-id: 20220810121513.1356081-1-marcandre.lureau@redhat.com
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
[PMM: fixed commit message typos]
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
21 months agoFix some typos in documentation (most of them found by codespell)
Stefan Weil [Fri, 12 Aug 2022 07:56:42 +0000 (09:56 +0200)]
Fix some typos in documentation (most of them found by codespell)

Signed-off-by: Stefan Weil <sw@weilnetz.de>
Reviewed-by: Hongren (Zenithal) Zheng <i@zenithal.me>
Message-id: 20220812075642.1200578-1-sw@weilnetz.de
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
21 months agotarget/arm: Don't report Statistical Profiling Extension in ID registers
Peter Maydell [Thu, 11 Aug 2022 13:11:27 +0000 (14:11 +0100)]
target/arm: Don't report Statistical Profiling Extension in ID registers

The newly added neoverse-n1 CPU has ID register values which indicate
the presence of the Statistical Profiling Extension, because the real
hardware has this feature.  QEMU's TCG emulation does not yet
implement SPE, though (not even as a minimal stub implementation), so
guests will crash if they try to use it because the SPE system
registers don't exist.

Force ID_AA64DFR0_EL1.PMSVer to 0 in CPU realize for TCG, so that
we don't advertise to the guest a feature that doesn't exist.

(We could alternatively do this by editing the value that
aarch64_neoverse_n1_initfn() sets for this ID register, but
suppressing the field in realize means we won't re-introduce this bug
when we add other CPUs that have SPE in hardware, such as the
Neoverse-V1.)

An example of a non-booting guest is current mainline Linux (5.19),
when booting in EL2 on the virt board (ie with -machine
virtualization=on).

Reported-by: Zenghui Yu <yuzenghui@huawei.com>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Zenghui Yu <yuzenghui@huawei.com>
Message-id: 20220811131127.947334-1-peter.maydell@linaro.org

21 months agolinux-user/aarch64: Reset target data on MADV_DONTNEED
Vitaly Buka [Mon, 11 Jul 2022 22:00:28 +0000 (15:00 -0700)]
linux-user/aarch64: Reset target data on MADV_DONTNEED

aarch64 stores MTE tags in target_date, and they should be reset by
MADV_DONTNEED.

Signed-off-by: Vitaly Buka <vitalybuka@google.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20220711220028.2467290-1-vitalybuka@google.com>
[lv: fix code style issues]
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
21 months agoMerge tag 'linux-user-for-7.1-pull-request' of https://gitlab.com/laurent_vivier...
Richard Henderson [Wed, 10 Aug 2022 17:26:57 +0000 (10:26 -0700)]
Merge tag 'linux-user-for-7.1-pull-request' of https://gitlab.com/laurent_vivier/qemu into staging

Pull request linux-user 20220810

fix compat with glibc >= 2.36 sys/mount.h

# -----BEGIN PGP SIGNATURE-----
#
# iQJGBAABCAAwFiEEzS913cjjpNwuT1Fz8ww4vT8vvjwFAmLz4coSHGxhdXJlbnRA
# dml2aWVyLmV1AAoJEPMMOL0/L7487vMP/RjW8WI+0SliCfLPUcRvymeu9Feyzlit
# fj/s1sONL3TDZYWV2AhIM5mKYPPWDh7z8aNnIgOc5pnIMOw9MDX33ynTWvh0ZhPb
# EMSRqPDUFDaC4JMnlw3rSZpUj5PdZjDrlK4RGLqS+vPjd+xo5fETcYTA+zEovLJ3
# RfNk0QVvfYX5V0aLDlNBQQSxWb+Sq4Nlp00oUAwGsIZ3+GHBr83+4NQ0/oUIDq3F
# 6SpZ4tsZpPvIDNZihP7yNQVWFiIiCIEY6naYDSKxDgKb1HP/6pYxFFn2pmXSrD21
# ew9FxHzGNrqwlTxRbgjxNHvG33Y03NygNrXxI5sp00r6KnXXd05pIAtOLhJUjREY
# ErdJgNFDBeCujBmmNE5zD/dnaUoPdsSjGljPXiyjsMPSAHe2uEkmT6P0ZMGXTeTT
# eHbfTKQXs7cFhMtYPGDrKwREYKnEZz+zqfgx0+BWfShVSZr+tMpeXZ4TCgYNO2Ur
# s2budJJy3fkbz809l4weIHhF7iuPAzEbCV4TY+t/wm0W/nJnQ4WSy5bXGfqH+Pk5
# e20nUhiiuvXGo5CwefSKWQ2Fz9RHOZ1LszI8rZkVbYdfAxcWs3oG/1jDNgTcZLXu
# RJq0uMj+JPW3DPk61qRW5jp0UFwOCaanOf1jVNvlSXF/tu0ufeII6gyUElwpEUOt
# DDXrqodv7ZkX
# =G/l+
# -----END PGP SIGNATURE-----
# gpg: Signature made Wed 10 Aug 2022 09:50:18 AM PDT
# gpg:                using RSA key CD2F75DDC8E3A4DC2E4F5173F30C38BD3F2FBE3C
# gpg:                issuer "laurent@vivier.eu"
# gpg: Good signature from "Laurent Vivier <lvivier@redhat.com>" [undefined]
# gpg:                 aka "Laurent Vivier <laurent@vivier.eu>" [undefined]
# gpg:                 aka "Laurent Vivier (Red Hat) <lvivier@redhat.com>" [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: CD2F 75DD C8E3 A4DC 2E4F  5173 F30C 38BD 3F2F BE3C

* tag 'linux-user-for-7.1-pull-request' of https://gitlab.com/laurent_vivier/qemu:
  linux-user: fix compat with glibc >= 2.36 sys/mount.h

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
21 months agolinux-user: fix compat with glibc >= 2.36 sys/mount.h
Daniel P. Berrangé [Tue, 2 Aug 2022 16:41:34 +0000 (12:41 -0400)]
linux-user: fix compat with glibc >= 2.36 sys/mount.h

The latest glibc 2.36 has extended sys/mount.h so that it
defines the FSCONFIG_* enum constants. These are historically
defined in linux/mount.h, and thus if you include both headers
the compiler complains:

In file included from /usr/include/linux/fs.h:19,
                 from ../linux-user/syscall.c:98:
/usr/include/linux/mount.h:95:6: error: redeclaration of 'enum fsconfig_command'
   95 | enum fsconfig_command {
      |      ^~~~~~~~~~~~~~~~
In file included from ../linux-user/syscall.c:31:
/usr/include/sys/mount.h:189:6: note: originally defined here
  189 | enum fsconfig_command
      |      ^~~~~~~~~~~~~~~~
/usr/include/linux/mount.h:96:9: error: redeclaration of enumerator 'FSCONFIG_SET_FLAG'
   96 |         FSCONFIG_SET_FLAG       = 0,    /* Set parameter, supplying no value */
      |         ^~~~~~~~~~~~~~~~~
/usr/include/sys/mount.h:191:3: note: previous definition of 'FSCONFIG_SET_FLAG' with type 'enum fsconfig_command'
  191 |   FSCONFIG_SET_FLAG       = 0,    /* Set parameter, supplying no value */
      |   ^~~~~~~~~~~~~~~~~
...snip...

QEMU doesn't include linux/mount.h, but it does use
linux/fs.h and thus gets linux/mount.h indirectly.

glibc acknowledges this problem but does not appear to
be intending to fix it in the forseeable future, simply
documenting it as a known incompatibility with no
workaround:

  https://sourceware.org/glibc/wiki/Release/2.36#Usage_of_.3Clinux.2Fmount.h.3E_and_.3Csys.2Fmount.h.3E
  https://sourceware.org/glibc/wiki/Synchronizing_Headers

To address this requires either removing use of sys/mount.h
or linux/fs.h, despite QEMU needing declarations from
both.

This patch removes linux/fs.h, meaning we have to define
various FS_IOC constants that are now unavailable.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
Tested-by: Richard W.M. Jones <rjones@redhat.com>
Message-Id: <20220802164134.1851910-1-berrange@redhat.com>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
21 months agoUpdate version for v7.1.0-rc2 release
Richard Henderson [Wed, 10 Aug 2022 02:25:15 +0000 (19:25 -0700)]
Update version for v7.1.0-rc2 release

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
21 months agoMerge tag 'trivial-branch-for-7.1-pull-request' of https://gitlab.com/laurent_vivier...
Richard Henderson [Tue, 9 Aug 2022 19:17:21 +0000 (12:17 -0700)]
Merge tag 'trivial-branch-for-7.1-pull-request' of https://gitlab.com/laurent_vivier/qemu into staging

Pull request trivial branch 20220809

# -----BEGIN PGP SIGNATURE-----
#
# iQJGBAABCAAwFiEEzS913cjjpNwuT1Fz8ww4vT8vvjwFAmLykYgSHGxhdXJlbnRA
# dml2aWVyLmV1AAoJEPMMOL0/L74881MP/1UL3bfp1/tzxeN5wvT0mAdrKcj8obPE
# 5BB0QPD48NL8JqWq9HLLhX2vmAi2ibhPptpJkn+kXsqj8OW4Qp1JyWggZgD7O3mz
# S2OjVcpWrClhugoGhRUBm6G6kPsYjIBU0dLAINsyL6ETBZpIdkU/axLUJ6b2Wrm0
# eIQm6xNkGRhFAuya7MOX5ObzNylix2t1+QLxJMbA3XOCwl9PQRh7Wb/0oRhFMWZ9
# xCjraG9Jv1IxG28gGxMbUa2Ic7VTcVs+X+iu98AP7P3HBe/I31aXAmAf47MbMirk
# NJEYI9nDLZJyQmLgmBmyrQ+FIidDVhG7FURzIYeOoREv+xotQt6CTBNLKOcc4ccO
# YRy05JeUNeCJ015r8MZdiTwAwsbY0XPMijgqngqaWCw1BJO/luCdvUX6D4ehC5aZ
# zJPr7jJdqyhIZJjvPawoJSRsvWU495BCtyORtnU1T3uunEEu9vHLQKEy8gWtyitJ
# 7R6E/Mj4IzB9T0Kvz2acGBtxmtTshonjXaYgb11QRI5SWEUUhDNN64839opDPAW8
# PSmRZwfwkhIUlb9eRIEPMFScEEbQVgU+dAngSZva9un9ED2adPMreWHQrinMxQM4
# jtGAfG3RMQUh7b3VBlS87y0N+b2FSIrL9x0ujcozwuh0JMeiWxx+9AUq4dH8m2HU
# YZb3LXjm8i/P
# =o5gT
# -----END PGP SIGNATURE-----
# gpg: Signature made Tue 09 Aug 2022 09:55:36 AM PDT
# gpg:                using RSA key CD2F75DDC8E3A4DC2E4F5173F30C38BD3F2FBE3C
# gpg:                issuer "laurent@vivier.eu"
# gpg: Good signature from "Laurent Vivier <lvivier@redhat.com>" [undefined]
# gpg:                 aka "Laurent Vivier <laurent@vivier.eu>" [undefined]
# gpg:                 aka "Laurent Vivier (Red Hat) <lvivier@redhat.com>" [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: CD2F 75DD C8E3 A4DC 2E4F  5173 F30C 38BD 3F2F BE3C

* tag 'trivial-branch-for-7.1-pull-request' of https://gitlab.com/laurent_vivier/qemu:
  xlnx_dp: drop unsupported AUXCommand in xlnx_dp_aux_set_command
  contrib/vhost-user-blk: Clean up deallocation of VuVirtqElement

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
21 months agoMerge tag 'pull-target-arm-20220809' of https://git.linaro.org/people/pmaydell/qemu...
Richard Henderson [Tue, 9 Aug 2022 16:43:42 +0000 (09:43 -0700)]
Merge tag 'pull-target-arm-20220809' of https://git.linaro.org/people/pmaydell/qemu-arm into staging

target-arm queue:
 * icount: Take iothread lock when running QEMU timers

# -----BEGIN PGP SIGNATURE-----
#
# iQJNBAABCAA3FiEE4aXFk81BneKOgxXPPCUl7RQ2DN4FAmLyTy0ZHHBldGVyLm1h
# eWRlbGxAbGluYXJvLm9yZwAKCRA8JSXtFDYM3o2MEACpdpgpJd+OObHRSLZqQJbL
# 83X/aSSnBIFTeV1IlGC6sHbARffcKsEDQ/ktpmwvrABAJwEzTfaddSQADwlUefLJ
# 1L6Co1MpcOXnYZUIeaWAmN0POKKExB3gjrF19d9Dz9zHvm8Vu0CH/c/3iHsCVfd0
# +v00Pudd11ePWFn+BL6xjDN31OfZexqHVDbhKxoTAjj5BK0AJJAObBQUrp28UrbE
# 1qfg+BZMo/fPPLxRelmGIQLLr8UPEIyNoWZKRcuarJHbqhxqcPe1qIezMHPhMpzn
# vSzjiaYJVOxqj1gzj0Z+J7MSd0jNXVDQn0p7A0nEg7vT4mMt8+hhAuYqW0qAFCmQ
# 1rxiiGGKp5fmK7K+WfraaXqqXqi2P1078moVyg1rGdL5wYfZHyQoldDDNQwHoJkz
# DG6da5hiZjQn1nmL3OyyS0peyLzIE7DmFLP6xw+Op5Hrx/alVBrhpN1qPMzd7wG0
# TmrG//BtIIF5EiZw8oZqrvjcL//lzPvtM1EYmw/jTraV+KSO5anl2vjEi+VN5ngr
# zXPfvgupVoSqr/nCtitp+H71yogOWYp/FkE2xBgIS8qW4bQycPpX+qoi/0I1upTw
# 5FZYTTh6t5IBF8emc/1jQDUi8VlcT7Nz7Kma8fCdHI11xm8m5JI0+hfVkHEs2HQV
# lB+1HhMoJJ3pCzqJiWeINA==
# =xyyN
# -----END PGP SIGNATURE-----
# gpg: Signature made Tue 09 Aug 2022 05:12:29 AM PDT
# gpg:                using RSA key E1A5C593CD419DE28E8315CF3C2525ED14360CDE
# gpg:                issuer "peter.maydell@linaro.org"
# gpg: Good signature from "Peter Maydell <peter.maydell@linaro.org>" [full]
# gpg:                 aka "Peter Maydell <pmaydell@gmail.com>" [full]
# gpg:                 aka "Peter Maydell <pmaydell@chiark.greenend.org.uk>" [full]

* tag 'pull-target-arm-20220809' of https://git.linaro.org/people/pmaydell/qemu-arm:
  icount: Take iothread lock when running QEMU timers

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
21 months agoMerge tag 'net-pull-request' of https://github.com/jasowang/qemu into staging
Richard Henderson [Tue, 9 Aug 2022 14:44:29 +0000 (07:44 -0700)]
Merge tag 'net-pull-request' of https://github.com/jasowang/qemu into staging

# -----BEGIN PGP SIGNATURE-----
# Version: GnuPG v1
#
# iQEcBAABAgAGBQJi8iLAAAoJEO8Ells5jWIRrdMIAI1T5lgOhv2DfHXA6bElokIx
# 10NQ0dG5IBhO6l56p6Um95+tMDMfYBDjc8YOI1qv3L1PZOXdeHjs2ldUg8f0cmFP
# asvY1EJJW4SlCI0hk/Jb6oXf8BoVnNEnMmNGg8qRmVyEw2sFYkNhhA9dXH+537GN
# K0ZFOmfsYpn3EzKyqooln8XLT9lPsXX9LC1Oh0Jz1YmRn6y8/rngR1DWAEyr6MnL
# 5iGIyv5VEdeU1sQJRrH9DyCCGLlILCCUa2yo1RkV+Ac/qPdKWfkyE6K6kUelzGbp
# qqP9+rDpF3LwokqAI+8tJCwc6WqLL3Y/Ddb1J6gzydh8WcszjlXPjcBn8FeKXzk=
# =hAhp
# -----END PGP SIGNATURE-----
# gpg: Signature made Tue 09 Aug 2022 02:02:56 AM PDT
# gpg:                using RSA key EF04965B398D6211
# gpg: Good signature from "Jason Wang (Jason Wang on RedHat) <jasowang@redhat.com>" [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: 215D 46F4 8246 689E C77F  3562 EF04 965B 398D 6211

* tag 'net-pull-request' of https://github.com/jasowang/qemu:
  hw/net/rocker: Avoid undefined shifts with more than 31 ports

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
21 months agoicount: Take iothread lock when running QEMU timers
Peter Maydell [Tue, 9 Aug 2022 09:55:14 +0000 (10:55 +0100)]
icount: Take iothread lock when running QEMU timers

The function icount_prepare_for_run() is called with the iothread
unlocked, but it can call icount_notify_aio_contexts() which will
run qemu timer handlers. Those are supposed to be run only with
the iothread lock held, so take the lock while we do that.

Since icount mode runs everything on a single thread anyway,
not holding the lock is likely mostly not going to introduce
races, but it can cause us to trip over assertions that we
do hold the lock, such as the one reported in issue 1130.

Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1130
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Tested-by: Pavel Dovgalyuk <Pavel.Dovgalyuk@ispras.ru>
Message-id: 20220801164527.3134765-1-peter.maydell@linaro.org

21 months agohw/net/rocker: Avoid undefined shifts with more than 31 ports
Peter Maydell [Fri, 29 Jul 2022 15:59:32 +0000 (16:59 +0100)]
hw/net/rocker: Avoid undefined shifts with more than 31 ports

In rocker_port_phys_link_status() and rocker_port_phys_enable_read()
we construct a 64-bit value with one bit per front-panel port.
However we accidentally do the shift as 32-bit arithmetic, which
means that if there are more than 31 front-panel ports this is
undefined behaviour.

Fix the problem by ensuring we use 64-bit arithmetic for the whole
calculation. (We won't ever shift off the 64-bit value because
ROCKER_FP_PORTS_MAX is 62.)

Resolves: Coverity CID 14871211487160
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Jason Wang <jasowang@redhat.com>
21 months agoMerge tag 'pull-la-20220808' of https://gitlab.com/rth7680/qemu into staging
Richard Henderson [Tue, 9 Aug 2022 02:51:12 +0000 (19:51 -0700)]
Merge tag 'pull-la-20220808' of https://gitlab.com/rth7680/qemu into staging

loongarch: fix emulation of fcsr register

# -----BEGIN PGP SIGNATURE-----
#
# iQFRBAABCgA7FiEEekgeeIaLTbaoWgXAZN846K9+IV8FAmLxy0UdHHJpY2hhcmQu
# aGVuZGVyc29uQGxpbmFyby5vcmcACgkQZN846K9+IV91ZggAjgUGqrFRZFR72C5m
# cNkgB6f5rzc6hgnqwstsQpvKOXKu8WH9+6xJHoQKau1NY2KNdLnt1itpThL3K2+c
# nh0E/w/DrTiaq4NsbWu3SrkTSGW+zcdhljQff6gyyLZyLQAY34Ej2hBhKfva3sRZ
# Y/Lm8euq6d559LWvN/Nyo11RBPdSq+KPtfGcGdOynY+OBFsDmXDTjdjGDFHQESh2
# +WnXcjlXq46vLOuZ6LLiNIHRbvFdfjcr5pqKKlESedA+wikgxP+ZeoIx+7HxlZe3
# CpYTzbmhoz5n3seRRAl5CouxGsEfL7plUn3BS+InabthE+qE6xvgvS9vcd1YMkg1
# eoKefQ==
# =Sk/5
# -----END PGP SIGNATURE-----
# gpg: Signature made Mon 08 Aug 2022 07:49:41 PM PDT
# gpg:                using RSA key 7A481E78868B4DB6A85A05C064DF38E8AF7E215F
# gpg:                issuer "richard.henderson@linaro.org"
# gpg: Good signature from "Richard Henderson <richard.henderson@linaro.org>" [ultimate]

* tag 'pull-la-20220808' of https://gitlab.com/rth7680/qemu:
  target/loongarch: Remove cpu_fcsr0

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
21 months agotarget/loongarch: Remove cpu_fcsr0
Richard Henderson [Sat, 6 Aug 2022 17:04:44 +0000 (10:04 -0700)]
target/loongarch: Remove cpu_fcsr0

All of the fpu operations are defined with TCG_CALL_NO_WG, but they
all modify FCSR0.  The most efficient way to fix this is to remove
cpu_fcsr0, and instead use explicit load and store operations for the
two instructions that manipulate that value.

Acked-by: Qi Hu <huqi@loongson.cn>
Reviewed-by: Song Gao <gaosong@loongson.cn>
Reported-by: Feiyang Chen <chenfeiyang@loongson.cn>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
21 months agoMerge tag 'mips-20220809' of https://github.com/philmd/qemu into staging
Richard Henderson [Tue, 9 Aug 2022 00:59:27 +0000 (17:59 -0700)]
Merge tag 'mips-20220809' of https://github.com/philmd/qemu into staging

MIPS/SPARC patches queue

- target/mips: Handle lock_user failure in UHI_plog semihosting (Peter Maydell)
- hw/mips/malta: Turn off x86 specific features of PIIX4 PM (Igor Mammedov)
- hw/misc/grlib_ahb_apb_pnp: Support 8 and 16 bit accesses (Peter Maydell)

# -----BEGIN PGP SIGNATURE-----
#
# iQIzBAABCAAdFiEE+qvnXhKRciHc/Wuy4+MsLN6twN4FAmLxjkMACgkQ4+MsLN6t
# wN4DhQ/+L/lcVmz/hoIDsjyqMBpBYMYEftlytyuXUDqp9+1CGQpXXzf6cmXwiMK5
# DDP/q0PR508tevljDuc7A01ThkN5Vx8FcEpCaD54AjZ5n0BxSLl0Yw9Leftq8doD
# Nk0YonVEY1tNXYV/KGWsiA7Xhkm3pL66Jzc0fyotNhzsI/dGxTVO9vLTgLl4/Hxv
# iMj0AxPIOrKEsom61k6QKLgE5ZC3yIPZb+6upSwrQfx6oMtIac5NofEjNCuR0Uy5
# PgM6ZJKAM376JlP4hdJ91K04Wg8ql+ze/x2jpjbR0S3QRz4TbH57hJ00nNRLxDep
# 5hHE7FIg6xf7sJv8ukwLK31zOiT46Azkr1wG97mZ7NyxxT7VTXtKgje6IENLGCgy
# sCMWIEnrOh03seMShaCRqPcguYUR+XaMc+Hpv9XCu3ZvniI2CUpmVlm8M0t3hqVK
# XCMwSsXJZ2w4522lUAJio2a10dsHJDg8U81n1KozTRUEZ8QBVlkqNLAIsROKl1Fr
# LMsv9408nQLkAhYCBeZArw8ayITLTPqlE/S7fiLwwa6e8lPpkMyz/RlN16QsCSHr
# zQO0iwY4kldn7QekKPTMQE73sW5ziBIOe7P6F5jtexbeaY0vJ5ph8Kfrq6hUVuqN
# ieQVSi4psz43fpIjNodTk0nnsqAJXZ/7vy0sS38DvwQjBZojWIk=
# =RIZd
# -----END PGP SIGNATURE-----
# gpg: Signature made Mon 08 Aug 2022 03:29:23 PM PDT
# gpg:                using RSA key FAABE75E12917221DCFD6BB2E3E32C2CDEADC0DE
# gpg: Good signature from "Philippe Mathieu-Daudé (F4BUG) <f4bug@amsat.org>" [full]

* tag 'mips-20220809' of https://github.com/philmd/qemu:
  hw/misc/grlib_ahb_apb_pnp: Support 8 and 16 bit accesses
  hw/mips/malta: turn off x86 specific features of PIIX4_PM
  target/mips: Handle lock_user() failure in UHI_plog semihosting call

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
21 months agohw/misc/grlib_ahb_apb_pnp: Support 8 and 16 bit accesses
Peter Maydell [Tue, 2 Aug 2022 13:19:25 +0000 (14:19 +0100)]
hw/misc/grlib_ahb_apb_pnp: Support 8 and 16 bit accesses

In real hardware, the APB and AHB PNP data tables can be accessed
with byte and halfword reads as well as word reads.  Our
implementation currently only handles word reads.  Add support for
the 8 and 16 bit accesses.  Note that we only need to handle aligned
accesses -- unaligned accesses should continue to trap, as happens on
hardware.

Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1132
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Frederic Konrad <fkonrad@amd.com>
Message-Id: <20220802131925.3380923-1-peter.maydell@linaro.org>
Tested-by: Tomasz Martyniak <gitlab.com/tom4r>
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
21 months agohw/mips/malta: turn off x86 specific features of PIIX4_PM
Igor Mammedov [Thu, 28 Jul 2022 11:50:34 +0000 (07:50 -0400)]
hw/mips/malta: turn off x86 specific features of PIIX4_PM

QEMU crashes trying to save VMSTATE when only MIPS target are compiled in
  $ qemu-system-mips -monitor stdio
  (qemu) migrate "exec:gzip -c > STATEFILE.gz"
  Segmentation fault (core dumped)

It happens due to PIIX4_PM trying to parse hotplug vmstate structures
which are valid only for x86 and not for MIPS (as it requires ACPI
tables support which is not existent for ithe later)

Issue was probably exposed by trying to cleanup/compile out unused
ACPI bits from MIPS target (but forgetting about migration bits).

Disable compiled out features using compat properties as the least
risky way to deal with issue.

Signed-off-by: Igor Mammedov <imammedo@redhat.com>
Resolves: https://gitlab.com/qemu-project/qemu/-/issues/995
Reviewed-by: Ani Sinha <ani@anisinha.ca>
Acked-by: Michael S. Tsirkin <mst@redhat.com>
Message-Id: <20220728115034.1327988-1-imammedo@redhat.com>
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
21 months agotarget/mips: Handle lock_user() failure in UHI_plog semihosting call
Peter Maydell [Tue, 19 Jul 2022 19:17:37 +0000 (20:17 +0100)]
target/mips: Handle lock_user() failure in UHI_plog semihosting call

Coverity notes that we forgot to check the error return from
lock_user() in one place in the handling of the UHI_plog semihosting
call.  Add the missing error handling.

report_fault() is rather brutal in that it will call abort(), but
this is the same error-handling used in the rest of this file.

Resolves: Coverity CID 1490684
Fixes: ea4210600db3c5 ("target/mips: Avoid qemu_semihosting_log_out for UHI_plog")
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Message-Id: <20220719191737.384744-1-peter.maydell@linaro.org>
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
21 months agoMerge tag 'for-upstream' of https://gitlab.com/bonzini/qemu into staging
Richard Henderson [Mon, 8 Aug 2022 16:57:37 +0000 (09:57 -0700)]
Merge tag 'for-upstream' of https://gitlab.com/bonzini/qemu into staging

* Fix and tests for -readconfig
* Fixes for changeable block size

# -----BEGIN PGP SIGNATURE-----
#
# iQFIBAABCAAyFiEE8TM4V0tmI4mGbHaCv/vSX3jHroMFAmLxB6wUHHBib256aW5p
# QHJlZGhhdC5jb20ACgkQv/vSX3jHroMbgQgAmj38xh/KurUvjAwlki9OF+jIXem/
# r7eHtc6wG/dGN7CyL+EK08c2GfPIphhii3JGfLT3P/xHvHRVgYow2AELNvYSG85M
# SBQGfDsHLoKvY6Wni3AolECvtGycXkd30RtrzqdTT8iZyIhTTsikEG2hSgE+Z6Yy
# 9XGPHN9puTkkD5HYnDV1+T4+yc28F8UTVob3fv9b7LMH7mSYz7UN5Tw4zB7DjOL1
# JNTuYqW9JN1X1vIYKxYw9Y5Jb3qNjnl8y6if8bPuvrLRw94sd0ax23yEQHwtgcUj
# cYGcvZ2/X0SQg4AHTsqGJCuffKNDfHhmmA7w0Xb2DEvBvoveYOaDp3dKZQ==
# =L9FI
# -----END PGP SIGNATURE-----
# gpg: Signature made Mon 08 Aug 2022 05:55:08 AM PDT
# gpg:                using RSA key F13338574B662389866C7682BFFBD25F78C7AE83
# gpg:                issuer "pbonzini@redhat.com"
# gpg: Good signature from "Paolo Bonzini <bonzini@gnu.org>" [undefined]
# gpg:                 aka "Paolo Bonzini <pbonzini@redhat.com>" [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: 46F5 9FBD 57D6 12E7 BFD4  E2F7 7E15 100C CD36 69B1
#      Subkey fingerprint: F133 3857 4B66 2389 866C  7682 BFFB D25F 78C7 AE83

* tag 'for-upstream' of https://gitlab.com/bonzini/qemu:
  tests/qtest: add scenario for -readconfig handling
  vl: remove dead code in parse_memory_options()
  vl: fix [memory] section with -readconfig
  scsi-disk: ensure block size is non-zero and changes limited to bits 8-15
  scsi-disk: fix overflow when block size is not a multiple of BDRV_SECTOR_SIZE

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
21 months agoMerge tag 'pull-request-2022-08-08' of https://gitlab.com/thuth/qemu into staging
Richard Henderson [Mon, 8 Aug 2022 15:20:29 +0000 (08:20 -0700)]
Merge tag 'pull-request-2022-08-08' of https://gitlab.com/thuth/qemu into staging

* Fix booting in the s390-ccw bios when physical and logical block sizes differ
* Fix the replay-linux avocado test
* Relax a time constraint in iotest 264

# -----BEGIN PGP SIGNATURE-----
#
# iQJFBAABCAAvFiEEJ7iIR+7gJQEY8+q5LtnXdP5wLbUFAmLwmJsRHHRodXRoQHJl
# ZGhhdC5jb20ACgkQLtnXdP5wLbUuaw//XGlKYzjKHEsmSGGuwSEF/iW7BvHf8lAn
# X2loC7Fd1WzEoq1EX/s5jd/4+ZUVxDP4F2wO9Hzhi7GpEfd/Cr5cu3TPwWCGjQT8
# g6UFVPPzHeVU68GxQX6ufBAPk7Lc9S57GHZ9n4tzcN7Jvp63zAXEFXe4lVLnAmzJ
# ykDz1Ir1bCDEl1AIbVp1umpIAh4MkbY1XfZeXWRkbGtQolH1y/F6sZWw3i72G30b
# JOM1pmu89KjnxWPoz1J142jOx53/XpSSlrqpFeqieykbU59rilBTIwi+k7K0KMOd
# 0DbrPDuU0EQ7JRkWzAlTT/IfNPbQB5gOjw6zFr+0L5S+3LcPM/p8XszNk4j3XQWt
# Bps3HDU13LDQpydRyZajY4iCQl6tzBDVXCoY+LUgrYjkP6OM5UpbakZgXJWNw9Nu
# Juu3kQ7imtLtMlKZQGSvhsy6gyUXjVlZxTZFspTQsMoOp/BDZdIwG+mKxk786hgr
# 32RxingXv6SWFYS+zrKsRJePtleLJr/RcySZFHNboJt9RIGf6W/IdROEjgZeYLce
# QDnlfi6AbwnP37nWmah5Iu2PeoZwDgr3jL81otdWlU8bc7G+gjwrnN/E77y3jJvH
# Auhj9YBNttQH6O8L4juMaD9+8/KtO47FfVfXojmPoicEB9NeWLChlUovVz47LC/U
# olsgxmuoDac=
# =JZmF
# -----END PGP SIGNATURE-----
# gpg: Signature made Sun 07 Aug 2022 10:01:15 PM PDT
# gpg:                using RSA key 27B88847EEE0250118F3EAB92ED9D774FE702DB5
# gpg:                issuer "thuth@redhat.com"
# gpg: Good signature from "Thomas Huth <th.huth@gmx.de>" [undefined]
# gpg:                 aka "Thomas Huth <thuth@redhat.com>" [undefined]
# gpg:                 aka "Thomas Huth <th.huth@posteo.de>" [unknown]
# gpg:                 aka "Thomas Huth <huth@tuxfamily.org>" [undefined]
# gpg: WARNING: This key is not certified with a trusted signature!
# gpg:          There is no indication that the signature belongs to the owner.
# Primary key fingerprint: 27B8 8847 EEE0 2501 18F3  EAB9 2ED9 D774 FE70 2DB5

* tag 'pull-request-2022-08-08' of https://gitlab.com/thuth/qemu:
  tests/qemu-iotests/264: Allow up to 5s for the BLOCK_JOB_CANCEL event to arrive
  tests/avocado: fix replay-linux test
  pc-bios/s390-ccw: Update the s390-ccw.img with the block size fix
  pc-bios/s390-ccw: Fix booting with logical block size < physical block size

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
21 months agotests/qtest: add scenario for -readconfig handling
Daniel P. Berrangé [Fri, 5 Aug 2022 11:55:29 +0000 (12:55 +0100)]
tests/qtest: add scenario for -readconfig handling

This test of -readconfig validates the last three regressions we
have fixed with -readconfig:

 * Interpretation of memory size units as MiB not bytes
 * Allow use of [spice]
 * Allow use of [object]

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
Message-Id: <20220805115529.124544-2-berrange@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
21 months agovl: remove dead code in parse_memory_options()
Paolo Bonzini [Fri, 5 Aug 2022 17:15:39 +0000 (19:15 +0200)]
vl: remove dead code in parse_memory_options()

mem_str will never be an empty string, because qemu_opt_get_size() fails
if it encounters one:

   $ ./qemu-system-x86_64 -m size=
   qemu-system-x86_64: -m size=: Parameter size expects a non-negative number below 2^64
   Optional suffix k, M, G, T, P or E means kilo-, mega-, giga-, tera-, peta-
   and exabytes, respectively.

Suggested-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
21 months agovl: fix [memory] section with -readconfig
Paolo Bonzini [Fri, 5 Aug 2022 10:01:51 +0000 (12:01 +0200)]
vl: fix [memory] section with -readconfig

The -M memory.* options do not have magic applied to them like the -m
option, namely no "M" (for mebibytes) is tacked at the end of a suffixless
value for "-M memory.size".

This magic is performed by parse_memory_options, and we have to do it for
both "-m" and the [memory] section of a config file.  Storing [memory]
sections directly to machine_opts_dict changed the meaning of

    [memory]
      size = "1024"

in a -readconfig file from 1024MiB to 8KiB (1024 Bytes rounded up to
8KiB silently).  To avoid this, the [memory] section has to be changed
back to QemuOpts (combining [memory] and "-m" will work fine thanks to
.merge_lists being true).

Change parse_memory_options() so that, similar to the older function
set_memory_options(), it operates after command line parsing is done;
and also call it where set_memory_options() used to be.

Note, the parsing code uses exit(1) instead of exit(EXIT_FAILURE) to
match neighboring code.

Reported-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Fixes: ce9d03fb3f ("machine: add mem compound property", 2022-05-12)
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
21 months agoxlnx_dp: drop unsupported AUXCommand in xlnx_dp_aux_set_command
Qiang Liu [Mon, 8 Aug 2022 08:01:16 +0000 (16:01 +0800)]
xlnx_dp: drop unsupported AUXCommand in xlnx_dp_aux_set_command

In xlnx_dp_aux_set_command, when the command leads to the default
branch, xlxn-dp will abort and then crash.

This patch removes this abort and drops this operation.

Fixes: 58ac482 ("introduce xlnx-dp")
Resolves: https://gitlab.com/qemu-project/qemu/-/issues/411
Reported-by: Qiang Liu <cyruscyliu@gmail.com>
Tested-by: Qiang Liu <cyruscyliu@gmail.com>
Suggested-by: Thomas Huth <thuth@redhat.com>
Signed-off-by: Qiang Liu <cyruscyliu@gmail.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Reviewed-by: Frederic Konrad <fkonrad@amd.com>
Message-Id: <20220808080116.2184881-1-cyruscyliu@gmail.com>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
21 months agocontrib/vhost-user-blk: Clean up deallocation of VuVirtqElement
Markus Armbruster [Thu, 30 Jun 2022 08:52:19 +0000 (10:52 +0200)]
contrib/vhost-user-blk: Clean up deallocation of VuVirtqElement

We allocate VuVirtqElement with g_malloc() in
virtqueue_alloc_element(), but free it with free() in
vhost-user-blk.c.  Harmless, but use g_free() anyway.

One of the calls is guarded by a "not null" condition.  Useless,
because it cannot be null (it's dereferenced right before), and even
it it could be, free() and g_free() do the right thing.  Drop the
conditional.

Fixes: Coverity CID 1490290
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Raphael Norwitz <raphael.norwitz@nutanix.com>
Acked-by: Michael S. Tsirkin <mst@redhat.com>
Message-Id: <20220630085219.1305519-1-armbru@redhat.com>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
21 months agotests/qemu-iotests/264: Allow up to 5s for the BLOCK_JOB_CANCEL event to arrive
Thomas Huth [Tue, 2 Aug 2022 12:31:01 +0000 (14:31 +0200)]
tests/qemu-iotests/264: Allow up to 5s for the BLOCK_JOB_CANCEL event to arrive

It is possible to hit the assertTrue(delta_t < 2.0) on very loaded
systems. Increase the value to 5.0 to ease the situation a little bit.

Message-Id: <20220802123101.430757-1-thuth@redhat.com>
Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@yandex-team.ru>
Signed-off-by: Thomas Huth <thuth@redhat.com>
21 months agotests/avocado: fix replay-linux test
Pavel Dovgalyuk [Tue, 2 Aug 2022 10:36:06 +0000 (13:36 +0300)]
tests/avocado: fix replay-linux test

Last line of the test is missing by accident.
This patch fixes the script.

Signed-off-by: Pavel Dovgalyuk <Pavel.Dovgalyuk@ispras.ru>
Message-Id: <165943656662.362178.2086588841425038338.stgit@pasha-ThinkPad-X280>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Signed-off-by: Thomas Huth <thuth@redhat.com>
21 months agopc-bios/s390-ccw: Update the s390-ccw.img with the block size fix
Thomas Huth [Sun, 7 Aug 2022 16:22:35 +0000 (18:22 +0200)]
pc-bios/s390-ccw: Update the s390-ccw.img with the block size fix

The new binary now gets the block size of virtio-blk devices right.

Signed-off-by: Thomas Huth <thuth@redhat.com>
21 months agopc-bios/s390-ccw: Fix booting with logical block size < physical block size
Thomas Huth [Fri, 5 Aug 2022 09:42:14 +0000 (11:42 +0200)]
pc-bios/s390-ccw: Fix booting with logical block size < physical block size

For accessing single blocks during boot, it's the logical block size that
matters. (Physical block sizes are rather interesting e.g. for creating
file systems with the correct alignment for speed reasons etc.).
So the s390-ccw bios has to use the logical block size for calculating
sector numbers during the boot phase, the "physical_block_exp" shift
value must not be taken into account. This change fixes the boot process
when the guest hast been installed on a disk where the logical block size
differs from the physical one, e.g. if the guest has been installed
like this:

 qemu-system-s390x -nographic -accel kvm -m 2G \
  -drive if=none,id=d1,file=fedora.iso,format=raw,media=cdrom \
  -device virtio-scsi -device scsi-cd,drive=d1 \
  -drive if=none,id=d2,file=test.qcow2,format=qcow2
  -device virtio-blk,drive=d2,physical_block_size=4096,logical_block_size=512

Linux correctly uses the logical block size of 512 for the installation,
but the s390-ccw bios tries to boot from a disk with 4096 block size so
far, as long as this patch has not been applied yet (well, it used to work
by accident in the past due to the virtio_assume_scsi() hack that used to
enforce 512 byte sectors on all virtio-block disks, but that hack has been
well removed in commit 5447de2619050a0a4d to fix other scenarios).

Fixes: 5447de2619 ("pc-bios/s390-ccw/virtio-blkdev: Remove virtio_assume_scsi()")
Buglink: https://bugzilla.redhat.com/show_bug.cgi?id=2112303
Message-Id: <20220805094214.285223-1-thuth@redhat.com>
Reviewed-by: Cornelia Huck <cohuck@redhat.com>
Reviewed-by: Eric Farman <farman@linux.ibm.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
21 months agoMerge tag 'pull-la-20220805' of https://gitlab.com/rth7680/qemu into staging
Richard Henderson [Fri, 5 Aug 2022 19:55:53 +0000 (12:55 -0700)]
Merge tag 'pull-la-20220805' of https://gitlab.com/rth7680/qemu into staging

LoongArch updates:
  Store value in SET_FPU_* macros.
  Fix unused variable Werrors in acpi-build.c
  Update xml to match upstream gdb.

# -----BEGIN PGP SIGNATURE-----
#
# iQFRBAABCgA7FiEEekgeeIaLTbaoWgXAZN846K9+IV8FAmLtdTodHHJpY2hhcmQu
# aGVuZGVyc29uQGxpbmFyby5vcmcACgkQZN846K9+IV/u3Qf/XON//wiT054wyL3a
# wCZ7c4A96zA0Zu+S1FSo4CZ81wCUpAF5b76fhIU5GrLuWrs/UzOcn+akS8LNLLcM
# nQHqbYNQbkTGOj6DwlZfts8Ul/Ki/Yimjh0gBLFGepzYrsahJ4dCVwQR/KZNkMKf
# xwBn3+yq96DzEmIqjqEQtlet3Wmsow/zDU+RuHbtdrFiSx6MwhLo/e+dHVEEPkEL
# EBmFNETcmAzIg+oFfifkP1ZHgL/Nt2yjElwFZM2pKLMgANVpHOpCTap03KAO/xTt
# LzX5nmJ+4MYPyoEchRaNuq5sB5GqicDGuwGPdhu6qOV589duZ64M4dfm9ErTKEFA
# eE27rA==
# =fcsy
# -----END PGP SIGNATURE-----
# gpg: Signature made Fri 05 Aug 2022 12:53:30 PM PDT
# gpg:                using RSA key 7A481E78868B4DB6A85A05C064DF38E8AF7E215F
# gpg:                issuer "richard.henderson@linaro.org"
# gpg: Good signature from "Richard Henderson <richard.henderson@linaro.org>" [ultimate]

* tag 'pull-la-20220805' of https://gitlab.com/rth7680/qemu:
  target/loongarch: Update gdb_set_fpu() and gdb_get_fpu()
  target/loongarch: Update loongarch-fpu.xml
  target/loongarch: update loongarch-base64.xml
  target/loongarch: add gdb_arch_name()
  target/loongarch: Fix GDB get the wrong pc
  hw/loongarch: remove acpi-build.c unused variable 'aml_len'
  target/loongarch: Fix macros SET_FPU_* in cpu.h

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
21 months agoMerge tag 'misc-next-pull-request' of https://gitlab.com/berrange/qemu into staging
Richard Henderson [Fri, 5 Aug 2022 17:28:09 +0000 (10:28 -0700)]
Merge tag 'misc-next-pull-request' of https://gitlab.com/berrange/qemu into staging

Merge misc patches

 * Display deprecation warnings in -cpu help
 * Fix zerocopy IPv6 handling
 * Clarify platform support policy on minor release/backports
 * Fix closesocket call in error path

# -----BEGIN PGP SIGNATURE-----
#
# iQIzBAABCAAdFiEE2vOm/bJrYpEtDo4/vobrtBUQT98FAmLtNQoACgkQvobrtBUQ
# T9/vbQ//ab28uFWbUxnBjOsI57PEJLCL4iWCtJtMEkjWRT6W5hoMirktsThierSe
# Yi1idrL0Z5lP6S1AZvuKYO9yTjzO+VzpmolXXRB6lRabQJ7eL/KNAAj2gO1X/ELh
# UItcalI14ucrWUSd14PGjHAOgpI1RONDcgnY3/Yp9/ARz+0XEtH4CLk2NyAxCRn/
# PHDA/BB0tKf0S6aC92vHOVLdLppA6lhheIKCyrM+QWZfp/PuIQLvjHdilB9dcbdC
# JtZN5TWISvOPuAGBMkulAefKPMWhrdy2UYBIGvN3+s+l6y++neyrChagt0ky+8F3
# dF0AZsqVRQfVwAKLhHpaNAImCbUt2jVWXHXzgrwVSNpdP1oDcFVVuu/strdcvyb6
# UgZI10hkKWsaZXcjXJ0qMZ8bI5CLXAosRx4SA0U/SLGJs5jpEO9gK3cq5o+vtG+j
# cJI7/B5OI3csuBVCXddgl6bkOYldSOcP6QEre7KJ+V07feDWDGa8qzwpRvh9h6Vb
# YZ+eWWTOAbDbXpgwk8sNTGYHbKME6GSBMa2QF2rLFrIHnI9OoWFzn2O87wKSNt9M
# 9p7Xv2UF0hB6CQ2p0wjETbnkfbQR5C3ybanfWvqK/98w1AkwMkaK3pDDbX571hFN
# EzZx1cdirpthzvGXyYRsM+V64T86t7J2jeCbbPpEzSmpglD9IKM=
# =JTiu
# -----END PGP SIGNATURE-----
# gpg: Signature made Fri 05 Aug 2022 08:19:38 AM PDT
# 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]

* tag 'misc-next-pull-request' of https://gitlab.com/berrange/qemu:
  util/qemu-sockets: Replace the call to close a socket with closesocket()
  target/arm: display deprecation status in '-cpu help'
  target/s390x: display deprecation status in '-cpu help'
  target/i386: display deprecation status in '-cpu help'
  QIOChannelSocket: Add support for MSG_ZEROCOPY + IPV6
  docs: build-platforms: Clarify stance on minor releases and backports

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
21 months agotarget/loongarch: Update gdb_set_fpu() and gdb_get_fpu()
Song Gao [Fri, 5 Aug 2022 03:35:23 +0000 (11:35 +0800)]
target/loongarch: Update gdb_set_fpu() and gdb_get_fpu()

GDB LoongArch fpu use fcc register, update gdb_set_fpu()
and gdb_get_fpu() to match it.

Signed-off-by: Song Gao <gaosong@loongson.cn>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Acked-by: Alex Bennée <alex.bennee@linaro.org>
Message-Id: <20220805033523.1416837-6-gaosong@loongson.cn>

21 months agotarget/loongarch: Update loongarch-fpu.xml
Song Gao [Fri, 5 Aug 2022 03:35:22 +0000 (11:35 +0800)]
target/loongarch: Update loongarch-fpu.xml

Rename loongarch-fpu64.xml to loongarch-fpu.xml and update
loongarch-fpu.xml to match upstream GDB [1]

[1]:https://github.com/bminor/binutils-gdb/blob/master/gdb/features/loongarch/fpu.xml

Signed-off-by: Song Gao <gaosong@loongson.cn>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Acked-by: Alex Bennée <alex.bennee@linaro.org>
Message-Id: <20220805033523.1416837-5-gaosong@loongson.cn>

21 months agotarget/loongarch: update loongarch-base64.xml
Song Gao [Fri, 5 Aug 2022 03:35:21 +0000 (11:35 +0800)]
target/loongarch: update loongarch-base64.xml

Update loongarch-base64.xml to match the upstream GDB [1].

[1]:https://github.com/bminor/binutils-gdb/blob/master/gdb/features/loongarch/base64.xml

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Song Gao <gaosong@loongson.cn>
Acked-by: Alex Bennée <alex.bennee@linaro.org>
Message-Id: <20220805033523.1416837-4-gaosong@loongson.cn>

21 months agotarget/loongarch: add gdb_arch_name()
Song Gao [Fri, 5 Aug 2022 03:35:20 +0000 (11:35 +0800)]
target/loongarch: add gdb_arch_name()

Matches bfd/cpu-loongarch.c, bfd_loongarch_arch.

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Song Gao <gaosong@loongson.cn>
Acked-by: Alex Bennée <alex.bennee@linaro.org>
Message-Id: <20220805033523.1416837-3-gaosong@loongson.cn>

21 months agotarget/loongarch: Fix GDB get the wrong pc
Song Gao [Fri, 5 Aug 2022 03:35:19 +0000 (11:35 +0800)]
target/loongarch: Fix GDB get the wrong pc

GDB LoongArch add a register orig_a0, see the base64.xml [1].
We should add the orig_a0 to match the upstream GDB.

[1]: https://github.com/bminor/binutils-gdb/blob/master/gdb/features/loongarch/base64.xml

Signed-off-by: Song Gao <gaosong@loongson.cn>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Acked-by: Alex Bennée <alex.bennee@linaro.org>
Message-Id: <20220805033523.1416837-2-gaosong@loongson.cn>

21 months agohw/loongarch: remove acpi-build.c unused variable 'aml_len'
Song Gao [Thu, 21 Jul 2022 04:00:46 +0000 (12:00 +0800)]
hw/loongarch: remove acpi-build.c unused variable 'aml_len'

Fix a compiler warning on openbsd:
../src/hw/loongarch/acpi-build.c:416:12: warning: variable 'aml_len'
set but not used [-Wunused-but-set-variable]
    size_t aml_len = 0;
           ^

Reported-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Song Gao <gaosong@loongson.cn>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20220721040046.3985609-1-gaosong@loongson.cn>
[rth: Removing aml_len in turn makes fadt set but not used.]
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
21 months agotarget/loongarch: Fix macros SET_FPU_* in cpu.h
Qi Hu [Thu, 4 Aug 2022 13:24:50 +0000 (21:24 +0800)]
target/loongarch: Fix macros SET_FPU_* in cpu.h

The macros SET_FPU_* are used to set corresponding bits of fcsr.
Unfortunately it forgets to set the result and it causes fcsr's
"CAUSE" never being updated. This patch is to fix this bug.

Signed-off-by: Qi Hu <huqi@loongson.cn>
Reviewed-by: Song Gao <gaosong@loongson.cn>
Message-Id: <20220804132450.314329-1-huqi@loongson.cn>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
21 months agoutil/qemu-sockets: Replace the call to close a socket with closesocket()
Bin Meng [Tue, 2 Aug 2022 07:51:57 +0000 (15:51 +0800)]
util/qemu-sockets: Replace the call to close a socket with closesocket()

close() is a *nix function. It works on any file descriptor, and
sockets in *nix are an example of a file descriptor.

closesocket() is a Windows-specific function, which works only
specifically with sockets. Sockets on Windows do not use *nix-style
file descriptors, and socket() returns a handle to a kernel object
instead, so it must be closed with closesocket().

In QEMU there is already a logic to handle such platform difference
in os-posix.h and os-win32.h, that:

  * closesocket maps to close on POSIX
  * closesocket maps to a wrapper that calls the real closesocket()
    on Windows

Replace the call to close a socket with closesocket() instead.

Signed-off-by: Bin Meng <bin.meng@windriver.com>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
21 months agotarget/arm: display deprecation status in '-cpu help'
Daniel P. Berrangé [Tue, 24 May 2022 14:44:55 +0000 (15:44 +0100)]
target/arm: display deprecation status in '-cpu help'

When the user queries CPU models via QMP there is a 'deprecated' flag
present, however, this is not done for the CLI '-cpu help' command.

Reviewed-by: Cornelia Huck <cohuck@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
21 months agotarget/s390x: display deprecation status in '-cpu help'
Daniel P. Berrangé [Tue, 24 May 2022 14:44:55 +0000 (15:44 +0100)]
target/s390x: display deprecation status in '-cpu help'

When the user queries CPU models via QMP there is a 'deprecated' flag
present, however, this is not done for the CLI '-cpu help' command.

Reviewed-by: Cornelia Huck <cohuck@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
21 months agotarget/i386: display deprecation status in '-cpu help'
Daniel P. Berrangé [Tue, 24 May 2022 14:44:55 +0000 (15:44 +0100)]
target/i386: display deprecation status in '-cpu help'

When the user queries CPU models via QMP there is a 'deprecated' flag
present, however, this is not done for the CLI '-cpu help' command.

Reviewed-by: Cornelia Huck <cohuck@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
21 months agoQIOChannelSocket: Add support for MSG_ZEROCOPY + IPV6
Leonardo Bras [Thu, 4 Aug 2022 07:10:43 +0000 (04:10 -0300)]
QIOChannelSocket: Add support for MSG_ZEROCOPY + IPV6

For using MSG_ZEROCOPY, there are two steps:
1 - io_writev() the packet, which enqueues the packet for sending, and
2 - io_flush(), which gets confirmation that all packets got correctly sent

Currently, if MSG_ZEROCOPY is used to send packets over IPV6, no error will
be reported in (1), but it will fail in the first time (2) happens.

This happens because (2) currently checks for cmsg_level & cmsg_type
associated with IPV4 only, before reporting any error.

Add checks for cmsg_level & cmsg_type associated with IPV6, and thus enable
support for MSG_ZEROCOPY + IPV6

Fixes: 2bc58ffc29 ("QIOChannelSocket: Implement io_writev zero copy flag & io_flush for CONFIG_LINUX")
Signed-off-by: Leonardo Bras <leobras@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
21 months agodocs: build-platforms: Clarify stance on minor releases and backports
Andrea Bolognani [Wed, 20 Apr 2022 16:03:11 +0000 (18:03 +0200)]
docs: build-platforms: Clarify stance on minor releases and backports

These changes match those made in the following libvirt commits:

  2ac78307af docs: Clarify our stance on backported packages
  78cffd450a docs: Spell out our policy concerning minor releases

Since QEMU's platform support policy is based on libvirt's, it
makes sense to mirror these recent changes made to the latter.

The policy is not altered significantly - we're simply spelling
out some rules that were likely already being implicitly
enforced.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
21 months agoMerge tag 'trivial-branch-for-7.1-pull-request' of https://gitlab.com/laurent_vivier...
Richard Henderson [Fri, 5 Aug 2022 00:21:13 +0000 (17:21 -0700)]
Merge tag 'trivial-branch-for-7.1-pull-request' of https://gitlab.com/laurent_vivier/qemu into staging

Pull request trivial branch 20220804

# -----BEGIN PGP SIGNATURE-----
#
# iQJGBAABCAAwFiEEzS913cjjpNwuT1Fz8ww4vT8vvjwFAmLsHD8SHGxhdXJlbnRA
# dml2aWVyLmV1AAoJEPMMOL0/L748y7AP/iXRxiqvnb478I+OuOPRu37PaBEfU3n4
# Ry4xr1VT+9GV3MKBK1icA065+tTmW4s1ANJBihhGgn0S1oMiSJQk6esAKtjGsdt0
# OdWPPxVHN2XMs0UgwnONjzgSCbS5boLPK6wk+jMoyb3Vry+moa7JIbRr1ynlWOdN
# 3S3rDTsyOX0gvuNOjht56g5aGRnnPqU3qIU6AdIOxpZxpb4dHi3g+UDAB5APCZss
# oUZonuBeiSA+1T2XJc9opNdA56s8ObO41TJ1vMqt4TboYWUo+VXZf5Y21wE85Cx/
# qUtNiY7rCfBA8EdjmvkunmV0jIc9TghWCBTh3JMWp756dvwIpwl4eWnODFUwyhZs
# S4EAlPgHEjzqi6dbuKb+MNDkQKjUjP8gDn8ZVPQT+QLl0yjY9sOasKqkI0xnZDfI
# NVVIhUjpwWfC9jJL7M+ML6+Tg16UpH4vOq9nySZ3G/z61P1+uXnI/M2Fx5LxoELQ
# Z9eHzphbXgyGialt+Yin0A07rOYG9oRgAKGc2e0RgEPFSO8c6kcy+DdoVgz87xCC
# PwrfNs/s6vzH11a3MPkYhTadVvaDIXbPgkRdUNKPyaGLvSjkrQ7aMCCGT0dCfDAq
# 00SAq+KMaSdL9VDgtipGcDOGwbLpI9ixNXvMPNrfVu+Qa6VcZO6synwWaeTMnxzf
# tx4tSb/W4nB3
# =y8/X
# -----END PGP SIGNATURE-----
# gpg: Signature made Thu 04 Aug 2022 12:21:35 PM PDT
# gpg:                using RSA key CD2F75DDC8E3A4DC2E4F5173F30C38BD3F2FBE3C
# gpg:                issuer "laurent@vivier.eu"
# gpg: Good signature from "Laurent Vivier <lvivier@redhat.com>" [undefined]
# gpg:                 aka "Laurent Vivier <laurent@vivier.eu>" [undefined]
# gpg:                 aka "Laurent Vivier (Red Hat) <lvivier@redhat.com>" [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: CD2F 75DD C8E3 A4DC 2E4F  5173 F30C 38BD 3F2F BE3C

* tag 'trivial-branch-for-7.1-pull-request' of https://gitlab.com/laurent_vivier/qemu:
  include/qemu/host-utils.h: Simplify the compiler check in mulu128()
  ppc: Remove redundant macro MSR_BOOK3S_MASK.
  docs/about/removed-features: Move the -soundhw into the right section
  vdpa: Fix file descriptor leak on get features error
  README.rst: fix link formatting

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
21 months agoMerge tag 'block-pull-request' of https://gitlab.com/stefanha/qemu into staging
Richard Henderson [Thu, 4 Aug 2022 21:06:17 +0000 (14:06 -0700)]
Merge tag 'block-pull-request' of https://gitlab.com/stefanha/qemu into staging

Pull request

- Format string portability fix in virtiofsd

# -----BEGIN PGP SIGNATURE-----
#
# iQEzBAABCAAdFiEEhpWov9P5fNqsNXdanKSrs4Grc8gFAmLsF9sACgkQnKSrs4Gr
# c8hAgwf/QPdBt6F1kBZTlSSt2nV2VAlX9HxsWAE5tSbtUTNS9Xr+avX6MHljAU20
# WN+zZ+4cUHjIqtt6NueqkTczV5PqccvB6H9Cs0FdkKH8unyMSHvSRNuRlAG+LgMF
# YQdHGGc9tvcIACz4GwWfzXJ/FsaoFHw7qTX3AUxe9nmlZnbB7cdl4Z7v6CQZ6kFL
# bfXCd2bXcw2XosykGijsiiJ5IV+nshchaVA01DbO+w/KeLaGJgUbiEB6unMGUIBL
# IMxy9VaP2AS44cGqNkFfWIm2tCfE0uT2qhca4BMk0kXQlwoBAuFGHuGHhbH0dU+w
# fFN+lSaLs0oBGo1G0Mw+ImLF9XymAw==
# =k1jb
# -----END PGP SIGNATURE-----
# gpg: Signature made Thu 04 Aug 2022 12:02:51 PM PDT
# gpg:                using RSA key 8695A8BFD3F97CDAAC35775A9CA4ABB381AB73C8
# gpg: Good signature from "Stefan Hajnoczi <stefanha@redhat.com>" [full]
# gpg:                 aka "Stefan Hajnoczi <stefanha@gmail.com>" [full]

* tag 'block-pull-request' of https://gitlab.com/stefanha/qemu:
  virtiofsd: Fix format strings

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
21 months agoMerge tag 'pull-ppc-20220804' of https://gitlab.com/danielhb/qemu into staging
Richard Henderson [Thu, 4 Aug 2022 18:47:58 +0000 (11:47 -0700)]
Merge tag 'pull-ppc-20220804' of https://gitlab.com/danielhb/qemu into staging

ppc patch queue for 2022-08-04:

In this short queue we have a fix in the sam460ex machine where we're
not storing all GPIO lines in sam460ex_init().

This is not causing problems (as far as we're aware of) at this moment,
but this is getting in the way of a ppc405 rework we want to do for 7.2,
so let's fix it now.

# -----BEGIN PGP SIGNATURE-----
#
# iHUEABYKAB0WIQQX6/+ZI9AYAK8oOBk82cqW3gMxZAUCYuwOIQAKCRA82cqW3gMx
# ZN+NAQDDOk4b79khltmrslo4Sa16nu/ARgqMGOsyy0Y5Whs9MgEAyiAVhpQ6C7Ok
# W2sHeUkv/ZvzWvE7LWXMPZehBgU9DgM=
# =QrsF
# -----END PGP SIGNATURE-----
# gpg: Signature made Thu 04 Aug 2022 11:21:21 AM PDT
# gpg:                using EDDSA key 17EBFF9923D01800AF2838193CD9CA96DE033164
# gpg: Good signature from "Daniel Henrique Barboza <danielhb413@gmail.com>" [unknown]
# 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: 17EB FF99 23D0 1800 AF28  3819 3CD9 CA96 DE03 3164

* tag 'pull-ppc-20220804' of https://gitlab.com/danielhb/qemu:
  hw/ppc: sam460ex.c: store all GPIO lines in mal_irqs[]

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
21 months agovirtiofsd: Fix format strings
Stefan Weil [Thu, 4 Aug 2022 07:48:33 +0000 (09:48 +0200)]
virtiofsd: Fix format strings

Signed-off-by: Stefan Weil <sw@weilnetz.de>
Message-Id: <20220804074833.892604-1-sw@weilnetz.de>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
21 months agohw/ppc: sam460ex.c: store all GPIO lines in mal_irqs[]
Daniel Henrique Barboza [Wed, 3 Aug 2022 23:32:04 +0000 (20:32 -0300)]
hw/ppc: sam460ex.c: store all GPIO lines in mal_irqs[]

We're not storing all GPIO lines we're retrieving with
qdev_get_gpio_in() in mal_irqs[]. We're storing just the last one in the
first index:

    for (i = 0; i < ARRAY_SIZE(mal_irqs); i++) {
        mal_irqs[0] = qdev_get_gpio_in(uic[2], 3 + i);
    }
    ppc4xx_mal_init(env, 4, 16, mal_irqs);

mal_irqs is used in ppc4xx_mal_init() to assign the IRQs to MAL:

    for (i = 0; i < 4; i++) {
        mal->irqs[i] = irqs[i];
    }

Since only irqs[0] has been initialized, mal->irqs[1,2,3] are being
zeroed.

This doesn´t seem to trigger any apparent issues at this moment, but
Cedric's QOMification of the MAL device [1] is executing a
sysbus_connect_irq() that will fail if we do not store all GPIO lines
properly.

[1] https://lists.gnu.org/archive/html/qemu-devel/2022-08/msg00497.html

Cc: Peter Maydell <peter.maydell@linaro.org>
Cc: BALATON Zoltan <balaton@eik.bme.hu>
Fixes: 706e944206d7 ("hw/ppc/sam460ex: Drop use of ppcuic_init()")
Acked-by: BALATON Zoltan <balaton@eik.bme.hu>
Reviewed-by: Cédric Le Goater <clg@kaod.org>
Message-Id: <20220803233204.2724202-1-danielhb413@gmail.com>
Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
21 months agoinclude/qemu/host-utils.h: Simplify the compiler check in mulu128()
Thomas Huth [Thu, 21 Jul 2022 07:48:09 +0000 (09:48 +0200)]
include/qemu/host-utils.h: Simplify the compiler check in mulu128()

We currently require at least GCC 7.4 or Clang 6.0 for compiling QEMU.
GCC has __builtin_mul_overflow since version 5 already, and Clang 6.0
also provides this built-in function (see its documentation on this page:
https://releases.llvm.org/6.0.0/tools/clang/docs/LanguageExtensions.html ).
So we can simplify the #if statement here.

Signed-off-by: Thomas Huth <thuth@redhat.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20220721074809.1513357-1-thuth@redhat.com>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
21 months agoppc: Remove redundant macro MSR_BOOK3S_MASK.
Yonggang Luo [Thu, 28 Jul 2022 20:11:35 +0000 (04:11 +0800)]
ppc: Remove redundant macro MSR_BOOK3S_MASK.

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com>
Message-Id: <20220728201135.223-1-luoyonggang@gmail.com>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
21 months agodocs/about/removed-features: Move the -soundhw into the right section
Thomas Huth [Tue, 2 Aug 2022 07:56:11 +0000 (09:56 +0200)]
docs/about/removed-features: Move the -soundhw into the right section

The note about the removal of '-soundhw' has been accidentally added
to the section of removed "linux-user mode CPUs" ... it should reside
in the section about removed "System emulator command line arguments"
instead.

Fixes: 039a68373c ("introduce -audio as a replacement for -soundhw")
Signed-off-by: Thomas Huth <thuth@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Reviewed-by: Christian Schoenebeck <qemu_oss@crudebyte.com>
Message-Id: <20220802075611.346835-1-thuth@redhat.com>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
21 months agovdpa: Fix file descriptor leak on get features error
Eugenio Pérez [Tue, 2 Aug 2022 11:24:46 +0000 (13:24 +0200)]
vdpa: Fix file descriptor leak on get features error

File descriptor vdpa_device_fd is not free in the case of returning
error from vhost_vdpa_get_features. Fixing it by making all errors go to
the same error path.

Resolves: Coverity CID 1490785
Fixes: 8170ab3f43 ("vdpa: Extract get features part from vhost_vdpa_get_max_queue_pairs")
Signed-off-by: Eugenio Pérez <eperezma@redhat.com>
Reviewed-by: Laurent Vivier <lvivier@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Message-Id: <20220802112447.249436-2-eperezma@redhat.com>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
21 months agoREADME.rst: fix link formatting
Cornelia Huck [Wed, 3 Aug 2022 09:02:50 +0000 (11:02 +0200)]
README.rst: fix link formatting

Make the links render correctly.

Signed-off-by: Cornelia Huck <cohuck@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Message-Id: <20220803090250.136556-1-cohuck@redhat.com>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
21 months agoMerge tag 'linux-user-for-7.1-pull-request' of https://gitlab.com/laurent_vivier...
Richard Henderson [Wed, 3 Aug 2022 15:32:44 +0000 (08:32 -0700)]
Merge tag 'linux-user-for-7.1-pull-request' of https://gitlab.com/laurent_vivier/qemu into staging

Pull request linux-user 20220803

# -----BEGIN PGP SIGNATURE-----
#
# iQJGBAABCAAwFiEEzS913cjjpNwuT1Fz8ww4vT8vvjwFAmLqjIMSHGxhdXJlbnRA
# dml2aWVyLmV1AAoJEPMMOL0/L748bpAP/1HW4wQztNCDL2epXGtDMTHFIjsLlc05
# h/3BwnXXXbRv/m4+IEJLITI5WpyZ24CGgA5kIFPRDxLCIHxcTo5etzqkJzxhnRvU
# MNP3m8L5gSAUUZhD8Xw2b95V8vOv4cu8J+sgub8ZaRXJpcHK1cuCF43OeI3bBuoz
# HNVY8XHl0E46JyXQmK9/phBRSK8INhlMIORd+k/GzSx7+9/UdIqTj1kVpdgbQ8we
# GqrnVW9hYA2T2vUL3SEV8t6GE6lSGRr9bvsyRRfLxJanUEQbGmbJPvqBwjamRwUF
# xZOBou/cYQOoI9AVku9bL+h2ITGfrfNZ8Oo7r7oOrz+ZjBfL9hUQqhFhI/oI265n
# 4ivzdOcsXH6OT7X+JdZRvyv6pxVL7ycu2KCKvmnNvQSocGHT1OvFqIHAWd+NAdEr
# c4q1ob1QdUfZjrzjzLR/qY2NPZat1Ge5lSIXOwC1G3T5umuw8cV7BV9KJJRoQXfE
# AWeXsLKqqByQ59z+qObnFIkUXLaUOzKMjHNFpDGSqk+dzXxQYJtBn+b8ZLoL9MLa
# miIN9imVzI2gzolIBz9Za2pnBw72bIR2PdXd3zfKH0cqmytOhKlMIEK4KJcB6kMB
# CNAbszUwrmBSopGGryf+hLMk9VsPLVUg+Yqnc6/GLY8LF9d8Xr5rd8UzelYowBuh
# 3UR/V06U2Skv
# =41sQ
# -----END PGP SIGNATURE-----
# gpg: Signature made Wed 03 Aug 2022 07:56:03 AM PDT
# gpg:                using RSA key CD2F75DDC8E3A4DC2E4F5173F30C38BD3F2FBE3C
# gpg:                issuer "laurent@vivier.eu"
# gpg: Good signature from "Laurent Vivier <lvivier@redhat.com>" [undefined]
# gpg:                 aka "Laurent Vivier <laurent@vivier.eu>" [undefined]
# gpg:                 aka "Laurent Vivier (Red Hat) <lvivier@redhat.com>" [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: CD2F 75DD C8E3 A4DC 2E4F  5173 F30C 38BD 3F2F BE3C

* tag 'linux-user-for-7.1-pull-request' of https://gitlab.com/laurent_vivier/qemu:
  linux-user: Use memfd for open syscall emulation
  linux-user: Do not treat madvise()'s advice as a bitmask
  linux-user/flatload.c: Fix setting of image_info::end_code

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
21 months agoUpdate version for v7.1.0-rc1 release
Richard Henderson [Wed, 3 Aug 2022 03:12:42 +0000 (20:12 -0700)]
Update version for v7.1.0-rc1 release

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
21 months agoMerge tag 'pull-semi-20220802' of https://gitlab.com/rth7680/qemu into staging
Richard Henderson [Wed, 3 Aug 2022 00:59:36 +0000 (17:59 -0700)]
Merge tag 'pull-semi-20220802' of https://gitlab.com/rth7680/qemu into staging

Fix mips semihosting regression.

# -----BEGIN PGP SIGNATURE-----
#
# iQFRBAABCgA7FiEEekgeeIaLTbaoWgXAZN846K9+IV8FAmLpx/EdHHJpY2hhcmQu
# aGVuZGVyc29uQGxpbmFyby5vcmcACgkQZN846K9+IV8d2Qf+PO1v5r5HDZYVYyhZ
# moew0E+XKv+Tzw9zjHlarC75pxMfFWbkUzKXvrsvGRg/MKo+VQyLC65PuxdtMQsr
# FSHF0KQpa0XRb7fZ+HozZE5ufmXHdtEiiXxDe0hvTt7MVRHqtonECYA2Ian3cZra
# bTJ1Iwn9mVmaWWG1JqCyvDO+PszAAQO8wCc+ADso7yt5C3BJLfWUmjjPRMWF2dHu
# 9mz15ii6kF73833btwb1/LuxtPy9UxxpHKTA8Xqpjb7ZXOZU67e0Z52CMgNBcB/U
# aeo1GUZqDKi7swI9Ilrl5ZUAQ5PsS76ePjr4j4d6aTp0ry+1axdwvkcbJnW1okMe
# qS242Q==
# =5DLw
# -----END PGP SIGNATURE-----
# gpg: Signature made Tue 02 Aug 2022 05:57:21 PM PDT
# gpg:                using RSA key 7A481E78868B4DB6A85A05C064DF38E8AF7E215F
# gpg:                issuer "richard.henderson@linaro.org"
# gpg: Good signature from "Richard Henderson <richard.henderson@linaro.org>" [ultimate]

* tag 'pull-semi-20220802' of https://gitlab.com/rth7680/qemu:
  target/mips: Advance pc after semihosting exception

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
21 months agotarget/mips: Advance pc after semihosting exception
Richard Henderson [Sat, 30 Jul 2022 02:17:02 +0000 (19:17 -0700)]
target/mips: Advance pc after semihosting exception

Delay generating the exception until after we know the
insn length, and record that length in env->error_code.

Fixes: 8ec7e3c53d4 ("target/mips: Use an exception for semihosting")
Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1126
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
21 months agoMerge tag 'pull-migration-20220802c' of https://gitlab.com/dagrh/qemu into staging
Richard Henderson [Tue, 2 Aug 2022 17:03:18 +0000 (10:03 -0700)]
Merge tag 'pull-migration-20220802c' of https://gitlab.com/dagrh/qemu into staging

Migration fixes pull 2022-08-02

Small migration (and virtiofsd) fixes.

Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
# -----BEGIN PGP SIGNATURE-----
#
# iQIzBAABCAAdFiEERfXHG0oMt/uXep+pBRYzHrxb/ecFAmLpR80ACgkQBRYzHrxb
# /edDiQ//VWx6VFpq3j/cFe+aZudCJWbHD5HI8e0wABoCAMzfYnRRq5pMP7DaVy/x
# Su0Lr6AO7vqSZzAqjsSm4DLQJHYM28YXxo0un/aJvnOZFGiXJzFe9OIE1LUwekQe
# g6OrsyhOAf7wHY9MsoC6RRitKdSo/z7YZYZY6wEv2cyIJDda1+b9jpD6mWADQ2z1
# 7eU5T0Kxfg2nArgF1MwgMWzPzjw4xN6BbqLLkWKdf3RD8Vl0BOdwxfXPDECqouUi
# 08vcNB4jRV7WSJ5mnOEW2EMQvgmUkSe9HUhMhkD39LmbeeJ4a84oRoKZkQuvrb1h
# qsbwoMlWhg8nxqyqB7ChTUw/27V3lfzlr/k6r6ExXsDL+zUwJXg4LrFuzyaqWdb2
# vH5cp/mZkSho+PcIF+KeFQMEj51yV/y0ucU4JWwyyKCnGoJYofmZnBWG2czGOotq
# 2qX44srufFkTDISpZ+NVUsaFl06nTrS7W9aTZdISYpGuxzHphOtrnYj8Pqqdwv4B
# F6CyNmUcVbLLnGIRASYYEYMByfptmiRQgGhOtv1IJyYgzIgg0PJQUR5Dbjgb96vR
# 0jhvLucKAkBrQaxkxxMVuIUJ9JdLeVbyEaSrc38qfr3FinRt8rgNr0mnFPAcNS7s
# oAy4Ei9jZ3MoAITs/JD+ODglC/f58o0oHaSA6RFrOxmxxkrXowk=
# =b2BF
# -----END PGP SIGNATURE-----
# gpg: Signature made Tue 02 Aug 2022 08:50:37 AM PDT
# gpg:                using RSA key 45F5C71B4A0CB7FB977A9FA90516331EBC5BFDE7
# gpg: Good signature from "Dr. David Alan Gilbert (RH2) <dgilbert@redhat.com>" [full]

* tag 'pull-migration-20220802c' of https://gitlab.com/dagrh/qemu:
  virtiofsd: Disable killpriv_v2 by default
  migration: Define BLK_MIG_BLOCK_SIZE as unsigned long long
  migration: Assert that migrate_multifd_compression() returns an in-range value
  Revert "migration: Simplify unqueue_page()"
  migration: add remaining params->has_* = true in migration_instance_init()

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
21 months agovirtiofsd: Disable killpriv_v2 by default
Vivek Goyal [Fri, 29 Jul 2022 13:17:06 +0000 (09:17 -0400)]
virtiofsd: Disable killpriv_v2 by default

We are having bunch of issues with killpriv_v2 enabled by default. First
of all it relies on clearing suid/sgid bits as needed by dropping
capability CAP_FSETID. This does not work for remote filesystems like
NFS (and possibly others).

Secondly, we are noticing other issues related to clearing of SGID
which leads to failures for xfstests generic/355 and generic/193.

Thirdly, there are other issues w.r.t caching of metadata (suid/sgid)
bits in fuse client with killpriv_v2 enabled. Guest can cache that
data for sometime even if cleared on server.

Second and Third issue are fixable. Just that it might take a little
while to get it fixed in kernel. First one will probably not see
any movement for a long time.

Given these issues, killpriv_v2 does not seem to be a good candidate
for enabling by default. We have already disabled it by default in
rust version of virtiofsd.

Hence this patch disabled killpriv_v2 by default. User can choose to
enable it by passing option "-o killpriv_v2".

Signed-off-by: Vivek Goyal <vgoyal@redhat.com>
Message-Id: <YuPd0itNIAz4tQRt@redhat.com>
Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
21 months agomigration: Define BLK_MIG_BLOCK_SIZE as unsigned long long
Peter Maydell [Thu, 21 Jul 2022 11:52:07 +0000 (12:52 +0100)]
migration: Define BLK_MIG_BLOCK_SIZE as unsigned long long

When we use BLK_MIG_BLOCK_SIZE in expressions like
block_mig_state.submitted * BLK_MIG_BLOCK_SIZE, this multiplication
is done as 32 bits, because both operands are 32 bits.  Coverity
complains about possible overflows because we then accumulate that
into a 64 bit variable.

Define BLK_MIG_BLOCK_SIZE as unsigned long long using the ULL suffix.
The only two current uses of it with this problem are both in
block_save_pending(), so we could just cast to uint64_t there, but
using the ULL suffix is simpler and ensures that we don't
accidentally introduce new variants of the same issue in future.

Resolves: Coverity CID 14871361487175
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Message-Id: <20220721115207.729615-3-peter.maydell@linaro.org>
Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Reviewed-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
21 months agomigration: Assert that migrate_multifd_compression() returns an in-range value
Peter Maydell [Thu, 21 Jul 2022 11:52:06 +0000 (12:52 +0100)]
migration: Assert that migrate_multifd_compression() returns an in-range value

Coverity complains that when we use the return value from
migrate_multifd_compression() as an array index:
  multifd_recv_state->ops = multifd_ops[migrate_multifd_compression()];

that this might overrun the array (which is declared to have size
MULTIFD_COMPRESSION__MAX).  This is because the function return type
is MultiFDCompression, which is an autogenerated enum.  The code
generator includes the "one greater than the maximum possible value"
MULTIFD_COMPRESSION__MAX in the enum, even though this is not
actually a valid value for the enum, and this makes Coverity think
that migrate_multifd_compression() could return that __MAX value and
index off the end of the array.

Suppress the Coverity error by asserting that the value we're going
to return is within range.

Resolves: Coverity CID 14872391487254
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Message-Id: <20220721115207.729615-2-peter.maydell@linaro.org>
Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Reviewed-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
21 months agoRevert "migration: Simplify unqueue_page()"
Thomas Huth [Tue, 2 Aug 2022 06:19:49 +0000 (08:19 +0200)]
Revert "migration: Simplify unqueue_page()"

This reverts commit cfd66f30fb0f735df06ff4220e5000290a43dad3.

The simplification of unqueue_page() introduced a bug that sometimes
breaks migration on s390x hosts.

The problem is not fully understood yet, but since we are already in
the freeze for QEMU 7.1 and we need something working there, let's
revert this patch for the upcoming release. The optimization can be
redone later again in a proper way if necessary.

Buglink: https://bugzilla.redhat.com/show_bug.cgi?id=2099934
Signed-off-by: Thomas Huth <thuth@redhat.com>
Message-Id: <20220802061949.331576-1-thuth@redhat.com>
Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
21 months agomigration: add remaining params->has_* = true in migration_instance_init()
Leonardo Bras [Tue, 26 Jul 2022 01:02:35 +0000 (22:02 -0300)]
migration: add remaining params->has_* = true in migration_instance_init()

Some of params->has_* = true are missing in migration_instance_init, this
causes migrate_params_check() to skip some tests, allowing some
unsupported scenarios.

Fix this by adding all missing params->has_* = true in
migration_instance_init().

Fixes: 69ef1f36b0 ("migration: define 'tls-creds' and 'tls-hostname' migration parameters")
Fixes: 1d58872a91 ("migration: do not wait for free thread")
Fixes: d2f1d29b95 ("migration: add support for a "tls-authz" migration parameter")
Signed-off-by: Leonardo Bras <leobras@redhat.com>
Message-Id: <20220726010235.342927-1-leobras@redhat.com>
Reviewed-by: Peter Xu <peterx@redhat.com>
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
21 months agoMerge tag 'for-upstream' of git://repo.or.cz/qemu/kevin into staging
Richard Henderson [Tue, 2 Aug 2022 13:52:05 +0000 (06:52 -0700)]
Merge tag 'for-upstream' of git://repo.or.cz/qemu/kevin into staging

Block layer patches

- libvduse: Coverity fixes
- hd-geometry: Fix ignored bios-chs-trans setting
- io_uring: Fix compiler warning (missing #include)
- main loop: add missing documentation links to GS/IO macros
- qemu-iotests: Discard stderr when probing devices

# -----BEGIN PGP SIGNATURE-----
#
# iQJFBAABCAAvFiEE3D3rFZqa+V09dFb+fwmycsiPL9YFAmLpKDURHGt3b2xmQHJl
# ZGhhdC5jb20ACgkQfwmycsiPL9ZMcA//buzWQl/AFL2VT5Fy3WpFCYDVp5mTPJ2q
# bgkhCpn6i7UXIkML53hygfm7LN9Fj8Q8Ld4ljkETzljJajS3zsXvyY6bgNevQutX
# 8WvkcUNWMb96DEgetInak2ebH6lhti6/V7lBfjNFG1yC2s8l+JoWIPqWfJqohdiN
# D4+loa/wQx1ZS3TgKq8zAxfi5qbbGxRTZQUvuCJNYRryRQmJsZH380DzlIqkRJWt
# b3rM7m9ElSpmcmwmztWkdK4E/2VYGknUQOnRpY0AUSUTcm/kaP7EVwh61+TdjlKL
# NZxvZ08kenGFTBEA9z3ahnggcLypj4IYU3DB29CiJLjMjCb0s7tMwc8USYajN+GA
# iDqkbK14mDd8auRDVbVcmnq34xzS0rJocpzT0Jo9zYo7oGe/r+JjaVWmWq0pZ2SE
# QQuSPZXZokUdpL6E5X05+JZ+u6+G+iQz9UOhNpwmKB1ajiXUVKIst/SctpyKedOr
# cJWB34tQxQIFB57s6K7wVMbSWPIumTwQc08EX0HoicT9pUMN7s+Z1jrCufudZ0ot
# gx95v7gBDZZDsJim5qi3znA8tqnUmtL0yxkUVgv7LdQfIleEnEFfutFJpq/7VFe9
# WRzXBQJPU451jF7Gvj/StA3+05qMr22mXW4CX6t96Ud6QHiR0mUBSGPRzYusIV4d
# KYOjySU7cOg=
# =axCN
# -----END PGP SIGNATURE-----
# gpg: Signature made Tue 02 Aug 2022 06:35:49 AM PDT
# gpg:                using RSA key DC3DEB159A9AF95D3D7456FE7F09B272C88F2FD6
# gpg:                issuer "kwolf@redhat.com"
# gpg: Good signature from "Kevin Wolf <kwolf@redhat.com>" [full]

* tag 'for-upstream' of git://repo.or.cz/qemu/kevin:
  main loop: add missing documentation links to GS/IO macros
  qemu-iotests: Discard stderr when probing devices
  hw/block/hd-geometry: Do not override specified bios-chs-trans
  libvduse: Pass positive value to strerror()
  libvduse: Replace strcpy() with strncpy()
  libvduse: Fix the incorrect function name
  block/io_uring: add missing include file

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
21 months agolinux-user: Use memfd for open syscall emulation
Rainer Müller [Fri, 29 Jul 2022 15:49:51 +0000 (17:49 +0200)]
linux-user: Use memfd for open syscall emulation

For certain paths in /proc, the open syscall is intercepted and the
returned file descriptor points to a temporary file with emulated
contents.

If TMPDIR is not accessible or writable for the current user (for
example in a read-only mounted chroot or container) tools such as ps
from procps may fail unexpectedly. Trying to read one of these paths
such as /proc/self/stat would return an error such as ENOENT or EROFS.

To relax the requirement on a writable TMPDIR, use memfd_create()
instead to create an anonymous file and return its file descriptor.

Signed-off-by: Rainer Müller <raimue@codingfarm.de>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20220729154951.76268-1-raimue@codingfarm.de>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
21 months agomain loop: add missing documentation links to GS/IO macros
Emanuele Giuseppe Esposito [Thu, 9 Jun 2022 12:22:06 +0000 (08:22 -0400)]
main loop: add missing documentation links to GS/IO macros

If we go directly to GLOBAL_STATE_CODE, IO_CODE or IO_OR_GS_CODE
definition, we just find that they "mark and check that the function
is part of the {category} API".
However, ther is no definition on what {category} API is, they are
in include/block/block-*.h
Therefore, add a comment that refers to such documentation.

Signed-off-by: Emanuele Giuseppe Esposito <eesposit@redhat.com>
Message-Id: <20220609122206.1016936-1-eesposit@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
21 months agoqemu-iotests: Discard stderr when probing devices
Cole Robinson [Sun, 5 Jun 2022 14:57:17 +0000 (10:57 -0400)]
qemu-iotests: Discard stderr when probing devices

qemu-iotests fails in the following setup:

  ./configure --enable-modules --enable-smartcard \
      --target-list=x86_64-softmmu,s390x-softmmu
  make
  cd build
  QEMU_PROG=`pwd`/s390x-softmmu/qemu-system-s390x \
      ../tests/check-block.sh qcow2
  ...
  --- /home/crobinso/src/qemu/tests/qemu-iotests/127.out
  +++ /home/crobinso/src/qemu/build/tests/qemu-iotests/scratch/127.out.bad
  @@ -1,4 +1,18 @@
   QA output created by 127
  +Failed to open module: /home/crobinso/src/qemu/build/hw-usb-smartcard.so: undefined symbol: ccid_card_ccid_attach
  ...
  --- /home/crobinso/src/qemu/tests/qemu-iotests/267.out
  +++ /home/crobinso/src/qemu/build/tests/qemu-iotests/scratch/267.out.bad
  @@ -1,4 +1,11 @@
   QA output created by 267
  +Failed to open module: /home/crobinso/src/qemu/build/hw-usb-smartcard.so: undefined symbol: ccid_card_ccid_attach

The stderr spew is its own known issue, but seems like iotests should
be discarding stderr in this case.

Signed-off-by: Cole Robinson <crobinso@redhat.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
21 months agohw/block/hd-geometry: Do not override specified bios-chs-trans
Lev Kujawski [Thu, 7 Jul 2022 20:40:45 +0000 (20:40 +0000)]
hw/block/hd-geometry: Do not override specified bios-chs-trans

For small disk images (<4 GiB), QEMU and SeaBIOS default to the
LARGE/ECHS disk translation method, but it is not uncommon for other
BIOS software to use LBA in these cases as well.  Some operating
system boot loaders (e.g., NT 4) do not handle LARGE translations
outside of fixed configurations.  See, e.g., Q154052:

"When starting an x86 based computer, Ntdetect.com retrieves and
stores Interrupt 13 information. . . If the disk controller is using a
32 sector/64 head translation scheme, this boundary will be 1 GB. If
the controller uses 63 sector/255 head translation [AUTHOR: i.e.,
LBA], the limit will be 4 GB."

To accommodate these situations, hd_geometry_guess() now follows the
disk translation specified by the user even when the ATA disk geometry
is guessed.

hd_geometry_guess():
* Only set the disk translation when translation is AUTO.
* Show the soon-to-be active translation (*ptrans) in the trace rather
  than what was guessed.

Resolves: https://gitlab.com/qemu-project/qemu/-/issues/56
Buglink: https://bugs.launchpad.net/qemu/+bug/1745312
Signed-off-by: Lev Kujawski <lkujaw@member.fsf.org>
Message-Id: <20220707204045.999544-1-lkujaw@member.fsf.org>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
21 months agolibvduse: Pass positive value to strerror()
Xie Yongji [Wed, 6 Jul 2022 09:56:24 +0000 (17:56 +0800)]
libvduse: Pass positive value to strerror()

The value passed to strerror() should be positive.
So let's fix it.

Fixes: Coverity CID 1490226, 1490223
Signed-off-by: Xie Yongji <xieyongji@bytedance.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Message-Id: <20220706095624.328-4-xieyongji@bytedance.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
21 months agolibvduse: Replace strcpy() with strncpy()
Xie Yongji [Wed, 6 Jul 2022 09:56:23 +0000 (17:56 +0800)]
libvduse: Replace strcpy() with strncpy()

Coverity reported a string overflow issue since we copied
"name" to "dev_config->name" without checking the length.
This should be a false positive since we already checked
the length of "name" in vduse_name_is_invalid(). But anyway,
let's replace strcpy() with strncpy() (as a general library,
we'd like to minimize dependencies on other libraries, so we
didn't use g_strlcpy() here) to fix the coverity complaint.

Fixes: Coverity CID 1490224
Signed-off-by: Xie Yongji <xieyongji@bytedance.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Message-Id: <20220706095624.328-3-xieyongji@bytedance.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
21 months agolibvduse: Fix the incorrect function name
Xie Yongji [Wed, 6 Jul 2022 09:56:22 +0000 (17:56 +0800)]
libvduse: Fix the incorrect function name

In vduse_name_is_valid(), we actually check whether
the name is invalid or not. So let's change the
function name to vduse_name_is_invalid() to match
the behavior.

Signed-off-by: Xie Yongji <xieyongji@bytedance.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Message-Id: <20220706095624.328-2-xieyongji@bytedance.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
21 months agoblock/io_uring: add missing include file
Jinhao Fan [Thu, 21 Jul 2022 06:56:45 +0000 (14:56 +0800)]
block/io_uring: add missing include file

The commit "Use io_uring_register_ring_fd() to skip fd operations" uses
warn_report but did not include the header file "qemu/error-report.h".
This causes "error: implicit declaration of function ‘warn_report’".
Include this header file.

Fixes: e2848bc574 ("Use io_uring_register_ring_fd() to skip fd operations")
Signed-off-by: Jinhao Fan <fanjinhao21s@ict.ac.cn>
Message-Id: <20220721065645.577404-1-fanjinhao21s@ict.ac.cn>
Reviewed-by: Stefano Garzarella <sgarzare@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
22 months agoMerge tag 'pull-riscv-to-apply-20220802' of github.com:alistair23/qemu into staging
Richard Henderson [Tue, 2 Aug 2022 02:05:10 +0000 (19:05 -0700)]
Merge tag 'pull-riscv-to-apply-20220802' of github.com:alistair23/qemu into staging

Seventh RISC-V PR for QEMU 7.1

This is a second PR to go in for RC1. It fixes a bug we have had
for awhile, but it's a simple fix so let's pull it in for RC1.

* linux-user/riscv: Align signal frame to 16 bytes

# -----BEGIN PGP SIGNATURE-----
#
# iQEzBAABCAAdFiEE9sSsRtSTSGjTuM6PIeENKd+XcFQFAmLoWxwACgkQIeENKd+X
# cFTePAf8Ci1TmiEzZ8eZo/+3EGIU4sNk749bFUhkUeQa2fB8IwCBAOG4nMyX/DvT
# 4nmkzFjJIWu2FQ8KJ9oJPnb8kZD4fKsAPCUX7bDV9hk9Pv26ReZbgwUgme8v9ehM
# l28BH8zxvUAZgj3TIG96k+X/k9dBjPMvhmcukym+HSdznyCXiUEwENC5WIsI4ARC
# jK295wItcH23SMOSgvFYE/JUNxbTqNvBu76OaUqjnasNOC4QfcJK+HTU0Uu9tVIN
# CUrUjnu2sJApmFEyRfz4mQ+2DvINffXTtCvcyIhVF//EG698joFxcyi/cHLZBf7i
# h3WCBDHIINe1gZlmhWfpBDtRd9KQjQ==
# =o+Uw
# -----END PGP SIGNATURE-----
# gpg: Signature made Mon 01 Aug 2022 04:00:44 PM PDT
# gpg:                using RSA key F6C4AC46D4934868D3B8CE8F21E10D29DF977054
# gpg: Good signature from "Alistair Francis <alistair@alistair23.me>" [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: F6C4 AC46 D493 4868 D3B8  CE8F 21E1 0D29 DF97 7054

* tag 'pull-riscv-to-apply-20220802' of github.com:alistair23/qemu:
  linux-user/riscv: Align signal frame to 16 bytes

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
22 months agolinux-user/riscv: Align signal frame to 16 bytes
Richard Henderson [Fri, 29 Jul 2022 20:19:42 +0000 (13:19 -0700)]
linux-user/riscv: Align signal frame to 16 bytes

Follow the kernel's alignment, as we already noted.

Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1093
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
Message-Id: <20220729201942.30738-1-richard.henderson@linaro.org>
Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
22 months agoMerge tag 'pull-aspeed-20220801' of https://github.com/legoater/qemu into staging
Richard Henderson [Mon, 1 Aug 2022 20:55:11 +0000 (13:55 -0700)]
Merge tag 'pull-aspeed-20220801' of https://github.com/legoater/qemu into staging

aspeed queue:

* Fix ownership of RAM regions on the fby35 machine

# -----BEGIN PGP SIGNATURE-----
#
# iQIzBAABCAAdFiEEoPZlSPBIlev+awtgUaNDx8/77KEFAmLn1N8ACgkQUaNDx8/7
# 7KHaVA//eh5wIZKeg1Qit8dhVoPXcO7b97KFpBreyCkfdREJpoLjoFe4y+rnKhnL
# tJm6qx1YG5s0UN/ODcy4TyKV9CkpcjsRZ+BHuZ+jjiz3WzuarZUTbZx1jVSJP6z0
# xcXc3CucKe/yyidGV1gKGiWetuXv2F6nYHzfvJ4auei6Rga8rwmiN7Rqf3Qfh6Lw
# Islj/9axfLxGzuMV85uuRZdRrrlmTOjDgnF4mxwVXRrxjtLIaAbzKT6mc1p1FUry
# cuE7bDjbZoT7ftBn5y4gQXV38M3XcWzB1KvzMslldkccU7cTbJg8620KSNiscOkJ
# 03xEJiBJoAzy/X1PUmEODNYUV8a19xcsXEyqaRQiyYtO1XMBDcNkSaiaFacOnhFT
# UxabJf3qvzf1QwAmgxGUdbR5usNXsr8Yrnpf1lew7Mvr3SwOYVXqb/JPp+j7uoV3
# CVvvTFZm+hBQghaHC0wHBX+C3aLsTis4Jppn5loulo6fb9KZiosj2kPRwEIetVkt
# ZgkBOLWRWtizdWKM7HImt7F+v/r7ClFlwAIJj8QQV0HTtVZ+gM6MXWj5oczKENJ8
# vPkoP6AUoOWzKFEhBU5XtQ9DdwPSP9m6zAZXl4LD17tVPUPpsuSEDaxhH5hAEnIR
# 39Mgx7hoK0uLHhM02RrNodD/NDmrZCPV3PwZ979z0Q/C8dttRkY=
# =hAJg
# -----END PGP SIGNATURE-----
# gpg: Signature made Mon 01 Aug 2022 06:27:59 AM PDT
# 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

* tag 'pull-aspeed-20220801' of https://github.com/legoater/qemu:
  aspeed/fby35: Fix owner of the BMC RAM memory region
  aspeed: Remove unused fields from AspeedMachineState

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
22 months agoMerge tag 'pull-target-arm-20220801' of https://git.linaro.org/people/pmaydell/qemu...
Richard Henderson [Mon, 1 Aug 2022 19:00:08 +0000 (12:00 -0700)]
Merge tag 'pull-target-arm-20220801' of https://git.linaro.org/people/pmaydell/qemu-arm into staging

target-arm queue:
 * Fix KVM SVE ID register probe code

# -----BEGIN PGP SIGNATURE-----
#
# iQJNBAABCAA3FiEE4aXFk81BneKOgxXPPCUl7RQ2DN4FAmLn8rwZHHBldGVyLm1h
# eWRlbGxAbGluYXJvLm9yZwAKCRA8JSXtFDYM3seqD/sE4YU3qpovlyPhJJWsEFyH
# JRheAwddoj8P/ufOeJVPh85PqGH8zR6MSLSJqzz32ADrN56CFA56c0TRAoL7F6Ru
# iTibwP7hFloDxBCJIYVMZdbSw959LYADYHhdIN7UBkSryCoOC74AraUCwuYqzr9l
# jgh3lnvaH2kj5460XQQYPX4Pkf1jZIV83nhs9kh6GohhuHWtyz9UucDe8VcgMyl2
# 9jn7aobLWXI1LJyWTNYJHxQacGn4HK4HbVHczDRgf9PzmjliiTltGvol+T1XGyha
# TGHXMNnMTRbWFz7LCENfEYhup5ScuZbBr5fWh4sBveodczgOActNwmFuy1sempWo
# Cnzy/rwcNREj6EXoKvUkpATKuls9rtH9U4927mesxrk9S3bRJXU4C/EgpAn3qIBZ
# 1iFTgSq7eqX+BaYmG1/dtEK+vFX6mhpmKCMhQyRtSFHHibovvlANaNhOHgnPnS0m
# +Bb1pioolo31LLLxBpByOX/MxnXbG+GBnn2kmqX9MLkqamrYQq4g+ITUZcrLReId
# HmvBtYENoiXfReuvT/zRH1nBax97dKrluOgejco2bJrhiYaDgJ94jDMegdoR9mSl
# W/G3QHq18PJ5YOkrjmTn6IFjYNozLEvVqn5VwGXr6QZFxBuivAUoxOELrGULSlba
# OPTBWo2kAbJ8FvKOr3RzhQ==
# =hkV8
# -----END PGP SIGNATURE-----
# gpg: Signature made Mon 01 Aug 2022 08:35:24 AM PDT
# gpg:                using RSA key E1A5C593CD419DE28E8315CF3C2525ED14360CDE
# gpg:                issuer "peter.maydell@linaro.org"
# gpg: Good signature from "Peter Maydell <peter.maydell@linaro.org>" [full]
# gpg:                 aka "Peter Maydell <pmaydell@gmail.com>" [full]
# gpg:                 aka "Peter Maydell <pmaydell@chiark.greenend.org.uk>" [full]

* tag 'pull-target-arm-20220801' of https://git.linaro.org/people/pmaydell/qemu-arm:
  target/arm: Move sve probe inside kvm >= 4.15 branch
  target/arm: Set KVM_ARM_VCPU_SVE while probing the host
  target/arm: Use kvm_arm_sve_supported in kvm_arm_get_host_cpu_features

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
22 months agoMerge tag 'pull-request-2022-08-01' of https://gitlab.com/thuth/qemu into staging
Richard Henderson [Mon, 1 Aug 2022 17:22:00 +0000 (10:22 -0700)]
Merge tag 'pull-request-2022-08-01' of https://gitlab.com/thuth/qemu into staging

- Some fixes for various tests
- Improve wordings in some files

# -----BEGIN PGP SIGNATURE-----
#
# iQJFBAABCAAvFiEEJ7iIR+7gJQEY8+q5LtnXdP5wLbUFAmLn6aYRHHRodXRoQHJl
# ZGhhdC5jb20ACgkQLtnXdP5wLbWekg/+NVIT1jp3tcbfPIE6pB0vI/AhqN3i2hUd
# zfJ4V3rSe5tg54JpmuuSt542mp4BDM9bPfYcY/DYESWEtW0c9wv80iP/5LFdJF0G
# GYtk7Q4pRXvB32kF0v9OxjCEGPUeEqSRrDrsI/Ify5evEIhr55oHPnDjN/US1Bx+
# TIuVfmyz8jhSPHsUvZzfVyFxkHre1+BWDxgM3zxoHFIaWEscIPE1KhwRILbKIxWx
# MHpL8JLAneGFwljQoUAMCl7GzHkVna59RhqkbBJ+8iTaNGipQj9FhHZBo2CulO0J
# SR7scWowYN8Jt2FNMe3tcKM2xQn/2Fg2TEK4sp6q+hCXhJuvFfWFHBiFYTNpagFA
# LGgZmPfDr4uZtMEqY4AdEZdL14YZcoM9E/RpW7GhSvMHy73wOj16O8luH1bU0jtG
# 6X1VvAZlw8/Son1Tbq2CC6WejlMfJFXSzF6Fy6M7SflMPW44vJOs5uKdW405MYjE
# Pksbfz1rwoNfK+1qBNQop7SccgDRvPtlLf3lDAU9V/JHWVEITs1KTfyS+46U8jKA
# 9SVBzKuTpVd+aXvMgvMAmmqnyvUBPHJ9KcFq4vHNbIETsGaQsXu0Q6waBmpcK8YB
# KUL/g0EsdfhkpVVgKYZ4Bzj7shG6SKTdwc/lUcOt+wQuDrZZzaC+A2cu/6ReQN6T
# BIHtoaxTz8E=
# =K6RW
# -----END PGP SIGNATURE-----
# gpg: Signature made Mon 01 Aug 2022 07:56:38 AM PDT
# gpg:                using RSA key 27B88847EEE0250118F3EAB92ED9D774FE702DB5
# gpg:                issuer "thuth@redhat.com"
# gpg: Good signature from "Thomas Huth <th.huth@gmx.de>" [undefined]
# gpg:                 aka "Thomas Huth <thuth@redhat.com>" [undefined]
# gpg:                 aka "Thomas Huth <th.huth@posteo.de>" [unknown]
# gpg:                 aka "Thomas Huth <huth@tuxfamily.org>" [undefined]
# gpg: WARNING: This key is not certified with a trusted signature!
# gpg:          There is no indication that the signature belongs to the owner.
# Primary key fingerprint: 27B8 8847 EEE0 2501 18F3  EAB9 2ED9 D774 FE70 2DB5

* tag 'pull-request-2022-08-01' of https://gitlab.com/thuth/qemu:
  tests/qtest/migration-test: Run the dirty ring tests only with the x86 target
  trivial: Fix duplicated words
  misc: fix commonly doubled up words
  tests/unit/test-qga: Replace the word 'blacklist' in the guest agent unit test
  migration-test: Allow test to run without uffd
  migration-test: Use migrate_ensure_converge() for auto-converge
  tests/tcg/linux-test: Fix random hangs in test_socket

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
22 months agoMerge tag 'for-qemu-2022-08-01' of github.com:cminyard/qemu into staging
Richard Henderson [Mon, 1 Aug 2022 15:50:54 +0000 (08:50 -0700)]
Merge tag 'for-qemu-2022-08-01' of github.com:cminyard/qemu into staging

Add a change to make Coverity happy.

# -----BEGIN PGP SIGNATURE-----
#
# iQIzBAABCgAdFiEE/Q1c5nzg9ZpmiCaGYfOMkJGb/4EFAmLn2woACgkQYfOMkJGb
# /4HDxA/9EvFQCSHLrbfp5rR44PQOcLnFOPt5Gq9JUcGZ+6JfsKkEmLMhj004hLlK
# pby6b+dvSPgZr+vzzTeSViQFZqlEv5xK4ItH4Kv9jwigFDxzeiHbygxGdHGjO2so
# eMGhGawCN0/7ElDOMIp7guRdxfy/vv+zK+u6Yod5wbduzQbYz/rVeGF5N6hb7Nkn
# lM8+W+Uz1StatOj83m1K0YNWZSvQ3zKG2Oc0zSJAjvDCZr89ifJRJkp+U+GrM/Hw
# 1gFI5Jtm7THPfuzUm5popnOtD5sae6lx0r1JNFSmX+5/IpcTu+7UqJQi0ANLiJeq
# 2Fm4SOv6CqmDBtZY6KIfXkdZouKhunlUv/wEfAc2geZHSMNzn7LDAMNcLfjDZG1A
# PFTKyv1Spn1d7BI5aqnLvY39yojYYg8SY6uiRRLPd6xNIivsywg9fZN7XRRY7L6h
# VeIYxo65z4kjfTpx2tdspdUngKGheH/IOARLkkR/Xvx7acV9LC9Af0HEJz/IJxXY
# WYdsmzsDCVtphBRVUIxiWIgR5qk73rnDzYEkjevK8JzZUFf6qoTUlLcL0zpJqP1A
# 1J56MoHBzmsVZLuJl+jf6UrBfyDPFAsarERKlfh1H0/DySz1JutqVascPnh2ZPQz
# hx+Ye3xj69cg7a35Vb4cEjAu96ngeYE5a7isamyaYuBQ/ixmYTE=
# =97ZM
# -----END PGP SIGNATURE-----
# gpg: Signature made Mon 01 Aug 2022 06:54:18 AM PDT
# gpg:                using RSA key FD0D5CE67CE0F59A6688268661F38C90919BFF81
# gpg: Good signature from "Corey Minyard <cminyard@mvista.com>" [unknown]
# gpg:                 aka "Corey Minyard <minyard@acm.org>" [unknown]
# gpg:                 aka "Corey Minyard <corey@minyard.net>" [unknown]
# gpg:                 aka "Corey Minyard <minyard@mvista.com>" [unknown]
# 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: FD0D 5CE6 7CE0 F59A 6688  2686 61F3 8C90 919B FF81

* tag 'for-qemu-2022-08-01' of github.com:cminyard/qemu:
  ipmi:smbus: Add a check around a memcpy

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
22 months agotarget/arm: Move sve probe inside kvm >= 4.15 branch
Richard Henderson [Mon, 1 Aug 2022 15:21:18 +0000 (16:21 +0100)]
target/arm: Move sve probe inside kvm >= 4.15 branch

The test for the IF block indicates no ID registers are exposed, much
less host support for SVE.  Move the SVE probe into the ELSE block.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20220726045828.53697-4-richard.henderson@linaro.org
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
22 months agotarget/arm: Set KVM_ARM_VCPU_SVE while probing the host
Richard Henderson [Mon, 1 Aug 2022 15:21:18 +0000 (16:21 +0100)]
target/arm: Set KVM_ARM_VCPU_SVE while probing the host

Because we weren't setting this flag, our probe of ID_AA64ZFR0
was always returning zero.  This also obviates the adjustment
of ID_AA64PFR0, which had sanitized the SVE field.

The effects of the bug are not visible, because the only thing that
ID_AA64ZFR0 is used for within qemu at present is tcg translation.
The other tests for SVE within KVM are via ID_AA64PFR0.SVE.

Reported-by: Zenghui Yu <yuzenghui@huawei.com>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20220726045828.53697-3-richard.henderson@linaro.org
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
22 months agotarget/arm: Use kvm_arm_sve_supported in kvm_arm_get_host_cpu_features
Richard Henderson [Mon, 1 Aug 2022 15:21:17 +0000 (16:21 +0100)]
target/arm: Use kvm_arm_sve_supported in kvm_arm_get_host_cpu_features

Indication for support for SVE will not depend on whether we
perform the query on the main kvm_state or the temp vcpu.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20220726045828.53697-2-richard.henderson@linaro.org
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
22 months agotests/qtest/migration-test: Run the dirty ring tests only with the x86 target
Thomas Huth [Mon, 1 Aug 2022 11:17:46 +0000 (13:17 +0200)]
tests/qtest/migration-test: Run the dirty ring tests only with the x86 target

kvm_dirty_ring_supported() only checks whether the dirty ring support
is available on the x86 host, but it ignores whether the target QEMU
architecture is x86 or not. Thus the test_vcpu_dirty_limit() test
currently fails with the assert((strcmp(arch, "x86_64") == 0)) statement
in dirtylimit_start_vm() if the users run e.g. "make check-qtest-aarch64"
on their x86 host. Fix it by only executing the tests when we're running
with a x86_64 target QEMU binary with KVM.

Message-Id: <20220801114644.208197-1-thuth@redhat.com>
Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
22 months agoMerge tag 'nvme-next-pull-request' of git://git.infradead.org/qemu-nvme into staging
Richard Henderson [Mon, 1 Aug 2022 13:29:49 +0000 (06:29 -0700)]
Merge tag 'nvme-next-pull-request' of git://git.infradead.org/qemu-nvme into staging

hw/nvme fixes

Some fixes for hw/nvme ioeventfd support.

# -----BEGIN PGP SIGNATURE-----
#
# iQEzBAABCAAdFiEEUigzqnXi3OaiR2bATeGvMW1PDekFAmLnpQ4ACgkQTeGvMW1P
# Delnywf/fM7Qp5WMR0ExHqVuKfpN1EBK8C6wa3xp7EI0pCDP50ZwJfcMmeZOhDAe
# 3KXdNTXV43cxygkdzG/uxh7j26Zq8zGzcf1RVLAIUqzL9wTkoFcJ4+aIuzlV4wjU
# oS1jK+pItJ9/Kb9SeavVGOzTzyBzs2G9odRvjyjGrwrEfpEBEtncwfXAK7mPqt1V
# TNDR0M0qJ9Bheaoqs7miqa4zOevtKKp3pPeG0n2BOhWromGx6MbeHwTuNg96zR0+
# VXuEmUyj8r6ezKmQdgnJPoqFCwEJI0iBGPSKhpIp3EGrkAww2IuBAN8C4bo03Bzq
# Fj3pne5Sr9iBV/nhz9vN267STQzdsw==
# =AL7y
# -----END PGP SIGNATURE-----
# gpg: Signature made Mon 01 Aug 2022 03:03:58 AM PDT
# gpg:                using RSA key 522833AA75E2DCE6A24766C04DE1AF316D4F0DE9
# gpg: Good signature from "Klaus Jensen <its@irrelevant.dk>" [unknown]
# gpg:                 aka "Klaus Jensen <k.jensen@samsung.com>" [unknown]
# 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: DDCA 4D9C 9EF9 31CC 3468  4272 63D5 6FC5 E55D A838
#      Subkey fingerprint: 5228 33AA 75E2 DCE6 A247  66C0 4DE1 AF31 6D4F 0DE9

* tag 'nvme-next-pull-request' of git://git.infradead.org/qemu-nvme:
  hw/nvme: do not enable ioeventfd by default
  hw/nvme: unregister the event notifier handler on the main loop
  hw/nvme: skip queue processing if notifier is cleared

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
22 months agoaspeed/fby35: Fix owner of the BMC RAM memory region
Cédric Le Goater [Thu, 28 Jul 2022 06:15:52 +0000 (08:15 +0200)]
aspeed/fby35: Fix owner of the BMC RAM memory region

A MachineState object is used as a owner of the RAM region and this
asserts in memory_region_init_ram() when QEMU is built with
CONFIG_QOM_CAST_DEBUG :

    /* This will assert if owner is neither NULL nor a DeviceState.
     * We only want the owner here for the purposes of defining a
     * unique name for migration. TODO: Ideally we should implement
     * a naming scheme for Objects which are not DeviceStates, in
     * which case we can relax this restriction.
     */
    owner_dev = DEVICE(owner);

Use the BMC and BIC objects as the owners of their memory regions.

Cc: Peter Delevoryas <peter@pjd.dev>
Fixes: 778e14cc5cd5 ("aspeed: Add AST2600 (BMC) to fby35")
Reviewed-by: Peter Delevoryas <peter@pjd.dev>
Message-Id: <20220727102714.803041-3-clg@kaod.org>
Signed-off-by: Cédric Le Goater <clg@kaod.org>
22 months agoaspeed: Remove unused fields from AspeedMachineState
Cédric Le Goater [Thu, 28 Jul 2022 06:15:52 +0000 (08:15 +0200)]
aspeed: Remove unused fields from AspeedMachineState

Fixes: 346160cbf2af ("aspeed: Set the dram container at the SoC level")
Message-Id: <20220727102714.803041-2-clg@kaod.org>
Signed-off-by: Cédric Le Goater <clg@kaod.org>
22 months agoscsi-disk: ensure block size is non-zero and changes limited to bits 8-15
Mark Cave-Ayland [Sat, 30 Jul 2022 12:26:56 +0000 (13:26 +0100)]
scsi-disk: ensure block size is non-zero and changes limited to bits 8-15

The existing code assumes that the block size can be generated from p[1] << 8
in multiple places which ignores the top and bottom 8 bits. If the block size
is allowed to be set to an arbitrary value then this causes a mismatch
between the value written by the guest in the block descriptor and the value
subsequently read back using READ CAPACITY causing the guest to generate
requests that can crash QEMU.

For now restrict block size changes to bits 8-15 and also ignore requests to
set the block size to 0 which causes the SCSI emulation to crash in at least
one place with a divide by zero error.

Fixes: 356c4c441e ("scsi-disk: allow MODE SELECT block descriptor to set the block size")
Closes: https://gitlab.com/qemu-project/qemu/-/issues/1112
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Message-Id: <20220730122656.253448-3-mark.cave-ayland@ilande.co.uk>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
22 months agoscsi-disk: fix overflow when block size is not a multiple of BDRV_SECTOR_SIZE
Mark Cave-Ayland [Sat, 30 Jul 2022 12:26:55 +0000 (13:26 +0100)]
scsi-disk: fix overflow when block size is not a multiple of BDRV_SECTOR_SIZE

In scsi_disk_emulate_write_same() the number of host sectors to transfer is
calculated as (s->qdev.blocksize / BDRV_SECTOR_SIZE) which is then used to
copy data in block size chunks to the iov buffer.

Since the loop copying the data to the iov buffer uses a fixed increment of
s->qdev.blocksize then using a block size that isn't a multiple of
BDRV_SECTOR_SIZE introduces a rounding error in the iov buffer size calculation
such that the iov buffer copy overflows the space allocated.

Update the iov buffer copy for() loop so that it will use the smallest of either
the current block size or the remaining transfer count to prevent the overflow.

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Message-Id: <20220730122656.253448-2-mark.cave-ayland@ilande.co.uk>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
22 months agoipmi:smbus: Add a check around a memcpy
Corey Minyard [Sun, 31 Jul 2022 22:58:09 +0000 (17:58 -0500)]
ipmi:smbus: Add a check around a memcpy

In one case:

  memcpy(sid->inmsg + sid->inlen, buf, len);

if len == 0 then sid->inmsg + sig->inlen can point to one past the inmsg
array if the array is full.  We have to allow len == 0 due to some
vagueness in the spec, but we don't have to call memcpy.

Found by Coverity.  This is not a problem in practice, but the results
are technically (maybe) undefined.  So make Coverity happy.

Reported-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Corey Minyard <cminyard@mvista.com>
Acked-by: Michael S. Tsirkin <mst@redhat.com>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
22 months agohw/nvme: do not enable ioeventfd by default
Klaus Jensen [Thu, 28 Jul 2022 06:34:21 +0000 (08:34 +0200)]
hw/nvme: do not enable ioeventfd by default

Do not enable ioeventfd by default. Let the feature mature a bit before
we consider enabling it by default.

Fixes: 2e53b0b45024 ("hw/nvme: Use ioeventfd to handle doorbell updates")
Reviewed-by: Keith Busch <kbusch@kernel.org>
Reviewed-by: Jinhao Fan <fanjinhao21s@ict.ac.cn>
Signed-off-by: Klaus Jensen <k.jensen@samsung.com>
22 months agohw/nvme: unregister the event notifier handler on the main loop
Klaus Jensen [Thu, 28 Jul 2022 06:48:51 +0000 (08:48 +0200)]
hw/nvme: unregister the event notifier handler on the main loop

Make sure the notifier handler is unregistered in the main loop prior to
cleaning it up.

Fixes: 2e53b0b45024 ("hw/nvme: Use ioeventfd to handle doorbell updates")
Reviewed-by: Keith Busch <kbusch@kernel.org>
Reviewed-by: Jinhao Fan <fanjinhao21s@ict.ac.cn>
Signed-off-by: Klaus Jensen <k.jensen@samsung.com>