[PATCH v5 2/4] coreaudio: Commit the result of init in the end

2025-01-22 Thread Akihiko Odaki
init_out_device may only commit some part of the result and leave the state inconsistent when it encounters a fatal error or the device gets unplugged during the operation, which is expressed by kAudioHardwareBadObjectError or kAudioHardwareBadDeviceError. Commit the result in the end of the functi

[PATCH v5 4/4] coreaudio: Initialize the buffer for device change

2025-01-22 Thread Akihiko Odaki
Reallocate buffers when the active device change as the required buffer size may differ. Signed-off-by: Akihiko Odaki Reviewed-by: Phil Dennis-Jordan Acked-by: Christian Schoenebeck --- audio/coreaudio.m | 1 + 1 file changed, 1 insertion(+) diff --git a/audio/coreaudio.m b/audio/coreaudio.m

[PATCH v5 3/4] audio: Add functions to initialize buffers

2025-01-22 Thread Akihiko Odaki
These functions can be used to re-initialize buffers when hardware parameters change due to device hotplug, for example. Signed-off-by: Akihiko Odaki Reviewed-by: Phil Dennis-Jordan Reviewed-by: Christian Schoenebeck --- audio/audio_int.h | 2 ++ audio/audio.c | 24 ++-

[PATCH v5 1/4] coreaudio: Improve naming

2025-01-22 Thread Akihiko Odaki
coreaudio had names that are not conforming to QEMU codding style. coreaudioVoiceOut also had some members that are prefixed with redundant words like "output" or "audio". Global names included "out" to tell they are specific to output devices, but this rule was not completely enforced. The frame s

[PATCH v5 0/4] coreaudio fixes

2025-01-22 Thread Akihiko Odaki
This series contains two fixes for coreaudio. See each one for details. Signed-off-by: Akihiko Odaki --- Changes in v5: - Added patch "coreaudio: Improve naming", removing verbose names like outputDeviceID and audioDevicePropertyBufferFrameSize altogether. - Link to v4: https://lore.kernel.org

Re: [PATCH 10/10] rust: qdev: make reset take a shared reference

2025-01-22 Thread Zhao Liu
On Fri, Jan 17, 2025 at 10:26:57AM +0100, Paolo Bonzini wrote: > Date: Fri, 17 Jan 2025 10:26:57 +0100 > From: Paolo Bonzini > Subject: [PATCH 10/10] rust: qdev: make reset take a shared reference > X-Mailer: git-send-email 2.47.1 > > Because register reset is within a borrow_mut() call, reset >

Re: [PATCH 09/10] rust: pl011: pull device-specific code out of MemoryRegionOps callbacks

2025-01-22 Thread Zhao Liu
On Fri, Jan 17, 2025 at 10:26:56AM +0100, Paolo Bonzini wrote: > Date: Fri, 17 Jan 2025 10:26:56 +0100 > From: Paolo Bonzini > Subject: [PATCH 09/10] rust: pl011: pull device-specific code out of > MemoryRegionOps callbacks > X-Mailer: git-send-email 2.47.1 > > read() can now return a simple u64

Re: [PATCH 08/10] rust: pl011: remove duplicate definitions

2025-01-22 Thread Zhao Liu
On Fri, Jan 17, 2025 at 10:26:55AM +0100, Paolo Bonzini wrote: > Date: Fri, 17 Jan 2025 10:26:55 +0100 > From: Paolo Bonzini > Subject: [PATCH 08/10] rust: pl011: remove duplicate definitions > X-Mailer: git-send-email 2.47.1 > > Unify the "Interrupt" enum and the "INT_*" constants with a struct

Re: [PATCH 07/10] rust: pl011: wrap registers with BqlRefCell

2025-01-22 Thread Zhao Liu
On Fri, Jan 17, 2025 at 10:26:54AM +0100, Paolo Bonzini wrote: > Date: Fri, 17 Jan 2025 10:26:54 +0100 > From: Paolo Bonzini > Subject: [PATCH 07/10] rust: pl011: wrap registers with BqlRefCell > X-Mailer: git-send-email 2.47.1 > > This is a step towards making memory ops use a shared reference t

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

