Re: [RFC PATCH 0/3] single-binary: make QAPI generated files common

2025-04-25 Thread Markus Armbruster
Philippe Mathieu-Daudé writes: > On 25/4/25 09:35, Daniel P. Berrangé wrote: >> On Thu, Apr 24, 2025 at 11:33:47AM -0700, Pierrick Bouvier wrote: >>> Feedback >>> >>> >>> The goal of this series is to be spark a conversation around following >>> topics: >>> >>> - Would you be open to su

[PATCH v1 0/1] xen: mapcache: grants: Fix mixup betwen ro and rw mappings

2025-04-25 Thread Edgar E. Iglesias
From: "Edgar E. Iglesias" This fixes an issue with grant mappings when a read-only mapping is requested followed by a read-write mapping for the same page. Today, we don't track write-ability and read-write lookups hit on read-only entries. This series is an attempt to fix this by splitting mapc

[PATCH v1 1/1] xen: mapcache: Split mapcache_grants by ro and rw

2025-04-25 Thread Edgar E. Iglesias
From: "Edgar E. Iglesias" Today, we don't track write-abiliy in the cache, if a user requests a readable mapping followed by a writeable mapping on the same page, the second lookup will incorrectly hit the readable entry. Split mapcache_grants by ro and rw access. Grants will now have separate w

Re: [PATCH v6 0/4] virtio: Convert feature properties to OnOffAuto

