[PATCH v7 0/9] vfio: Improve error reporting (part 2)

2024-05-16 Thread Cédric Le Goater
or_setg_errno() in vfio_devices_query_dirty_bitmap() and vfio_legacy_query_dirty_bitmap() - ':' -> '-' in vfio_iommu_map_dirty_notify() Cédric Le Goater (9): vfio: Add Error** argument to .set_dirty_page_tracking() handler vfio: Add Error** argument to vfio_devices_dma_logging_start() migration: Extend migratio

[PATCH v7 7/9] memory: Add Error** argument to memory_get_xlat_addr()

2024-05-16 Thread Cédric Le Goater
Let the callers do the reporting. This will be useful in vfio_iommu_map_dirty_notify(). Cc: Michael S. Tsirkin Cc: Paolo Bonzini Cc: David Hildenbrand Reviewed-by: Peter Xu Reviewed-by: Eric Auger Reviewed-by: Avihai Horon Signed-off-by: Cédric Le Goater --- include/exec/memory.h | 15

[PATCH v7 1/9] vfio: Add Error** argument to .set_dirty_page_tracking() handler

2024-05-16 Thread Cédric Le Goater
We will use the Error object to improve error reporting in the .log_global*() handlers of VFIO. Add documentation while at it. Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Avihai Horon Reviewed-by: Eric Auger Signed-off-by: Cédric Le Goater --- include/hw/vfio/vfio-container-base.h | 18

[PATCH v7 2/9] vfio: Add Error** argument to vfio_devices_dma_logging_start()

2024-05-16 Thread Cédric Le Goater
and reported. The vfio_set_migration_error() call becomes redundant in vfio_listener_log_global_start(). Remove it. Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Avihai Horon Reviewed-by: Eric Auger Signed-off-by: Cédric Le Goater --- Changes in v7: - Commit log improvements (Eric) hw

[PATCH v7 8/9] vfio: Add Error** argument to .get_dirty_bitmap() handler

2024-05-16 Thread Cédric Le Goater
Let the callers do the error reporting. Add documentation while at it. Reviewed-by: Eric Auger Reviewed-by: Avihai Horon Signed-off-by: Cédric Le Goater --- Changes in v7: - Fixed even more line wrapping of *dirty_bitmap() routines (Avihai) - vfio_sync_dirty_bitmap() Fixed return when

[PATCH v7 4/9] vfio/migration: Add an Error** argument to vfio_migration_set_state()

2024-05-16 Thread Cédric Le Goater
under the migration stream if a migration is in progress. Reviewed-by: Avihai Horon Signed-off-by: Cédric Le Goater --- Changes in v7: - vfio_migration_set_state() : Introduced an error prefix to remove redundancy in error messages (Eric) Commented error_report when setting the device

[PATCH v7 6/9] vfio: Reverse test on vfio_get_xlat_addr()

2024-05-16 Thread Cédric Le Goater
It will simplify the changes coming after. Reviewed-by: Avihai Horon Reviewed-by: Eric Auger Signed-off-by: Cédric Le Goater --- hw/vfio/common.c | 22 +- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/hw/vfio/common.c b/hw/vfio/common.c index

[PATCH v7 5/9] vfio/migration: Add Error** argument to .vfio_save_config() handler

2024-05-16 Thread Cédric Le Goater
Use vmstate_save_state_with_err() to improve error reporting in the callers and store a reported error under the migration stream. Add documentation while at it. Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Eric Auger Reviewed-by: Avihai Horon Signed-off-by: Cédric Le Goater --- include

Re: [PATCH v6 8/9] vfio: Add Error** argument to .get_dirty_bitmap() handler

2024-05-16 Thread Cédric Le Goater
On 5/16/24 10:42, Avihai Horon wrote: On 14/05/2024 18:31, Cédric Le Goater wrote: External email: Use caution opening links or attachments Let the callers do the error reporting. Add documentation while at it. Signed-off-by: Cédric Le Goater ---   Changes in v6:   - Fixed the line

Re: [PATCH v6 4/9] vfio/migration: Add an Error** argument to vfio_migration_set_state()

2024-05-16 Thread Cédric Le Goater
On 5/16/24 10:18, Avihai Horon wrote: On 14/05/2024 18:31, Cédric Le Goater wrote: External email: Use caution opening links or attachments Add an Error** argument to vfio_migration_set_state() and adjust callers, including vfio_save_setup(). The error will be propagated up

Re: [PATCH v6 4/9] vfio/migration: Add an Error** argument to vfio_migration_set_state()

2024-05-16 Thread Cédric Le Goater
On 5/15/24 09:20, Eric Auger wrote: Hi Cédric, On 5/14/24 17:31, Cédric Le Goater wrote: Add an Error** argument to vfio_migration_set_state() and adjust callers, including vfio_save_setup(). The error will be propagated up to qemu_savevm_state_setup() where the save_setup() handler

Re: [PATCH v6 3/9] migration: Extend migration_file_set_error() with Error* argument

2024-05-15 Thread Cédric Le Goater
On 5/15/24 09:04, Eric Auger wrote: Hi Cédric, On 5/14/24 17:31, Cédric Le Goater wrote: Use it to update the current error of the migration stream if available and if not, simply print out the error. Next changes will update with an error to report. Reviewed-by: Avihai Horon Acked

Re: [PATCH v6 2/9] vfio: Add Error** argument to vfio_devices_dma_logging_start()

2024-05-15 Thread Cédric Le Goater
On 5/15/24 08:53, Eric Auger wrote: Hi Cédric, On 5/14/24 17:31, Cédric Le Goater wrote: This allows to update the Error argument of the VFIO log_global_start() handler. Errors for container based logging will also be propagated to qemu_savevm_state_setup() when the ram save_setup() handler

