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

2025-01-28 Thread David Hildenbrand
On 28.01.25 01: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 si

Re: [PATCH v2 07/15] target/ppc: Restrict powerpc_checkstop() to TCG

2025-01-28 Thread Harsh Prateek Bora
On 1/27/25 15:56, Philippe Mathieu-Daudé wrote: Expose powerpc_checkstop() prototype, and move it to tcg-excp_helper.c, only built when TCG is available. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Harsh Prateek Bora --- target/ppc/internal.h| 4 +++- target/ppc/excp_

Re: [PATCH v2 09/15] target/ppc: Restrict exception helpers to TCG

2025-01-28 Thread Harsh Prateek Bora
On 1/27/25 15:56, Philippe Mathieu-Daudé wrote: Move exception helpers to tcg-excp_helper.c so they are only built when TCG is selected. Signed-off-by: Philippe Mathieu-Daudé --- target/ppc/excp_helper.c | 34 target/ppc/tcg-excp_helper.c | 38

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

2025-01-28 Thread Philippe Mathieu-Daudé
On 28/1/25 10:27, Daniel P. Berrangé wrote: On Tue, Jan 28, 2025 at 10:17:33AM +0100, Philippe Mathieu-Daudé wrote: On 28/1/25 10:02, Alex Bennée wrote: Thomas Huth writes: On 28/01/2025 01.42, Richard Henderson wrote: Time for our biennial attempt to kill ancient hosts. I've been re-workin

Re: [PATCH 02/11] acpi/ghes: add a firmware file with HEST address

2025-01-28 Thread Mauro Carvalho Chehab
Em Thu, 23 Jan 2025 10:02:17 + Jonathan Cameron escreveu: > On Wed, 22 Jan 2025 16:46:19 +0100 > Mauro Carvalho Chehab wrote: > > > Store HEST table address at GPA, placing its content at > > hest_addr_le variable. > > > > Signed-off-by: Mauro Carvalho Chehab > > Reviewed-by: Jonathan Cam

Re: [PATCH v2 08/15] target/ppc: Remove raise_exception_ra()

2025-01-28 Thread Philippe Mathieu-Daudé
On 28/1/25 10:46, Harsh Prateek Bora wrote: On 1/27/25 15:56, Philippe Mathieu-Daudé wrote: Introduced in commit db789c6cd33 ("ppc: Provide basic raise_exception_* functions"), raise_exception_ra() has never been used. Remove as dead code. Signed-off-by: Philippe Mathieu-Daudé Although the

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

2025-01-28 Thread Philippe Mathieu-Daudé
On 28/1/25 11:01, Philippe Mathieu-Daudé wrote: On 28/1/25 10:27, Daniel P. Berrangé wrote: On Tue, Jan 28, 2025 at 10:17:33AM +0100, Philippe Mathieu-Daudé wrote: On 28/1/25 10:02, Alex Bennée wrote: Thomas Huth writes: On 28/01/2025 01.42, Richard Henderson wrote: Time for our biennial a

Re: [PATCH V5 15/23] migration: cpr-transfer mode

2025-01-28 Thread Markus Armbruster
Steven Sistare writes: > On 1/17/2025 8:44 AM, Markus Armbruster wrote: >> Steven Sistare writes: >> >>> On 1/7/2025 7:05 AM, Markus Armbruster wrote: Steve Sistare writes: > Add the cpr-transfer migration mode, which allows the user to transfer > a guest to a new QEMU instan

Re: [PATCH 7/7] tests/qtest/migration: Allow using accelerators different of TCG / KVM

