Re: [PATCH v3 1/3] qapi: Moved architecture agnostic data types to `machine`

2023-11-02 Thread Markus Armbruster
Dinah B writes: > Hi, > > I noticed that qapi now has a machine-common category - do you think these > changes would be more appropriate in that file > rather than "machine" for the revision? You're right. We created machine-common.json for stuff needed by both machine.json and machine-target.j

Re: -drive if=none: can't we make this the default?

2023-11-02 Thread Markus Armbruster
Peter Maydell writes: [...] > Also, you can't arbitrarily change the command-line compat > requirements because of how you've chosen to (re-)implement an > option. That doesn't mean the current syntax is set in stone, but > I'm pretty sure the command line isn't at the HMP "we can change > it wi

Re: [PATCH 2/3] linux-user: Report AArch64 hwcap2 fields above bit 31

2023-11-02 Thread Philippe Mathieu-Daudé
On 30/10/23 18:39, Peter Maydell wrote: The AArch64 ELF hwcap2 field is 64 bits, but our get_elf_hwcap2() works with uint32_t, so it accidentally fails to report any hwcaps over bit 31. Use uint64_t here. The Arm hwcap2 is only 32 bits (because the ELF format makes these fields be the size of "

[PATCH v4 16/41] vfio/container: Move vrdl_list to base container

2023-11-02 Thread Zhenzhong Duan
No functional change intended. Signed-off-by: Zhenzhong Duan --- include/hw/vfio/vfio-common.h | 11 include/hw/vfio/vfio-container-base.h | 11 hw/vfio/common.c | 38 +-- hw/vfio/container-base.c | 1 + hw/vfio

[PATCH v4 01/41] vfio/container: Move IBM EEH related functions into spapr_pci_vfio.c

2023-11-02 Thread Zhenzhong Duan
With vfio_eeh_as_ok/vfio_eeh_as_op moved and made static, vfio.h becomes empty and is deleted. No functional changes intended. Suggested-by: Cédric Le Goater Signed-off-by: Zhenzhong Duan Acked-by: Eric Farman Reviewed-by: Cédric Le Goater --- include/hw/vfio/vfio.h | 7 --- hw/ppc/spapr_

[PATCH v4 17/41] vfio/container: Move listener to base container

2023-11-02 Thread Zhenzhong Duan
From: Eric Auger Move listener to base container. Also error and initialized fields are moved at the same time. No functional change intended. Signed-off-by: Eric Auger Signed-off-by: Yi Liu Signed-off-by: Yi Sun Signed-off-by: Zhenzhong Duan --- include/hw/vfio/vfio-common.h | 3

[PATCH v4 02/41] vfio/container: Move vfio_container_add/del_section_window into spapr.c

2023-11-02 Thread Zhenzhong Duan
vfio_container_add/del_section_window are spapr specific functions, so move them into spapr.c to make container.c cleaner. No functional changes intended. Suggested-by: Cédric Le Goater Signed-off-by: Zhenzhong Duan Reviewed-by: Cédric Le Goater --- hw/vfio/container.c | 90 --

[PATCH v4 07/41] vfio/container: Introduce a empty VFIOIOMMUOps

2023-11-02 Thread Zhenzhong Duan
This empty VFIOIOMMUOps named vfio_legacy_ops will hold all general IOMMU ops of legacy container. Signed-off-by: Zhenzhong Duan --- include/hw/vfio/vfio-common.h | 2 +- hw/vfio/container.c | 5 + 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/include/hw/vfio/vfio-c

[PATCH v4 03/41] vfio/container: Move spapr specific init/deinit into spapr.c

2023-11-02 Thread Zhenzhong Duan
Move spapr specific init/deinit code into spapr.c and wrap them with vfio_spapr_container_init/deinit, this way footprint of spapr is further reduced, vfio_prereg_listener could also be made static. vfio_listener_release is unnecessary when prereg_listener is moved out, so have it removed. No fun

[PATCH v4 13/41] vfio/container: Move per container device list in base container

2023-11-02 Thread Zhenzhong Duan
VFIO Device is also changed to point to base container instead of legacy container. No fucntional change intended. Signed-off-by: Zhenzhong Duan Reviewed-by: Cédric Le Goater --- include/hw/vfio/vfio-common.h | 3 +-- include/hw/vfio/vfio-container-base.h | 1 + hw/vfio/common.c

[PATCH v4 24/41] vfio/spapr: Move hostwin_list into spapr container

2023-11-02 Thread Zhenzhong Duan
No functional changes intended. Signed-off-by: Zhenzhong Duan --- include/hw/vfio/vfio-common.h | 1 - hw/vfio/spapr.c | 36 +++ 2 files changed, 20 insertions(+), 17 deletions(-) diff --git a/include/hw/vfio/vfio-common.h b/include/hw/vfio/vfio-co

[PATCH v4 00/41] vfio: Adopt iommufd

2023-11-02 Thread Zhenzhong Duan
Hi, Thanks all for giving guides and comments on previous series, here is the v4 of pure iommufd support part. Based on Cédric's suggestion, this series includes an effort to remove spapr code from container.c, now all spapr functions are moved to spapr.c or spapr_pci_vfio.c, but there are still

[PATCH v4 18/41] vfio/container: Move dirty_pgsizes and max_dirty_bitmap_size to base container

2023-11-02 Thread Zhenzhong Duan
From: Eric Auger No functional change intended. Signed-off-by: Eric Auger Signed-off-by: Yi Liu Signed-off-by: Yi Sun Signed-off-by: Zhenzhong Duan Reviewed-by: Cédric Le Goater --- include/hw/vfio/vfio-common.h | 2 -- include/hw/vfio/vfio-container-base.h | 2 ++ hw/vfio/containe

[PATCH v4 28/41] vfio/iommufd: Implement the iommufd backend

2023-11-02 Thread Zhenzhong Duan
From: Yi Liu Add the iommufd backend. The IOMMUFD container class is implemented based on the new /dev/iommu user API. This backend obviously depends on CONFIG_IOMMUFD. So far, the iommufd backend doesn't support dirty page sync yet due to missing support in the host kernel. Co-authored-by: Eri

[PATCH v4 14/41] vfio/container: Convert functions to base container

2023-11-02 Thread Zhenzhong Duan
From: Eric Auger In the prospect to get rid of VFIOContainer refs in common.c lets convert misc functions to use the base container object instead: vfio_devices_all_dirty_tracking vfio_devices_all_device_dirty_tracking vfio_devices_all_running_and_mig_active vfio_devices_query_dirty_bitmap vfio_

[PATCH v4 06/41] vfio: Introduce base object for VFIOContainer and targeted interface

2023-11-02 Thread Zhenzhong Duan
Introduce a dumb VFIOContainerBase object and its targeted interface. This is willingly not a QOM object because we don't want it to be visible from the user interface. The VFIOContainerBase will be smoothly populated in subsequent patches as well as interfaces. No fucntional change intended. Sig

[PATCH v4 27/41] util/char_dev: Add open_cdev()

2023-11-02 Thread Zhenzhong Duan
From: Yi Liu /dev/vfio/devices/vfioX may not exist. In that case it is still possible to open /dev/char/$major:$minor instead. Add helper function to abstract the cdev open. Suggested-by: Jason Gunthorpe Signed-off-by: Yi Liu Signed-off-by: Zhenzhong Duan --- MAINTAINERS | 6

[PATCH v4 05/41] vfio/common: Move vfio_host_win_add/del into spapr.c

2023-11-02 Thread Zhenzhong Duan
Only spapr supports a customed host window list, other vfio driver assume 64bit host window. So remove the check in listener callback and move vfio_host_win_add/del into spapr.c and make it static. With the check removed, we still need to do the same check for VFIO_SPAPR_TCE_IOMMU which allows a s

[PATCH v4 10/41] vfio/common: Move giommu_list in base container

2023-11-02 Thread Zhenzhong Duan
From: Eric Auger Move the giommu_list field in the base container and store the base container in the VFIOGuestIOMMU. No functional change intended. Signed-off-by: Eric Auger Signed-off-by: Yi Liu Signed-off-by: Yi Sun Signed-off-by: Zhenzhong Duan --- include/hw/vfio/vfio-common.h

[PATCH v4 21/41] vfio/spapr: Introduce spapr backend and target interface

2023-11-02 Thread Zhenzhong Duan
Introduce an empty spapr backend which will hold spapr specific content, currently only prereg_listener and hostwin_list. Also introduce two spapr specific callbacks add/del_window into VFIOIOMMUOps. Instantiate a spapr ops with a helper setup_spapr_ops and assign it to bcontainer->ops. Signed-of

[PATCH v4 22/41] vfio/spapr: switch to spapr IOMMU BE add/del_section_window

2023-11-02 Thread Zhenzhong Duan
No fucntional change intended. Signed-off-by: Zhenzhong Duan --- include/hw/vfio/vfio-common.h | 5 - include/hw/vfio/vfio-container-base.h | 5 + hw/vfio/common.c | 8 ++-- hw/vfio/container-base.c | 21 + hw/vfio/spap

[PATCH v4 35/41] vfio/pci: Make vfio cdev pre-openable by passing a file handle

2023-11-02 Thread Zhenzhong Duan
This gives management tools like libvirt a chance to open the vfio cdev with privilege and pass FD to qemu. This way qemu never needs to have privilege to open a VFIO or iommu cdev node. Together with the earlier support of pre-opening /dev/iommu device, now we have full support of passing a vfio

[PATCH v4 12/41] vfio/container: Switch to IOMMU BE set_dirty_page_tracking/query_dirty_bitmap API

2023-11-02 Thread Zhenzhong Duan
From: Eric Auger dirty_pages_supported field is also moved to the base container No fucntional change intended. Signed-off-by: Eric Auger Signed-off-by: Yi Liu Signed-off-by: Yi Sun Signed-off-by: Zhenzhong Duan --- v4: use assert include/hw/vfio/vfio-common.h | 6 -- include

[PATCH v4 15/41] vfio/container: Move pgsizes and dma_max_mappings to base container

2023-11-02 Thread Zhenzhong Duan
From: Eric Auger No functional change intended. Signed-off-by: Eric Auger Signed-off-by: Yi Liu Signed-off-by: Yi Sun Signed-off-by: Zhenzhong Duan --- v4: Split vrdl_list change out in a seperate patch include/hw/vfio/vfio-common.h | 2 -- include/hw/vfio/vfio-container-base.h |

[PATCH v4 41/41] vfio: Compile out iommufd for PPC target

2023-11-02 Thread Zhenzhong Duan
Since PPC doesn't support IOMMUFD, make iommufd related code compiled out. Suggested-by: Cédric Le Goater Signed-off-by: Zhenzhong Duan --- hw/vfio/common.c | 2 +- hw/vfio/pci.c| 2 +- hw/vfio/platform.c | 2 +- backends/meson.build | 4 ++-- hw/vfio/meson.build | 2 +- 5 files

[PATCH v4 37/41] vfio/platform: Make vfio cdev pre-openable by passing a file handle

2023-11-02 Thread Zhenzhong Duan
This gives management tools like libvirt a chance to open the vfio cdev with privilege and pass FD to qemu. This way qemu never needs to have privilege to open a VFIO or iommu cdev node. Signed-off-by: Zhenzhong Duan --- hw/vfio/platform.c | 41 + 1 file c

[PATCH v4 23/41] vfio/spapr: Move prereg_listener into spapr container

2023-11-02 Thread Zhenzhong Duan
No functional changes intended. Signed-off-by: Zhenzhong Duan --- include/hw/vfio/vfio-common.h | 1 - hw/vfio/spapr.c | 24 2 files changed, 16 insertions(+), 9 deletions(-) diff --git a/include/hw/vfio/vfio-common.h b/include/hw/vfio/vfio-common.h index

[PATCH v4 11/41] vfio/container: Move space field to base container

2023-11-02 Thread Zhenzhong Duan
From: Eric Auger Move the space field to the base object. Also the VFIOAddressSpace now contains a list of base containers. No fucntional change intended. Signed-off-by: Eric Auger Signed-off-by: Yi Liu Signed-off-by: Yi Sun Signed-off-by: Zhenzhong Duan --- v4: use bcontainer->space->as in

[PATCH v4 25/41] Add iommufd configure option

2023-11-02 Thread Zhenzhong Duan
This adds "--enable-iommufd/--disable-iommufd" to enable or disable iommufd support, enabled by default. Signed-off-by: Zhenzhong Duan --- meson.build | 6 ++ meson_options.txt | 2 ++ scripts/meson-buildoptions.sh | 3 +++ 3 files changed, 11 insertions(+) dif

[PATCH v4 29/41] vfio/iommufd: Relax assert check for iommufd backend

2023-11-02 Thread Zhenzhong Duan
Currently iommufd doesn't support dirty page sync yet, but it will not block us doing live migration if VFIO migration is force enabled. So in this case we allow set_dirty_page_tracking to be NULL. Note we don't need same change for query_dirty_bitmap because when dirty page sync isn't supported,

[PATCH v4 30/41] vfio/iommufd: Add support for iova_ranges

2023-11-02 Thread Zhenzhong Duan
Some vIOMMU such as virtio-iommu use iova ranges from host side to setup reserved ranges for passthrough device, so that guest will not use an iova range beyond host support. Use an uAPI of IOMMUFD to get iova ranges of host side and pass to vIOMMU just like the legacy backend. Signed-off-by: Zhe

[PATCH v4 08/41] vfio/container: Switch to dma_map|unmap API

2023-11-02 Thread Zhenzhong Duan
From: Eric Auger No fucntional change intended. Signed-off-by: Eric Auger Signed-off-by: Yi Liu Signed-off-by: Yi Sun Signed-off-by: Zhenzhong Duan --- v4: use SPDX identifier, use assert include/hw/vfio/vfio-common.h | 4 --- include/hw/vfio/vfio-container-base.h | 7 + hw/v

[PATCH v4 36/41] vfio: Allow the selection of a given iommu backend for platform ap and ccw

2023-11-02 Thread Zhenzhong Duan
Previously we added support to select iommu backend for vfio pci device. Now we added others, E.g: platform, ap and ccw. Signed-off-by: Zhenzhong Duan --- include/hw/vfio/vfio-platform.h | 1 + hw/vfio/ap.c| 5 + hw/vfio/ccw.c | 5 + hw/vfio/platform

[PATCH v4 19/41] vfio/container: Move iova_ranges to base container

2023-11-02 Thread Zhenzhong Duan
Meanwhile remove the helper function vfio_free_container as it only calls g_free now. No functional change intended. Signed-off-by: Zhenzhong Duan --- include/hw/vfio/vfio-common.h | 1 - include/hw/vfio/vfio-container-base.h | 1 + hw/vfio/common.c | 5 +++-- hw

[PATCH v4 33/41] vfio/iommufd: Enable pci hot reset through iommufd cdev interface

2023-11-02 Thread Zhenzhong Duan
Add a new callback iommufd_pci_hot_reset to do iommufd specific check and reset operation. Signed-off-by: Zhenzhong Duan --- hw/vfio/pci.h| 2 + hw/vfio/iommufd.c| 142 +++ hw/vfio/pci.c| 4 +- hw/vfio/trace-events | 1 + 4 files

[PATCH v4 20/41] vfio/container: Implement attach/detach_device

2023-11-02 Thread Zhenzhong Duan
From: Eric Auger No fucntional change intended. Signed-off-by: Eric Auger Signed-off-by: Yi Liu Signed-off-by: Yi Sun Signed-off-by: Zhenzhong Duan --- hw/vfio/common.c| 16 hw/vfio/container.c | 12 +--- 2 files changed, 21 insertions(+), 7 deletions(-) diff -

[PATCH v4 38/41] vfio/ap: Make vfio cdev pre-openable by passing a file handle

2023-11-02 Thread Zhenzhong Duan
This gives management tools like libvirt a chance to open the vfio cdev with privilege and pass FD to qemu. This way qemu never needs to have privilege to open a VFIO or iommu cdev node. Opportunisticly, remove some unnecessory double-cast. Signed-off-by: Zhenzhong Duan --- hw/vfio/ap.c | 32 ++

[PATCH v4 31/41] vfio/pci: Extract out a helper vfio_pci_get_pci_hot_reset_info

2023-11-02 Thread Zhenzhong Duan
This helper will be used by both legacy and iommufd backends. No functional changes intended. Signed-off-by: Zhenzhong Duan --- hw/vfio/pci.h | 3 +++ hw/vfio/pci.c | 54 +++ 2 files changed, 40 insertions(+), 17 deletions(-) diff --git a/hw/vfi

[PATCH v4 40/41] vfio: Make VFIOContainerBase poiner parameter const in VFIOIOMMUOps callbacks

2023-11-02 Thread Zhenzhong Duan
Some of the callbacks in VFIOIOMMUOps pass VFIOContainerBase poiner, those callbacks only need read access to the sub object of VFIOContainerBase. So make VFIOContainerBase, VFIOContainer and VFIOIOMMUFDContainer as const in these callbacks. Local functions called by those callbacks also need same

[PATCH v4 09/41] vfio/common: Introduce vfio_container_init/destroy helper

2023-11-02 Thread Zhenzhong Duan
This adds two helper functions vfio_container_init/destroy which will be used by both legacy and iommufd containers to do base container specific initialization and release. No fucntional change intended. Suggested-by: Cédric Le Goater Signed-off-by: Zhenzhong Duan --- include/hw/vfio/vfio-con

[PATCH v4 04/41] vfio/spapr: Make vfio_spapr_create/remove_window static

2023-11-02 Thread Zhenzhong Duan
vfio_spapr_create_window calls vfio_spapr_remove_window, With reoder of definition of the two, we can make vfio_spapr_create/remove_window static. No functional changes intended. Signed-off-by: Zhenzhong Duan Reviewed-by: Cédric Le Goater --- include/hw/vfio/vfio-common.h | 6 - hw/vfio/s

[PATCH v4 32/41] vfio/pci: Introduce a vfio pci hot reset interface

2023-11-02 Thread Zhenzhong Duan
Legacy vfio pci and iommufd cdev have different process to hot reset vfio device, expand current code to abstract out pci_hot_reset callback for legacy vfio, this same interface will also be used by iommufd cdev vfio device. Suggested-by: Cédric Le Goater Signed-off-by: Zhenzhong Duan --- hw/vf

[PATCH v4 39/41] vfio/ccw: Make vfio cdev pre-openable by passing a file handle

2023-11-02 Thread Zhenzhong Duan
This gives management tools like libvirt a chance to open the vfio cdev with privilege and pass FD to qemu. This way qemu never needs to have privilege to open a VFIO or iommu cdev node. Opportunisticly, remove a redundant definition of TYPE_VFIO_CCW. Signed-off-by: Zhenzhong Duan --- hw/vfio/c

[PATCH v4 34/41] vfio/pci: Allow the selection of a given iommu backend

2023-11-02 Thread Zhenzhong Duan
From: Eric Auger Now we support two types of iommu backends, let's add the capability to select one of them. This depends on whether an iommufd object has been linked with the vfio-pci device: if the user wants to use the legacy backend, it shall not link the vfio-pci device with any iommufd obj

Re: [RFC PATCH 5/5] hw/ppc/e500: Pass array of CPUs as array of canonical QOM paths

2023-11-02 Thread Philippe Mathieu-Daudé
On 31/10/23 22:16, Daniel Henrique Barboza wrote: On 10/30/23 11:39, Philippe Mathieu-Daudé wrote: Devices should avoid calling qemu_get_cpu() because this call doesn't work as expected with heterogeneous machines. Such devices often iterate over a cluster of CPUs, which the device's parent has

[PATCH v4 26/41] backends/iommufd: Introduce the iommufd object

2023-11-02 Thread Zhenzhong Duan
From: Eric Auger Introduce an iommufd object which allows the interaction with the host /dev/iommu device. The /dev/iommu can have been already pre-opened outside of qemu, in which case the fd can be passed directly along with the iommufd object: This allows the iommufd object to be shared accr

Re: [RFC PATCH 0/5] hw/ppc/e500: Pass array of CPUs as array of canonical QOM paths

2023-11-02 Thread Philippe Mathieu-Daudé
Hi Daniel, On 31/10/23 22:49, Daniel Henrique Barboza wrote: On 10/30/23 11:39, Philippe Mathieu-Daudé wrote: Following the discussion with Peter on my "cpus: Step toward removing global 'first_cpu'" series [*], we now pass the array of CPUs via property. Since we can not pass array of "link" p

Re: [RFC PATCH 0/5] hw/ppc/e500: Pass array of CPUs as array of canonical QOM paths

2023-11-02 Thread Philippe Mathieu-Daudé
On 31/10/23 22:49, Daniel Henrique Barboza wrote: On 10/30/23 11:39, Philippe Mathieu-Daudé wrote: Following the discussion with Peter on my "cpus: Step toward removing global 'first_cpu'" series [*], we now pass the array of CPUs via property. Since we can not pass array of "link" properties,

Re: [PATCH v8 0/4] pci hotplug tracking

2023-11-02 Thread Vladimir Sementsov-Ogievskiy
Ping. And some addition. We have the case, when the commit commit 7bed89958bfbf40df9ca681cefbdca63abdde39d Author: Maxim Levitsky Date: Tue Oct 6 14:38:58 2020 +0200 device_core: use drain_call_rcu in in qmp_device_add Soon, a device removal might only happen on RCU callback exe

[PATCH] tests/acpi/bios-tables-test: do not write new blobs unless there are changes

2023-11-02 Thread Ani Sinha
When dumping table blobs using rebuild-expected-aml.sh, table blobs from all test variants are dumped regardless of whether there are any actual changes to the tables or not. This creates lot of new files for various test variants that are not part of the git repository. This is because we do not c

Re: [PATCH v8 0/4] pci hotplug tracking

2023-11-02 Thread Vladimir Sementsov-Ogievskiy
[cc Peter, Nikolay and libvirt list] On 02.11.23 11:06, Vladimir Sementsov-Ogievskiy wrote: Ping. And some addition. We have the case, when the commit commit 7bed89958bfbf40df9ca681cefbdca63abdde39d Author: Maxim Levitsky Date:   Tue Oct 6 14:38:58 2020 +0200     device_core: use drain_call

Re: [PATCH v3] tests/avocado: add test to exercize processor address space memory bound checks

2023-11-02 Thread David Hildenbrand
On 01.11.23 02:29, Ani Sinha wrote: On 27-Oct-2023, at 4:12 PM, Ani Sinha wrote: QEMU has validations to make sure that a VM is not started with more memory (static and hotpluggable memory) than what the guest processor can address directly with its addressing bits. This change adds a test t

Re: [RFC PATCH 04/18] vdpa: move shadow_data to vhost_vdpa_shared

2023-11-02 Thread Si-Wei Liu
On 10/19/2023 7:34 AM, Eugenio Pérez wrote: Next patches will register the vhost_vdpa memory listener while the VM is migrating at the destination, so we can map the memory to the device before stopping the VM at the source. The main goal is to reduce the downtime. However, the destination Q

Re: [RFC PATCH 15/18] vdpa: add vhost_vdpa_load_setup

2023-11-02 Thread Si-Wei Liu
On 10/19/2023 7:34 AM, Eugenio Pérez wrote: Callers can use this function to setup the incoming migration. Signed-off-by: Eugenio Pérez --- include/hw/virtio/vhost-vdpa.h | 7 +++ hw/virtio/vhost-vdpa.c | 17 - 2 files changed, 23 insertions(+), 1 deletion(-)

Re: [PATCH] ui/sdl2: use correct key names in win title on mac

2023-11-02 Thread Philippe Mathieu-Daudé
On 30/10/23 03:41, Adrian Wowk wrote: Previously, when using the SDL2 UI on MacOS, the title bar uses incorrect key names (such as Ctrl and Alt instead of the standard MacOS key symbols like ⌃ and ⌥). This commit changes sdl_update_caption in ui/sdl2.c to use the correct symbols when compiling fo

Re: [PATCH v6 11/21] virtio-net: Return an error when vhost cannot enable RSS

2023-11-02 Thread Yuri Benditovich
Probably we mix two different patches in this discussion. Focusing on the patch in the e-mail header: IMO it is not acceptable to fail QEMU run for one feature that we can't make active when we silently drop all other features in such a case. On Wed, Nov 1, 2023 at 11:15 AM Akihiko Odaki wrote:

[PATCH] migration: Unlock mutex in error case

2023-11-02 Thread Juan Quintela
We were not unlocking bitmap mutex on the error case. Coverity discovered the problem. Fixes: a2326705e5 ("migration: Stop migration immediately in RDMA error paths") Signed-off-by: Juan Quintela --- migration/ram.c | 1 + 1 file changed, 1 insertion(+) diff --git a/migration/ram.c b/migration/

Re: [PATCH v8 03/19] target/riscv/cpu.c: set satp_max_supported in cpu_riscv_set_satp()

2023-11-02 Thread Andrew Jones
On Wed, Nov 01, 2023 at 05:41:48PM -0300, Daniel Henrique Barboza wrote: > The setter() for the boolean attributes that set satp_mode (sv32, sv39, > sv48, sv57, sv64) considers that the CPU will always do a > set_satp_mode_max_supported() during cpu_init(). > > This is not the case for the KVM 'ho

Re: [PATCH 1/2] hw/ssi: ibex_spi_host: Clear the interrupt even if disabled

2023-11-02 Thread Daniel Henrique Barboza
On 11/1/23 21:34, Alistair Francis wrote: We currently don't clear the interrupts if they are disabled. This means that if an interrupt occurs and the guest disables interrupts the QEMU IRQ will remain high. This doesn't immediately affect guests, but if the guest re-enables interrupts it's p

Re: [PATCH 2/2] target/riscv: cpu: Set the OpenTitan priv to 1.12.0

2023-11-02 Thread Daniel Henrique Barboza
On 11/1/23 21:34, Alistair Francis wrote: Set the Ibex CPU priv to 1.12.0 to ensure that smepmp/epmp is correctly enabled. Signed-off-by: Alistair Francis --- Reviewed-by: Daniel Henrique Barboza target/riscv/cpu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/t

Re: [PATCH v8 04/19] target/riscv/cpu.c: set satp_mode_max MBARE during satp_finalize()

2023-11-02 Thread Andrew Jones
On Wed, Nov 01, 2023 at 05:41:49PM -0300, Daniel Henrique Barboza wrote: > KVM CPUs can handle "cpu->cfg.satp_mode.supported == 0" because KVM will > make it do internally, not requiring the current SATP support from TCG. > > But other TCG CPUs doesn't deal well with it. We'll assert out before >

Re: [PATCH v6 11/21] virtio-net: Return an error when vhost cannot enable RSS

2023-11-02 Thread Michael S. Tsirkin
On Thu, Nov 02, 2023 at 11:09:27AM +0200, Yuri Benditovich wrote: > Probably we mix two different patches in this discussion. > Focusing on the patch in the e-mail header: > > IMO it is not acceptable to fail QEMU run for one feature that we can't make > active when we silently drop all other feat

Re: [RFC PATCH 02/18] vdpa: move iova tree to the shared struct

2023-11-02 Thread Si-Wei Liu
On 10/19/2023 7:34 AM, Eugenio Pérez wrote: Next patches will register the vhost_vdpa memory listener while the VM is migrating at the destination, so we can map the memory to the device before stopping the VM at the source. The main goal is to reduce the downtime. However, the destination Q

[PATCH v2 4/4] hw/riscv/virt: Add IOPMP support

2023-11-02 Thread Ethan Chen via
- Add 'iopmp=on' option to enable a iopmp device and a dma device connect to the iopmp device - Add 'iopmp_cascade=on' option to enable iopmp cascading. Signed-off-by: Ethan Chen --- hw/riscv/Kconfig| 2 ++ hw/riscv/virt.c | 68 + include

[PATCH v2 3/4] hw/dma: Add Andes ATCDMAC300 support

2023-11-02 Thread Ethan Chen via
Signed-off-by: Ethan Chen --- hw/dma/Kconfig | 3 + hw/dma/atcdmac300.c | 460 hw/dma/meson.build | 1 + include/hw/dma/atcdmac300.h | 171 ++ 4 files changed, 635 insertions(+) create mode 100644 hw/dma/atcdmac30

[PATCH v2 0/4] Support RISC-V IOPMP

2023-11-02 Thread Ethan Chen via
This series implements IOPMP specification v1.0.0-draft4 rapid-k model. When IOPMP is enabled, a DMA device ATCDMAC300 is added to RISC-V virt platform. This DMA devce is connected to the IOPMP and has the functionalities required by IOPMP, including: - Support specify source-id (SID) - Support as

[PATCH v2 2/4] Add RISC-V IOPMP support

2023-11-02 Thread Ethan Chen via
Support specification Version 1.0.0-draft4 rapid-k model. Signed-off-by: Ethan Chen --- hw/misc/Kconfig | 3 + hw/misc/meson.build | 1 + hw/misc/riscv_iopmp.c | 902 ++ include/hw/misc/riscv_iopmp.h | 330 + 4 files

[PATCH v2 1/4] exec/memattrs: Add iopmp source id, start address, end address to MemTxAttrs

2023-11-02 Thread Ethan Chen via
Signed-off-by: Ethan Chen --- include/exec/memattrs.h | 6 ++ 1 file changed, 6 insertions(+) diff --git a/include/exec/memattrs.h b/include/exec/memattrs.h index d04170aa27..fc15e5d7d3 100644 --- a/include/exec/memattrs.h +++ b/include/exec/memattrs.h @@ -64,6 +64,12 @@ typedef struct MemTx

Re: [PATCH v8 05/19] target/riscv/tcg: update priv_ver on user_set extensions

2023-11-02 Thread Andrew Jones
On Wed, Nov 01, 2023 at 05:41:50PM -0300, Daniel Henrique Barboza wrote: > We'll add a new bare CPU type that won't have any default priv_ver. This > means that the CPU will default to priv_ver = 0, i.e. 1.10.0. > > At the same we'll allow these CPUs to enable extensions at will, but > then, if th

Re: [PATCH v6 06/12] target/riscv/tcg: add user flag for profile support

2023-11-02 Thread Daniel Henrique Barboza
On 11/2/23 00:00, Alistair Francis wrote: On Tue, Oct 31, 2023 at 3:19 AM Daniel Henrique Barboza wrote: On 10/30/23 10:28, Daniel Henrique Barboza wrote: On 10/28/23 05:54, Daniel Henrique Barboza wrote: The TCG emulation implements all the extensions described in the RVA22U64 profil

Re: [PATCH v2 0/3] ide: implement simple legacy/native mode switching for PCI IDE controllers

2023-11-02 Thread Bernhard Beschow
Am 24. Oktober 2023 22:40:53 UTC schrieb Mark Cave-Ayland : >This series adds a simple implementation of legacy/native mode switching for >PCI >IDE controllers and updates the via-ide device to use it. > >The approach I take here is to add a new pci_ide_update_mode() function which >handles >

Re: [PATCH 6/6] system/memory: Trace names of MemoryRegions rather than host pointers

2023-11-02 Thread Bernhard Beschow
Am 30. Oktober 2023 03:36:44 UTC schrieb "Philippe Mathieu-Daudé" : >Hi Bernhard, > >On 28/10/23 14:24, Bernhard Beschow wrote: >> Tracing the host pointer of the accessed MemoryRegion seems to be a debug >> feature for developing QEMU itself. When analyzing guest behavior by >> comparing >> t

Re: [PATCH v8 06/19] target/riscv: add rv64i CPU

2023-11-02 Thread Andrew Jones
On Wed, Nov 01, 2023 at 05:41:51PM -0300, Daniel Henrique Barboza wrote: > We don't have any form of a 'bare bones' CPU. rv64, our default CPUs, > comes with a lot of defaults. This is fine for most regular uses but > it's not suitable when more control of what is actually loaded in the > CPU is re

[PULL 02/10] hw/m68k/mcf5206: Pass CPU using QOM link property

2023-11-02 Thread Thomas Huth
From: Philippe Mathieu-Daudé Avoid the interrupt controller directly access the first cpu via the qemu_get_cpu() call. Pass it as argument to mcf5206_init() from the board code. Reviewed-by: Richard Henderson Reviewed-by: Thomas Huth Signed-off-by: Philippe Mathieu-Daudé Message-ID: <20231024

[PULL 06/10] hw/m68k/virt: Do not open-code sysbus_create_simple()

2023-11-02 Thread Thomas Huth
From: Philippe Mathieu-Daudé Mechanical change using the following coccinelle script: @@ identifier dev; expression qom_type; expression addr; expression irq; @@ -dev = qdev_new(qom_type); -sysbus_realize_and_unref(SYS_BUS_DEVICE(dev), &error_fatal); -sysbus_mmio_ma

[PULL 10/10] tests/avocado/machine_m68k_nextcube: Fix the download URL for the ROM image

2023-11-02 Thread Thomas Huth
If Avocado has to fetch this asset, the download fails with a 403 HTTP error. Use a different URL to fix the issue. Message-ID: <20231101201934.27637-1-h...@tuxfamily.org> Signed-off-by: Thomas Huth --- tests/avocado/machine_m68k_nextcube.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions

[PULL 05/10] hw/m68k/next-cube: Do not open-code sysbus_create_simple()

2023-11-02 Thread Thomas Huth
From: Philippe Mathieu-Daudé Mechanical change using the following coccinelle script: @@ identifier dev; identifier sbd; expression qom_type; expression addr; @@ -dev = qdev_new(qom_type); -sysbus_realize_and_unref(SYS_BUS_DEVICE(dev), &error_fatal); -sysbus_mmio_ma

[PULL 04/10] hw/m68k/mcf_intc: Pass CPU using QOM link property

2023-11-02 Thread Thomas Huth
From: Philippe Mathieu-Daudé QOM objects shouldn't access each other internals fields except using the QOM API. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Tested-by: Thomas Huth Reviewed-by: Thomas Huth Message-ID: <20231024083010.12453-5-phi...@linaro.org> Signed-o

[PULL 07/10] hw/char/mcf_uart: Have mcf_uart_create() return DeviceState

2023-11-02 Thread Thomas Huth
From: Philippe Mathieu-Daudé There is no point in having mcf_uart_init() demote the DeviceState pointer and return a void one. Directly return the real typedef. mcf_uart_init() do both init + realize: rename as mcf_uart_create(). Similarly, mcf_uart_mm_init() do init / realize / mmap: rename as

[PULL 09/10] m68k: Instantiate the ESP SCSI controller for the NeXTcube machine

2023-11-02 Thread Thomas Huth
The NeXTcube uses a NCR 53C90 SCSI interface for its disks, so we should be able to use the ESP controller from QEMU here. The code here has been basically taken from Bryce Lanham's GSoC 2011 contribution, except for the next_scsi_init() function which has been rewritte as a replacement for the esp

[PULL 03/10] hw/m68k/mcf_intc: Expose MMIO region via SysBus API

2023-11-02 Thread Thomas Huth
From: Philippe Mathieu-Daudé QOM objects shouldn't access each other internals fields except using the QOM API. Here the caller of mcf_intc_init() access the MMIO region from the MCF_INTC state. Avoid that by exposing that region via sysbus_init_mmio(), then get it with sysbus_mmio_get_region().

[PULL 08/10] hw/m68k/next-cube: Mirror BIOS to address 0

2023-11-02 Thread Thomas Huth
The ROM is also available at address 0, so add a proper mirror for this address. Acked-by: Mark Cave-Ayland Message-ID: <20230930132351.30282-2-h...@tuxfamily.org> Signed-off-by: Thomas Huth --- hw/m68k/next-cube.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/hw/m68k/n

[PULL 00/10] m68k patches

2023-11-02 Thread Thomas Huth
Hi Stefan! The following changes since commit 6c9ae1ce82b65faa3f266fd103729878cf11e07e: Merge tag 'for-upstream' of https://repo.or.cz/qemu/kevin into staging (2023-11-01 06:58:11 +0900) are available in the Git repository at: https://gitlab.com/huth/qemu.git tags/m68k-pull-2023-11-02 fo

[PULL 01/10] hw/m68k/irqc: Pass CPU using QOM link property

2023-11-02 Thread Thomas Huth
From: Philippe Mathieu-Daudé Avoid the interrupt controller directly access the 'first_cpu' global. Pass 'cpu' from the board code. Reviewed-by: Richard Henderson Reviewed-by: Thomas Huth Signed-off-by: Philippe Mathieu-Daudé Message-ID: <20231024083010.12453-2-phi...@linaro.org> Signed-off-b

Re: [RFC PATCH 00/18] Map memory at destination .load_setup in vDPA-net migration

2023-11-02 Thread Si-Wei Liu
On 10/19/2023 7:34 AM, Eugenio Pérez wrote: Current memory operations like pinning may take a lot of time at the destination. Currently they are done after the source of the migration is stopped, and before the workload is resumed at the destination. This is a period where neigher traffic

Re: FreeBSD 13.2 installer does not see AHCI devices on aarch64/sbsa-ref and x86-64/q35

2023-11-02 Thread Marcin Juszkiewicz
W dniu 3.10.2023 o 22:41, Niklas Cassel pisze: On Tue, Oct 03, 2023 at 08:11:39PM +0300, Michael Tokarev wrote: Were you able to take a look at what's going on here? I wish I were able to help here but I know right to nothing about ahci emulation.. I was away on a conference all last week,

Re: FreeBSD 13.2 installer does not see AHCI devices on aarch64/sbsa-ref and x86-64/q35

2023-11-02 Thread Michael Tokarev
02.11.2023 13:16, Marcin Juszkiewicz: W dniu 3.10.2023 o 22:41, Niklas Cassel pisze: On Tue, Oct 03, 2023 at 08:11:39PM +0300, Michael Tokarev wrote: Were you able to take a look at what's going on here?  I wish I were able to help here but I know right to nothing about ahci emulation.. I w

Re: [PATCH v6 11/21] virtio-net: Return an error when vhost cannot enable RSS

2023-11-02 Thread Yuri Benditovich
On Thu, Nov 2, 2023 at 11:33 AM Michael S. Tsirkin wrote: > On Thu, Nov 02, 2023 at 11:09:27AM +0200, Yuri Benditovich wrote: > > Probably we mix two different patches in this discussion. > > Focusing on the patch in the e-mail header: > > > > IMO it is not acceptable to fail QEMU run for one fea

Re: [PATCH 5/5] migration: Print expected-downtime on completion

2023-11-02 Thread Joao Martins
On 31/10/2023 13:14, Juan Quintela wrote: > Joao Martins wrote: >> Right now, migration statistics either print downtime or expected >> downtime depending on migration completing of in progress. Also in the >> beginning of migration by printing the downtime limit as expected >> downtime, when esti

Re: [v3 1/6] system/dirtylimit: Fix a race situation

2023-11-02 Thread Juan Quintela
Hyman Huang wrote: > Fix a race situation for global variable dirtylimit_state. > > Also, replace usleep by g_usleep to increase platform > accessibility to the sleep function. > > Signed-off-by: Hyman Huang > Reviewed-by: Fabiano Rosas > Message-Id: > Reviewed-by: Juan Quintela queued.

Re: [v3 2/6] system/dirtylimit: Drop the reduplicative check

2023-11-02 Thread Juan Quintela
Hyman Huang wrote: > Checking if dirty limit is in service is done by the > dirtylimit_query_all function, drop the reduplicative > check in the qmp_query_vcpu_dirty_limit function. > > Signed-off-by: Hyman Huang > Reviewed-by: Fabiano Rosas > Message-Id: > <31384f768279027560ab952ebc2bbff1ddb6

Re: [PATCH] hw/ide/ahci: fix legacy software reset

2023-11-02 Thread Marcin Juszkiewicz
W dniu 5.10.2023 o 11:53, Niklas Cassel pisze: From: Niklas Cassel Legacy software contains a standard mechanism for generating a reset to a Serial ATA device - setting the SRST (software reset) bit in the Device Control register. Serial ATA has a more robust mechanism called COMRESET, also ref

Re: [v3 3/6] tests: Add migration dirty-limit capability test

2023-11-02 Thread Juan Quintela
Hyman Huang wrote: > Add migration dirty-limit capability test if kernel support > dirty ring. > > Migration dirty-limit capability introduce dirty limit > capability, two parameters: x-vcpu-dirty-limit-period and > vcpu-dirty-limit are introduced to implement the live > migration with dirty limit

Re: [v3 6/6] docs/migration: Add the dirty limit section

2023-11-02 Thread Juan Quintela
Hyman Huang wrote: > The dirty limit feature has been introduced since the 8.1 > QEMU release but has not reflected in the document, add a > section for that. > > Signed-off-by: Hyman Huang > Reviewed-by: Fabiano Rosas > Message-Id: > <36194a8a23d937392bf13d9fff8e898030c827a3.1697815117.git.yon

Re: -drive if=none: can't we make this the default?

2023-11-02 Thread Kevin Wolf
Am 01.11.2023 um 12:21 hat Peter Maydell geschrieben: > On Tue, 31 Oct 2023 at 18:45, Kevin Wolf wrote: > > Am 16.10.2023 um 13:58 hat Michael Tokarev geschrieben: > > > Almost everyone mentions -blockdev as a replacement for -drive. > > > > More specifically for -drive if=none. I honestly don't k

Re: [PATCH v3 1/8] qemu-img: rebase: stop when reaching EOF of old backing file

2023-11-02 Thread Kevin Wolf
Am 01.11.2023 um 18:51 hat Michael Tokarev geschrieben: > 01.11.2023 18:38, Andrey Drobyshev wrote: > > Hi Michael, > > > > Since this series is already merged in master, I'm not sure whether it's > > necessary to forward this particular patch to qemu-stable, or it should > > rather be cherry-pick

Re: [PATCH 2/5] hw/ppc/e500: Declare CPU QOM types using DEFINE_TYPES() macro

2023-11-02 Thread Kevin Wolf
Am 30.10.2023 um 15:39 hat Philippe Mathieu-Daudé geschrieben: > When multiple QOM types are registered in the same file, > it is simpler to use the the DEFINE_TYPES() macro. In > particular because type array declared with such macro > are easier to review. > > Signed-off-by: Philippe Mathieu-Dau

[PATCH 1/1] plugins: enable plugins for windows

2023-11-02 Thread Greg Manning
Enable plugins for windows, including updating the example plugins to compile and work on windows (except lockstep.c, which uses unix sockets) In qemu-plugin.h, mark all API functions as __declspec(dllexport) when compiling the executables, and as __declspec(dllimport) when being used to compile p

Re: -drive if=none: can't we make this the default?

2023-11-02 Thread Peter Maydell
On Thu, 2 Nov 2023 at 10:43, Kevin Wolf wrote: > > Am 01.11.2023 um 12:21 hat Peter Maydell geschrieben: > > On Tue, 31 Oct 2023 at 18:45, Kevin Wolf wrote: > > > Am 16.10.2023 um 13:58 hat Michael Tokarev geschrieben: > > > > Almost everyone mentions -blockdev as a replacement for -drive. > > >

[PATCH 0/1] Enable plugin support for windows

2023-11-02 Thread Greg Manning
This patch enables plugin support on windows. qemu plugins on windows now correctly load/link the qemu_plugin_* symbols when they are loaded[1]. This works by creating a delay-loaded .lib file with dlltool[2], then linking the plugins against that to get them compiled. No messing around with funct

  1   2   3   4   >