Re: [PATCH v6 1/9] vfio: Add Error** argument to .set_dirty_page_tracking() handler

2024-05-15 Thread Cédric Le Goater
On 5/15/24 08:40, Eric Auger wrote: Hi Cédric, On 5/14/24 17:31, Cédric Le Goater wrote: We will use the Error object to improve error reporting in the .log_global*() handlers of VFIO. Add documentation while at it. Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Avihai Horon Signed-off

Re: [PATCH v2 03/11] vfio: Make VFIOIOMMUClass::attach_device() and its wrapper return bool

2024-05-15 Thread Cédric Le Goater
On 5/7/24 09:34, Duan, Zhenzhong wrote: -Original Message- From: Cédric Le Goater Subject: Re: [PATCH v2 03/11] vfio: Make VFIOIOMMUClass::attach_device() and its wrapper return bool On 5/7/24 08:42, Zhenzhong Duan wrote: Make VFIOIOMMUClass::attach_device() and its wrapper

Re: [PATCH v3 2/4] vfio/migration: Emit VFIO migration QAPI event

2024-05-15 Thread Cédric Le Goater
vents", is added so events can be enabled only for the required devices. It is disabled by default. Signed-off-by: Avihai Horon Reviewed-by: Cédric Le Goater Thanks, C. --- include/hw/vfio/vfio-common.h | 1 + hw/vfio/migration.c | 59 +--

Re: [PATCH v3 4/4] vfio/migration: Enhance VFIO migration state tracing

2024-05-15 Thread Cédric Le Goater
vfio_migration_set_state() fails (covering recover state and device reset transitions) and in no-op state transitions to the same state. Suggested-by: Cédric Le Goater Signed-off-by: Avihai Horon Thanks for doing so, Reviewed-by: Cédric Le Goater C. --- hw/vfio/migration.c | 8 ++-- hw/vfio

Re: [PULL 05/11] ui/console: Use qemu_dmabuf_get_..() helpers instead

2024-05-15 Thread Cédric Le Goater
On 5/15/24 14:38, Richard Henderson wrote: On 5/14/24 15:17, marcandre.lur...@redhat.com wrote: --- a/ui/gtk-egl.c +++ b/ui/gtk-egl.c @@ -70,6 +70,7 @@ void gd_egl_draw(VirtualConsole *vc)   QemuDmaBuf *dmabuf = vc->gfx.guest_fb.dmabuf;   #endif   int ww, wh, ws; +    int fence_fd;  

Re: [PATCH v5 01/10] vfio: Add Error** argument to .set_dirty_page_tracking() handler

2024-05-15 Thread Cédric Le Goater
On 5/15/24 14:29, Avihai Horon wrote: On 15/05/2024 15:25, Cédric Le Goater wrote: External email: Use caution opening links or attachments On 5/15/24 14:17, Avihai Horon wrote: On 13/05/2024 19:27, Cédric Le Goater wrote: External email: Use caution opening links or attachments On 5/13

Re: [PATCH v5 01/10] vfio: Add Error** argument to .set_dirty_page_tracking() handler

2024-05-15 Thread Cédric Le Goater
On 5/15/24 14:17, Avihai Horon wrote: On 13/05/2024 19:27, Cédric Le Goater wrote: External email: Use caution opening links or attachments On 5/13/24 15:03, Avihai Horon wrote: Hi Cedric, On 06/05/2024 12:20, Cédric Le Goater wrote: External email: Use caution opening links

[PATCH] ui/console: Only declare variable fence_fd when CONFIG_GBM is defined

2024-05-15 Thread Cédric Le Goater
") Cc: Dongwon Kim Cc: Marc-André Lureau Signed-off-by: Cédric Le Goater --- ui/gtk-egl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ui/gtk-egl.c b/ui/gtk-egl.c index 0473f689c915f8b2303cd9d11bc7d8336c2a85ba..9831c10e1bd58f76d8f803ad0a72d983adc3f490 100644 --- a/ui

Re: [PATCH v2 10/11] vfio/cpr: Make vfio_cpr_register_container() return bool

2024-05-14 Thread Cédric Le Goater
On 5/7/24 08:42, Zhenzhong Duan wrote: This is to follow the coding standand to return bool if 'Error **' is used to pass error. Suggested-by: Cédric Le Goater Signed-off-by: Zhenzhong Duan Reviewed-by: Cédric Le Goater Thanks, C. --- include/hw/vfio/vfio-common.h | 2 +- hw/vfio

Re: [PATCH v2 11/11] backends/iommufd: Make iommufd_backend_*() return bool

2024-05-14 Thread Cédric Le Goater
., log through either error interface or trace, not both. Suggested-by: Cédric Le Goater Signed-off-by: Zhenzhong Duan Reviewed-by: Cédric Le Goater Thanks, C. --- include/sysemu/iommufd.h | 6 +++--- backends/iommufd.c | 29 + hw/vfio/iommufd.c

Re: [PATCH v2 09/11] vfio/iommufd: Make iommufd_cdev_*() return bool

2024-05-14 Thread Cédric Le Goater
iommufd_cdev_attach_container iommufd_cdev_get_info_iova_range After the change, all functions in hw/vfio/iommufd.c follows the standand. Suggested-by: Cédric Le Goater Signed-off-by: Zhenzhong Duan Reviewed-by: Cédric Le Goater Thanks, C. --- hw/vfio/iommufd.c | 88

Re: [PATCH v2 08/11] vfio/container: Make vfio_get_device() return bool

2024-05-14 Thread Cédric Le Goater
On 5/7/24 08:42, Zhenzhong Duan wrote: This is to follow the coding standand to return bool if 'Error **' is used to pass error. Suggested-by: Cédric Le Goater Signed-off-by: Zhenzhong Duan Reviewed-by: Cédric Le Goater Thanks, C. --- hw/vfio/container.c | 16