2025-01-28 Thread Richard Henderson
On 1/28/25 11:50, Fabiano Rosas wrote: Richard Henderson writes: On 1/28/25 07:04, Fabiano Rosas wrote: Philippe Mathieu-Daudé writes: There is no particular reason to restrict all the framework to TCG or KVM, since we can check on a per-test basis which accelerator is available (via Migra

Re: [PATCH 6/9] cpus: Call hotplug handlers in DeviceWire()

2025-01-28 Thread Richard Henderson
On 1/28/25 06:21, Philippe Mathieu-Daudé wrote: To call the hotplug handlers with REALIZED vCPU, we can use the DeviceWire handler. Signed-off-by: Philippe Mathieu-Daudé --- hw/core/cpu-common.c | 11 ++- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/hw/core/cpu-commo

Re: [PATCH] hw/arm/virt: Support larger highmem MMIO regions

2025-01-28 Thread Matt Ochs
> On Jan 28, 2025, at 11:52 AM, Eric Auger wrote: > > Hi Matthew, Shameer, > > On 1/28/25 6:36 PM, Shameerali Kolothum Thodi wrote: >> >>> -Original Message- >>> From: Matthew R. Ochs >>> Sent: Tuesday, January 28, 2025 4:03 PM >>> To: qemu-devel@nongnu.org; Shameerali Kolothum Thodi >

[PATCH 0/5] tests/functional: Update Aspeed OpenBMC images

2025-01-28 Thread Cédric Le Goater
Hello, This series updates the OpenBMC firmware images to the latest version for existing tests and also adds 2 new tests for Aspeed machines which were not tested before : witherspoon and bletchley. Thanks, C. Cédric Le Goater (5): tests/functional: Introduce a new test routine for OpenBMC i

Re: [PATCH V5 15/23] migration: cpr-transfer mode

2025-01-28 Thread Steven Sistare
On 1/28/2025 6:56 AM, Markus Armbruster wrote: Steven Sistare writes: On 1/17/2025 8:44 AM, Markus Armbruster wrote: Steven Sistare writes: On 1/7/2025 7:05 AM, Markus Armbruster wrote: Steve Sistare writes: Add the cpr-transfer migration mode, which allows the user to transfer a guest

Re: [PATCH V7 00/24] Live update: cpr-transfer

2025-01-28 Thread Steven Sistare
On 1/27/2025 10:39 AM, Fabiano Rosas wrote: Steve Sistare writes: What? This patch series adds the live migration cpr-transfer mode, which allows the user to transfer a guest to a new QEMU instance on the same host with minimal guest pause time, by preserving guest RAM in place, albeit with n

Re: [PATCH] tests/functional: Add a ppc64 mac99 test

2025-01-28 Thread Cédric Le Goater
+    self.vm.set_console() + +    self.vm.add_args('-kernel', linux_path, + '-append', 'root=/dev/sda', + '-drive', f'file={rootfs_path},format=raw', + '-net', 'nic,model=sungem', '-net', 'user', The machine alrea

[PATCH v2] tests/functional: Add a ppc64 mac99 test

2025-01-28 Thread Cédric Le Goater
The test sequence boots from disk a mac99 machine in 64-bit mode, in which case the CPU is a PPC 970. The buildroot rootfs is built with config : BR2_powerpc64=y BR2_powerpc_970=y and the kernel with the g5 deconfig. Reviewed-by: Thomas Huth Signed-off-by: Cédric Le Goater --- Changes in v2

Re: [PATCH V5 15/23] migration: cpr-transfer mode

2025-01-28 Thread Steven Sistare
On 1/28/2025 6:56 AM, Markus Armbruster wrote: Steven Sistare writes: On 1/17/2025 8:44 AM, Markus Armbruster wrote: Steven Sistare writes: On 1/7/2025 7:05 AM, Markus Armbruster wrote: Steve Sistare writes: Add the cpr-transfer migration mode, which allows the user to transfer a guest

Re: [PATCH] tests/functional: Add a ppc64 mac99 test

2025-01-28 Thread Richard Henderson
On 1/28/25 12:23, BALATON Zoltan wrote: Oh, you're right, OpenBIOS hangs with "milliseconds isn't unique" when running "qemu- system-ppc64 -M mac99 -display none -serial stdio" ... that's weird... so you need to keep the -nographic here, indeed! That's because of -display none, without that yo

Re: [PATCH 0/9] hw/sysbus/platform-bus: Introduce TYPE_DYNAMIC_SYS_BUS_DEVICE

2025-01-28 Thread Bernhard Beschow
Am 28. Januar 2025 15:10:18 UTC schrieb "Philippe Mathieu-Daudé" : >On 28/1/25 13:57, BALATON Zoltan wrote: >> On Tue, 28 Jan 2025, Peter Maydell wrote: >>> On Tue, 28 Jan 2025 at 10:42, Gerd Hoffmann wrote: On Sat, Jan 25, 2025 at 07:13:34PM +0100, Philippe Mathieu-Daudé wrote: >>>

Re: [PATCH] tests/qtest/qom-test: Test retrieval of machine class properties

2025-01-28 Thread Fabiano Rosas
Thomas Huth writes: > There were recently some crashes that occurred when trying to > retrieve the properties of machines. Let's add a test to avoid > regression here. > > Signed-off-by: Thomas Huth Reviewed-by: Fabiano Rosas

Re: [PATCH 06/21] hw/arm/fsl-imx8mp: Implement clock tree

2025-01-28 Thread Bernhard Beschow
Am 28. Januar 2025 14:35:14 UTC schrieb Peter Maydell : >On Mon, 20 Jan 2025 at 20:38, Bernhard Beschow wrote: >> >> Fixes quite a few stack traces during the Linux boot process. Also provides >> the >> clocks for devices added later, e.g. enet1. >> >> Signed-off-by: Bernhard Beschow >> ---

Re: [PATCH 09/21] hw/arm/fsl-imx8mp: Add PCIe support

2025-01-28 Thread Bernhard Beschow
Am 28. Januar 2025 14:33:14 UTC schrieb Peter Maydell : >On Mon, 20 Jan 2025 at 20:38, Bernhard Beschow wrote: >> >> Linux checks for the PLLs in the PHY to be locked, so implement a model >> emulating that. >> >> Signed-off-by: Bernhard Beschow > >> diff --git a/docs/system/arm/imx8mp-evk.rs

Re: [PATCH 05/21] hw/arm: Add i.MX 8M Plus EVK board

2025-01-28 Thread Bernhard Beschow
Am 28. Januar 2025 14:29:53 UTC schrieb Peter Maydell : >On Mon, 20 Jan 2025 at 20:38, Bernhard Beschow wrote: >> >> As a first step, implement the bare minimum: CPUs, RAM, interrupt controller, >> serial. All other devices of the A53 memory map are represented as >> TYPE_UNIMPLEMENTED_DEVICE,

Re: [PATCH 20/21] hw/i2c: Import TCA6416 emulation from Xilinx

2025-01-28 Thread Bernhard Beschow
Am 21. Januar 2025 03:07:39 UTC schrieb BALATON Zoltan : >On Mon, 20 Jan 2025, Bernhard Beschow wrote: >> Xilinx QEMU implements a TCA6416 device model which may be useful for the >> broader QEMU community, so upstream it. In the Xilinx fork, the device model >> gets compiled whenever CONFIG_CAD

[PATCH] dbus: add -audio dbus nsamples option

2025-01-28 Thread marcandre . lureau
From: Marc-André Lureau Allow to set the number of audio samples per read/write to dbus. Signed-off-by: Marc-André Lureau --- qapi/audio.json | 22 +- audio/dbusaudio.c| 21 ++--- ui/dbus-display1.xml | 12 3 files changed, 51 insertion

Re: [PATCH 1/2] tests/qtest: Extract qtest_qom_has_concrete_type() helper

2025-01-28 Thread Thomas Huth
On 28/01/2025 12.18, Philippe Mathieu-Daudé wrote: Extract qtest_qom_has_concrete_type() out of qtest_has_device() in order to re-use it in the following commit. Signed-off-by: Philippe Mathieu-Daudé --- tests/qtest/libqtest.c | 89 -- 1 file changed,

Re: [PATCH 2/2] tests/qtest: Make qtest_has_accel() generic

2025-01-28 Thread Thomas Huth
On 28/01/2025 12.18, Philippe Mathieu-Daudé wrote: Since commit b14a0b7469f ("accel: Use QOM classes for accel types") accelerators are registered as QOM objects. Use QOM as a generic API to query for available accelerators. This is in particular useful to query hardware accelerators such HFV, Xe

Re: [PATCH] block-backend: protect setting block root to NULL with block graph write lock

2025-01-28 Thread Fiona Ebner
Am 16.01.25 um 16:52 schrieb Kevin Wolf: > Am 10.01.2025 um 17:37 hat Fiona Ebner geschrieben: >> Am 09.01.25 um 11:47 schrieb Kevin Wolf: >>> Am 08.01.2025 um 13:46 hat Fiona Ebner geschrieben: Setting blk->root is a graph change operation and thus needs to be protected by the block grap

Re: [PATCH 07/76] target/arm: Use vfp.fp_status_a64 in A64-only helper functions

2025-01-28 Thread Peter Maydell
On Sat, 25 Jan 2025 at 15:16, Richard Henderson wrote: > > On 1/24/25 08:27, Peter Maydell wrote: > > @@ -2808,7 +2808,7 @@ bool is_ebf(CPUARMState *env, float_status *statusp, > > float_status *oddstatusp) > >*/ > > bool ebf = is_a64(env) && env->vfp.fpcr & FPCR_EBF; > > > > -*

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

2025-01-28 Thread BALATON Zoltan
On Tue, 28 Jan 2025, Harsh Prateek Bora wrote: 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 de

Re: [PATCH 0/9] hw/sysbus/platform-bus: Introduce TYPE_DYNAMIC_SYS_BUS_DEVICE

2025-01-28 Thread BALATON Zoltan
On Tue, 28 Jan 2025, Peter Maydell wrote: On Tue, 28 Jan 2025 at 10:42, Gerd Hoffmann wrote: On Sat, Jan 25, 2025 at 07:13:34PM +0100, Philippe Mathieu-Daudé wrote: Some SysBus devices can optionally be dynamically plugged onto the sysbus-platform-bus (then virtual guests are aware of mmio ma

[Stable-8.2.9 04/45] linux-user: Fix strace output for s390x mmap()

2025-01-28 Thread Michael Tokarev
print_mmap() assumes that mmap() receives arguments via memory if mmap2() is present. s390x (as opposed to s390) does not fit this pattern: it does not have mmap2(), but mmap() still receives arguments via memory. Fix by sharing the detection logic between syscall.c and strace.c. Cc: qemu-sta...@

[Stable-9.1.3 34/58] target/i386: Reset TSCs of parked vCPUs too on VM reset

2025-01-28 Thread Michael Tokarev
Since commit 5286c3662294 ("target/i386: properly reset TSC on reset") QEMU writes the special value of "1" to each online vCPU TSC on VM reset to reset it. However parked vCPUs don't get that handling and due to that their TSCs get desynchronized when the VM gets reset. This in turn causes KVM to

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

2025-01-28 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-9.1.3 37/58] config/targets: update aarch64_be-linux-user gdb XML list

2025-01-28 Thread Michael Tokarev
Attempting to run the binary asserts when it can't find the XML entry. We can fix it so we don't although I suspect other stuff is broken. Fixes: https://gitlab.com/qemu-project/qemu/-/issues/2580 Reviewed-by: Pierrick Bouvier Signed-off-by: Alex Bennée Message-Id: <20241023113406.1284676-13-ale

[Stable-9.1.3 14/58] tests/9p: add missing Rgetattr response name

2025-01-28 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-9.1.3 20/58] target/ppc: Fix THREAD_SIBLING_FOREACH for multi-socket

2025-01-28 Thread Michael Tokarev
The THREAD_SIBLING_FOREACH macro wasn't excluding threads from other chips. Add chip_index field to the thread state and add a check for the new field in the macro. Fixes: b769d4c8f4c6 ("target/ppc: Add initial flags and helpers for SMT support") Signed-off-by: Glenn Miles [npiggin: set chip_ind

[Stable-9.1.3 05/58] virtio-net: Fix size check in dhclient workaround

2025-01-28 Thread Michael Tokarev
work_around_broken_dhclient() accesses IP and UDP headers to detect relevant packets and to calculate checksums, but it didn't check if the packet has size sufficient to accommodate them, causing out-of-bound access hazards. Fix this by correcting the size requirement. Fixes: 1d41b0c1ec66 ("Work a

[Stable-9.1.3 46/58] migration: Dump correct JSON format for nullptr replacement

2025-01-28 Thread Michael Tokarev
QEMU plays a trick with null pointers inside an array of pointers in a VMSD field. See 07d4e69147 ("migration/vmstate: fix array of ptr with nullptrs") for more details on why. The idea makes sense in general, but it may overlooked the JSON writer where it could write nothing in a "struct" in the

[Stable-9.1.3 43/58] migration: Fix parsing of s390 stream

2025-01-28 Thread Michael Tokarev
The parsing for the S390StorageAttributes section is currently leaving an unconsumed token that is later interpreted by the generic code as QEMU_VM_EOF, cutting the parsing short. The migration will issue a STATTR_FLAG_DONE between iterations, which the script consumes correctly, but there's a fin

[Stable-9.1.3 57/58] tests: acpi: update expected blobs

2025-01-28 Thread Michael Tokarev
_DSM function 7 AML should have followig change: If ((Arg2 == 0x07)) { -Local0 = Package (0x02) -{ -Zero, -"" -} Local2 = AIDX (DerefOf

[Stable-9.1.3 28/58] x86/loader: only patch linux kernels

2025-01-28 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-9.1.3 49/58] multifd: bugfix for incorrect migration data with QPL compression

2025-01-28 Thread Michael Tokarev
When QPL compression is enabled on the migration channel and the same dirty page changes from a normal page to a zero page in the iterative memory copy, the dirty page will not be updated to a zero page again on the target side, resulting in incorrect memory data on the source and target sides. Th

[Stable-9.1.3 10/58] virtio-net: Add queues before loading them

2025-01-28 Thread Michael Tokarev
Call virtio_net_set_multiqueue() to add queues before loading their states. Otherwise the loaded queues will not have handlers and elements in them will not be processed. Cc: qemu-sta...@nongnu.org Fixes: 8c49756825da ("virtio-net: Add only one queue pair when realizing") Reported-by: Laurent Vivi

[Stable-8.2.9 19/45] target/riscv: Avoid bad shift in riscv_cpu_do_interrupt()

2025-01-28 Thread Michael Tokarev
In riscv_cpu_do_interrupt() we use the 'cause' value we got out of cs->exception as a shift value. However this value can be larger than 31, which means that "1 << cause" is undefined behaviour, because we do the shift on an 'int' type. This causes the undefined behaviour sanitizer to complain on

[Stable-9.1.3 25/58] 9pfs: fix regression regarding CVE-2023-2861

2025-01-28 Thread Michael Tokarev
The released fix for this CVE: f6b0de53fb8 ("9pfs: prevent opening special files (CVE-2023-2861)") caused a regression with security_model=passthrough. When handling a 'Tmknod' request there was a side effect that 'Tmknod' request could fail as 9p server was trying to adjust permissions: #6

[Stable-9.1.3 42/58] migration: Remove unused argument in vmsd_desc_field_end

2025-01-28 Thread Michael Tokarev
Reviewed-by: Peter Xu Message-Id: <20250109185249.23952-3-faro...@suse.de> Signed-off-by: Fabiano Rosas (cherry picked from commit 2aead53d39b828f8d9d0769ffa3579dadd64d846) Signed-off-by: Michael Tokarev diff --git a/migration/vmstate.c b/migration/vmstate.c index fa002b24e8..aa2821dec6 100644

[Stable-9.1.3 38/58] target/loongarch: Use actual operand size with vbsrl check

2025-01-28 Thread Michael Tokarev
Hardcoded 32 bytes is used for vbsrl emulation check, there is problem when options lsx=on,lasx=off is used for vbsrl.v instruction in TCG mode. It injects LASX exception rather LSX exception. Here actual operand size is used. Cc: qemu-sta...@nongnu.org Fixes: df97f338076 ("target/loongarch: Impl

[Stable-9.1.3 26/58] tcg: Reset free_temps before tcg_optimize

2025-01-28 Thread Michael Tokarev
When allocating new temps during tcg_optmize, do not re-use any EBB temps that were used within the TB. We do not have any idea what span of the TB in which the temp was live. Introduce tcg_temp_ebb_reset_freed and use before tcg_optimize, as well as replacing the equivalent in plugin_gen_inject

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

2025-01-28 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

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

2025-01-28 Thread Philippe Mathieu-Daudé
On 28/1/25 10:02, Alex Bennée wrote: Thomas Huth writes: 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 add

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

2025-01-28 Thread Daniel P . Berrangé
On Tue, Jan 28, 2025 at 10:17:33AM +0100, Philippe Mathieu-Daudé wrote: > On 28/1/25 10:02, Alex Bennée wrote: > > Thomas Huth writes: > > > > > 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 gen

Re: [PATCH v2 08/15] target/ppc: Remove raise_exception_ra()

2025-01-28 Thread Harsh Prateek Bora
On 1/27/25 15:56, Philippe Mathieu-Daudé wrote: Introduced in commit db789c6cd33 ("ppc: Provide basic raise_exception_* functions"), raise_exception_ra() has never been used. Remove as dead code. Signed-off-by: Philippe Mathieu-Daudé Although there are a bunch of raise_exception_err_ra cal

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

2025-01-28 Thread Peter Maydell
On Mon, 27 Jan 2025 at 23:11, Bernhard Beschow wrote: > > > > 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

[PULL 00/48] i386, rust changes for 2024-01-24

2025-01-28 Thread Paolo Bonzini
The following changes since commit d6430c17d7113d3c38480dc34e59d00b0504e2f7: Merge tag 'pull-riscv-to-apply-20250119-1' of https://github.com/alistair23/qemu into staging (2025-01-19 08:55:46 -0500) are available in the Git repository at: https://gitlab.com/bonzini/qemu.git tags/for-upstrea

[PULL 38/48] rust: pl011: extract conversion to RegisterOffset

2025-01-28 Thread Paolo Bonzini
As an added bonus, this also makes the new function return u32 instead of u64, thus factoring some casts into a single place. Reviewed-by: Zhao Liu Signed-off-by: Paolo Bonzini --- rust/hw/char/pl011/src/device.rs | 137 ++- rust/hw/char/pl011/src/lib.rs| 2 +-

Re: [PATCH 05/11] acpi/generic_event_device: add logic to detect if HEST addr is available

2025-01-28 Thread Mauro Carvalho Chehab
Em Fri, 24 Jan 2025 11:23:46 +0100 Igor Mammedov escreveu: > On Wed, 22 Jan 2025 16:46:22 +0100 > Mauro Carvalho Chehab wrote: > > > Create a new property (x-has-hest-addr) and use it to detect if > > the GHES table offsets can be calculated from the HEST address > > (qemu 9.2 and upper) or via

[Stable-9.1.3 15/58] tests/9p: add 'use-after-unlink' test

2025-01-28 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-9.1.3 47/58] migration: Fix arrays of pointers in JSON writer

2025-01-28 Thread Michael Tokarev
Currently, if an array of pointers contains a NULL pointer, that pointer will be encoded as '0' in the stream. Since the JSON writer doesn't define a "pointer" type, that '0' will now be an uint8, which is different from the original type being pointed to, e.g. struct. (we're further calling uint8

[Stable-9.1.3 09/58] migration: Allow pipes to keep working for fd migrations

2025-01-28 Thread Michael Tokarev
Libvirt may still use pipes for old file migrations in fd: URI form, especially when loading old images dumped from Libvirt's compression algorithms. In that case, Libvirt needs to compress / uncompress the images on its own over the migration binary stream, and pipes are passed over to QEMU for o

[Stable-9.1.3 50/58] tests/qtest/boot-serial-test: Correct HPPA machine name

2025-01-28 Thread Michael Tokarev
Commit 7df6f751176 ("hw/hppa: Split out machine creation") renamed the 'hppa' machine as 'B160L', but forgot to update the boot serial test, which ended being skipped. Cc: qemu-sta...@nongnu.org Fixes: 7df6f751176 ("hw/hppa: Split out machine creation") Reported-by: Thomas Huth Signed-off-by: Phi

[Stable-7.2.16 30/31] pci: acpi: Windows 'PCI Label Id' bug workaround

2025-01-28 Thread Michael Tokarev
Current versions of Windows call _DSM(func=7) regardless of whether it is supported or not. It leads to NICs having bogus 'PCI Label Id = 0', where none should be set at all. Also presence of 'PCI Label Id' triggers another Windows bug on localized versions that leads to hangs. The later bug is fi

[Stable-9.1.3 44/58] s390x: Fix CSS migration

2025-01-28 Thread Michael Tokarev
Commit a55ae46683 ("s390: move css_migration_enabled from machine to css.c") disabled CSS migration globally instead of doing it per-instance. CC: Paolo Bonzini CC: qemu-sta...@nongnu.org #9.1 Fixes: a55ae46683 ("s390: move css_migration_enabled from machine to css.c") Resolves: https://gitlab.co

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

2025-01-28 Thread Alex Bennée
Thomas Huth writes: > 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

[Stable-8.2.9 18/45] hw/openrisc/openrisc_sim: keep serial@90000000 as default

2025-01-28 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

Re: [PATCH 08/10] rust: qdev: switch from legacy reset to Resettable

2025-01-28 Thread Zhao Liu
> For now I prefer to make things homogeneous... this way if someone has > to copy the code into a wrapper for a new interface they don't have to > wonder about small differences. Yes. > (This by the way will also be a reason to use function pointers for > character devices as well, instead of th

Re: [PATCH 1/2] plugin: extend API with qemu_plugin_tb_get_insn_by_vaddr

2025-01-28 Thread Alex Bennée
Luke Craig writes: > --- > include/qemu/qemu-plugin.h | 11 +++ > plugins/api.c | 13 + > 2 files changed, 24 insertions(+) > > diff --git a/include/qemu/qemu-plugin.h b/include/qemu/qemu-plugin.h > index 3a850aa216..a1c478c54f 100644 > --- a/include/qemu/qemu-pl

[PATCH 0/2] tests/qtest: Make qtest_has_accel() generic

2025-01-28 Thread Philippe Mathieu-Daudé
In preparation of running QTests using HVF on Darwin, make qtest_has_accel() generic. Note, this also allow running other accelerators such Xen, WHPX, ... Philippe Mathieu-Daudé (2): tests/qtest: Extract qtest_qom_has_concrete_type() helper tests/qtest: Make qtest_has_accel() generic tests/

[PATCH 2/2] tests/qtest: Make qtest_has_accel() generic

2025-01-28 Thread Philippe Mathieu-Daudé
Since commit b14a0b7469f ("accel: Use QOM classes for accel types") accelerators are registered as QOM objects. Use QOM as a generic API to query for available accelerators. This is in particular useful to query hardware accelerators such HFV, Xen or WHPX which otherwise have their definitions pois

[PATCH 1/2] tests/qtest: Extract qtest_qom_has_concrete_type() helper

2025-01-28 Thread Philippe Mathieu-Daudé
Extract qtest_qom_has_concrete_type() out of qtest_has_device() in order to re-use it in the following commit. Signed-off-by: Philippe Mathieu-Daudé --- tests/qtest/libqtest.c | 89 -- 1 file changed, 51 insertions(+), 38 deletions(-) diff --git a/tests/q

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

2025-01-28 Thread Prasad Pandit
On Tue, 28 Jan 2025 at 11:00, Prasad Pandit wrote: > > for (int i = 0; i < MIGRATION_CAPABILITY__MAX; i++) { > > if (args->caps[i]) { > > migrate_set_capability(from, > > MigrationCapability_str(args->caps[i]), true); > > migrate_set_capability(to, > > Migrati

[Stable-9.1.3 58/58] hw/cxl: Fix msix_notify: Assertion `vector < dev->msix_entries_nr`

2025-01-28 Thread Michael Tokarev
This assertion always happens when we sanitize the CXL memory device. $ echo 1 > /sys/bus/cxl/devices/mem0/security/sanitize It is incorrect to register an MSIX number beyond the device's capability. Increase the device's MSIX number to cover the mailbox msix number(9). Fixes: 43efb0bfad2b ("hw/

[Stable-9.1.3 16/58] 9pfs: remove obsolete comment in v9fs_getattr()

2025-01-28 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-9.1.3 45/58] migration: Rename vmstate_info_nullptr

2025-01-28 Thread Michael Tokarev
Rename vmstate_info_nullptr from "uint64_t" to "nullptr". This vmstate actually reads and writes just a byte, so the proper name would be uint8. However, since this is a marker for a NULL pointer, it's convenient to have a more explicit name that can be identified by the consumers of the JSON part

[Stable-8.2.9 33/45] s390x/s390-virtio-ccw: don't crash on weird RAM sizes

2025-01-28 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-8.2.9 20/45] Update FreeBSD CI jobs FreeBSD 14.1

2025-01-28 Thread Michael Tokarev
The current FreeBSD CI jobs are failing installation since the "opencv" package is now missing there. Updating to 14.1 fixes the issue. Message-Id: <20240911090149.286257-1-th...@redhat.com> Reviewed-by: Li-Wen Hsu Signed-off-by: Thomas Huth (cherry picked from commit b4358ed4fd29c21c69e492d814f

[Stable-8.2.9 27/45] edk2: get version + date from git submodule

2025-01-28 Thread Michael Tokarev
Turned out hard-coding version and date in the Makefile wasn't a bright idea. Updating it on edk2 updates is easily forgotten. Fetch the info from git instead. Store in edk2-version, so this can be committed to the repo and is present in tarballs too. Reviewed-by: Peter Maydell Signed-off-by:

[Stable-8.2.9 28/45] edk2: commit version info

2025-01-28 Thread Michael Tokarev
Reviewed-by: Peter Maydell Signed-off-by: Gerd Hoffmann Message-ID: <20240327102448.61877-3-kra...@redhat.com> (cherry picked from commit 6494a08d1025c1ca5341af61e47d1e369c2877c8) Signed-off-by: Michael Tokarev diff --git a/roms/edk2-version b/roms/edk2-version new file mode 100644 index 00

[Stable-7.2.16 05/31] virtio-net: Fix size check in dhclient workaround

2025-01-28 Thread Michael Tokarev
work_around_broken_dhclient() accesses IP and UDP headers to detect relevant packets and to calculate checksums, but it didn't check if the packet has size sufficient to accommodate them, causing out-of-bound access hazards. Fix this by correcting the size requirement. Fixes: 1d41b0c1ec66 ("Work a

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

2025-01-28 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-8.2.9 43/45] pci: acpi: Windows 'PCI Label Id' bug workaround

2025-01-28 Thread Michael Tokarev
Current versions of Windows call _DSM(func=7) regardless of whether it is supported or not. It leads to NICs having bogus 'PCI Label Id = 0', where none should be set at all. Also presence of 'PCI Label Id' triggers another Windows bug on localized versions that leads to hangs. The later bug is fi

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

2025-01-28 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-8.2.9 37/45] tests/qtest/boot-serial-test: Correct HPPA machine name

2025-01-28 Thread Michael Tokarev
Commit 7df6f751176 ("hw/hppa: Split out machine creation") renamed the 'hppa' machine as 'B160L', but forgot to update the boot serial test, which ended being skipped. Cc: qemu-sta...@nongnu.org Fixes: 7df6f751176 ("hw/hppa: Split out machine creation") Reported-by: Thomas Huth Signed-off-by: Phi

[Stable-7.2.16 09/31] tests/9p: fix Rreaddir response name

2025-01-28 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 14/31] tests/9p: also check 'Tgetattr' in 'use-after-unlink' test

2025-01-28 Thread Michael Tokarev
This verifies expected behaviour of previous bug fix patch. Signed-off-by: Christian Schoenebeck Reviewed-by: Greg Kurz Message-Id: <7017658155c517b9665b75333a97c79aa2d4f3df.1732465720.git.qemu_...@crudebyte.com> (cherry picked from commit eaab44ccc59b83d8dff60fca3361a9b98ec7fee6) Signed-off-by

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

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

[Stable-8.2.9 08/45] scsi: megasas: Internal cdbs have 16-byte length

2025-01-28 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-8.2.9 32/45] vhost-user: fix shared object return values

2025-01-28 Thread Michael Tokarev
VHOST_USER_BACKEND_SHARED_OBJECT_ADD and VHOST_USER_BACKEND_SHARED_OBJECT_REMOVE state in the spec that they return 0 for successful operations, non-zero otherwise. However, implementation relies on the return types of the virtio-dmabuf library, with opposite semantics (true if everything is correc

[Stable-9.1.3 13/58] tests/9p: fix Rreaddir response name

2025-01-28 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-8.2.9 22/45] .gitlab-ci.d/cirrus: Drop support for macOS 13 (Ventura)

2025-01-28 Thread Michael Tokarev
macOS 15 "Sequoia" was released on September 16, 2024 [1]. According to QEMU's support policy, we stop supporting the previous major release two years after the the new major release has been published. Time to remove support for macOS 13 (Ventura, released on October 2022, [2]). Promote the macO

[Stable-9.1.3 35/58] hw/intc/riscv_aplic: Fix APLIC in_clrip and clripnum write emulation

2025-01-28 Thread Michael Tokarev
In the section "4.7 Precise effects on interrupt-pending bits" of the RISC-V AIA specification defines that: "If the source mode is Level1 or Level0 and the interrupt domain is configured in MSI delivery mode (domaincfg.DM = 1): The pending bit is cleared whenever the rectified input value is low,

[Stable-8.2.9 24/45] tcg/riscv: Fix StoreStore barrier generation

2025-01-28 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-9.1.3 18/58] tests/9p: also check 'Tgetattr' in 'use-after-unlink' test

