[Stable-8.2.9 30/45] hw/intc/arm_gicv3_its: Zero initialize local DTEntry etc structs

2025-01-27 Thread Michael Tokarev
In the GICv3 ITS model, we have a common coding pattern which has a local C struct like "DTEntry dte", which is a C representation of an in-guest-memory data structure, and we call a function such as get_dte() to read guest memory and fill in the C struct. These functions to read in the struct som

[Stable-8.2.9 02/45] bitops.h: Define bit operations on 'uint32_t' arrays

2025-01-27 Thread Michael Tokarev
Currently bitops.h defines a set of operations that work on arbitrary-length bit arrays. However (largely because they originally came from the Linux kernel) the bit array storage is an array of 'unsigned long'. This is OK for the kernel and even for parts of QEMU where we don't really care about

[Stable-7.2.16 24/31] target/i386/cpu: Fix notes for CPU models

2025-01-27 Thread Michael Tokarev
Fixes: 644e3c5d812 ("missing vmx features for Skylake-Server and Cascadelake-Server") Signed-off-by: Han Han Reviewed-by: Chenyi Qiang Reviewed-by: Michael Tokarev Signed-off-by: Michael Tokarev (cherry picked from commit 93dcc9390e5ad0696ae7e9b7b3a5b08c2d1b6de6) Signed-off-by: Michael Tokarev

[Stable-8.2.9 21/45] .gitlab-ci.d/cirrus: Remove the netbsd and openbsd jobs

2025-01-27 Thread Michael Tokarev
During the past months, the netbsd and openbsd jobs in the Cirrus-CI were broken most of the time - the setup to run a BSD in KVM on Cirrus-CI from gitlab via the cirrus-run script was very fragile, and since the jobs were not run by default, it used to bitrot very fast. Now Cirrus-CI also introdu

[Stable-8.2.9 25/45] fuzz: specify audiodev for usb-audio

2025-01-27 Thread Michael Tokarev
Fixes test-failure on Fedora 40 CI. Reported-by: Thomas Huth Signed-off-by: Alexander Bulekov Reviewed-by: Thomas Huth Message-ID: <20240527040711.311865-1-alx...@bu.edu> Signed-off-by: Thomas Huth (cherry picked from commit e7fca81e170530104c36bd8f3e1d7e7c11011481) Signed-off-by: Michael Toka

[Stable-8.2.9 15/45] target/ppc: Fix non-maskable interrupt while halted

2025-01-27 Thread Michael Tokarev
The ppc (pnv and spapr) NMI injection code does not go through the asynchronous interrupt path and set a bit in env->pending_interrupts and raise an interrupt request that the cpu_exec() loop can see. Instead it injects the exception directly into registers. This can lead to cpu_exec() missing tha

[Stable-8.2.9 09/45] tests/9p: fix Rreaddir response name