Re: [PATCH v2 06/11] vfio/container: Make vfio_connect_container() return bool

2024-05-14 Thread Cédric Le Goater
On 5/7/24 08:42, Zhenzhong Duan wrote: This is to follow the coding standand to return bool if 'Error **' is used to pass error. Suggested-by: Cédric Le Goater Signed-off-by: Zhenzhong Duan Reviewed-by: Cédric Le Goater Thanks, C. --- hw/vfio/container.c | 18 +++--- 1

Re: [PATCH v2 07/11] vfio/container: Make vfio_set_iommu() return bool

2024-05-14 Thread Cédric Le Goater
On 5/7/24 08:42, Zhenzhong Duan wrote: This is to follow the coding standand to return bool if 'Error **' is used to pass error. Suggested-by: Cédric Le Goater Signed-off-by: Zhenzhong Duan Reviewed-by: Cédric Le Goater Thanks, C. --- hw/vfio/container.c | 22

Re: [PATCH v2 02/11] vfio/pci: Use g_autofree in iommufd_cdev_get_info_iova_range()

2024-05-14 Thread Cédric Le Goater
On 5/7/24 08:42, Zhenzhong Duan wrote: Local pointer info is freed before return from iommufd_cdev_get_info_iova_range(). Use 'g_autofree' to avoid the g_free() calls. Signed-off-by: Zhenzhong Duan Reviewed-by: Cédric Le Goater Thanks, C. --- hw/vfio/iommufd.c | 4 +--- 1 file

Re: [PATCH v2 01/11] vfio/pci: Use g_autofree in vfio_realize

2024-05-14 Thread Cédric Le Goater
On 5/7/24 08:42, Zhenzhong Duan wrote: Local pointer name is allocated before vfio_attach_device() call and freed after the call. Same for tmp when calling realpath(). Use 'g_autofree' to avoid the g_free() calls. Signed-off-by: Zhenzhong Duan Reviewed-by: Cédric Le Goater Thanks, C

[PATCH v6 7/9] memory: Add Error** argument to memory_get_xlat_addr()

2024-05-14 Thread Cédric Le Goater
Let the callers do the reporting. This will be useful in vfio_iommu_map_dirty_notify(). Cc: Michael S. Tsirkin Cc: Paolo Bonzini Cc: David Hildenbrand Reviewed-by: Peter Xu Signed-off-by: Cédric Le Goater --- Changes in v6: - Fixed memory_get_xlat_addr documentation (Avihai) include