2025-01-28 Thread Michael Tokarev
This verifies expected behaviour of previous bug fix patch. Signed-off-by: Christian Schoenebeck Reviewed-by: Greg Kurz Message-Id: <7017658155c517b9665b75333a97c79aa2d4f3df.1732465720.git.qemu_...@crudebyte.com> (cherry picked from commit eaab44ccc59b83d8dff60fca3361a9b98ec7fee6) Signed-off-by

[Stable-8.2.9 44/45] tests: acpi: update expected blobs

2025-01-28 Thread Michael Tokarev
_DSM function 7 AML should have followig change: If ((Arg2 == 0x07)) { -Local0 = Package (0x02) -{ -Zero, -"" -} Local2 = AIDX (DerefOf

[Stable-8.2.9 14/45] tests/9p: also check 'Tgetattr' in 'use-after-unlink' test

2025-01-28 Thread Michael Tokarev
This verifies expected behaviour of previous bug fix patch. Signed-off-by: Christian Schoenebeck Reviewed-by: Greg Kurz Message-Id: <7017658155c517b9665b75333a97c79aa2d4f3df.1732465720.git.qemu_...@crudebyte.com> (cherry picked from commit eaab44ccc59b83d8dff60fca3361a9b98ec7fee6) Signed-off-by

[Stable-7.2.16 27/31] pci: ensure valid link status bits for downstream ports

2025-01-28 Thread Michael Tokarev
PCI hotplug for downstream endpoints on arm fails because Linux' PCIe hotplug driver doesn't like the QEMU provided LNKSTA: pcieport :08:01.0: pciehp: Slot(2): Card present pcieport :08:01.0: pciehp: Slot(2): Link Up pcieport :08:01.0: pciehp: Slot(2): Cannot train link: status 0

[Stable-9.1.3 19/58] target/ppc: Fix non-maskable interrupt while halted

2025-01-28 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-9.1.3 12/58] scsi: megasas: Internal cdbs have 16-byte length

2025-01-28 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-8.2.9 26/45] x86/loader: only patch linux kernels

2025-01-28 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-9.1.3 48/58] multifd: bugfix for migration using compression methods

2025-01-28 Thread Michael Tokarev
When compression is enabled on the migration channel and the pages processed are all zero pages, these pages will not be sent and updated on the target side, resulting in incorrect memory data on the source and target sides. The root cause is that all compression methods call multifd_send_prepare_

<    1   2   3   4   5   >