2025-01-27 Thread Michael Tokarev
All 9p response types are prefixed with an "R", therefore fix "READDIR" -> "RREADDIR" in function rmessage_name(). Fixes: 4829469fd9ff ("tests/virtio-9p: added readdir test") Signed-off-by: Christian Schoenebeck Reviewed-by: Greg Kurz Message-Id: (cherry picked from commit abf0f092c1dd33b9ffa9

[Stable-7.2.16 19/31] x86/loader: only patch linux kernels

2025-01-27 Thread Michael Tokarev
If the binary loaded via -kernel is *not* a linux kernel (in which case protocol == 0), do not patch the linux kernel header fields. It's (a) pointless and (b) might break binaries by random patching and (c) changes the binary hash which in turn breaks secure boot verification. Background: OVMF h

[Stable-8.2.9 13/45] 9pfs: fix 'Tgetattr' after unlink

2025-01-27 Thread Michael Tokarev
With a valid file ID (FID) of an open file, it should be possible to send a 'Tgettattr' 9p request and successfully receive a 'Rgetattr' response, even if the file has been removed in the meantime. Currently this would fail with ENOENT. I.e. this fixes the following misbehaviour with a 9p Linux cl

[Stable-7.2.16 20/31] hw/intc/arm_gicv3_its: Zero initialize local DTEntry etc structs

2025-01-27 Thread Michael Tokarev
In the GICv3 ITS model, we have a common coding pattern which has a local C struct like "DTEntry dte", which is a C representation of an in-guest-memory data structure, and we call a function such as get_dte() to read guest memory and fill in the C struct. These functions to read in the struct som

[Stable-8.2.9 01/45] hw/intc/openpic: Avoid taking address of out-of-bounds array index

2025-01-27 Thread Michael Tokarev
The clang sanitizer complains about the code in the EOI handling of openpic_cpu_write_internal(): UBSAN_OPTIONS=halt_on_error=1:abort_on_error=1 ./build/clang/qemu-system-ppc -M mac99,graphics=off -display none -kernel day15/invaders.elf ../../hw/intc/openpic.c:1034:16: runtime error: index -1 ou

[Stable-7.2.16 11/31] tests/9p: add 'use-after-unlink' test

2025-01-27 Thread Michael Tokarev
After removing a file from the file system, we should still be able to work with the file if we already had it open before removal. As a first step we verify that it is possible to write to an unlinked file, as this is what already works. This test is extended later on after having fixed other use

[Stable-7.2.16 29/31] tests: acpi: whitelist expected blobs

2025-01-27 Thread Michael Tokarev
Signed-off-by: Igor Mammedov Message-Id: <20250115125342.3883374-2-imamm...@redhat.com> Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin (cherry picked from commit 1ad32644fe4c9fb25086be15a66dde1d55d3410f) Signed-off-by: Michael Tokarev (Mjt: drop x86/ subdir and drop a few fil

[Stable-8.2.9 11/45] tests/9p: add 'use-after-unlink' test

2025-01-27 Thread Michael Tokarev
After removing a file from the file system, we should still be able to work with the file if we already had it open before removal. As a first step we verify that it is possible to write to an unlinked file, as this is what already works. This test is extended later on after having fixed other use

[Stable-8.2.9 00/45] Patch Round-up for stable 8.2.9, freeze on 2025-02-06

2025-01-27 Thread Michael Tokarev
The following patches are queued for QEMU stable v8.2.9: https://gitlab.com/qemu-project/qemu/-/commits/staging-8.2 Patch freeze is 2025-02-06, and the release is planned for 2025-02-08: https://wiki.qemu.org/Planning/8.2 Please respond here or CC qemu-sta...@nongnu.org on any additional pa

[Stable-7.2.16 28/31] pci/msix: Fix msix pba read vector poll end calculation

2025-01-27 Thread Michael Tokarev
The end vector calculation has a bug that results in polling fewer than required vectors when reading at a non-zero offset in PBA memory. Fixes: bbef882cc193 ("msi: add API to get notified about pending bit poll") Signed-off-by: Nicholas Piggin Message-Id: <20241212120402.1475053-1-npig...@gmail.

[Stable-7.2.16 10/31] tests/9p: add missing Rgetattr response name

2025-01-27 Thread Michael Tokarev
'Tgetattr' 9p request and its 'Rgetattr' response types are already used by test client, however this response type is yet missing in function rmessage_name(), so add it. Fixes: a6821b828404 ("tests/9pfs: compare QIDs in fs_walk_none() test") Signed-off-by: Christian Schoenebeck Reviewed-by: Greg

[Stable-7.2.16 04/31] cirrus-ci: Remove MSYS2 jobs duplicated with gitlab-ci

2025-01-27 Thread Michael Tokarev
- Various developers are reluctant to git Cirrus-CI the permissions requested to access their GitHub account. - When we use the cirrus-run script to trigger Cirrus-CI job from GitLab-CI, the GitLab-CI job is restricted to a 1h timeout (often not enough). - Although Cirrus-CI VMs are more po

[Stable-7.2.16 03/31] hw/intc/loongarch_extioi: Use set_bit32() and clear_bit32() for s->isr

2025-01-27 Thread Michael Tokarev
In extioi_setirq() we try to operate on a bit array stored as an array of uint32_t using the set_bit() and clear_bit() functions by casting the pointer to 'unsigned long *'. This has two problems: * the alignment of 'uint32_t' is less than that of 'unsigned long' so we pass an insufficiently al

[Stable-7.2.16 23/31] docs: Correct release of TCG trace-events removal

2025-01-27 Thread Michael Tokarev
TCG trace-events were deprecated before the v6.2 release, and removed for v7.0. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Alex Bennée Reviewed-by: Michael Tokarev Signed-off-by: Michael Tokarev (cherry picked from commit b4859e8f33a7d9c793a60395f792c10190cb4f78) Signed-off-by: Michael

[Stable-7.2.16 25/31] backends/cryptodev-vhost-user: Fix local_error leaks

2025-01-27 Thread Michael Tokarev
Do not propagate error to the upper, directly output the error to avoid leaks. Fixes: 2fda101de07 ("virtio-crypto: Support asynchronous mode") Resolves: https://gitlab.com/qemu-project/qemu/-/issues/2714 Signed-off-by: Gabriel Barrantes Reviewed-by: zhenwei pi Message-Id: Signed-off-by: Philip

[Stable-7.2.16 22/31] s390x/s390-virtio-ccw: don't crash on weird RAM sizes

2025-01-27 Thread Michael Tokarev
KVM is not happy when starting a VM with weird RAM sizes: # qemu-system-s390x --enable-kvm --nographic -m 1234K qemu-system-s390x: kvm_set_user_memory_region: KVM_SET_USER_MEMORY_REGION failed, slot=0, start=0x0, size=0x244000: Invalid argument kvm_set_phys_mem: error registering slot: I

[Stable-7.2.16 17/31] tcg/riscv: Fix StoreStore barrier generation

2025-01-27 Thread Michael Tokarev
On RISC-V to StoreStore barrier corresponds `fence w, w` not `fence r, r` Cc: qemu-sta...@nongnu.org Fixes: efbea94c76b ("tcg/riscv: Add slowpath load and store instructions") Reviewed-by: Richard Henderson Signed-off-by: Denis Tomashev Signed-off-by: Roman Artemev Message-ID: Signed-off-by: R

[Stable-7.2.16 18/31] fuzz: specify audiodev for usb-audio

2025-01-27 Thread Michael Tokarev
Fixes test-failure on Fedora 40 CI. Reported-by: Thomas Huth Signed-off-by: Alexander Bulekov Reviewed-by: Thomas Huth Message-ID: <20240527040711.311865-1-alx...@bu.edu> Signed-off-by: Thomas Huth (cherry picked from commit e7fca81e170530104c36bd8f3e1d7e7c11011481) Signed-off-by: Michael Toka

[Stable-7.2.16 06/31] qdev: Fix set_pci_devfn() to visit option only once

2025-01-27 Thread Michael Tokarev
pci_devfn properties accept either a string or an integer as input. To implement this, set_pci_devfn() first tries to visit the option as a string, and if that fails, it visits it as an integer instead. While the QemuOpts visitor happens to accept this, it is invalid according to the visitor interf

[Stable-7.2.16 12/31] 9pfs: remove obsolete comment in v9fs_getattr()

2025-01-27 Thread Michael Tokarev
The comment claims that we'd only support basic Tgetattr fields. This is no longer true, so remove this comment. Fixes: e06a765efbe3 ("hw/9pfs: Add st_gen support in getattr reply") Signed-off-by: Christian Schoenebeck Reviewed-by: Greg Kurz Message-Id: (cherry picked from commit 3bc4db44430f5

[Stable-7.2.16 07/31] ssh: Do not switch session to non-blocking mode

2025-01-27 Thread Michael Tokarev
The libssh does not handle non-blocking mode in SFTP correctly. The driver code already changes the mode to blocking for the SFTP initialization, but for some reason changes to non-blocking mode. This used to work accidentally until libssh in 0.11 branch merged the patch to avoid infinite looping i

[Stable-7.2.16 16/31] hw/openrisc/openrisc_sim: keep serial@90000000 as default

2025-01-27 Thread Michael Tokarev
We used to only have a single UART on the platform and it was located at address 0x9000. When the number of UARTs was increased to 4, the first UART remained at it's location, but instead of being the first one to be registered, it became the last. This caused QEMU to pick 0x9300 as the de

[Stable-7.2.16 21/31] meson.build: Disallow libnfs v6 to fix the broken macOS build

2025-01-27 Thread Michael Tokarev
The macOS builds in our CI (and possibly other very recent distros) are currently broken since the update to libnfs version 6 there. That version apparently comes with a big API breakage. v5.0.3 was the final release of the old API (see the libnfs commit here: https://github.com/sahlberg/libnfs/com

[Stable-7.2.16 13/31] 9pfs: fix 'Tgetattr' after unlink

2025-01-27 Thread Michael Tokarev
With a valid file ID (FID) of an open file, it should be possible to send a 'Tgettattr' 9p request and successfully receive a 'Rgetattr' response, even if the file has been removed in the meantime. Currently this would fail with ENOENT. I.e. this fixes the following misbehaviour with a 9p Linux cl

[Stable-7.2.16 15/31] target/ppc: Fix non-maskable interrupt while halted

2025-01-27 Thread Michael Tokarev
The ppc (pnv and spapr) NMI injection code does not go through the asynchronous interrupt path and set a bit in env->pending_interrupts and raise an interrupt request that the cpu_exec() loop can see. Instead it injects the exception directly into registers. This can lead to cpu_exec() missing tha

[Stable-7.2.16 08/31] scsi: megasas: Internal cdbs have 16-byte length

2025-01-27 Thread Michael Tokarev
Host drivers do not necessarily set cdb_len in megasas io commands. With commits 6d1511cea0 ("scsi: Reject commands if the CDB length exceeds buf_len") and fe9d8927e2 ("scsi: Add buf_len parameter to scsi_req_new()"), this results in failures to boot Linux from affected SCSI drives because cdb_len

[Stable-7.2.16 01/31] hw/intc/openpic: Avoid taking address of out-of-bounds array index

2025-01-27 Thread Michael Tokarev
The clang sanitizer complains about the code in the EOI handling of openpic_cpu_write_internal(): UBSAN_OPTIONS=halt_on_error=1:abort_on_error=1 ./build/clang/qemu-system-ppc -M mac99,graphics=off -display none -kernel day15/invaders.elf ../../hw/intc/openpic.c:1034:16: runtime error: index -1 ou

[Stable-7.2.16 00/31] Patch Round-up for stable 7.2.16, freeze on 2025-02-06

2025-01-27 Thread Michael Tokarev
The following patches are queued for QEMU stable v7.2.16: https://gitlab.com/qemu-project/qemu/-/commits/staging-7.2 Patch freeze is 2025-02-06, and the release is planned for 2025-02-08: https://wiki.qemu.org/Planning/7.2 Please respond here or CC qemu-sta...@nongnu.org on any additional p

Re: [PATCH] MAINTAINERS: Remove Bin Meng from RISC-V maintainers

2025-01-27 Thread Philippe Mathieu-Daudé
Cc'ing work email On 28/1/25 07:05, Alistair Francis wrote: Bin Meng has been a long time contributor and maintainer for QEMU RISC-V and has been very beneficial to the RISC-V ecosystem. Unfortunately his email has started to bounce so this patch is removing them from MAINTAINERS. If in the fut

Re: [PATCH v2 05/15] target/ppc: Move ppc_ldl_code() to tcg-excp_helper.c

2025-01-27 Thread Philippe Mathieu-Daudé
On 28/1/25 07:13, Harsh Prateek Bora wrote: On 1/27/25 15:56, Philippe Mathieu-Daudé wrote: Signed-off-by: Philippe Mathieu-Daudé ---   target/ppc/excp_helper.c | 21 -   target/ppc/tcg-excp_helper.c | 18 ++   2 files changed, 18 insertions(+), 21 deleti

Re: [PATCH v2 06/15] target/ppc: Ensure powerpc_checkstop() is only called under TCG

2025-01-27 Thread Harsh Prateek Bora
On 1/28/25 12:13, Harsh Prateek Bora wrote: On 1/27/25 15:56, Philippe Mathieu-Daudé wrote: Signed-off-by: Philippe Mathieu-Daudé ---   target/ppc/excp_helper.c | 6 ++   1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/target/ppc/excp_helper.c b/target/ppc/excp_helper.c in

Re: [PATCH v2 06/15] target/ppc: Ensure powerpc_checkstop() is only called under TCG

2025-01-27 Thread Harsh Prateek Bora
On 1/27/25 15:56, Philippe Mathieu-Daudé wrote: Signed-off-by: Philippe Mathieu-Daudé --- target/ppc/excp_helper.c | 6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/target/ppc/excp_helper.c b/target/ppc/excp_helper.c index 8956466db1d..b08cd53688c 100644 --- a/targe

Re: [PATCH v6 10/10] docs/system: virtio-gpu: Document host/guest requirements

2025-01-27 Thread Akihiko Odaki
On 2025/01/27 18:45, Alex Bennée wrote: Akihiko Odaki writes: On 2025/01/27 5:11, Dmitry Osipenko wrote: From: Alex Bennée This attempts to tidy up the VirtIO GPU documentation to make the list of requirements clearer. There are still a lot of moving parts and the distros have some catching

Re: [PATCH v2 05/15] target/ppc: Move ppc_ldl_code() to tcg-excp_helper.c

2025-01-27 Thread Harsh Prateek Bora
On 1/27/25 15:56, Philippe Mathieu-Daudé wrote: Signed-off-by: Philippe Mathieu-Daudé --- target/ppc/excp_helper.c | 21 - target/ppc/tcg-excp_helper.c | 18 ++ 2 files changed, 18 insertions(+), 21 deletions(-) This patch also needs to remove th

Re: [PATCH v2 04/15] target/ppc: Move TCG specific exception handlers to tcg-excp_helper.c

2025-01-27 Thread Harsh Prateek Bora
On 1/27/25 15:56, Philippe Mathieu-Daudé wrote: Move the TCGCPUOps handlers to a new unit: tcg-excp_helper.c, only built when TCG is selected. Nice. Just a thought - will the filename look better as excp_helper-tcg.c ? That naming usually help developers when using tab completion. See in

Re: [PATCH] MAINTAINERS: Remove Bin Meng from RISC-V maintainers

2025-01-27 Thread Alistair Francis
On Tue, Jan 28, 2025 at 4:05 PM Alistair Francis wrote: > > Bin Meng has been a long time contributor and maintainer for QEMU RISC-V > and has been very beneficial to the RISC-V ecosystem. > > Unfortunately his email has started to bounce so this patch is removing > them from MAINTAINERS. If in th

[PATCH] MAINTAINERS: Remove Bin Meng from RISC-V maintainers

2025-01-27 Thread Alistair Francis
Bin Meng has been a long time contributor and maintainer for QEMU RISC-V and has been very beneficial to the RISC-V ecosystem. Unfortunately his email has started to bounce so this patch is removing them from MAINTAINERS. If in the future Bin Meng wants to return we will happily re-add them. Note

Re: [PATCH v4 4/4] tests/qtest/migration: add postcopy tests with multifd

2025-01-27 Thread Prasad Pandit
Hello Fabiano, On Tue, 28 Jan 2025 at 02:43, Fabiano Rosas wrote: > > +if (args->multifd) { > > +migrate_set_capability(from, "multifd", true); > > +migrate_set_capability(to, "multifd", true); > > This is slightly backwards because currently that's what the hooks are > for. I

Re: [PATCH v2 03/15] target/ppc: Make ppc_ldl_code() declaration public

2025-01-27 Thread Harsh Prateek Bora
On 1/27/25 15:56, Philippe Mathieu-Daudé wrote: We are going to move code calling ppc_ldl_code() out of excp_helper.c where it is defined. Expose its declaration for few commits, until eventually making it static again once everything is moved. Signed-off-by: Philippe Mathieu-Daudé Reviewe

Re: [PATCH v2 02/15] hw/ppc/spapr: Restrict part of PAGE_INIT hypercall to TCG

2025-01-27 Thread Harsh Prateek Bora
On 1/27/25 15:56, Philippe Mathieu-Daudé wrote: Restrict the tb_flush() call to TCG. Assert we are using KVM or TCG. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Harsh Prateek Bora --- hw/ppc/spapr_hcall.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/h

Re: [PATCH v2 01/15] hw/ppc/spapr: Restrict CONFER hypercall to TCG

2025-01-27 Thread Harsh Prateek Bora
Hi Philippe, On 1/27/25 15:56, Philippe Mathieu-Daudé wrote: TODO: Add PPC folks why :) While this appear be TCG specific, may I know what caused you to bring this change? Usually we have blanks stubs for hcalls in KVM mode which are only TCG specific. That helps in avoiding building TCG spe

Re: [PATCH 0/1] meson: Deprecate 32-bit host systems

2025-01-27 Thread Thomas Huth
On 28/01/2025 01.42, Richard Henderson wrote: Time for our biennial attempt to kill ancient hosts. I've been re-working the tcg code generator a bit over the holidays. One place that screams for a bit of cleanup is with 64-bit guest addresses on 32-bit hosts. Of course the best "cleanup" is to

[PATCH v6] hw/i386/cpu: remove default_cpu_version and simplify

2025-01-27 Thread Ani Sinha
commit 0788a56bd1ae3 ("i386: Make unversioned CPU models be aliases") introduced 'default_cpu_version' for PCMachineClass. This created three categories of CPU models: - Most unversioned CPU models would use version 1 by default. - For machines 4.0.1 and older that do not support cpu model aliase

Re: [PATCH v3 1/2] s390x/pci: add support for guests that request direct mapping

2025-01-27 Thread Thomas Huth
On 27/01/2025 21.45, Matthew Rosato wrote:   #include "hw/s390x/s390-pci-bus.h" @@ -1008,17 +1009,25 @@ static int reg_ioat(CPUS390XState *env, S390PCIBusDevice *pbdev, ZpciFib fib,   }     /* currently we only support designation type 1 with translation */ -    if (!(dt == ZPCI_IOT

Re: [PATCH 2/6] hw/loader: Remove unused load_elf_ram()

2025-01-27 Thread Alistair Francis
On Mon, Jan 27, 2025 at 9:39 PM Philippe Mathieu-Daudé wrote: > > Last use of load_elf_ram() was removed in commit 188e255bf8e > ("hw/s390x: Remove the possibility to load the s390-netboot.img > binary"), remove it. > > Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Alistair Francis Alista

Re: [PATCH 2/2] tests/tcg/s390x: Test modifying code using the MVC instruction

2025-01-27 Thread Richard Henderson
On 1/27/25 16:12, Ilya Leoshkevich wrote: Add a small test to prevent regressions. Signed-off-by: Ilya Leoshkevich --- tests/tcg/s390x/Makefile.softmmu-target | 1 + tests/tcg/s390x/mvc-smc.c | 82 + 2 files changed, 83 insertions(+) create mode 1006

[PATCH 1/1] meson: Deprecate 32-bit host support

2025-01-27 Thread Richard Henderson
We deprecated i686 system mode support for qemu 8.0. However, to make real cleanups to TCG we need to remove all 32-bit hosts. Signed-off-by: Richard Henderson --- docs/about/deprecated.rst | 8 meson.build | 6 ++ 2 files changed, 10 insertions(+), 4 deletions(-) dif

Re: [PATCH 1/2] target/s390x: Fix MVC not always invalidating translation blocks

2025-01-27 Thread Richard Henderson
On 1/27/25 16:12, Ilya Leoshkevich wrote: Node.js crashes in qemu-system-s390x with random SIGSEGVs / SIGILLs. The v8 JIT used by Node.js can garbage collect and overwrite unused code. Overwriting is performed by WritableJitAllocation::CopyCode(), which ultimately calls memcpy(). For certain siz

[PATCH 0/1] meson: Deprecate 32-bit host systems

2025-01-27 Thread Richard Henderson
Time for our biennial attempt to kill ancient hosts. I've been re-working the tcg code generator a bit over the holidays. One place that screams for a bit of cleanup is with 64-bit guest addresses on 32-bit hosts. Of course the best "cleanup" is to not have to handle such silliness at all. Two y

[PATCH 1/2] target/s390x: Fix MVC not always invalidating translation blocks

2025-01-27 Thread Ilya Leoshkevich
Node.js crashes in qemu-system-s390x with random SIGSEGVs / SIGILLs. The v8 JIT used by Node.js can garbage collect and overwrite unused code. Overwriting is performed by WritableJitAllocation::CopyCode(), which ultimately calls memcpy(). For certain sizes, memcpy() uses the MVC instruction. QEMU

[PATCH 2/2] tests/tcg/s390x: Test modifying code using the MVC instruction

2025-01-27 Thread Ilya Leoshkevich
Add a small test to prevent regressions. Signed-off-by: Ilya Leoshkevich --- tests/tcg/s390x/Makefile.softmmu-target | 1 + tests/tcg/s390x/mvc-smc.c | 82 + 2 files changed, 83 insertions(+) create mode 100644 tests/tcg/s390x/mvc-smc.c diff --git a/tests

Re: [RFC PATCH 0/5] hw/arm/virt: Add support for user-creatable nested SMMUv3

2025-01-27 Thread Nathan Chen
>with an error message indicating DMA mapping failed for the passthrough >devices. A correction - the message indicates UEFI failed to find a mapping for the boot partition ("map: no mapping found"), not that DMA mapping failed. But earlier EDK debug logs still show PCI host bridge resource conf

[PATCH 19/22] target/arm: Use float*_maybe_ah_chs in sve_ftssel_*

2025-01-27 Thread Richard Henderson
Signed-off-by: Richard Henderson --- target/arm/tcg/sve_helper.c | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/target/arm/tcg/sve_helper.c b/target/arm/tcg/sve_helper.c index 3f38e07829..a2ff3b7f11 100644 --- a/target/arm/tcg/sve_helper.c +++ b/target/arm/tcg/sv

[PATCH 09/22] target/arm: Remove ah_fp_status_f16

2025-01-27 Thread Richard Henderson
Replace with fp_status[FPST_AH_F16]. Signed-off-by: Richard Henderson --- target/arm/cpu.h| 3 +-- target/arm/cpu.c| 2 +- target/arm/vfp_helper.c | 10 +- 3 files changed, 7 insertions(+), 8 deletions(-) diff --git a/target/arm/cpu.h b/target/arm/cpu.h index 18afff850

[PATCH 13/22] target/arm: Remove fp_status_a64

2025-01-27 Thread Richard Henderson
Replace with fp_status[FPST_A64]. Signed-off-by: Richard Henderson --- target/arm/cpu.h| 1 - target/arm/cpu.c| 2 +- target/arm/tcg/sme_helper.c | 2 +- target/arm/tcg/vec_helper.c | 10 +- target/arm/vfp_helper.c | 16 5 files changed, 15

[PATCH 11/22] target/arm: Remove fp_status_f16_a64

2025-01-27 Thread Richard Henderson
Replace with fp_status[FPST_A64_F16]. Signed-off-by: Richard Henderson --- target/arm/cpu.h| 1 - target/arm/cpu.c| 2 +- target/arm/tcg/sme_helper.c | 2 +- target/arm/tcg/vec_helper.c | 8 target/arm/vfp_helper.c | 16 5 files changed,

[PATCH 07/22] target/arm: Remove standard_fp_status_f16

2025-01-27 Thread Richard Henderson
Replace with fp_status[FPST_STD_F16]. Signed-off-by: Richard Henderson --- target/arm/cpu.h| 1 - target/arm/cpu.c| 4 ++-- target/arm/tcg/mve_helper.c | 24 target/arm/vfp_helper.c | 8 4 files changed, 18 insertions(+), 19 deleti

[PATCH 04/22] target/arm: Rename FPST_FPCR_F16_A64 to FPST_A64_F16

2025-01-27 Thread Richard Henderson
Signed-off-by: Richard Henderson --- target/arm/tcg/translate.h | 8 ++--- target/arm/tcg/translate-a64.c | 44 +++ target/arm/tcg/translate-sve.c | 66 +- 3 files changed, 59 insertions(+), 59 deletions(-) diff --git a/target/arm/tcg/tran

[PATCH 03/22] target/arm: Rename FPST_FPCR_F16_A32 to FPST_A32_F16

2025-01-27 Thread Richard Henderson
Signed-off-by: Richard Henderson --- target/arm/tcg/translate.h | 6 +++--- target/arm/tcg/translate-vfp.c | 24 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/target/arm/tcg/translate.h b/target/arm/tcg/translate.h index 2edb707b85..adf6eb8b91 1006

[PATCH 22/22] target/arm: Use flags for AH negation in do_fmla_zpzzz_*

2025-01-27 Thread Richard Henderson
The float*_muladd functions have a flags argument that can perform optional negation of various operand. We don't use that for "normal" arm fmla, because the muladd flags are not applied when an input is a NaN. But since FEAT_AFP does not negate NaNs, this behaviour is exactly what we need. Sinc

[PATCH 17/22] target/arm: Move float*_ah_chs to vec_internal.h

2025-01-27 Thread Richard Henderson
Signed-off-by: Richard Henderson --- target/arm/tcg/vec_internal.h | 20 target/arm/tcg/helper-a64.c | 15 +-- 2 files changed, 21 insertions(+), 14 deletions(-) diff --git a/target/arm/tcg/vec_internal.h b/target/arm/tcg/vec_internal.h index 094f5c169c..a67393

[PATCH 20/22] target/arm: Use float*_maybe_ah_chs in sve_ftmad_*

2025-01-27 Thread Richard Henderson
Since we know the operand is negative, absolute value can be had by negating rather than abs per se. Signed-off-by: Richard Henderson --- target/arm/tcg/sve_helper.c | 12 +++- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/target/arm/tcg/sve_helper.c b/target/arm/tcg/sve_

[PATCH 06/22] target/arm: Introduce CPUARMState.vfp.fp_status[]

2025-01-27 Thread Richard Henderson
Move ARMFPStatusFlavour to cpu.h with which to index this array. For now, place the array in an anonymous union with the existing structures. Adjust the order of the existing structures to match the enum. Simplify fpstatus_ptr() using the new array. Signed-off-by: Richard Henderson --- target

[PATCH 14/22] target/arm: Remove fp_status_a32

2025-01-27 Thread Richard Henderson
Replace with fp_status[FPST_A32]. As this was the last of the old structures, we can remove the anonymous union and struct. Signed-off-by: Richard Henderson --- target/arm/cpu.h| 7 +-- target/arm/cpu.c| 2 +- target/arm/vfp_helper.c | 18 +- 3 files change

[PATCH 10/22] target/arm: Remove ah_fp_status

2025-01-27 Thread Richard Henderson
Replace with fp_status[FPST_AH]. Signed-off-by: Richard Henderson --- target/arm/cpu.h| 3 +-- target/arm/cpu.c| 6 +++--- target/arm/vfp_helper.c | 6 +++--- 3 files changed, 7 insertions(+), 8 deletions(-) diff --git a/target/arm/cpu.h b/target/arm/cpu.h index 0f7d5d5430..5e3d

[PATCH 05/22] target/arm: Rename FPST_FPCR_AH* to FPST_AH*

2025-01-27 Thread Richard Henderson
Signed-off-by: Richard Henderson --- target/arm/tcg/translate.h | 14 +++--- target/arm/tcg/translate-a64.c | 8 target/arm/tcg/translate-sve.c | 8 3 files changed, 15 insertions(+), 15 deletions(-) diff --git a/target/arm/tcg/translate.h b/target/arm/tcg/transla

[PATCH 15/22] target/arm: Simplify fp_status indexing in mve_helper.c

2025-01-27 Thread Richard Henderson
Select on index instead of pointer. No functional change. Signed-off-by: Richard Henderson --- target/arm/tcg/mve_helper.c | 40 + 1 file changed, 14 insertions(+), 26 deletions(-) diff --git a/target/arm/tcg/mve_helper.c b/target/arm/tcg/mve_helper.c index 3

[PATCH 02/22] target/arm: Rename FPST_FPCR_A64 to FPST_A64

2025-01-27 Thread Richard Henderson
Signed-off-by: Richard Henderson --- target/arm/tcg/translate.h | 8 +-- target/arm/tcg/translate-a64.c | 78 +-- target/arm/tcg/translate-sme.c | 4 +- target/arm/tcg/translate-sve.c | 98 +- 4 files changed, 94 insertions(+), 94 dele

[PATCH 08/22] target/arm: Remove standard_fp_status

2025-01-27 Thread Richard Henderson
Replace with fp_status[FPST_STD]. Signed-off-by: Richard Henderson --- target/arm/cpu.h| 1 - target/arm/cpu.c| 8 target/arm/tcg/mve_helper.c | 28 ++-- target/arm/tcg/vec_helper.c | 4 ++-- target/arm/vfp_helper.c | 4 ++-- 5 fil

[PATCH 18/22] target/arm: Introduce float*_maybe_ah_chs

2025-01-27 Thread Richard Henderson
Add versions of float*_ah_chs which takes fpcr_ah. These will help simplify some usages. Signed-off-by: Richard Henderson --- target/arm/tcg/vec_internal.h | 15 +++ 1 file changed, 15 insertions(+) diff --git a/target/arm/tcg/vec_internal.h b/target/arm/tcg/vec_internal.h index a67

[PATCH 00/22] target/arm: FEAT_AFP followups for FEAT_SME2

2025-01-27 Thread Richard Henderson
Hi Peter, After reviewing your AFP patch set, and starting to rebase SME2 work on top of that (since I'd been skipping the FPCR.AH portion of SME2), here are some cleanups which might be folded back into the original change for FPCR.AH or left as separate follow-ups. All of the FPST frobbing is b

[PATCH 01/22] target/arm: Rename FPST_FPCR_A32 to FPST_A32

2025-01-27 Thread Richard Henderson
Signed-off-by: Richard Henderson --- target/arm/tcg/translate.h | 6 ++-- target/arm/tcg/translate-vfp.c | 54 +- 2 files changed, 30 insertions(+), 30 deletions(-) diff --git a/target/arm/tcg/translate.h b/target/arm/tcg/translate.h index 59e780df2e..6ce2471

[PATCH 21/22] target/arm: Use float*_maybe_ah_chs in sve_ftmad_*

2025-01-27 Thread Richard Henderson
The construction of neg_imag and neg_real were done to make it easy to apply both in parallel with two simple logical operations. This changed with FPCR.AH, which is more complex than that. Note that there was a naming issue with neg_imag and neg_real. They were named backward, with neg_imag bein

[PATCH 16/22] target/arm: Simplify DO_VFP_cmp in vfp_helper.c

2025-01-27 Thread Richard Henderson
Pass ARMFPStatusFlavour index instead of fp_status[FOO]. Signed-off-by: Richard Henderson --- target/arm/vfp_helper.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/target/arm/vfp_helper.c b/target/arm/vfp_helper.c index a2775a2e8d..4e242275e7 100644 --- a/target/

[PATCH 12/22] target/arm: Remove fp_status_f16_a32

2025-01-27 Thread Richard Henderson
Replace with fp_status[FPST_A32_F16]. Signed-off-by: Richard Henderson --- target/arm/cpu.h| 1 - target/arm/cpu.c| 2 +- target/arm/tcg/vec_helper.c | 4 ++-- target/arm/vfp_helper.c | 14 +++--- 4 files changed, 10 insertions(+), 11 deletions(-) diff --g

Re: [PATCH v2 06/13] hw/sd/sd: Remove legacy sd_set_cb() in favor of GPIOs

2025-01-27 Thread Bernhard Beschow
Am 27. Januar 2025 13:24:46 UTC schrieb Peter Maydell : >On Sat, 11 Jan 2025 at 18:37, Bernhard Beschow wrote: >> >> Commit ce5dd27534b0 "hw/sd: Remove omap2_mmc device" removed the last user of >> sd_set_cb(). Rework this functionality into GPIOs. >> >> Reviewed-by: Philippe Mathieu-Daudé >>

Re: [PATCH 1/6] hw/avr/boot: Replace load_elf_ram_sym() -> load_elf_as()

2025-01-27 Thread Richard Henderson
On 1/27/25 03:38, Philippe Mathieu-Daudé wrote: load_elf_ram_sym() with load_rom=true, sym_cb=NULL is equivalent to load_elf_as(). Replace by the latter to simplify. Signed-off-by: Philippe Mathieu-Daudé --- hw/avr/boot.c | 8 +++- 1 file changed, 3 insertions(+), 5 deletions(-) Review

Re: [PATCH 6/6] hw/loader: Pass ELFDATA endian order argument to load_elf()

2025-01-27 Thread Richard Henderson
On 1/27/25 03:38, Philippe Mathieu-Daudé wrote: Rather than passing a boolean 'is_big_endian' argument, directly pass the ELFDATA, which can be unspecified using the ELFDATANONE value. Update the call sites: 0 -> ELFDATA2LSB 1 -> ELFDATA2MSB TARGET_BIG_EN

[PATCH v6 6/6] hostmem: Handle remapping of RAM

2025-01-27 Thread “William Roche
From: William Roche Let's register a RAM block notifier and react on remap notifications. Simply re-apply the settings. Exit if something goes wrong. Merging and dump settings are handled by the remap notification in addition to memory policy and preallocation. Co-developed-by: David Hildenbran

[PATCH v6 4/6] numa: Introduce and use ram_block_notify_remap()

2025-01-27 Thread “William Roche
From: David Hildenbrand Notify registered listeners about the remap at the end of qemu_ram_remap() so e.g., a memory backend can re-apply its settings correctly. Signed-off-by: David Hildenbrand Signed-off-by: William Roche --- hw/core/numa.c | 11 +++ include/exec/ramlist.h |

[PATCH v6 3/6] accel/kvm: Report the loss of a large memory page

2025-01-27 Thread “William Roche
From: William Roche In case of a large page impacted by a memory error, provide an information about the impacted large page before the memory error injection message. This message would also appear on ras enabled ARM platforms, with the introduction of an x86 similar error injection message. I

[PATCH v6 5/6] hostmem: Factor out applying settings

2025-01-27 Thread “William Roche
From: David Hildenbrand We want to reuse the functionality when remapping RAM. Signed-off-by: David Hildenbrand Signed-off-by: William Roche --- backends/hostmem.c | 155 - 1 file changed, 82 insertions(+), 73 deletions(-) diff --git a/backends/hos

[PATCH v6 2/6] system/physmem: poisoned memory discard on reboot

2025-01-27 Thread “William Roche
From: William Roche Repair poisoned memory location(s), calling ram_block_discard_range(): punching a hole in the backend file when necessary and regenerating a usable memory. If the kernel doesn't support the madvise calls used by this function and we are dealing with anonymous memory, fall back

[PATCH v6 1/6] system/physmem: handle hugetlb correctly in qemu_ram_remap()

2025-01-27 Thread “William Roche
From: William Roche The list of hwpoison pages used to remap the memory on reset is based on the backend real page size. To correctly handle hugetlb, we must mmap(MAP_FIXED) a complete hugetlb page; hugetlb pages cannot be partially mapped. Co-developed-by: David Hildenbrand Signed-off-by: Will

[PATCH v6 0/6] Poisoned memory recovery on reboot

2025-01-27 Thread “William Roche
From: William Roche Hello David, I'm back on this topic. --- This set of patches fixes several problems with hardware memory errors impacting hugetlbfs memory backed VMs and the generic memory recovery on VM reset. When using hugetlbfs large pages, any large page location being impacted by an H

Re: [PATCH v5 6/6] hostmem: Handle remapping of RAM

2025-01-27 Thread William Roche
On 1/14/25 15:11, David Hildenbrand wrote: On 10.01.25 22:14, “William Roche wrote: From: David Hildenbrand You can make yourself the author and just make me a Co-developed-by here. LGTM! Ok done. Thanks.

Re: [PATCH 5/6] hw/loader: Pass ELFDATA endian order argument to load_elf_as()

2025-01-27 Thread Richard Henderson
On 1/27/25 03:38, Philippe Mathieu-Daudé wrote: Rather than passing a boolean 'is_big_endian' argument, directly pass the ELFDATA, which can be unspecified using the ELFDATANONE value. Update the call sites: 0 -> ELFDATA2LSB 1 -> ELFDATA2MSB Note, this allow removing the target_words_bige

Re: [PATCH 4/6] hw/loader: Pass ELFDATA endian order argument to load_elf_ram_sym()

2025-01-27 Thread Richard Henderson
On 1/27/25 03:38, Philippe Mathieu-Daudé wrote: Rather than passing a boolean 'is_big_endian' argument, directly pass the ELFDATA, which can be unspecified using the ELFDATANONE value. Update the call sites: 0 -> ELFDATA2LSB Suggested-by: Richard Henderson Signed-off-by: Philippe Mathieu-Dau

Re: [PATCH v5 0/6] Poisoned memory recovery on reboot

2025-01-27 Thread William Roche
On 1/14/25 15:12, David Hildenbrand wrote: On 10.01.25 22:13, “William Roche wrote: From: William Roche Hello David, I'm keeping the description of the patch set you already reviewed: Hi, one request, can you send it out next time (v6) *not* as reply to the previous thread, but just as a

Re: [PATCH 3/6] hw/loader: Clarify local variable name in load_elf_ram_sym()

2025-01-27 Thread Richard Henderson
On 1/27/25 03:38, Philippe Mathieu-Daudé wrote: #if HOST_BIG_ENDIAN -data_order = ELFDATA2MSB; +host_data_order = ELFDATA2MSB; #else -data_order = ELFDATA2LSB; +host_data_order = ELFDATA2LSB; #endif Worth squashing host_data_order = HOST_BIG_ENDIAN ? ELFDATA2MSB : ELFDA

Re: [PATCH v5 3/6] accel/kvm: Report the loss of a large memory page

2025-01-27 Thread William Roche
On 1/14/25 15:09, David Hildenbrand wrote: On 10.01.25 22:14, “William Roche wrote: From: William Roche In case of a large page impacted by a memory error, enhance the existing Qemu error message which indicates that the error is injected in the VM, adding "on lost large page SIZE@ADDR". Incl

Re: [PATCH v5 2/6] system/physmem: poisoned memory discard on reboot

2025-01-27 Thread William Roche
On 1/14/25 15:07, David Hildenbrand wrote: On 10.01.25 22:14, “William Roche wrote: From: William Roche Repair poisoned memory location(s), calling ram_block_discard_range(): punching a hole in the backend file when necessary and regenerating a usable memory. If the kernel doesn't support the

Re: [PATCH v4 2/7] system/physmem: poisoned memory discard on reboot

2025-01-27 Thread William Roche
On 1/14/25 15:00, David Hildenbrand wrote: If we can get the current set of fixes integrated, I'll submit another fix proposal to take the fd_offset into account in a second time. (Not enlarging the current set) But here is what I'm thinking about. That we can discuss later if you want: @@ -3

Re: [PATCH v5 1/6] system/physmem: handle hugetlb correctly in qemu_ram_remap()

2025-01-27 Thread William Roche
On 1/14/25 15:02, David Hildenbrand wrote: On 10.01.25 22:14, “William Roche wrote: From: William Roche The list of hwpoison pages used to remap the memory on reset is based on the backend real page size. When dealing with hugepages, we create a single entry for the entire page. To correctly

  1   2   3   4   >