2025-01-22 Thread Nicolin Chen
Hi Don, On Fri, Jan 10, 2025 at 11:05:24PM -0500, Donald Dutile wrote: > On 1/8/25 11:45 PM, Nicolin Chen wrote: > > On Mon, Dec 16, 2024 at 10:01:29AM +, Shameerali Kolothum Thodi wrote: > > > And patches prior to this commit adds that support: > > > 4ccdbe3: ("cover-letter: Add HW accelerate

Re: [PATCH 06/10] rust: pl011: extract PL011Registers

2025-01-22 Thread Zhao Liu
> --- a/rust/hw/char/pl011/src/device_class.rs > +++ b/rust/hw/char/pl011/src/device_class.rs > @@ -6,11 +6,11 @@ > use std::os::raw::{c_int, c_void}; > > use qemu_api::{ > -bindings::*, c_str, vmstate_clock, vmstate_fields, vmstate_of, > vmstate_subsections, > -vmstate_unused, zeroabl

Re: [PATCH] target/i386: extract common bits of gen_repz/gen_repz_nz

2025-01-22 Thread Richard Henderson
On 1/22/25 01:50, Paolo Bonzini wrote: Now that everything has been cleaned up, look at DF and prefixes in a single function, and call that one from gen_repz and gen_repz_nz. Based-on:<20241215090613.89588-1-pbonz...@redhat.com> Suggested-by: Richard Henderson Signed-off-by: Paolo Bonzini ---

Re: [PATCH] hw/virtio/vhost: Disable IOTLB callbacks when IOMMU gets disabled

2025-01-22 Thread Jason Wang
On Wed, Jan 22, 2025 at 3:55 PM Eric Auger wrote: > > Hi Jason, > > > On 1/22/25 8:17 AM, Jason Wang wrote: > > On Wed, Jan 22, 2025 at 12:25 AM Eric Auger wrote: > >> > >> Hi Jason, > >> > >> On 1/21/25 4:27 AM, Jason Wang wrote: > >>> On Tue, Jan 21, 2025 at 1:33 AM Eric Auger wrote: > Wh

[PATCH v2 1/2] hw/misc/ivshmem-pci: Rename remaining parts for consistency

2025-01-22 Thread Gustavo Romero
For consistency, rename the remaining parts of ivshmem PCI device after it was renamed from ivshmem to ivshmem-pci. Signed-off-by: Gustavo Romero --- contrib/ivshmem-client/ivshmem-client.h | 2 +- contrib/ivshmem-server/ivshmem-server.h | 2 +- docs/system/device-emula

[PATCH v2 0/2] Add me as the maintainer for ivshmem-pci

2025-01-22 Thread Gustavo Romero
Add me as the maintainer for the ivshmem-pci.c device, the ivshmem server, and the ivshmem client tool. Also, adjust remaining parts left behind after ivshmem PCI device was renamed from ivshmem.c to ivshmem-pci.c, like header files, Kconfig, docs, and build scripts. Cheers, Gustavo Gustavo Rome

[PATCH v2 2/2] MAINTAINERS: Add me as the maintainer for ivshmem-pci

2025-01-22 Thread Gustavo Romero
Add me as the maintainer for the ivshmem-pci device and for the ivshmem server and client tool. Signed-off-by: Gustavo Romero --- MAINTAINERS | 9 - 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/MAINTAINERS b/MAINTAINERS index 846b81e3ec..8327ce9c79 100644 --- a/MAINTAINER

Re: [RFC v3 4/5] virtio: add in_xlat_addr & out_xlat_addr VirtQueueElement members

2025-01-22 Thread Si-Wei Liu
On 1/16/2025 11:02 AM, Eugenio Perez Martin wrote: On Fri, Jan 10, 2025 at 6:09 PM Jonah Palmer wrote: Adds the in_xlat_addr & out_xlat_addr hwaddr arrays to the VirtQueueElement struct and introduces an optional GPA output parameter to dma_memory_map(). These arrays will store a VirtQueue

Re: [PATCH v3 1/1] system/physmem: take into account fd_offset for file fallocate

2025-01-22 Thread David Hildenbrand
On 22.01.25 20:40, “William Roche wrote: From: William Roche Punching a hole in a file with fallocate needs to take into account the fd_offset value for a correct file location. But guest_memfd internal use doesn't currently consider fd_offset. Fixes: 4b870dc4d0c0 ("hostmem-file: add offset op

Re: [PATCH v2 08/10] gdbstub: Prefer cached CpuClass over CPU_GET_CLASS() macro

2025-01-22 Thread Alex Bennée
Philippe Mathieu-Daudé writes: > CpuState caches its CPUClass since commit 6fbdff87062 > ("cpu: cache CPUClass in CPUState for hot code paths"), > use it. > > Signed-off-by: Philippe Mathieu-Daudé > Reviewed-by: Richard Henderson Acked-by: Alex Bennée -- Alex Bennée Virtualisation Tech Lead

Re: [PATCH v4 1/7] linux-user: netlink: Add missing IFA_PROTO to host_to_target_data_addr_rtattr()

2025-01-22 Thread Helge Deller
* Laurent Vivier : > [...] > It would be cleaner to replace all the IFA_XXX by their QEMU_IFA_XXX. Thanks for review, Laurent! Below I've merged patch #1 and #7, as suggested by you. Is this OK? Can you review? Thanks! Helge From: Helge Deller Date: Mon

Re: [PATCH v2 02/10] gdbstub: Clarify no more than @gdb_num_core_regs can be accessed

2025-01-22 Thread Alex Bennée
Philippe Mathieu-Daudé writes: > Both CPUClass::gdb_read_register() and CPUClass::gdb_write_register() > handlers are called from common gdbstub code, and won't be called with > register index over CPUClass::gdb_num_core_regs: > > int gdb_read_register(CPUState *cpu, GByteArray *buf, int reg) >

Re: [PATCH] crypto: fix bogus error benchmarking pbkdf on fast machines

2025-01-22 Thread Daniel P . Berrangé
On Wed, Jan 22, 2025 at 10:19:41PM +0300, Michael Tokarev wrote: > 08.01.2025 21:43, Daniel P. Berrangé пишет: > > We're seeing periodic reports of errors like: > > > > $ qemu-img create -f luks --object secret,data=123456,id=sec0 \ > >-o key-secret=sec0 luks-info.img 1M > >

Re: [PATCH v3 1/1] system/physmem: take into account fd_offset for file fallocate

2025-01-22 Thread Peter Xu
On Wed, Jan 22, 2025 at 07:40:53PM +, “William Roche wrote: > From: William Roche > > Punching a hole in a file with fallocate needs to take into account the > fd_offset value for a correct file location. > But guest_memfd internal use doesn't currently consider fd_offset. > > Fixes: 4b870dc

[PATCH v3 0/1] fallocate missing fd_offset

2025-01-22 Thread “William Roche
From: William Roche Working on the poisoned memory recovery mechanisms with David Hildenbrand, it appeared that the file hole punching done with the memory discard functions are missing the file offset value fd_offset to correctly modify the right file location. Note that guest_memfd would not c

[PATCH v3 1/1] system/physmem: take into account fd_offset for file fallocate

2025-01-22 Thread “William Roche
From: William Roche Punching a hole in a file with fallocate needs to take into account the fd_offset value for a correct file location. But guest_memfd internal use doesn't currently consider fd_offset. Fixes: 4b870dc4d0c0 ("hostmem-file: add offset option") Signed-off-by: William Roche ---

Re: [PATCH v4 1/3] coreaudio: Commit the result of init in the end

2025-01-22 Thread Christian Schoenebeck
On Friday, January 17, 2025 7:47:00 AM CET Akihiko Odaki wrote: > init_out_device may only commit some part of the result and leave the > state inconsistent when it encounters a fatal error or the device gets > unplugged during the operation, which is expressed by > kAudioHardwareBadObjectError or

Re: [PATCH v2 1/1] system/physmem: take into account fd_offset for file fallocate

2025-01-22 Thread William Roche
On 1/22/25 09:01, David Hildenbrand wrote: On 21.01.25 23:54, “William Roche wrote: From: William Roche [...] --- a/system/physmem.c +++ b/system/physmem.c @@ -3655,6 +3655,7 @@ int ram_block_discard_range(RAMBlock *rb, uint64_t start, size_t length)   need_madvise = (rb->page_size ==

Re: [PATCH] crypto: fix bogus error benchmarking pbkdf on fast machines

2025-01-22 Thread Michael Tokarev
08.01.2025 21:43, Daniel P. Berrangé пишет: We're seeing periodic reports of errors like: $ qemu-img create -f luks --object secret,data=123456,id=sec0 \ -o key-secret=sec0 luks-info.img 1M Formatting 'luks-info.img', fmt=luks size=1048576 key-secret=sec0 qemu-img: luks-

Re: [PATCH v4 3/3] coreaudio: Initialize the buffer for device change

2025-01-22 Thread Christian Schoenebeck
On Friday, January 17, 2025 7:47:02 AM CET Akihiko Odaki wrote: > Reallocate buffers when the active device change as the required buffer > size may differ. > > Signed-off-by: Akihiko Odaki OTOH it also re-allocates the buffer when the size did not change, but Ok. Acked-by: Christian Schoenebec

[PATCH 2/2] hw/hppa: Fix booting Linux kernel with initrd

2025-01-22 Thread deller
From: Helge Deller Commit 20f7b890173b ("hw/hppa: Reset vCPUs calling resettable_reset()") broke booting the Linux kernel with initrd which may have been provided on the command line. The problem is, that the mentioned commit zeroes out initial registers which were preset with addresses for the L

[PATCH 1/2] hw/hppa: Support up to 256 GiB RAM on 64-bit machines

2025-01-22 Thread deller
From: Helge Deller Allow up to 256 GB RAM, which is the maximum a rp8440 machine (the very last 64-bit PA-RISC machine) physically supports. Signed-off-by: Helge Deller --- hw/hppa/hppa_hardware.h | 2 ++ hw/hppa/machine.c | 26 +++--- 2 files changed, 21 insertions(

[PATCH 0/2] hppa updates

2025-01-22 Thread deller
From: Helge Deller Two patches: The first fixes booting a Linux kernel which is provided on the command line. The second patch adds support for more than 4GB RAM on 64-bit boxes (requires additional patch for SeaBIOS-hppa which will be pushed before qemu v10). Helge Deller (2): hw/hppa: Suppor

Re: [PATCH] tests/functional: Fix the aarch64_tcg_plugins test

2025-01-22 Thread Thomas Huth
On 22/01/2025 18.33, Alex Bennée wrote: Thomas Huth writes: Unfortunately, this test had not been added to meson.build, so we did not notice a regression: Looking for 'Kernel panic - not syncing: VFS:' as the indication for the final boot state of the kernel was a bad idea since 'Kernel panic

Re: [RFC 1/1 v3] target/riscv: use tcg ops generation to emulate whole reg rvv loads/stores.

2025-01-22 Thread Alex Bennée
Paolo Savini writes: > This patch replaces the use of a helper function with direct tcg ops > generation > in order to emulate whole register loads and stores. This is done in order to > improve the performance of QEMU. Generally having the frontend second guess what the backend will do is not

Re: [PATCH] hw/boards: Convert MachineClass bitfields to boolean

2025-01-22 Thread Pierrick Bouvier
On 1/22/25 02:32, Philippe Mathieu-Daudé wrote: As Daniel mentioned: "The number of instances of MachineClass is not large enough that we save a useful amount of memory through bitfields." Also, see recent commit ecbf3567e21 ("docs/devel/style: add a section about bitfield, and disallow th

Re: [PATCH] tests/functional: Fix the aarch64_tcg_plugins test

2025-01-22 Thread Alex Bennée
Thomas Huth writes: > Unfortunately, this test had not been added to meson.build, so we did > not notice a regression: Looking for 'Kernel panic - not syncing: VFS:' > as the indication for the final boot state of the kernel was a bad > idea since 'Kernel panic - not syncing' is the default failu

Re: [PATCH] vhost-user: Silence unsupported VHOST_USER_PROTOCOL_F_RARP error

2025-01-22 Thread Daniel P . Berrangé
On Wed, Jan 22, 2025 at 06:22:06PM +0100, Laurent Vivier wrote: > On 22/01/2025 17:51, Stefano Garzarella wrote: > > On Wed, Jan 22, 2025 at 05:41:15PM +0100, Laurent Vivier wrote: > > > On 22/01/2025 17:20, Stefano Garzarella wrote: > > > > On Wed, Jan 22, 2025 at 08:59:22AM -0500, Michael S. Tsir

Re: [PATCH 05/10] rust: vmstate: implement VMState for scalar types

2025-01-22 Thread Paolo Bonzini
On 1/22/25 13:33, Zhao Liu wrote: On Fri, Jan 17, 2025 at 10:00:41AM +0100, Paolo Bonzini wrote: Date: Fri, 17 Jan 2025 10:00:41 +0100 From: Paolo Bonzini Subject: [PATCH 05/10] rust: vmstate: implement VMState for scalar types X-Mailer: git-send-email 2.47.1 Scalar types are those that have t

Re: [PATCH] vhost-user: Silence unsupported VHOST_USER_PROTOCOL_F_RARP error

2025-01-22 Thread Laurent Vivier
On 22/01/2025 17:51, Stefano Garzarella wrote: On Wed, Jan 22, 2025 at 05:41:15PM +0100, Laurent Vivier wrote: On 22/01/2025 17:20, Stefano Garzarella wrote: On Wed, Jan 22, 2025 at 08:59:22AM -0500, Michael S. Tsirkin wrote: On Wed, Jan 22, 2025 at 02:42:14PM +0100, Stefano Garzarella wrote:

[PATCH 3/4] vfio/igd: refactor vfio_probe_igd_bar4_quirk() into pci config quirk

2025-01-22 Thread Tomita Moeko
The actual IO BAR4 write quirk in vfio_probe_igd_bar4_quirk() was removed in previous change, leaving the function not matching its name, so move it into the newly introduced vfio_config_quirk_setup(). There is no functional change in this commit. If any failure occurs, the function simply returns

[PATCH 1/4] vfio/igd: remove GTT write quirk in IO BAR 4

2025-01-22 Thread Tomita Moeko
The IO BAR4 of IGD devices contains a pair of 32-bit address/data registers, MMIO_Index (0x0) and MMIO_Data (0x4), which provide access to the MMIO BAR0 (GTTMMADR) from IO space. These registers are probably only used by the VBIOS, and are not documented by intel. The observed layout of MMIO_Index

[PATCH 0/4] vfio/igd: remove incorrect IO BAR4 quirk

2025-01-22 Thread Tomita Moeko
Based on experiments and reverse engineering about the mysterious IO BAR4, it appears that the current quirk implementation is incorrect. As discussed in a previous mail thread [1], current implementation believes VBIOS is writing HPA of Data Stolen Memory (DSM) in GTT entries, so it intercepts and

[PATCH 2/4] vfio/pci: add placeholder for device-specific config space quirks

2025-01-22 Thread Tomita Moeko
Some devices, such as IGD, require device-specific quirks to be applied to their pci config spaces. Currently, these quirks are either part of BAR quirk, or being a part of vfio_realize(). Add a placeholder for pci config quirks for moving the quirks to one place later. Signed-off-by: Tomita Moeko

[PATCH 4/4] vfio/igd: do not include GTT stolen size in etc/igd-bdsm-size

2025-01-22 Thread Tomita Moeko
Though GTT Stolen Memory (GSM) is right below Data Stolen Memory (DSM) in host address space, direct access to GSM is prohibited, and it is not mapped to guest address space. Both host and guest accesses GSM indirectly through the second half of MMIO BAR0 (GTTMMADR). Guest firmware only need to re

Re: [PATCH v5 0/8] Support virtio-gpu DRM native context

2025-01-22 Thread Alex Bennée
Dmitry Osipenko writes: > This patchset adds DRM native context support to VirtIO-GPU on Qemu. > > Contarary to Virgl and Venus contexts that mediates high level GFX APIs, > DRM native context [1] mediates lower level kernel driver UAPI, which > reflects in a less CPU overhead and less/simpler co

Re: [PATCH] hw/boards: Convert MachineClass bitfields to boolean

2025-01-22 Thread Philippe Mathieu-Daudé
On 22/1/25 16:27, Thomas Huth wrote: On 22/01/2025 15.33, Peter Maydell wrote: On Wed, 22 Jan 2025 at 12:36, Thomas Huth wrote: On 22/01/2025 11.32, Philippe Mathieu-Daudé wrote: As Daniel mentioned:    "The number of instances of MachineClass is not large enough     that we save a useful a

Re: [PATCH v4 1/7] linux-user: netlink: Add missing IFA_PROTO to host_to_target_data_addr_rtattr()

2025-01-22 Thread Laurent Vivier
Le 20/01/2025 à 22:33, del...@kernel.org a écrit : From: Helge Deller Fixes this warning: Unknown host IFA type: 11 IFA_PROTO has been introduced in kernel v5.18, and as such using it unconditionally breaks build on Ubuntu 22.04. Instead convert the IFA_XXX values to QEMU_IDA_XXX values and

Re: [PATCH v4 7/7] linux-user: netlink: Use QEMU_IFA_XXX values instead of IFA_XXX

2025-01-22 Thread Laurent Vivier
Le 20/01/2025 à 22:33, del...@kernel.org a écrit : From: Helge Deller Convert existing places to use QEMU_IFA_XXX values. Signed-off-by: Helge Deller --- linux-user/fd-trans.c | 16 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/linux-user/fd-trans.c b/linux

Re: [PATCH] vhost-user: Silence unsupported VHOST_USER_PROTOCOL_F_RARP error

2025-01-22 Thread Stefano Garzarella
On Wed, Jan 22, 2025 at 05:41:15PM +0100, Laurent Vivier wrote: On 22/01/2025 17:20, Stefano Garzarella wrote: On Wed, Jan 22, 2025 at 08:59:22AM -0500, Michael S. Tsirkin wrote: On Wed, Jan 22, 2025 at 02:42:14PM +0100, Stefano Garzarella wrote: On Tue, Jan 21, 2025 at 11:00:29AM +0100, Laure

Re: [PATCH 05/10] rust: pl011: pull interrupt updates out of read/write ops

2025-01-22 Thread Paolo Bonzini
Il mer 22 gen 2025, 17:31 Zhao Liu ha scritto: > > if event == bindings::QEMUChrEvent::CHR_EVENT_BREAK && > !self.loopback_enabled() { > > -self.put_fifo(registers::Data::BREAK.into()); > > +let update = self.put_fifo(registers::Data::BREAK.into()); > > We can omi

[RFC 0/1 v3] target/riscv: use tcg ops generation to emulate whole reg rvv loads/stores.

2025-01-22 Thread Paolo Savini
Previous versions: - RFC v1: https://lore.kernel.org/all/20241218170840.1090473-1-paolo.sav...@embecosm.com/ - RFC v2: https://lore.kernel.org/all/20241220153834.16302-1-paolo.sav...@embecosm.com/ Thanks Max for the feedback here: https://lore.kernel.org/all/258795e9-4e97-4cd7-949f-24e88d24f..

[RFC 1/1 v3] target/riscv: use tcg ops generation to emulate whole reg rvv loads/stores.

2025-01-22 Thread Paolo Savini
This patch replaces the use of a helper function with direct tcg ops generation in order to emulate whole register loads and stores. This is done in order to improve the performance of QEMU. We still use the helper function when vstart is not 0 at the beginning of the emulation of the whole registe

Re: [PATCH 2/7] guest_memfd: Introduce an object to manage the guest-memfd with RamDiscardManager

2025-01-22 Thread Peter Xu
On Wed, Jan 22, 2025 at 05:41:31PM +0800, Xu Yilun wrote: > On Wed, Jan 22, 2025 at 03:30:05PM +1100, Alexey Kardashevskiy wrote: > > > > > > On 22/1/25 02:18, Peter Xu wrote: > > > On Tue, Jun 25, 2024 at 12:31:13AM +0800, Xu Yilun wrote: > > > > On Mon, Jan 20, 2025 at 03:46:15PM -0500, Peter X

Re: [PATCH 03/10] rust: pl011: extract conversion to RegisterOffset

2025-01-22 Thread Zhao Liu
> > > -pub fn read(&mut self, offset: hwaddr, _size: c_uint) -> > > > std::ops::ControlFlow { > > > +fn regs_read(&mut self, offset: RegisterOffset) -> ControlFlow > > u32> { > > > use RegisterOffset::*; > > > > Can we move this "use" to the start of the file? > > I don't think

Re: [PATCH] vhost-user: Silence unsupported VHOST_USER_PROTOCOL_F_RARP error

2025-01-22 Thread Laurent Vivier
On 22/01/2025 17:20, Stefano Garzarella wrote: On Wed, Jan 22, 2025 at 08:59:22AM -0500, Michael S. Tsirkin wrote: On Wed, Jan 22, 2025 at 02:42:14PM +0100, Stefano Garzarella wrote: On Tue, Jan 21, 2025 at 11:00:29AM +0100, Laurent Vivier wrote: > In vhost_user_receive() if vhost_net_notify_mi

Re: [RFC PATCH] Fix race in live migration failure path

2025-01-22 Thread Peter Xu
Hi, Shivam, On Wed, Jan 22, 2025 at 10:54:17AM +, Shivam Kumar wrote: > There is one place where we set the migration status to FAILED but we don’t > set > s->error, i.e. in save_snapshot workflow, please check qemu_savevm_state but > not sure setting s->error in this case is possible (or req

Re: [PATCH 05/10] rust: pl011: pull interrupt updates out of read/write ops

2025-01-22 Thread Zhao Liu
On Fri, Jan 17, 2025 at 10:26:52AM +0100, Paolo Bonzini wrote: > Date: Fri, 17 Jan 2025 10:26:52 +0100 > From: Paolo Bonzini > Subject: [PATCH 05/10] rust: pl011: pull interrupt updates out of > read/write ops > X-Mailer: git-send-email 2.47.1 > > qemu_irqs are not part of the vmstate, therefore

Re: [PATCH] vhost-user: Silence unsupported VHOST_USER_PROTOCOL_F_RARP error

2025-01-22 Thread Stefano Garzarella
On Wed, Jan 22, 2025 at 08:59:22AM -0500, Michael S. Tsirkin wrote: On Wed, Jan 22, 2025 at 02:42:14PM +0100, Stefano Garzarella wrote: On Tue, Jan 21, 2025 at 11:00:29AM +0100, Laurent Vivier wrote: > In vhost_user_receive() if vhost_net_notify_migration_done() reports > an error we display on

Re: [PULL v2 0/9] s390x and test patches 2025-01-21

2025-01-22 Thread Stefan Hajnoczi
Applied, thanks. Please update the changelog at https://wiki.qemu.org/ChangeLog/10.0 for any user-visible changes. signature.asc Description: PGP signature

Re: [PATCH] vhost-user: Silence unsupported VHOST_USER_PROTOCOL_F_RARP error

2025-01-22 Thread Michael S. Tsirkin
On Wed, Jan 22, 2025 at 05:20:06PM +0100, Stefano Garzarella wrote: > On Wed, Jan 22, 2025 at 08:59:22AM -0500, Michael S. Tsirkin wrote: > > On Wed, Jan 22, 2025 at 02:42:14PM +0100, Stefano Garzarella wrote: > > > On Tue, Jan 21, 2025 at 11:00:29AM +0100, Laurent Vivier wrote: > > > > In vhost_us

Re: [RFC v3 1/5] vhost-vdpa: Decouple the IOVA allocator

2025-01-22 Thread Jonah Palmer
On 1/21/25 12:25 PM, Eugenio Perez Martin wrote: On Tue, Jan 21, 2025 at 3:53 PM Jonah Palmer wrote: On 1/16/25 11:44 AM, Eugenio Perez Martin wrote: On Fri, Jan 10, 2025 at 6:09 PM Jonah Palmer wrote: Decouples the IOVA allocator from the full IOVA->HVA tree to support a SVQ IOVA->HV

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

2025-01-22 Thread Peter Xu
On Wed, Jan 22, 2025 at 01:26:21PM +0530, Prasad Pandit wrote: > Hi, > On Tue, 21 Jan 2025 at 21:17, Peter Xu wrote: > > https://lore.kernel.org/qemu-devel/ZykJBq7ME5jgSzCA@x1n/ > > Would you please add all the tests mentioned there? > > /x86_64/migration/multifd/file/mapped-ram/ > /x86_6

[PATCH 09/11] arm/virt: Wire up a GED error device for ACPI / GHES

2025-01-22 Thread Mauro Carvalho Chehab
Adds support to ARM virtualization to allow handling generic error ACPI Event via GED & error source device. It is aligned with Linux Kernel patch: https://lore.kernel.org/lkml/1272350481-27951-8-git-send-email-ying.hu...@intel.com/ Co-authored-by: Mauro Carvalho Chehab Co-authored-by: Jonathan

[PATCH 11/11] scripts/ghes_inject: add a script to generate GHES error inject

2025-01-22 Thread Mauro Carvalho Chehab
Using the QMP GHESv2 API requires preparing a raw data array containing a CPER record. Add a helper script with subcommands to prepare such data. Currently, only ARM Processor error CPER record is supported. Signed-off-by: Mauro Carvalho Chehab --- MAINTAINERS| 3 + scrip

[PATCH 08/11] acpi/generic_event_device: add an APEI error device

2025-01-22 Thread Mauro Carvalho Chehab
Adds a generic error device to handle generic hardware error events as specified at ACPI 6.5 specification at 18.3.2.7.2: https://uefi.org/specs/ACPI/6.5/18_Platform_Error_Interfaces.html#event-notification-for-generic-error-sources using HID PNP0C33. The PNP0C33 device is used to report hardware

[PATCH 10/11] qapi/acpi-hest: add an interface to do generic CPER error injection

2025-01-22 Thread Mauro Carvalho Chehab
Creates a QMP command to be used for generic ACPI APEI hardware error injection (HEST) via GHESv2, and add support for it for ARM guests. Error injection uses ACPI_HEST_SRC_ID_QMP source ID to be platform independent. This is mapped at arch virt bindings, depending on the types supported by QEMU a

[PATCH 07/11] acpi/ghes: Cleanup the code which gets ghes ged state

2025-01-22 Thread Mauro Carvalho Chehab
Move the check logic into a common function and simplify the code which checks if GHES is enabled and was properly setup. Signed-off-by: Mauro Carvalho Chehab --- hw/acpi/ghes-stub.c| 4 ++-- hw/acpi/ghes.c | 33 +++-- include/hw/acpi/ghes.h | 9 +---

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

2025-01-22 Thread Mauro Carvalho Chehab
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 the legacy way via an offset obtained from the hardware_errors firmware file. Signed-off-by: Mauro Carvalho Chehab --- hw/acpi/generic_event_

[PATCH 04/11] acpi/generic_event_device: Update GHES migration to cover hest addr

2025-01-22 Thread Mauro Carvalho Chehab
The GHES migration logic at GED should now support HEST table location too. Signed-off-by: Mauro Carvalho Chehab --- hw/acpi/generic_event_device.c | 29 + 1 file changed, 29 insertions(+) diff --git a/hw/acpi/generic_event_device.c b/hw/acpi/generic_event_device.c i

[PATCH 00/11] Change ghes to use HEST-based offsets and add support for error inject

2025-01-22 Thread Mauro Carvalho Chehab
Now that the ghes preparation patches were merged, let's add support for error injection. I'm opting to fold two patch series into one here: 1. https://lore.kernel.org/qemu-devel/20250113130854.848688-1-mchehab+hua...@kernel.org/ It is the first 5 patches containing changes to the math used to

[PATCH 01/11] acpi/ghes: Prepare to support multiple sources on ghes

2025-01-22 Thread Mauro Carvalho Chehab
The current code is actually dependent on having just one error structure with a single source. As the number of sources should be arch-dependent, as it will depend on what kind of synchronous/assynchronous notifications will exist, change the logic to dynamically build the table. Yet, for a prop

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

2025-01-22 Thread Mauro Carvalho Chehab
Store HEST table address at GPA, placing its content at hest_addr_le variable. Signed-off-by: Mauro Carvalho Chehab Reviewed-by: Jonathan Cameron --- Change from v8: - hest_addr_lr is now pointing to the error source size and data. Signed-off-by: Mauro Carvalho Chehab --- hw/acpi/ghes.c

[PATCH 03/11] acpi/ghes: Use HEST table offsets when preparing GHES records

2025-01-22 Thread Mauro Carvalho Chehab
There are two pointers that are needed during error injection: 1. The start address of the CPER block to be stored; 2. The address of the ack, which needs a reset before next error. It is preferable to calculate them from the HEST table. This allows checking the source ID, the size of the table

[PATCH 06/11] acpi/ghes: add a notifier to notify when error data is ready

2025-01-22 Thread Mauro Carvalho Chehab
Some error injection notify methods are async, like GPIO notify. Add a notifier to be used when the error record is ready to be sent to the guest OS. Signed-off-by: Mauro Carvalho Chehab --- hw/acpi/ghes.c | 5 - include/hw/acpi/ghes.h | 3 +++ 2 files changed, 7 insertions(+), 1 del

Re: [PATCH] hw/boards: Convert MachineClass bitfields to boolean

2025-01-22 Thread Thomas Huth
On 22/01/2025 15.33, Peter Maydell wrote: On Wed, 22 Jan 2025 at 12:36, Thomas Huth wrote: On 22/01/2025 11.32, Philippe Mathieu-Daudé wrote: As Daniel mentioned: "The number of instances of MachineClass is not large enough that we save a useful amount of memory through bitfields." A

[PATCH 3/5] vfio: Improve error reporting when MMIO region mapping fails

2025-01-22 Thread Cédric Le Goater
When the IOMMU address space width is smaller than the physical address width, a MMIO region of a device can fail to map because the region is outside the supported IOVA ranges of the VM. In this case, PCI peer-to-peer transactions on BARs are not supported. This can occur with the 39-bit IOMMU ad

[PATCH 0/5] vfio: Improve error reporting when MMIO region mapping fails

2025-01-22 Thread Cédric Le Goater
Hello, Under certain circumstances, a MMIO region of a device fails to map because the region is outside the supported IOVA ranges of the VM. In this case, PCI peer-to-peer transactions on BARs are not supported. This typically occurs when the IOMMU address space width is less than the physical ad

[PATCH 2/5] vfio: Modify vfio_viommu_preset() parameter

2025-01-22 Thread Cédric Le Goater
We plan to use vfio_viommu_preset() in MemoryListener handlers which operate at the container level. Change the parameter to VFIOContainerBase to ease future changes. Signed-off-by: Cédric Le Goater --- include/hw/vfio/vfio-common.h | 2 +- hw/vfio/common.c | 4 ++-- hw/vfio/migrati

[PATCH 1/5] vfio/pci: Replace "iommu_device" by "vIOMMU"

2025-01-22 Thread Cédric Le Goater
This is to be consistent with other reported errors related to vIOMMU devices. Signed-off-by: Cédric Le Goater --- hw/vfio/pci.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/vfio/pci.c b/hw/vfio/pci.c index cf14987e42bd9188d5040b51a2f84cfa959f632d..ad326839db49cf3a5052

[PATCH 4/5] cpu: Introduce cpu_get_phys_bits()

2025-01-22 Thread Cédric Le Goater
The Intel CPU has a complex history regarding setting of the physical address space width on KVM. A 'phys_bits' field and a "phys-bits" property were added by commit af45907a1328 ("target-i386: Allow physical address bits to be set") to tune this value. In certain circumstances, it is interesting

Re: [PATCH v7 2/4] chardev/char-hub: implement backend chardev aggregator

2025-01-22 Thread Roman Penyaev
On Wed, Jan 22, 2025 at 3:44 PM Alex Bennée wrote: > > Roman Penyaev writes: > > > This patch implements a new chardev backend `hub` device, which > > aggregates input from multiple backend devices and forwards it to a > > single frontend device. Additionally, `hub` device takes the output > > fr

[PATCH 5/5] vfio: Check compatibility of CPU and IOMMU address space width

2025-01-22 Thread Cédric Le Goater
Print a warning if IOMMU address space width is smaller than the physical address width. In this case, PCI peer-to-peer transactions on BARs are not supported and failures of device MMIO regions are to be expected. This can occur with the 39-bit IOMMU address space width as found on consumer grade

Re: [PATCH 04/10] rust: pl011: extract CharBackend receive logic into a separate function

2025-01-22 Thread Paolo Bonzini
On 1/22/25 15:59, Zhao Liu wrote: if size > 0 { debug_assert!(!buf.is_null()); -state.as_mut().put_fifo(c_uint::from(buf.read_volatile())) An extra question...here I'm not sure, do we really need read_volatile? No, the buffer is not guest visible. It will

Re: [PATCH 03/10] rust: pl011: extract conversion to RegisterOffset

2025-01-22 Thread Paolo Bonzini
On 1/22/25 15:34, Zhao Liu wrote: On Fri, Jan 17, 2025 at 10:26:50AM +0100, Paolo Bonzini wrote: Date: Fri, 17 Jan 2025 10:26:50 +0100 From: Paolo Bonzini Subject: [PATCH 03/10] rust: pl011: extract conversion to RegisterOffset X-Mailer: git-send-email 2.47.1 As an added bonus, this also makes

Re: [PATCH v3 17/26] hw/arm/virt: Reserve one bit of guest-physical address for RME

2025-01-22 Thread Jean-Philippe Brucker
Hi Gavin, On Fri, Dec 13, 2024 at 10:03:08PM +1000, Gavin Shan wrote: > Hi Jean, > > On 11/26/24 5:56 AM, Jean-Philippe Brucker wrote: > > When RME is enabled, the upper GPA bit is used to distinguish protected > > from unprotected addresses. Reserve it when setting up the guest memory > > map. >

Re: [PATCH v3 2/3] scripts: validate SPDX license choices

2025-01-22 Thread Peter Maydell
On Fri, 17 Jan 2025 at 12:42, Daniel P. Berrangé wrote: > > We expect all new code to be contributed with the "GPL-2.0-or-later" > license tag. Divergence is permitted if the new file is derived from > pre-existing code under a different license, whether from elsewhere > in QEMU codebase, or outsi

Re: [PATCH v7 2/4] chardev/char-hub: implement backend chardev aggregator

2025-01-22 Thread Alex Bennée
Roman Penyaev writes: > This patch implements a new chardev backend `hub` device, which > aggregates input from multiple backend devices and forwards it to a > single frontend device. Additionally, `hub` device takes the output > from the frontend device and sends it back to all the connected > b

Re: [PATCH 04/10] rust: pl011: extract CharBackend receive logic into a separate function

2025-01-22 Thread Zhao Liu
On Fri, Jan 17, 2025 at 10:26:51AM +0100, Paolo Bonzini wrote: > Date: Fri, 17 Jan 2025 10:26:51 +0100 > From: Paolo Bonzini > Subject: [PATCH 04/10] rust: pl011: extract CharBackend receive logic into > a separate function > X-Mailer: git-send-email 2.47.1 > > Prepare for moving all references

Re: [PATCH] hw/boards: Convert MachineClass bitfields to boolean

2025-01-22 Thread Peter Maydell
On Wed, 22 Jan 2025 at 12:36, Thomas Huth wrote: > > On 22/01/2025 11.32, Philippe Mathieu-Daudé wrote: > > As Daniel mentioned: > > > > "The number of instances of MachineClass is not large enough > >that we save a useful amount of memory through bitfields." > > > > Also, see recent commit

Re: [PATCH 06/22] exec/cpu: Call cpu_remove_sync() once in cpu_common_unrealize()

2025-01-22 Thread Igor Mammedov
On Thu, 16 Jan 2025 19:05:46 +0100 Philippe Mathieu-Daudé wrote: > On 28/11/23 17:42, Igor Mammedov wrote: > > On Mon, 18 Sep 2023 18:02:39 +0200 > > Philippe Mathieu-Daudé wrote: > > > >> While create_vcpu_thread() creates a vCPU thread, its counterpart > >> is cpu_remove_sync(), which join

Re: [PATCH 03/10] rust: pl011: extract conversion to RegisterOffset

2025-01-22 Thread Zhao Liu
On Fri, Jan 17, 2025 at 10:26:50AM +0100, Paolo Bonzini wrote: > Date: Fri, 17 Jan 2025 10:26:50 +0100 > From: Paolo Bonzini > Subject: [PATCH 03/10] rust: pl011: extract conversion to RegisterOffset > X-Mailer: git-send-email 2.47.1 > > As an added bonus, this also makes the new function return

Re: CXL emulation on aarch64

2025-01-22 Thread Jonathan Cameron via
On Fri, 17 Jan 2025 09:43:11 + Jonathan Cameron via wrote: > On Fri, 17 Jan 2025 10:13:41 +0900 > Itaru Kitayama wrote: > > > > On Jan 16, 2025, at 19:58, Jonathan Cameron > > > wrote: > > > > > > On Thu, 16 Jan 2025 15:04:53 +0900 > > > Itaru Kitayama wrote: > > > > > >> Hi Jonath

Re: [PATCH] vhost-user: Silence unsupported VHOST_USER_PROTOCOL_F_RARP error

2025-01-22 Thread Michael S. Tsirkin
On Wed, Jan 22, 2025 at 02:42:14PM +0100, Stefano Garzarella wrote: > On Tue, Jan 21, 2025 at 11:00:29AM +0100, Laurent Vivier wrote: > > In vhost_user_receive() if vhost_net_notify_migration_done() reports > > an error we display on the console: > > > > Vhost user backend fails to broadcast fake

[PATCH] Fix a data race with goflag in rcutorture test

2025-01-22 Thread Vitalii Mordan
This patch addresses a potential data race involving the global variable goflag in the rcutorture test. The issue is resolved by adding the atomic qualifier to ensure proper synchronization. Fixes: 8fda74a52b ("rcu: add rcutorture") Resolves: https://gitlab.com/qemu-project/qemu/-/issues/2750 Sign

Re: [PATCH v2 0/3] scripts/qemu-gdb: Make coroutine dumps to work with coredumps

2025-01-22 Thread Kevin Wolf
Am 12.12.2024 um 21:47 hat Peter Xu geschrieben: > v1: https://lore.kernel.org/r/20241211201739.1380222-1-pet...@redhat.com > > Changelog: in previous v1, I got a wrong cut-off accident in commit > message, which is now fixed (along with some small touchup elsewhere). > When at it, I also tried to

Re: [PATCH v2 1/2] tests/functional/qemu_test/decorators: Fix bad check for imports

2025-01-22 Thread Daniel P . Berrangé
On Wed, Jan 22, 2025 at 02:43:13PM +0100, Thomas Huth wrote: > skipIfMissingImports should use importlib.import_module() for checking > whether a module with the name stored in the "impname" variable is > available or not, otherwise the code tries to import a module with > the name "impname" instea

Re: [PATCH 2/2] improve precision of throttle_pct

2025-01-22 Thread fuqiang wang
On 2025/1/21 20:25, Yong Huang wrote: On Tue, Dec 31, 2024 at 9:56 AM fuqiang wang wrote: Using the current algorithm, there are issues with precision not being handled correctly during division operations. (Even though double type casting is used in the function, it does not seem to have an

[PATCH v2 0/2] tests/functional: Fix broken decorators

2025-01-22 Thread Thomas Huth
Many of the new decorators of the functional tests don't work as expected (and simply always allow to run the tests). Let's fix them! v2: - Use importlib.import_module() to check whether we can import a module - Split the import check into a separate patch Thomas Huth (2): tests/functional/qemu

[PATCH v2 2/2] tests/functional: Fix broken decorators with lamda functions

2025-01-22 Thread Thomas Huth
The decorators that use a lambda function are currently broken and do not properly skip the test if the condition is not met. Using "return skipUnless(lambda: ...)" does not work as expected. To fix it, rewrite the decorators without lambda, it's simpler that way anyway. Reviewed-by: Daniel P. Ber

[PATCH v2 1/2] tests/functional/qemu_test/decorators: Fix bad check for imports

2025-01-22 Thread Thomas Huth
skipIfMissingImports should use importlib.import_module() for checking whether a module with the name stored in the "impname" variable is available or not, otherwise the code tries to import a module with the name "impname" instead. (This bug hasn't been noticed before since there is another issue

  1   2   >