2025-04-25 Thread Markus Armbruster
Daniel P. Berrangé writes: > On Fri, Apr 25, 2025 at 08:14:13AM -0400, Michael S. Tsirkin wrote: >> On Thu, Mar 06, 2025 at 03:16:26PM +0900, Akihiko Odaki wrote: >> > This series was spun off from: >> > "[PATCH 0/3] virtio-net: Convert feature properties to OnOffAuto" >> > (https://patchew.org/Q

Re: [PATCH v2] block: Remove unused callback function *bdrv_aio_pdiscard

2025-04-25 Thread Kevin Wolf
Am 21.04.2025 um 20:21 hat Sunny Zhu geschrieben: > The bytes type in *bdrv_aio_pdiscard should be int64_t rather than int. > > There are no drivers implementing the *bdrv_aio_pdiscard() callback, > it appears to be an unused function. Therefore, we'll simply remove it > instead of fixing it. > >

Re: [PATCH] Drop support for Python 3.8

2025-04-25 Thread Markus Armbruster
Philippe Mathieu-Daudé writes: > Hi Thomas, > > On 25/4/25 14:07, Thomas Huth wrote: >> From: Thomas Huth >> Python 3.8 went "end of life" in October 2024 and Fedora 42 dropped >> this version already, so the "python" CI job is currently failing. >> Thus it's time to drop support for this Python

[PATCH 2/7] target/riscv: Pass ra to riscv_csrrw_do64

2025-04-25 Thread Richard Henderson
Signed-off-by: Richard Henderson --- target/riscv/csr.c | 15 +++ 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/target/riscv/csr.c b/target/riscv/csr.c index 6f1f69eba6..e9c2f95b6e 100644 --- a/target/riscv/csr.c +++ b/target/riscv/csr.c @@ -5516,7 +5516,8 @@ static in

[PATCH 7/7] target/riscv: Fix write_misa vs aligned next_pc

2025-04-25 Thread Richard Henderson
Do not examine a random host return address, but properly compute the next pc for the guest cpu. Fixes: f18637cd611 ("RISC-V: Add misa runtime write support") Signed-off-by: Richard Henderson --- target/riscv/csr.c | 22 +- 1 file changed, 17 insertions(+), 5 deletions(-) di

[PATCH 3/7] target/riscv: Pass ra to riscv_csrrw_do128

2025-04-25 Thread Richard Henderson
Signed-off-by: Richard Henderson --- target/riscv/csr.c | 9 + 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/target/riscv/csr.c b/target/riscv/csr.c index e9c2f95b6e..d62d1aaaee 100644 --- a/target/riscv/csr.c +++ b/target/riscv/csr.c @@ -5588,7 +5588,7 @@ RISCVException r

[PATCH 0/7] target/riscv: Fix write_misa vs aligned next_pc

2025-04-25 Thread Richard Henderson
As discussed, the use of GETPC() within write_misa is wrong. I've done just enough plumbing to get the helper return address piped down to write_misa, so that we can make use of unwind data. AFAIK, nothing in check-tcg or check-functional would test this. It shouldn't be too hard to write a test a

[PATCH 4/7] target/riscv: Pass ra to riscv_csrrw

2025-04-25 Thread Richard Henderson
Signed-off-by: Richard Henderson --- target/riscv/cpu.h | 8 hw/riscv/riscv_hart.c| 2 +- target/riscv/csr.c | 8 target/riscv/op_helper.c | 4 ++-- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/target/riscv/cpu.h b/target/riscv/cpu.h index 4d4

[PATCH 6/7] target/riscv: Move insn_len to internals.h

2025-04-25 Thread Richard Henderson
Signed-off-by: Richard Henderson --- target/riscv/internals.h | 5 + target/riscv/translate.c | 5 - 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/target/riscv/internals.h b/target/riscv/internals.h index 213aff31d8..4570bd50be 100644 --- a/target/riscv/internals.h +++ b/

[PULL 00/58] Misc single binary patches for 2025-04-25

2025-04-25 Thread Philippe Mathieu-Daudé
The following changes since commit 019fbfa4bcd2d3a835c241295e22ab2b5b56129b: Merge tag 'pull-misc-2025-04-24' of https://repo.or.cz/qemu/armbru into staging (2025-04-24 13:44:57 -0400) are available in the Git repository at: https://github.com/philmd/qemu.git tags/single-binar

[PULL 17/58] qom/object: Fix type conflict of GLib function pointers

2025-04-25 Thread Philippe Mathieu-Daudé
From: Kohei Tokunaga On Emscripten, function pointer casts can result in runtime failures due to strict function signature checks. This affects the use of g_list_sort and g_slist_sort, which internally perform function pointer casts that are not supported by Emscripten. To avoid these issues, g_l

[PULL 15/58] qom: Constify TypeInfo::interfaces

2025-04-25 Thread Philippe Mathieu-Daudé
Reviewed-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daudé Message-Id: <20250424194905.82506-6-phi...@linaro.org> --- include/hw/virtio/virtio-pci.h | 2 +- include/qom/object.h | 2 +- hw/scsi/megasas.c | 2 +- rust/qemu-api/src/qom.rs | 2 +- 4 files chan

[PULL 06/58] target/ppc: Register CPUClass:list_cpus

2025-04-25 Thread Philippe Mathieu-Daudé
Register ppc_cpu_list() as CPUClass:list_cpus callback. Reduce its scope and remove the cpu_list definition. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Thomas Huth Reviewed-by: Richard Henderson Reviewed-by: Zhao Liu Message-Id: <20250324185837.46506-4-phi...@linaro.org> --- target/pp

[PULL 07/58] target/sparc: Register CPUClass:list_cpus

2025-04-25 Thread Philippe Mathieu-Daudé
Register sparc_cpu_list() as CPUClass:list_cpus callback. Reduce its scope and remove the cpu_list definition. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Thomas Huth Reviewed-by: Richard Henderson Reviewed-by: Zhao Liu Message-Id: <20250324185837.46506-5-phi...@linaro.org> --- target/

[PULL 10/58] hw/pci-host/designware: Use deposit/extract API

2025-04-25 Thread Philippe Mathieu-Daudé
Prefer the safer (less bug-prone) deposit/extract API to access lower/upper 32-bit of 64-bit registers. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Gustavo Romero Message-Id: <20250331152041.74533-3-phi...@linaro.org> --- hw/pci-host/designware.c | 48 ++--

[PULL 04/58] cpus: Introduce CPUClass::list_cpus() callback

2025-04-25 Thread Philippe Mathieu-Daudé
Some targets define cpu_list to a method listing their CPUs on stdout. In order to make list_cpus() generic, introduce the CPUClass::list_cpus() callback. When no callback is registered, list_cpus() defaults to the cpu_list definition. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Thomas Hut

[PULL 09/58] cpus: Remove #ifdef check on cpu_list definition

2025-04-25 Thread Philippe Mathieu-Daudé
Since we removed all definitions of cpu_list, the #ifdef check is always true. Remove it, inlining cpu_list(). Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Thomas Huth Reviewed-by: Richard Henderson Reviewed-by: Zhao Liu Message-Id: <20250324185837.46506-7-phi...@linaro.org> --- cpu-tar

[PULL 34/50] vfio: Rename vfio_devices_all_device_dirty_tracking()

2025-04-25 Thread Cédric Le Goater
Use the prefix 'vfio_container_devices_' to reflect the routine simply loops over the container's device list. Reviewed-by: John Levon Reviewed-by: Avihai Horon Link: https://lore.kernel.org/qemu-devel/20250326075122.1299361-31-...@redhat.com Signed-off-by: Cédric Le Goater --- include/hw/vfi

[PULL 13/50] vfio: Move VFIOHostDMAWindow definition into spapr.c

2025-04-25 Thread Cédric Le Goater
VFIOHostDMAWindow is only used in file "spapr.c". Move it there. Reviewed-by: John Levon Link: https://lore.kernel.org/qemu-devel/20250318095415.670319-9-...@redhat.com Reviewed-by: Zhenzhong Duan Link: https://lore.kernel.org/qemu-devel/20250326075122.1299361-10-...@redhat.com Signed-off-by: C

[PULL 02/50] vfio: Open code vfio_migration_set_error()

2025-04-25 Thread Cédric Le Goater
VFIO uses migration_file_set_error() in a couple of places where an 'Error **' parameter is not provided. In MemoryListener handlers : vfio_listener_region_add vfio_listener_log_global_stop vfio_listener_log_sync and in callback routines for IOMMU notifiers : vfio_iommu_map_notify vfio

[PULL 23/50] vfio: Move vfio_get_device_info() to helpers.c

2025-04-25 Thread Cédric Le Goater
vfio_get_device_info() is a low level routine. Move it with the other helpers. Reviewed-by: Zhenzhong Duan Reviewed-by: John Levon Link: https://lore.kernel.org/qemu-devel/20250318095415.670319-19-...@redhat.com Link: https://lore.kernel.org/qemu-devel/20250326075122.1299361-20-...@redhat.com S

[PULL 21/50] vfio: Move vfio_get_info_dma_avail() into helpers.c

2025-04-25 Thread Cédric Le Goater
vfio_get_info_dma_avail() is a low level routine similar to the other routines extracting capabilities from 'struct vfio_iommu_type1_info'. It belongs to file "helpers.c". Reviewed-by: John Levon Link: https://lore.kernel.org/qemu-devel/20250318095415.670319-17-...@redhat.com Reviewed-by: Zhenzho

[PULL 27/50] vfio: Move vfio_device_list into device.c

2025-04-25 Thread Cédric Le Goater
'vfio_device_list' is VFIODevice related. Move its definitions into "device.c". Reviewed-by: John Levon Link: https://lore.kernel.org/qemu-devel/20250318095415.670319-23-...@redhat.com Reviewed-by: Zhenzhong Duan Link: https://lore.kernel.org/qemu-devel/20250326075122.1299361-24-...@redhat.com

[PULL 01/50] vfio/igd: Update IGD passthrough documentation

2025-04-25 Thread Cédric Le Goater
From: Tomita Moeko A previous change made the OpRegion and LPC quirks independent of the existing legacy mode, update the documentation accordingly. More related topics, like creating EFI Option ROM of IGD for OVMF, how to solve the VFIO_DMA_MAP Invalid Argument warning, as well as details on IGD

[PULL 03/50] vfio/spapr: Enhance error handling in vfio_spapr_create_window()

2025-04-25 Thread Cédric Le Goater
From: Amit Machhiwal Introduce an Error ** parameter to vfio_spapr_create_window() to enable structured error reporting. This allows the function to propagate detailed errors back to callers. Suggested-by: Cédric Le Goater Signed-off-by: Amit Machhiwal Reviewed-by: Cédric Le Goater Link: htt

[PULL 16/50] vfio: Introduce a new header file for VFIOcontainer declarations

2025-04-25 Thread Cédric Le Goater
Gather all VFIOcontainer related declarations into "hw/vfio/vfio-container.h" to reduce exposure of VFIO internals in "hw/vfio/vfio-common.h". These declarations were initially introduced in commit 65501a745dba ("vfio: vfio-pci device assignment driver"). They are made available externally for PPC

[PULL 00/50] vfio queue

2025-04-25 Thread Cédric Le Goater
The following changes since commit 019fbfa4bcd2d3a835c241295e22ab2b5b56129b: Merge tag 'pull-misc-2025-04-24' of https://repo.or.cz/qemu/armbru into staging (2025-04-24 13:44:57 -0400) are available in the Git repository at: https://github.com/legoater/qemu/ tags/pull-vfio-202

[PULL 07/50] vfio: Introduce a new header file for external migration services

2025-04-25 Thread Cédric Le Goater
The migration core subsystem makes use of the VFIO migration API to collect statistics on the number of bytes transferred. These services are declared in "hw/vfio/vfio-common.h" which also contains VFIO internal declarations. Move the migration declarations into a new header file "hw/vfio/vfio-migr

[PULL 17/50] vfio: Make vfio_group_list static

2025-04-25 Thread Cédric Le Goater
vfio_group_list is only used in file "container.c". Reviewed-by: John Levon Reviewed-by: Zhenzhong Duan Link: https://lore.kernel.org/qemu-devel/20250318095415.670319-13-...@redhat.com Link: https://lore.kernel.org/qemu-devel/20250326075122.1299361-14-...@redhat.com Signed-off-by: Cédric Le Goa

[PULL 05/50] vfio: Move vfio_mig_active() into migration.c

2025-04-25 Thread Cédric Le Goater
vfio_mig_active() is part of the VFIO migration API. Move the definitions where VFIO migration is implemented. Reviewed-by: Avihai Horon Reviewed-by: John Levon Link: https://lore.kernel.org/qemu-devel/20250318095415.670319-2-...@redhat.com Link: https://lore.kernel.org/qemu-devel/20250326075122

[PULL 11/50] vfio: Move vfio_device_state_is_running/precopy() into migration.c

2025-04-25 Thread Cédric Le Goater
These routines are migration related. Move their declaration and implementation under the migration files. Reviewed-by: Prasad Pandit Reviewed-by: John Levon Link: https://lore.kernel.org/qemu-devel/20250326075122.1299361-8-...@redhat.com Signed-off-by: Cédric Le Goater --- hw/vfio/vfio-migrat

[PULL 26/50] vfio: Move vfio_kvm_device_fd() into helpers.c

2025-04-25 Thread Cédric Le Goater
The vfio_kvm_device_add/del_fd() routines opening the VFIO pseudo device are defined in "helpers.c". Move 'vfio_kvm_device_fd' definition there and its declaration into "vfio-helpers.h" to reduce exposure of VFIO internals in "hw/vfio/vfio-common.h". Reviewed-by: John Levon Link: https://lore.ker

[PULL 08/50] vfio: Make vfio_un/block_multiple_devices_migration() static

2025-04-25 Thread Cédric Le Goater
Both of these routines are only used in file "migration.c". Move them there. Reviewed-by: Joao Martins Link: https://lore.kernel.org/qemu-devel/20250318095415.670319-5-...@redhat.com Reviewed-by: John Levon Link: https://lore.kernel.org/qemu-devel/20250326075122.1299361-5-...@redhat.com Signed-o

[PULL 32/50] vfio: Make vfio_container_query_dirty_bitmap() static

2025-04-25 Thread Cédric Le Goater
vfio_container_query_dirty_bitmap() is only used in "container-base.c". Also, rename to vfio_container_iommu_query_dirty_bitmap() to reflect it is using the VFIO IOMMU backend device ->query_dirty_bitmap() handler. Reviewed-by: Joao Martins Reviewed-by: John Levon Reviewed-by: Avihai Horon Link

[PULL 38/50] vfio: Introduce vfio_listener_un/register() routines

2025-04-25 Thread Cédric Le Goater
This hides the MemoryListener implementation and makes the code common to both IOMMU backends, legacy and IOMMUFD. Reviewed-by: Joao Martins Reviewed-by: John Levon Link: https://lore.kernel.org/qemu-devel/20250326075122.1299361-35-...@redhat.com Signed-off-by: Cédric Le Goater --- hw/vfio/vf

[PULL 47/50] vfio: Remove hiod_typename property

2025-04-25 Thread Cédric Le Goater
From: Zhenzhong Duan Because we handle host IOMMU device creation in each container backend, we know which type name to use, so hiod_typename property is useless now, just remove it. Signed-off-by: Zhenzhong Duan Reviewed-by: Cédric Le Goater Link: https://lore.kernel.org/qemu-devel/202504230

[PULL 28/50] vfio: Move vfio_de/attach_device() into device.c

2025-04-25 Thread Cédric Le Goater
These routines are VFIODevice related. Move their definitions into "device.c". Reviewed-by: John Levon Link: https://lore.kernel.org/qemu-devel/20250318095415.670319-24-...@redhat.com Reviewed-by: Zhenzhong Duan Link: https://lore.kernel.org/qemu-devel/20250326075122.1299361-25-...@redhat.com S

[PULL 24/50] vfio: Introduce a new file for VFIODevice definitions

2025-04-25 Thread Cédric Le Goater
Move all VFIODevice related routines of "helpers.c" into a new "device.c" file. Reviewed-by: Zhenzhong Duan Reviewed-by: John Levon Link: https://lore.kernel.org/qemu-devel/20250326075122.1299361-21-...@redhat.com Signed-off-by: Cédric Le Goater --- hw/vfio/device.c | 330

[PULL 22/50] vfio: Move vfio_kvm_device_add/del_fd() to helpers.c

2025-04-25 Thread Cédric Le Goater
vfio_kvm_device_add/del_fd() are low level routines. Move them with the other helpers. Reviewed-by: Zhenzhong Duan Reviewed-by: John Levon Link: https://lore.kernel.org/qemu-devel/20250318095415.670319-18-...@redhat.com Link: https://lore.kernel.org/qemu-devel/20250326075122.1299361-19-...@redh

[PULL 36/50] vfio: Introduce new files for VFIO MemoryListener

2025-04-25 Thread Cédric Le Goater
File "common.c" has been emptied of most of its definitions by the previous changes and the only definitions left are related to the VFIO MemoryListener handlers. Rename it to "listener.c" and introduce its associated "vfio-listener.h" header file for the declarations. Cleanup a little the include

[PULL 15/50] vfio: Introduce new files for VFIORegion definitions and declarations

2025-04-25 Thread Cédric Le Goater
Gather all VFIORegion related declarations and definitions into their own files to reduce exposure of VFIO internals in "hw/vfio/vfio-common.h". They were introduced for 'vfio-platform' support in commits db0da029a185 ("vfio: Generalize region support") and a664477db8da ("hw/vfio/pci: Introduce VFI

[PULL 42/50] MAINTAINERS: Add a maintainer for util/vfio-helpers.c

2025-04-25 Thread Cédric Le Goater
The NVMe Block device driver makes use of a reduced VFIO library managing the host interface. These routines are VFIO related and do not have a maintainer. Move util/vfio-helpers.c under VFIO jurisdiction. Reviewed-by: Philippe Mathieu-Daudé Link: https://lore.kernel.org/qemu-devel/20250422162954

[PULL 44/50] vfio/iommufd: Move realize() after attachment

2025-04-25 Thread Cédric Le Goater
From: Zhenzhong Duan Previously device attaching depends on realize() getting host IOMMU capabilities to check dirty tracking support. Now we have a separate call to ioctl(IOMMU_GET_HW_INFO) to get host IOMMU capabilities and check that for dirty tracking support, there is no dependency any more

[PULL 19/50] vfio: Move Host IOMMU type declarations into their respective files

2025-04-25 Thread Cédric Le Goater
These definitions don't have any use outside of their respective submodules. There is no need to expose them externally. Keep them private. Reviewed-by: Zhenzhong Duan Reviewed-by: John Levon Link: https://lore.kernel.org/qemu-devel/20250318095415.670319-15-...@redhat.com Link: https://lore.ker

[PULL 39/50] vfio: Rename vfio-common.h to vfio-device.h

2025-04-25 Thread Cédric Le Goater
"hw/vfio/vfio-common.h" has been emptied of most of its declarations by the previous changes and the only declarations left are related to VFIODevice. Rename it to "hw/vfio/vfio-device.h" and make the necessary adjustments. Reviewed-by: Zhenzhong Duan Link: https://lore.kernel.org/qemu-devel/202

[PULL 10/50] vfio: Introduce a new header file for internal migration services

2025-04-25 Thread Cédric Le Goater
Gather all VFIO migration related declarations into "vfio-migration-internal.h" to reduce exposure of VFIO internals in "hw/vfio/vfio-common.h". Cc: Kirti Wankhede Cc: Avihai Horon Reviewed-by: Prasad Pandit Reviewed-by: John Levon Reviewed-by: Avihai Horon Link: https://lore.kernel.org/qemu-

[PULL 33/50] vfio: Rename vfio_devices_all_dirty_tracking_started()

2025-04-25 Thread Cédric Le Goater
Also rename vfio_devices_all_device_dirty_tracking_started() while at it and use the prefix 'vfio_container_devices_' for routines simply looping over the container's device list. Reviewed-by: Joao Martins Reviewed-by: John Levon Reviewed-by: Avihai Horon Link: https://lore.kernel.org/qemu-dev

[PULL 41/50] vfio: Rename VFIOContainer related services

2025-04-25 Thread Cédric Le Goater
Rename these routines : vfio_put_group -> vfio_group_put vfio_get_group -> vfio_group_get vfio_kvm_device_del_group -> vfio_group_del_kvm_device vfio_kvm_device_add_group -> vfio_group_add_kvm_device vfio_get_device -> vfio_device_get vfio_put_base_device -> vfio_device_put vfio_devi

[PULL 14/50] vfio: Introduce a new header file for VFIOIOMMUFD declarations

2025-04-25 Thread Cédric Le Goater
Gather all VFIOIOMMUFD related declarations introduced by commits 5ee3dc7af785 ("vfio/iommufd: Implement the iommufd backend") and 5b1e96e65403 ("vfio/iommufd: Introduce auto domain creation") into "vfio-iommufd.h". This to reduce exposure of VFIO internals in "hw/vfio/vfio-common.h". Cc: Joao Mar

[PULL 50/50] vfio: refactor out vfio_pci_config_setup()

2025-04-25 Thread Cédric Le Goater
From: John Levon Refactor the PCI config setup code out of vfio_realize() for readability. Reviewed-by: Cédric Le Goater Signed-off-by: John Levon Link: https://lore.kernel.org/qemu-devel/20250409134814.478903-3-john.le...@nutanix.com Signed-off-by: Cédric Le Goater --- hw/vfio/pci.c | 176

[PULL 20/50] vfio: Introduce a new header file for helper services

2025-04-25 Thread Cédric Le Goater
Gather all helper routine declarations into "vfio-helpers.h" to reduce exposure of VFIO internals in "hw/vfio/vfio-common.h". Reviewed-by: John Levon Link: https://lore.kernel.org/qemu-devel/20250318095415.670319-16-...@redhat.com Reviewed-by: Zhenzhong Duan Link: https://lore.kernel.org/qemu-d

[PULL 46/50] vfio: Cleanup host IOMMU device creation

2025-04-25 Thread Cédric Le Goater
From: Zhenzhong Duan realize() is now moved after attachment, do the same for hiod creation. Introduce a new function vfio_device_hiod_create_and_realize() to do them all in one go. Suggested-by: Cédric Le Goater Signed-off-by: Zhenzhong Duan Reviewed-by: Cédric Le Goater Link: https://lore.

[PULL 48/50] vfio: Register/unregister container for CPR only once for each container

2025-04-25 Thread Cédric Le Goater
From: Zhenzhong Duan vfio_cpr_register_container and vfio_cpr_unregister_container are container scoped function. Calling them for each device attaching/detaching would corrupt CPR reboot notifier list, i.e., when two VFIO devices are attached to same container and have same notifier registered t

[PULL 12/50] vfio: Introduce a new header file for VFIOdisplay declarations

2025-04-25 Thread Cédric Le Goater
Gather all VFIOdisplay related declarations into "vfio-display.h" to reduce exposure of VFIO internals in "hw/vfio/vfio-common.h". Reviewed-by: John Levon Link: https://lore.kernel.org/qemu-devel/20250318095415.670319-8-...@redhat.com Reviewed-by: Zhenzhong Duan Link: https://lore.kernel.org/qem

[PULL 40/50] vfio: Rename VFIODevice related services

2025-04-25 Thread Cédric Le Goater
Rename these routines : vfio_disable_irqindex -> vfio_device_irq_disable vfio_unmask_single_irqindex -> vfio_device_irq_unmask vfio_mask_single_irqindex -> vfio_device_irq_mask vfio_set_irq_signaling -> vfio_device_irq_set_signaling vfio_attach_device -> vfio_device

[PULL 04/50] vfio/spapr: Fix L2 crash with PCI device passthrough and memory > 128G

2025-04-25 Thread Cédric Le Goater
From: Amit Machhiwal An L2 KVM guest fails to boot inside a pSeries LPAR when booted with a memory more than 128 GB and PCI device passthrough. The L2 guest also crashes when it is booted with a memory greater than 128 GB and a PCI device is hotplugged later. The issue arises from a conditional

[PULL 09/50] vfio: Make vfio_viommu_preset() static

2025-04-25 Thread Cédric Le Goater
This routine is only used in file "migration.c". Move it there. Reviewed-by: John Levon Reviewed-by: Joao Martins Link: https://lore.kernel.org/qemu-devel/20250318095415.670319-6-...@redhat.com Link: https://lore.kernel.org/qemu-devel/20250326075122.1299361-6-...@redhat.com Signed-off-by: Cédric

[PULL 29/50] vfio: Move vfio_reset_handler() into device.c

2025-04-25 Thread Cédric Le Goater
Pass-through devices of a VM are not necessarily in the same group and all groups/address_spaces need to be scanned when the machine is reset. Commit f16f39c3fc97 ("Implement PCI hot reset") introduced a VM reset handler for this purpose. Move it under device.c Also reintroduce the comment which e

[PULL 31/50] vfio: Make vfio_devices_query_dirty_bitmap() static

2025-04-25 Thread Cédric Le Goater
vfio_devices_query_dirty_bitmap() is only used in "container-base.c". Also, rename to vfio_container_devices_query_dirty_bitmap() to reflect with the prefix 'vfio_container_devices_' that it simply loops over the container's device list. Reviewed-by: Joao Martins Reviewed-by: John Levon Reviewed

[PULL 35/50] vfio: Rename vfio_get_dirty_bitmap()

2025-04-25 Thread Cédric Le Goater
Rename to vfio_container_query_dirty_bitmap() to be consistent with the VFIO container routine naming scheme. Reviewed-by: Joao Martins Reviewed-by: John Levon Reviewed-by: Avihai Horon Link: https://lore.kernel.org/qemu-devel/20250326075122.1299361-32-...@redhat.com Signed-off-by: Cédric Le G

[PULL 45/50] vfio/container: Move realize() after attachment

2025-04-25 Thread Cédric Le Goater
From: Zhenzhong Duan To match the change for IOMMUFD backend, move realize() after attachment for legacy backend too. Suggested-by: Cédric Le Goater Suggested-by: Donald Dutile Signed-off-by: Zhenzhong Duan Reviewed-by: Cédric Le Goater Link: https://lore.kernel.org/qemu-devel/2025042307282

[PULL 43/50] vfio/iommufd: Make a separate call to get IOMMU capabilities

2025-04-25 Thread Cédric Le Goater
From: Zhenzhong Duan Currently we depend on .realize() calling iommufd_backend_get_device_info() to get IOMMU capabilities and check for dirty page tracking support. By make a extra separate call, this dependency is removed. This happens only during device attach, it's not a hot path. Suggested

[PULL 25/50] vfio: Introduce new files for CPR definitions and declarations

2025-04-25 Thread Cédric Le Goater
Gather all CPR related declarations into "vfio-cpr.h" to reduce exposure of VFIO internals in "hw/vfio/vfio-common.h". These were introduced in commit d9fa4223b30a ("vfio: register container for cpr"). Order file list in meson.build while at it. Cc: Steve Sistare Reviewed-by: Steve Sistare Link

[PULL 18/50] vfio: Move VFIOAddressSpace helpers into container-base.c

2025-04-25 Thread Cédric Le Goater
VFIOAddressSpace is a common object used by VFIOContainerBase which is declared in "hw/vfio/vfio-container-base.h". Move the VFIOAddressSpace related services into "container-base.c". While at it, rename : vfio_get_address_space -> vfio_address_space_get vfio_put_address_space -> vfio_address

[PULL 06/50] vfio: Rename vfio_reset_bytes_transferred()

2025-04-25 Thread Cédric Le Goater
Enforce a 'vfio_mig_' prefix for the VFIO migration API to better reflect the namespace these routines belong to. Reviewed-by: Avihai Horon Reviewed-by: John Levon Reviewed-by: Philippe Mathieu-Daudé Link: https://lore.kernel.org/qemu-devel/20250318095415.670319-3-...@redhat.com Link: https://l

[PULL 37/50] vfio: Rename RAM discard related services

2025-04-25 Thread Cédric Le Goater
Rename some routines to better reflect the namespace they belong to. Reviewed-by: Avihai Horon Link: https://lore.kernel.org/qemu-devel/20250326075122.1299361-34-...@redhat.com Signed-off-by: Cédric Le Goater --- hw/vfio/listener.c | 12 ++-- 1 file changed, 6 insertions(+), 6 deletion

[PULL 30/50] vfio: Move dirty tracking related services into container-base.c

2025-04-25 Thread Cédric Le Goater
Routines of common.c : vfio_devices_all_dirty_tracking_started vfio_devices_all_device_dirty_tracking vfio_devices_query_dirty_bitmap vfio_get_dirty_bitmap are all related to dirty page tracking directly at the container level or at the container device level. Naming is a bit confusing. We wi

[PULL 49/50] vfio: refactor out vfio_interrupt_setup()

2025-04-25 Thread Cédric Le Goater
From: John Levon Refactor the interrupt setup code out of vfio_realize() for readability. Signed-off-by: John Levon Reviewed-by: Cédric Le Goater Link: https://lore.kernel.org/qemu-devel/20250409134814.478903-2-john.le...@nutanix.com Signed-off-by: Cédric Le Goater --- hw/vfio/pci.c | 55 ++

Re: [PATCH v4 09/11] target/i386/kvm: reset AMD PMU registers during VM reset

2025-04-25 Thread Zhao Liu
On Wed, Apr 16, 2025 at 02:52:34PM -0700, Dongli Zhang wrote: > Date: Wed, 16 Apr 2025 14:52:34 -0700 > From: Dongli Zhang > Subject: [PATCH v4 09/11] target/i386/kvm: reset AMD PMU registers during > VM reset > X-Mailer: git-send-email 2.43.5 > > QEMU uses the kvm_get_msrs() function to save In

Re: [PATCH 10.1 v3 00/27] target/riscv: SATP mode and CPU definition overhaul

2025-04-25 Thread Paolo Bonzini
On Thu, Apr 24, 2025 at 4:39 PM Paolo Bonzini wrote: > > Thanks! > > > > Applied to riscv-to-apply.next > > As Daniel noticed, I was expecting > https://lore.kernel.org/qemu-devel/20250210133134.90879-1-phi...@linaro.org/ > to get in before this series. > > If you need a version that applies witho

Re: [PATCH v4 0/6] qom: Constify class_data

2025-04-25 Thread Philippe Mathieu-Daudé
On 24/4/25 21:48, Philippe Mathieu-Daudé wrote: Following Richard's suggestion [*], make QOM class data *const*. [*] https://lore.kernel.org/qemu-devel/f4ec871d-e759-44bc-a10b-872322330...@linaro.org/ Philippe Mathieu-Daudé (6): hw/misc/edu: Convert type_init() -> DEFINE_TYPES() qom: Ha

Re: [PATCH 0/4] meson: Use osdep_prefix for strchrnul()

2025-04-25 Thread Philippe Mathieu-Daudé
Hi Paolo, Pierrick, On 24/4/25 06:50, Akihiko Odaki wrote: macOS SDK may have the symbol of strchrnul(), but it is actually available only on macOS 15.4 or later and that fact is codified in string.h. Include the header file using osdep_prefix to check if the function is available on the deploym

Re: [PATCH 10.1 v3 00/27] target/riscv: SATP mode and CPU definition overhaul

2025-04-25 Thread Philippe Mathieu-Daudé
On 25/4/25 12:55, Paolo Bonzini wrote: On Thu, Apr 24, 2025 at 4:39 PM Paolo Bonzini wrote: Thanks! Applied to riscv-to-apply.next As Daniel noticed, I was expecting https://lore.kernel.org/qemu-devel/20250210133134.90879-1-phi...@linaro.org/ to get in before this series. If you need a vers

Re: [PATCH 10.1 v3 00/27] target/riscv: SATP mode and CPU definition overhaul

2025-04-25 Thread Paolo Bonzini
On Fri, Apr 25, 2025 at 1:02 PM Philippe Mathieu-Daudé wrote: > > On 25/4/25 12:55, Paolo Bonzini wrote: > > On Thu, Apr 24, 2025 at 4:39 PM Paolo Bonzini wrote: > >>> Thanks! > >>> > >>> Applied to riscv-to-apply.next > >> > >> As Daniel noticed, I was expecting > >> https://lore.kernel.org/qemu

Re: [PATCH v4] target/i386: Fix model number of Zhaoxin YongFeng vCPU template

2025-04-25 Thread Ewan Hai
On 4/24/25 3:25 PM, Michael Tokarev wrote: On 15.04.2025 05:45, Ewan Hai wrote: The model number was mistakenly set to 0x0b (11) in commit ff04bc1ac4. The correct value is 0x5b. This mistake occurred because the extended model bits in cpuid[eax=0x1].eax were overlooked, and only the base mod

Re: Whether the qemu mps2-an385 model support getchar?

2025-04-25 Thread Philippe Mathieu-Daudé
Hi, Cc'ing Alex and Gustavo. On 23/4/25 13:31, 小马驹 wrote: When I use mps2-an385 model on qemu, I found that it seems not support getchar. I used the FreeRTOS official demo(mps2-an385-GCC-QEMU), then I tried to use UART  to receive input strings from QEMU terminal, so I tried to use getchar()

[PATCH v2 8/9] target/riscv: widen (m|s)counteren to target_ulong

2025-04-25 Thread Daniel Henrique Barboza
We want to support scounteren as a KVM CSR. The KVM UAPI defines every CSR size as target_ulong, and our env->scounteren is fixed at 32 bits. The other existing cases where the property size does not match the KVM reg size happens with uint64_t properties, like 'mstatus'. When running a 32 bit CPU

[PATCH v2 4/9] target/riscv/kvm: turn kvm_riscv_reg_id_ulong() in a macro

2025-04-25 Thread Daniel Henrique Barboza
We need the reg_id_ulong() helper to be a macro to be able to create a static array of KVMCPUConfig that will hold CSR information. Despite the amount of changes all of them are tedious/trivial: - replace instances of "kvm_riscv_reg_id_ulong" with "KVM_RISCV_REG_ID_ULONG"; - RISCV_CORE_REG(),

[PATCH v2 0/9] target/riscv/kvm: CSR related fixes

2025-04-25 Thread Daniel Henrique Barboza
Hi, In this second version the most noticeable changes are: - patch "target/riscv/kvm: reset 'scounteren' with host val" was dropped. After the v1 reviews [1] we decided that a better way would be to change the default 'virt' CPU to max. This would prevent the error condition handled in tha

[PATCH v2 1/9] target/riscv/kvm: minor fixes/tweaks

2025-04-25 Thread Daniel Henrique Barboza
Remove an unused 'KVMScratchCPU' pointer argument in kvm_riscv_check_sbi_dbcn_support(). Put kvm_riscv_reset_regs_csr() after kvm_riscv_put_regs_csr(). This will make a future patch diff easier to read, when changes in kvm_riscv_reset_regs_csr() and kvm_riscv_get_regs_csr() will be made. Fixes: a

[PATCH v2 9/9] target/riscv/kvm: add scounteren CSR

2025-04-25 Thread Daniel Henrique Barboza
Now that CPURISCVState::scounteren is a target_ulong, add support for the scounteren KVM CSR. Reported-by: Andrew Jones Signed-off-by: Daniel Henrique Barboza --- target/riscv/kvm/kvm-cpu.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/target/riscv/kvm/kvm-cpu.c b/target/riscv/kvm/kvm-c

[PATCH v2 3/9] target/riscv/kvm: turn u32/u64 reg functions in macros

2025-04-25 Thread Daniel Henrique Barboza
This change is motivated by a future change w.r.t CSRs management. We want to handle them the same way as KVM extensions, i.e. a static array with KVMCPUConfig objs that will be read/write during init and so on. But to do that properly we must be able to declare a static array that hold KVM regs.

Re: [PATCH 9/9] hw/riscv/virt.c: remove 'long' casts in fmt strings

2025-04-25 Thread Daniel Henrique Barboza
On 4/24/25 6:41 AM, Joel Stanley wrote: On Wed, 23 Apr 2025 at 20:39, Daniel Henrique Barboza wrote: We can avoid the 'long' casts by using PRIx64 and HWADDR_PRIx on the fmt strings for uint64_t and hwaddr types. Signed-off-by: Daniel Henrique Barboza --- hw/riscv/virt.c | 29 ++

Re: [PATCH v4 02/13] memory: Change memory_region_set_ram_discard_manager() to return the result

2025-04-25 Thread David Hildenbrand
  RamDiscardManager *rdm);>>>     /**    * memory_region_find: translate an address/size relative to a diff --git a/system/memory.c b/system/memory.c index b17b5538ff..62d6b410f0 100644 --- a/system/memory.c +++ b/system/memory.c @@ -2115,12 +2115,16 @@ RamDiscardMan

Re: [PATCH v4 03/13] memory: Unify the definiton of ReplayRamPopulate() and ReplayRamDiscard()

2025-04-25 Thread David Hildenbrand
On 07.04.25 09:49, Chenyi Qiang wrote: Update ReplayRamDiscard() function to return the result and unify the ReplayRamPopulate() and ReplayRamDiscard() to ReplayStateChange() at the same time due to their identical definitions. This unification simplifies related structures, such as VirtIOMEMRepl

Re: [PATCH v4 03/13] memory: Unify the definiton of ReplayRamPopulate() and ReplayRamDiscard()

2025-04-25 Thread David Hildenbrand
On 09.04.25 07:43, Alexey Kardashevskiy wrote: On 7/4/25 17:49, Chenyi Qiang wrote: Update ReplayRamDiscard() function to return the result and unify the ReplayRamPopulate() and ReplayRamDiscard() to ReplayStateChange() at the same time due to their identical definitions. This unification simp

Re: [PATCH 08/14] vfio: add vfio-pci-base class

2025-04-25 Thread Cédric Le Goater
On 4/24/25 23:52, John Levon wrote: On Thu, Apr 24, 2025 at 05:17:28PM +0200, Cédric Le Goater wrote: !---| CAUTION: External Email |---! On 4/9/25 15:48, John Lev

Re: [PATCH v4 04/13] memory: Introduce generic state change parent class for RamDiscardManager

2025-04-25 Thread David Hildenbrand
On 09.04.25 11:56, Alexey Kardashevskiy wrote: On 7/4/25 17:49, Chenyi Qiang wrote: RamDiscardManager is an interface used by virtio-mem to adjust VFIO mappings in relation to VM page assignment. It manages the state of populated and discard for the RAM. To accommodate future scnarios for mana

Re: [PATCH v4 04/13] memory: Introduce generic state change parent class for RamDiscardManager

2025-04-25 Thread David Hildenbrand
On 16.04.25 05:32, Chenyi Qiang wrote: On 4/10/2025 9:44 AM, Chenyi Qiang wrote: On 4/10/2025 8:11 AM, Alexey Kardashevskiy wrote: On 9/4/25 22:57, Chenyi Qiang wrote: On 4/9/2025 5:56 PM, Alexey Kardashevskiy wrote: On 7/4/25 17:49, Chenyi Qiang wrote: RamDiscardManager is an inte

Re: [PATCH v2 8/9] target/riscv: widen (m|s)counteren to target_ulong

2025-04-25 Thread Daniel Henrique Barboza
On 4/25/25 9:11 AM, Andrew Jones wrote: On Fri, Apr 25, 2025 at 08:37:04AM -0300, Daniel Henrique Barboza wrote: We want to support scounteren as a KVM CSR. The KVM UAPI defines every CSR size as target_ulong, and our env->scounteren is fixed at 32 bits. The other existing cases where the pr

[PATCH 8/9] configs/devices: Add MIPS Boston-aia board model to RISC-V

2025-04-25 Thread Djordje Todorovic
The board model supports up to 64 harts with MIPS CPS, MIPS GCR, MIPS CPC, AIA plic, and AIA clint devices. The model can create boot code, if there is no -bios parameter. We can specify -smp x, cores=y,thread=z. Ex: Use 4 cores and 2 threads with each core to have 8 smp cpus as follows. qemu-sys

[PATCH 9/9] hw/riscv: Add a network device e1000e to the boston-aia

2025-04-25 Thread Djordje Todorovic
Add a network device e1000e to the boston-aia board model. There is no pch_gbe emulation, so we add e1000e in slot 0 func 1, instead. We need to pass func to call pci_parse_devaddr to find out slot and func. Signed-off-by: Chao-ying Fu Signed-off-by: Djordje Todorovic --- hw/pci/pci.c

[PATCH 0/9] riscv: Add support for MIPS P8700 CPU

2025-04-25 Thread Djordje Todorovic
This patch series adds support for MIPS P8700 CPU based on RISC-V. The P8700 is a high-performance processor from MIPS designed to meet the demands of modern workloads, offering exceptional scalability and efficiency. It builds on MIPS's established architectural strengths while introducing enhanc

[PATCH v4 1/2] target/riscv: Add BOSC's Xiangshan Kunminghu CPU

2025-04-25 Thread Ran Wang
From: Huang Borong <3543977...@qq.com> Add a CPU entry for the Xiangshan Kunminghu CPU, an open-source, high-performance RISC-V processor. More details can be found at: https://github.com/OpenXiangShan/XiangShan Note: The ISA extensions supported by the Xiangshan Kunminghu CPU are categorized bas

[PATCH 3/9] target/riscv: Add MIPS P8700 CPU

2025-04-25 Thread Djordje Todorovic
Introduce MIPS P8700 CPU and set reset vector to 0x1fc0. Signed-off-by: Chao-ying Fu Signed-off-by: Djordje Todorovic --- target/riscv/cpu-qom.h | 1 + target/riscv/cpu.c | 29 + 2 files changed, 30 insertions(+) diff --git a/target/riscv/cpu-qom.h b/target

[PATCH v4 2/2] hw/riscv: Initial support for BOSC's Xiangshan Kunminghu FPGA prototype

2025-04-25 Thread Ran Wang
From: Huang Borong <3543977...@qq.com> This implementation provides emulation for the Xiangshan Kunminghu FPGA prototype platform, including support for UART, CLINT, IMSIC, and APLIC devices. More details can be found at https://github.com/OpenXiangShan/XiangShan Signed-off-by: qinshaoqing Signe

[PATCH 4/9] target/riscv: Add MIPS P8700 CSRs

2025-04-25 Thread Djordje Todorovic
Define MIPS CSRs used for P8700 CPU. Signed-off-by: Chao-ying Fu Signed-off-by: Djordje Todorovic --- target/riscv/cpu.c | 1 + target/riscv/cpu.h | 7 ++ target/riscv/meson.build | 1 + target/riscv/mips_csr.c | 226 +++ 4 files changed, 2

  1   2   3   4   5   6   >