[PATCH v6 0/9] vfio: Improve error reporting (part 2

2024-05-14 Thread Cédric Le Goater
rty_bitmap() - ':' -> '-' in vfio_iommu_map_dirty_notify() Cédric Le Goater (9): vfio: Add Error** argument to .set_dirty_page_tracking() handler vfio: Add Error** argument to vfio_devices_dma_logging_start() migration: Extend migration_file_set_error() with Error* argument vfio/m

[PATCH v6 9/9] vfio: Also trace event failures in vfio_save_complete_precopy()

2024-05-14 Thread Cédric Le Goater
vfio_save_complete_precopy() currently returns before doing the trace event. Change that. Reviewed-by: Avihai Horon Signed-off-by: Cédric Le Goater --- hw/vfio/migration.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/hw/vfio/migration.c b/hw/vfio/migration.c index

[PATCH v6 4/9] vfio/migration: Add an Error** argument to vfio_migration_set_state()

2024-05-14 Thread Cédric Le Goater
under the migration stream if a migration is in progress. Signed-off-by: Cédric Le Goater --- Changes in v6: - Commit log improvements (Avihai) - vfio_migration_set_state() : Dropped the error_setg_errno() change when setting device in recover state fails (Avihai

[PATCH v6 2/9] vfio: Add Error** argument to vfio_devices_dma_logging_start()

2024-05-14 Thread Cédric Le Goater
in vfio_listener_log_global_start(). Remove it. Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Avihai Horon Signed-off-by: Cédric Le Goater --- Changes in v6: - Commit log improvements (Avihai) Changes in v5: - Used error_setg_errno() in vfio_devices_dma_logging_start() hw/vfio/common.c | 26

[PATCH v6 8/9] vfio: Add Error** argument to .get_dirty_bitmap() handler

2024-05-14 Thread Cédric Le Goater
Let the callers do the error reporting. Add documentation while at it. Signed-off-by: Cédric Le Goater --- Changes in v6: - Fixed the line wrapping (Avihai) - Fixed query_dirty_bitmap documentation (Avihai) Changes in v5: - Replaced error_setg() by error_setg_errno

[PATCH v6 6/9] vfio: Reverse test on vfio_get_xlat_addr()

2024-05-14 Thread Cédric Le Goater
It will simplify the changes coming after. Reviewed-by: Avihai Horon Signed-off-by: Cédric Le Goater --- Changes in v6: - Modified title (Avihai) - vfio_iommu_map_dirty_notify() : Modified goto label (Avihai) hw/vfio/common.c | 22 +- 1 file changed, 13 insertions

[PATCH v6 3/9] migration: Extend migration_file_set_error() with Error* argument

2024-05-14 Thread Cédric Le Goater
Use it to update the current error of the migration stream if available and if not, simply print out the error. Next changes will update with an error to report. Reviewed-by: Avihai Horon Acked-by: Fabiano Rosas Signed-off-by: Cédric Le Goater --- Changes in v6: - Commit log improvements

[PATCH v6 1/9] vfio: Add Error** argument to .set_dirty_page_tracking() handler

2024-05-14 Thread Cédric Le Goater
We will use the Error object to improve error reporting in the .log_global*() handlers of VFIO. Add documentation while at it. Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Avihai Horon Signed-off-by: Cédric Le Goater --- Changes in v5: - Fixed typo in set_dirty_page_tracking

[PATCH v6 5/9] vfio/migration: Add Error** argument to .vfio_save_config() handler

2024-05-14 Thread Cédric Le Goater
Use vmstate_save_state_with_err() to improve error reporting in the callers and store a reported error under the migration stream. Add documentation while at it. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Cédric Le Goater --- Changes in v6: - Modified title (Avihai

Re: [PATCH v5 10/10] vfio: Extend vfio_set_migration_error() with Error* argument

2024-05-14 Thread Cédric Le Goater
On 5/14/24 13:20, Cédric Le Goater wrote: On 5/13/24 16:26, Avihai Horon wrote: On 06/05/2024 12:20, Cédric Le Goater wrote: External email: Use caution opening links or attachments vfio_set_migration_error() sets the 'return' error on the migration stream if a migration is in progress

Re: [PATCH v5 10/10] vfio: Extend vfio_set_migration_error() with Error* argument

2024-05-14 Thread Cédric Le Goater
On 5/13/24 16:26, Avihai Horon wrote: On 06/05/2024 12:20, Cédric Le Goater wrote: External email: Use caution opening links or attachments vfio_set_migration_error() sets the 'return' error on the migration stream if a migration is in progress. To improve error reporting, add a new Error

Re: [PATCH v5 08/10] vfio: Add Error** argument to .get_dirty_bitmap() handler

2024-05-14 Thread Cédric Le Goater
On 5/13/24 15:51, Avihai Horon wrote: On 06/05/2024 12:20, Cédric Le Goater wrote: External email: Use caution opening links or attachments Let the callers do the error reporting. Add documentation while at it. Signed-off-by: Cédric Le Goater ---   Changes in v5:   - Replaced error_setg

Re: [PATCH v5 07/10] memory: Add Error** argument to memory_get_xlat_addr()

2024-05-14 Thread Cédric Le Goater
On 5/13/24 15:44, Avihai Horon wrote: On 06/05/2024 12:20, Cédric Le Goater wrote: External email: Use caution opening links or attachments Let the callers do the reporting. This will be useful in vfio_iommu_map_dirty_notify(). Cc: "Michael S. Tsirkin" Cc: Paolo Bonzini

Re: [PATCH v5 06/10] vfio: Reverse test on vfio_get_dirty_bitmap()

2024-05-14 Thread Cédric Le Goater
On 5/13/24 15:42, Avihai Horon wrote: On 06/05/2024 12:20, Cédric Le Goater wrote: External email: Use caution opening links or attachments Title should be: Reverse test on vfio_get_xlat_addr()? It could. It will simplify the changes coming after. Signed-off-by: Cédric Le Goater

Re: [PATCH v5 05/10] vfio: Add Error** argument to .vfio_save_config() handler

2024-05-14 Thread Cédric Le Goater
On 5/13/24 15:30, Avihai Horon wrote: On 06/05/2024 12:20, Cédric Le Goater wrote: External email: Use caution opening links or attachments Use vmstate_save_state_with_err() to improve error reporting in the callers and store a reported error under the migration stream. Add documentation

Re: [PATCH v5 04/10] vfio: Use new Error** argument in vfio_save_setup()

2024-05-14 Thread Cédric Le Goater
On 5/13/24 15:21, Avihai Horon wrote: On 06/05/2024 12:20, Cédric Le Goater wrote: External email: Use caution opening links or attachments Nit: change commit title prefix to vfio/migration (also in other patches that are closely related to vfio migration) Plus, maybe change subject

Re: [PATCH v5 03/10] vfio: Extend migration_file_set_error() with Error** argument

2024-05-13 Thread Cédric Le Goater
On 5/13/24 15:14, Avihai Horon wrote: On 06/05/2024 12:20, Cédric Le Goater wrote: External email: Use caution opening links or attachments Change commit title: vfio: Extend migration_file_set_error() with Error** argument to: migration: Extend migration_file_set_error() with Error

Re: [PATCH v5 02/10] vfio: Add Error** argument to vfio_devices_dma_logging_start()

2024-05-13 Thread Cédric Le Goater
On 5/13/24 15:08, Avihai Horon wrote: On 06/05/2024 12:20, Cédric Le Goater wrote: External email: Use caution opening links or attachments This allows to update the Error argument of the VFIO log_global_start() handler. Errors detected when device level logging is started will be propagated

Re: [PATCH v5 01/10] vfio: Add Error** argument to .set_dirty_page_tracking() handler

2024-05-13 Thread Cédric Le Goater
On 5/13/24 15:03, Avihai Horon wrote: Hi Cedric, On 06/05/2024 12:20, Cédric Le Goater wrote: External email: Use caution opening links or attachments We will use the Error object to improve error reporting in the .log_global*() handlers of VFIO. Add documentation while at it. First of all

Re: [PATCH v2 2/3] vfio/migration: Emit VFIO migration QAPI event

2024-05-13 Thread Cédric Le Goater
On 5/13/24 16:34, Avihai Horon wrote: On 13/05/2024 17:01, Cédric Le Goater wrote: External email: Use caution opening links or attachments On 5/9/24 11:09, Avihai Horon wrote: Emit VFIO migration QAPI event when a VFIO device changes its migration state. This can be used by management

Re: [PATCH v2 3/3] vfio/migration: Don't emit STOP_COPY VFIO migration QAPI event twice

2024-05-13 Thread Cédric Le Goater
state transitions. May be move trace_vfio_migration_set_state() at the beginning of vfio_migration_set_state() and introduce a new event for the currently named routine set_state() ? This can come with followups. Reviewed-by: Cédric Le Goater Thanks, C. +if (new_state == migration->dev

Re: [PATCH v2 1/3] qapi/vfio: Add VFIO migration QAPI event

2024-05-13 Thread Cédric Le Goater
, Reviewed-by: Cédric Le Goater Thanks, C. --- MAINTAINERS | 1 + qapi/qapi-schema.json | 1 + qapi/vfio.json| 67 +++ qapi/meson.build | 1 + 4 files changed, 70 insertions(+) create mode 100644 qapi/vfio.json diff --git

Re: [PATCH v2 2/3] vfio/migration: Emit VFIO migration QAPI event

2024-05-13 Thread Cédric Le Goater
On 5/9/24 11:09, Avihai Horon wrote: Emit VFIO migration QAPI event when a VFIO device changes its migration state. This can be used by management applications to get updates on the current state of the VFIO device for their own purposes. A new per VFIO device capability, "migration-events", is

Re: [PATCH] vfio: container: Fix missing allocation of VFIOSpaprContainer

2024-05-13 Thread Cédric Le Goater
Hello Shivaprasad, On 5/9/24 21:14, Shivaprasad G Bhat wrote: The commit 6ad359ec29 "(vfio/spapr: Move prereg_listener into spapr container)" began to use the newly introduced VFIOSpaprContainer structure. After several refactors, today the container_of(container, VFIOSpaprContainer, ABC) is

Re: [PATCH] ppc/pnv: Implement POWER9 LPC PSI serirq outputs and auto-clear function

2024-05-13 Thread Cédric Le Goater
Hello, On 5/10/24 16:30, Nicholas Piggin wrote: The POWER8 LPC ISA device irqs all get combined and reported to the line connected the PSI LPCHC irq. POWER9 changed this so only internal LPC host controller irqs use that line, and the device irqs get routed to 4 new lines connected to PSI

Re: [PATCH v5 01/19] backends: Introduce HostIOMMUDevice abstract

2024-05-13 Thread Cédric Le Goater
in the future. This looks like a way to work around some other problem, like avoiding exposing Linux definitions on windows build. Thanks, C. Suggested-by: Cédric Le Goater Signed-off-by: Zhenzhong Duan --- MAINTAINERS| 2 ++ include/sysemu/host_iommu_device.h | 51

Re: [PATCH v2 2/2] ppc/pnv: Implement ADU access to LPC space

2024-05-13 Thread Cédric Le Goater
to the serial port as it does on real hardware. This requires a linkage between adu and lpc, which allows adu to perform memory access in the lpc space. Signed-off-by: Nicholas Piggin Reviewed-by: Cédric Le Goater Thanks, C. --- include/hw/ppc/pnv_adu.h | 7 +++ include/hw/ppc/pnv_lpc.h

Re: [PATCH v2 1/2] ppc/pnv: Begin a more complete ADU LPC model for POWER9/10

2024-05-13 Thread Cédric Le Goater
Le Goater Thanks, C. --- include/hw/ppc/pnv_adu.h | 25 + include/hw/ppc/pnv_chip.h | 3 + include/hw/ppc/pnv_xscom.h | 6 ++ hw/ppc/pnv.c | 16 ++ hw/ppc/pnv_adu.c | 111 + hw/ppc/pnv_xscom.c | 9

Re: [PATCH v3 08/16] aspeed/smc: support 64 bits dma dram address

2024-05-07 Thread Cédric Le Goater
Hello Jamin, To handle the DMA DRAM Side Address High register, we should reintroduce an "dram-base" property which I removed a while ago. Something like : diff --git a/include/hw/ssi/aspeed_smc.h b/include/hw/ssi/aspeed_smc.h index 7f32e43ff6f3..6d8ef6bc968f 100644 ---

Re: [PATCH v3 11/16] aspeed/intc: Add AST2700 support

2024-05-07 Thread Cédric Le Goater
Hello Jamin On 4/16/24 11:18, Jamin Lin wrote: AST2700 interrupt controller(INTC) provides hardware interrupt interfaces to interrupt of processors PSP, SSP and TSP. In INTC, each interrupt of INT 128 to INT136 combines 32 interrupts. Introduce a new aspeed_intc class with instance_init and

Re: [PATCH v3 12/16] aspeed/soc: Add AST2700 support

2024-05-07 Thread Cédric Le Goater
Peter, Could you please look at aspeed_soc_ast2700_gic() when you have some time ? My GIC knowledge is a bit limited and I would feel more confortable with your feedback. The rest looks good to me. Thanks, C. On 4/16/24 11:18, Jamin Lin wrote: Initial definitions for a simple machine

[PATCH v2] ppc: Deprecate 'ref405ep' machine and 405 CPUs

2024-05-07 Thread Cédric Le Goater
The 'ref405ep' machine and PPC 405 CPU have no known users, firmware images are not available, OpenWRT dropped support in 2019, U-Boot in 2017, Linux also is dropping support in 2024. It is time to let go of this ancient hardware and focus on newer CPUs and platforms. Signed-off-by: Cédric Le

[PATCH] ppc: Deprecate 'ref405ep' machine and 405 CPUs

2024-05-07 Thread Cédric Le Goater
The 'ref405ep' machine and PPC 405 CPU have no known users, firmware images are not available, OpenWRT dropped support in 2019, U-Boot in 2017, Linux also is dropping support in 2024. It is time to let go of this ancient hardware and focus on newer CPUs and platforms. Signed-off-by: Cédric Le

Re: [PATCH v3 15/19] hw/pci: Introduce pci_device_[set|unset]_iommu_device()

2024-05-07 Thread Cédric Le Goater
On 5/7/24 09:48, Duan, Zhenzhong wrote: Hi Cédric, -Original Message- From: Cédric Le Goater Subject: Re: [PATCH v3 15/19] hw/pci: Introduce pci_device_[set|unset]_iommu_device() Hello Zhenzhong, On 4/29/24 08:50, Zhenzhong Duan wrote: From: Yi Liu pci_device_[set|unset

Re: [PATCH v4 04/19] vfio/iommufd: Introduce TYPE_HOST_IOMMU_DEVICE_IOMMUFD_VFIO device

2024-05-07 Thread Cédric Le Goater
On 5/7/24 11:20, Zhenzhong Duan wrote: TYPE_HOST_IOMMU_DEVICE_IOMMUFD_VFIO represents a host IOMMU device under VFIO iommufd backend. It will be created during VFIO device attaching and passed to vIOMMU. It will have its own .realize() implementation. Suggested-by: Cédric Le Goater Signed-off

Re: [PATCH v4 08/19] backends/iommufd: Introduce helper function iommufd_backend_get_device_info()

2024-05-07 Thread Cédric Le Goater
On 5/7/24 11:20, Zhenzhong Duan wrote: Introduce a helper function iommufd_backend_get_device_info() to get host IOMMU related information through iommufd uAPI. Signed-off-by: Yi Liu Signed-off-by: Yi Sun Signed-off-by: Zhenzhong Duan --- include/sysemu/iommufd.h | 4

Re: [PATCH v4 02/19] vfio/container: Introduce TYPE_HOST_IOMMU_DEVICE_LEGACY_VFIO device

2024-05-07 Thread Cédric Le Goater
On 5/7/24 11:20, Zhenzhong Duan wrote: TYPE_HOST_IOMMU_DEVICE_LEGACY_VFIO represents a host IOMMU device under VFIO legacy container backend. It will have its own realize implementation. Suggested-by: Eric Auger Suggested-by: Cédric Le Goater Signed-off-by: Zhenzhong Duan --- include/hw

Re: [PATCH v4 15/19] hw/pci: Introduce pci_device_[set|unset]_iommu_device()

2024-05-07 Thread Cédric Le Goater
On 5/7/24 11:20, Zhenzhong Duan wrote: From: Yi Liu pci_device_[set|unset]_iommu_device() call pci_device_get_iommu_bus_devfn() to get iommu_bus->iommu_ops and call [set|unset]_iommu_device callback to set/unset HostIOMMUDevice for a given PCI device. Signed-off-by: Yi Liu Signed-off-by: Yi

Re: [PATCH v2 03/11] vfio: Make VFIOIOMMUClass::attach_device() and its wrapper return bool

2024-05-07 Thread Cédric Le Goater
On 5/7/24 08:42, Zhenzhong Duan wrote: Make VFIOIOMMUClass::attach_device() and its wrapper function vfio_attach_device() return bool. This is to follow the coding standand to return bool if 'Error **' is used to pass error. Suggested-by: Cédric Le Goater Signed-off-by: Zhenzhong Duan

Re: [PATCH v3 15/19] hw/pci: Introduce pci_device_[set|unset]_iommu_device()

2024-05-07 Thread Cédric Le Goater
Hello Zhenzhong, On 4/29/24 08:50, Zhenzhong Duan wrote: From: Yi Liu pci_device_[set|unset]_iommu_device() call pci_device_get_iommu_bus_devfn() to get iommu_bus->iommu_ops and call [set|unset]_iommu_device callback to set/unset HostIOMMUDevice for a given PCI device. Signed-off-by: Yi Liu

Re: [PATCH v3 05/19] backends/host_iommu_device: Introduce HostIOMMUDeviceCaps

2024-05-07 Thread Cédric Le Goater
() to check common capabalities of different host platform IOMMUs. Suggested-by: Cédric Le Goater Signed-off-by: Zhenzhong Duan --- include/sysemu/host_iommu_device.h | 44 ++ backends/host_iommu_device.c | 29 2 files changed, 73

Re: [PATCH 1/3] vfio: Make VFIOIOMMUClass::attach_device() and its wrapper return bool

2024-05-06 Thread Cédric Le Goater
On 5/7/24 04:09, Duan, Zhenzhong wrote: -Original Message- From: Cédric Le Goater Subject: Re: [PATCH 1/3] vfio: Make VFIOIOMMUClass::attach_device() and its wrapper return bool On 5/6/24 10:33, Zhenzhong Duan wrote: Make VFIOIOMMUClass::attach_device() and its wrapper function

Re: [PATCH 3/3] vfio/migration: Don't emit STOP_COPY state change event twice

2024-05-06 Thread Cédric Le Goater
Hello Avihai, On 4/30/24 07:16, Avihai Horon wrote: When migrating a VFIO device that supports pre-copy, it is transitioned to STOP_COPY twice: once in vfio_vmstate_change() and second time in vfio_save_complete_precopy(). The second transition is harmless, as it's a STOP_COPY->STOP_COPY no-op

Re: [PATCH v4] vfio/pci: migration: Skip config space check for Vendor Specific Information in VSC during restore/load

2024-05-06 Thread Cédric Le Goater
ine types >= 9.1. The check would be enforced on older machine types (<= 9.0). Signed-off-by: Vinayak Kale Cc: Alex Williamson Cc: Michael S. Tsirkin Cc: Cédric Le Goater LGTM, Reviewed-by: Cédric Le Goater Thanks, C. --- Version History v3->v4: - VSC check is skipped for m

Re: [PATCH 3/3] vfio: Make VFIOIOMMUClass::add_window() and its wrapper return bool

2024-05-06 Thread Cédric Le Goater
On 5/6/24 10:33, Zhenzhong Duan wrote: Make VFIOIOMMUClass::add_window() and its wrapper function vfio_container_add_section_window() return bool. This is to follow the coding standand to return bool if 'Error **' is used to pass error. Suggested-by: Cédric Le Goater Signed-off-by: Zhenzhong

Re: [PATCH 2/3] vfio: Make VFIOIOMMUClass::setup() return bool

2024-05-06 Thread Cédric Le Goater
On 5/6/24 10:33, Zhenzhong Duan wrote: This is to follow the coding standand to return bool if 'Error **' is used to pass error. Suggested-by: Cédric Le Goater Signed-off-by: Zhenzhong Duan Reviewed-by: Cédric Le Goater Thanks, C. --- include/hw/vfio/vfio-container-base.h | 2

Re: [PATCH 1/3] vfio: Make VFIOIOMMUClass::attach_device() and its wrapper return bool

2024-05-06 Thread Cédric Le Goater
On 5/6/24 10:33, Zhenzhong Duan wrote: Make VFIOIOMMUClass::attach_device() and its wrapper function vfio_attach_device() return bool. This is to follow the coding standand to return bool if 'Error **' is used to pass error. Suggested-by: Cédric Le Goater Signed-off-by: Zhenzhong Duan

[PATCH v5 07/10] memory: Add Error** argument to memory_get_xlat_addr()

2024-05-06 Thread Cédric Le Goater
Let the callers do the reporting. This will be useful in vfio_iommu_map_dirty_notify(). Cc: "Michael S. Tsirkin" Cc: Paolo Bonzini Cc: David Hildenbrand Reviewed-by: Peter Xu Signed-off-by: Cédric Le Goater --- include/exec/memory.h | 15 ++- hw/vfio/common.c

[PATCH v5 09/10] vfio: Also trace event failures in vfio_save_complete_precopy()

2024-05-06 Thread Cédric Le Goater
vfio_save_complete_precopy() currently returns before doing the trace event. Change that. Signed-off-by: Cédric Le Goater --- hw/vfio/migration.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/hw/vfio/migration.c b/hw/vfio/migration.c index 87437490bd50321b3eb27770c932078597053746

[PATCH v5 02/10] vfio: Add Error** argument to vfio_devices_dma_logging_start()

2024-05-06 Thread Cédric Le Goater
in vfio_devices_dma_logging_start(). Remove it. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Cédric Le Goater --- Changes in v5: - Used error_setg_errno() in vfio_devices_dma_logging_start() hw/vfio/common.c | 26 +++--- 1 file changed, 15 insertions(+), 11 deletions

[PATCH v5 06/10] vfio: Reverse test on vfio_get_dirty_bitmap()

2024-05-06 Thread Cédric Le Goater
It will simplify the changes coming after. Signed-off-by: Cédric Le Goater --- hw/vfio/common.c | 22 +- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/hw/vfio/common.c b/hw/vfio/common.c index ed5ee6349ced78b3bde68d2ee506f78ba1a9dd9c

[PATCH v5 10/10] vfio: Extend vfio_set_migration_error() with Error* argument

2024-05-06 Thread Cédric Le Goater
vfio_set_migration_error() sets the 'return' error on the migration stream if a migration is in progress. To improve error reporting, add a new Error* argument to also set the Error object on the migration stream, if a migration is progress. Signed-off-by: Cédric Le Goater --- Changes in v5

[PATCH v5 08/10] vfio: Add Error** argument to .get_dirty_bitmap() handler

2024-05-06 Thread Cédric Le Goater
Let the callers do the error reporting. Add documentation while at it. Signed-off-by: Cédric Le Goater --- Changes in v5: - Replaced error_setg() by error_setg_errno() in vfio_devices_query_dirty_bitmap() and vfio_legacy_query_dirty_bitmap() - ':' -> '-' in vfio_iommu_map_dirty_not

[PATCH v5 03/10] vfio: Extend migration_file_set_error() with Error** argument

2024-05-06 Thread Cédric Le Goater
Use it to update the current error of the migration stream if available and if not, simply print out the error. Next changes will update with an error to report. Signed-off-by: Cédric Le Goater --- include/migration/misc.h | 2 +- hw/vfio/common.c | 2 +- hw/vfio/migration.c | 4

[PATCH v5 05/10] vfio: Add Error** argument to .vfio_save_config() handler

2024-05-06 Thread Cédric Le Goater
Use vmstate_save_state_with_err() to improve error reporting in the callers and store a reported error under the migration stream. Add documentation while at it. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Cédric Le Goater --- include/hw/vfio/vfio-common.h | 25

[PATCH v5 04/10] vfio: Use new Error** argument in vfio_save_setup()

2024-05-06 Thread Cédric Le Goater
under the migration stream if a migration is in progress. Signed-off-by: Cédric Le Goater --- Changes in v5: - Replaced error_setg() by error_setg_errno() in vfio_migration_set_state() - Rebased on 20c64c8a51a4 ("migration: migration_file_set_error") hw/vfio/migrat

[PATCH v5 01/10] vfio: Add Error** argument to .set_dirty_page_tracking() handler

2024-05-06 Thread Cédric Le Goater
We will use the Error object to improve error reporting in the .log_global*() handlers of VFIO. Add documentation while at it. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Cédric Le Goater --- Changes in v5: - Fixed typo in set_dirty_page_tracking documentation include/hw/vfio/vfio

[PATCH v5 00/10] vfio: Improve error reporting (part 2)

2024-05-06 Thread Cédric Le Goater
error_setg() by error_setg_errno() in vfio_migration_set_state() - Replaced error_setg() by error_setg_errno() in vfio_devices_query_dirty_bitmap() and vfio_legacy_query_dirty_bitmap() - ':' -> '-' in vfio_iommu_map_dirty_notify() Cédric Le Goater (10): vfio: Add Error** argument to .set_dirty_

Re: [PATCH v3 07/16] aspeed/smc: fix dma moving incorrect data length issue

2024-05-03 Thread Cédric Le Goater
On 4/30/24 10:51, Jamin Lin wrote: Hi Cedric, On 4/19/24 15:41, Cédric Le Goater wrote: On 4/16/24 11:18, Jamin Lin wrote: DMA length is from 1 byte to 32MB for AST2600 and AST10x0 and DMA length is from 4 bytes to 32MB for AST2500. In other words, if "R_DMA_LEN" is 0, it s

Re: [PATCH v3 00/19] Add a host IOMMU device abstraction to check with vIOMMU

2024-05-03 Thread Cédric Le Goater
On 5/3/24 16:10, Jason Gunthorpe wrote: On Fri, May 03, 2024 at 04:04:25PM +0200, Cédric Le Goater wrote: However, have you considered another/complementary approach which would be to create an host IOMMU (iommufd) backend object and a vIOMMU device object together for each vfio-pci device

Re: [PATCH v3 08/16] aspeed/smc: support 64 bits dma dram address

2024-05-03 Thread Cédric Le Goater
Hello Jamin, On 4/30/24 09:56, Jamin Lin wrote: Hi Cedric, -Original Message- From: Cédric Le Goater Sent: Tuesday, April 30, 2024 3:26 PM To: Jamin Lin ; Peter Maydell ; Andrew Jeffery ; Joel Stanley ; Alistair Francis ; Cleber Rosa ; Philippe Mathieu-Daudé ; Wainer dos Santos

Re: [PATCH v3 00/19] Add a host IOMMU device abstraction to check with vIOMMU

2024-05-03 Thread Cédric Le Goater
On 4/29/24 08:50, Zhenzhong Duan wrote: Hi, The most important change in this version is instroducing a common HostIOMMUDeviceCaps structure in HostIOMMUDevice and a new interface between vIOMMU and HostIOMMUDevice. HostIOMMUDeviceClass::realize() is introduced to initialize

Re: [PATCH 00/14] hw: define and enforce a standard lifecycle for versioned machines

2024-05-03 Thread Cédric Le Goater
ld agree with such a change. The version numbers always confused me. AFAICT, only QEMU_VERSION_MICRO would need some massaging. It shouldn't be too complex. For the series, Tested-by: Cédric Le Goater Thanks, C. Daniel P. Berrangé (14): include/hw: add helpers for defining versione

Re: [PATCH 1/2] ppc/pnv: Begin a more complete ADU LPC model for POWER9/10

2024-05-02 Thread Cédric Le Goater
On 5/3/24 06:51, Nicholas Piggin wrote: On Thu May 2, 2024 at 6:47 PM AEST, Cédric Le Goater wrote: On 5/1/24 14:39, Nicholas Piggin wrote: On Wed Apr 17, 2024 at 9:25 PM AEST, Cédric Le Goater wrote: Hello Nick, On 4/17/24 13:02, Nicholas Piggin wrote: This implements a framework

[PATCH 2/3] s390x/event-facility: Simplify sclp_get_event_facility_bus()

2024-05-02 Thread Cédric Le Goater
sclp_get_event_facility_bus() scans the whole machine to find a TYPE_SCLP_EVENTS_BUS object. The SCLPDevice instance is now available under the machine state, use it to simplify the lookup and adjust the creation of the consoles. Signed-off-by: Cédric Le Goater --- include/hw/s390x/event

[PATCH 3/3] s390x/sclp: Simplify get_sclp_device()

2024-05-02 Thread Cédric Le Goater
get_sclp_device() scans the whole machine to find a TYPE_SCLP object. Now that the SCLPDevice instance is available under the machine state, use it to simplify the lookup. While at it, remove the inline to let the compiler decide on how to optimize. Signed-off-by: Cédric Le Goater --- hw/s390x

[PATCH 1/3] s390x: Introduce a SCLPDevice pointer under the machine

2024-05-02 Thread Cédric Le Goater
Initialize directly SCLPDevice from the machine init handler and remove s390_sclp_init(). We will use the SCLPDevice pointer later to create the consoles. Signed-off-by: Cédric Le Goater --- include/hw/s390x/s390-virtio-ccw.h | 3 +++ include/hw/s390x/sclp.h| 2 -- hw/s390x/s390

[PATCH 0/3] s390x: Simplify SCLPDevice usage

2024-05-02 Thread Cédric Le Goater
Hello, Here is a little series reworking the SCLPDevice initialization in the machine to simplify its use. Applies on top of : https://lore.kernel.org/qemu-devel/20240430190843.453903-1-th...@redhat.com/ Thanks, C. Cédric Le Goater (3): s390x: Introduce a SCLPDevice pointer under

Re: [PATCH v3 06/19] range: Introduce range_get_last_bit()

2024-05-02 Thread Cédric Le Goater
On 4/30/24 11:58, Duan, Zhenzhong wrote: -Original Message- From: Cédric Le Goater Subject: Re: [PATCH v3 06/19] range: Introduce range_get_last_bit() On 4/29/24 08:50, Zhenzhong Duan wrote: This helper get the highest 1 bit position of the upper bound. If the range is empty

Re: [PATCH 1/2] ppc/pnv: Begin a more complete ADU LPC model for POWER9/10

2024-05-02 Thread Cédric Le Goater
On 5/1/24 14:39, Nicholas Piggin wrote: On Wed Apr 17, 2024 at 9:25 PM AEST, Cédric Le Goater wrote: Hello Nick, On 4/17/24 13:02, Nicholas Piggin wrote: This implements a framework for an ADU unit model. The ADU unit actually implements XSCOM, which is the bridge between MMIO and PIB

<    1   2   3   4   5   6   7   8   9   10   >