Re: [PATCH 1/7] qga/commands-posix: return fsinfo values directly as reported by statvfs

2024-02-27 Thread Marc-André Lureau
Hi On Tue, Feb 27, 2024 at 4:38 PM Andrey Drobyshev wrote: > > > > On 2/26/24 20:50, Konstantin Kostiuk wrote: > > > > Best Regards, > > Konstantin Kostiuk. > > > > > > On Mon, Feb 26, 2024 at 7:02 PM Andrey Drobyshev > > mailto:andrey.drobys...@virtuozzo.com>> > > wrote: > > > > Since the

Re: [PATCH v2] ppc/pnv: Improve pervasive topology calculation for big-core

2024-02-27 Thread Cédric Le Goater
On 2/27/24 21:36, Caleb Schlossin wrote: Big (SMT8) cores have a complicated function to map the core, thread ID to pervasive topology (PIR). Fix this for power8, power9, and power10. Signed-off-by: Caleb Schlossin --- Version 2 fixes the PIR calculation for core, thread ID for power10 big

Re: [PATCH v7 1/2] qom: new object to associate device to numa node

2024-02-27 Thread Markus Armbruster
writes: > From: Ankit Agrawal > > NVIDIA GPU's support MIG (Mult-Instance GPUs) feature [1], which allows > partitioning of the GPU device resources (including device memory) into > several (upto 8) isolated instances. Each of the partitioned memory needs > a dedicated NUMA node to operate. The

Re: [PATCH v2 1/7] hw/cxl/cxl-host: Fix missing ERRP_GUARD() in cxl_fixed_memory_window_config()

2024-02-27 Thread Markus Armbruster
Zhao Liu writes: > From: Zhao Liu > > As the comment in qapi/error, dereferencing @errp requires > ERRP_GUARD(): > > * = Why, when and how to use ERRP_GUARD() = > * > * Without ERRP_GUARD(), use of the @errp parameter is restricted: > * - It must not be dereferenced, because it may be null. >

Re: [PATCH V4 14/14] migration: options incompatible with cpr

2024-02-27 Thread Markus Armbruster
Steve Sistare writes: > Fail the migration request if options are set that are incompatible > with cpr. > > Signed-off-by: Steve Sistare > --- > migration/migration.c | 17 + > qapi/migration.json | 2 ++ > 2 files changed, 19 insertions(+) > > diff --git

Re: [PATCH V4 13/14] migration: update cpr-reboot description

2024-02-27 Thread Markus Armbruster
Steve Sistare writes: > Clarify qapi for cpr-reboot migration mode, and add vfio support. The patch only affects documentation, but that's less than clear from the commit message. Suggest Improve documentation for migration mode @cpr-reboot. In particular, document VFIO support. >

Re: [PATCH v9 2/4] qmp: add dump machine type compatibility properties

2024-02-27 Thread Markus Armbruster
Maksim Davydov writes: > To control that creating new machine type doesn't affect the previous > types (their compat_props) and to check complex compat_props inheritance > we need qmp command to print machine type compatibility properties. > This patch adds the ability to get list of all the

[PATCH] Fixed tlb huge page loading issue

2024-02-27 Thread Xianglai Li
The lddir and ldpte instruction emulation has a problem with the use of large page processing above level 2. The page size is not correctly calculated, resulting in the wrong page size of the table entry found by tlb. Signed-off-by: Xianglai Li --- target/loongarch/cpu.h| 1 +

Re: [EXT] Re: [PATCH v3] virtio-pci: correctly set virtio pci queue mem multiplier

2024-02-27 Thread Michael S. Tsirkin
On Wed, Feb 28, 2024 at 06:13:03AM +, Srujana Challa wrote: > > Subject: [EXT] Re: [PATCH v3] virtio-pci: correctly set virtio pci queue mem > > multiplier > > > > External Email > > > > -- > > On Fri, Feb 23, 2024 at

Re: [PATCH] qapi: Craft the BlockdevCreateOptionsLUKS comment

2024-02-27 Thread Markus Armbruster
Yong Huang writes: > On Wed, Feb 21, 2024 at 4:26 PM Markus Armbruster wrote: > >> Yong Huang writes: >> >> > On Wed, Feb 21, 2024 at 2:43 PM Markus Armbruster >> wrote: >> > >> >> Hyman Huang writes: >> >> >> >> > Add comment in detail for commit 433957bb7f (qapi: >> >> > Make parameter

Re: [PATCH 0/6] Add ivshmem-flat device

2024-02-27 Thread Markus Armbruster
Gustavo Romero writes: [...] > This patchset introduces a new device, ivshmem-flat, which is similar to the > current ivshmem device but does not require a PCI bus. It implements the > ivshmem > status and control registers as MMRs and the shared memory as a directly > accessible memory region

RE: [EXT] Re: [PATCH v3] virtio-pci: correctly set virtio pci queue mem multiplier

2024-02-27 Thread Srujana Challa
> Subject: [EXT] Re: [PATCH v3] virtio-pci: correctly set virtio pci queue mem > multiplier > > External Email > > -- > On Fri, Feb 23, 2024 at 10:56:17AM +0530, Srujana Challa wrote: > > Currently, virtio_pci_queue_mem_mult

RE: [RFC 4/8] hw/core: Add cache topology options in -smp

2024-02-27 Thread JeeHeng Sia
> -Original Message- > From: Zhao Liu > Sent: Tuesday, February 20, 2024 5:25 PM > To: Daniel P . Berrangé ; Eduardo Habkost > ; Marcel Apfelbaum > ; Philippe Mathieu-Daudé ; > Yanan Wang ; > Michael S . Tsirkin ; Paolo Bonzini ; > Richard Henderson ; > Eric Blake ; Markus

Re: [PATCH v7 1/2] qom: new object to associate device to numa node

2024-02-27 Thread Ankit Agrawal
>> diff --git a/include/hw/acpi/acpi-generic-initiator.h >> b/include/hw/acpi/acpi-generic-initiator.h >> new file mode 100644 >> index 00..2f183b029a >> --- /dev/null >> +++ b/include/hw/acpi/acpi-generic-initiator.h > >> +typedef struct AcpiGenericInitiatorClass { >> +   

[PULL 21/25] migration: update cpr-reboot description

2024-02-27 Thread peterx
From: Steve Sistare Clarify qapi for cpr-reboot migration mode, and add vfio support. Signed-off-by: Steve Sistare Reviewed-by: Peter Xu Link: https://lore.kernel.org/r/1708622920-68779-14-git-send-email-steven.sist...@oracle.com Signed-off-by: Peter Xu --- qapi/migration.json | 35

[PULL 17/25] migration: per-mode notifiers

2024-02-27 Thread peterx
From: Steve Sistare Keep a separate list of migration notifiers for each migration mode. Suggested-by: Peter Xu Signed-off-by: Steve Sistare Reviewed-by: Peter Xu Reviewed-by: David Hildenbrand Link: https://lore.kernel.org/r/1708622920-68779-8-git-send-email-steven.sist...@oracle.com

[PULL 13/25] migration: convert to NotifierWithReturn

2024-02-27 Thread peterx
From: Steve Sistare Change all migration notifiers to type NotifierWithReturn, so notifiers can return an error status in a future patch. For now, pass NULL for the notifier error parameter, and do not check the return value. Signed-off-by: Steve Sistare Reviewed-by: Peter Xu Reviewed-by:

[PULL 25/25] migration: Use migrate_has_error() in close_return_path_on_source()

2024-02-27 Thread peterx
From: Cédric Le Goater close_return_path_on_source() retrieves the migration error from the the QEMUFile '->to_dst_file' to know if a shutdown is required. This shutdown is required to exit the return-path thread. Avoid relying on '->to_dst_file' and use migrate_has_error() instead. (using

[PULL 16/25] migration: MigrationNotifyFunc

2024-02-27 Thread peterx
From: Steve Sistare Define MigrationNotifyFunc to improve type safety and simplify migration notifiers. Signed-off-by: Steve Sistare Reviewed-by: Peter Xu Reviewed-by: David Hildenbrand Link: https://lore.kernel.org/r/1708622920-68779-7-git-send-email-steven.sist...@oracle.com

[PULL 22/25] migration: options incompatible with cpr

2024-02-27 Thread peterx
From: Steve Sistare Fail the migration request if options are set that are incompatible with cpr. Signed-off-by: Steve Sistare Reviewed-by: Peter Xu Link: https://lore.kernel.org/r/1708622920-68779-15-git-send-email-steven.sist...@oracle.com Signed-off-by: Peter Xu --- qapi/migration.json

[PULL 19/25] migration: notifier error checking

2024-02-27 Thread peterx
From: Steve Sistare Check the status returned by migration notifiers for event type MIG_EVENT_PRECOPY_SETUP, and report errors. None of the notifiers return an error status at this time. Signed-off-by: Steve Sistare Reviewed-by: Peter Xu Link:

[PULL 24/25] migration: Join the return path thread before releasing to_dst_file

2024-02-27 Thread peterx
From: Fabiano Rosas The return path thread might hang at a blocking system call. Before joining the thread we might need to issue a shutdown() on the socket file descriptor to release it. To determine whether the shutdown() is necessary we look at the QEMUFile error. Make sure we only clean up

[PULL 15/25] migration: remove postcopy_after_devices

2024-02-27 Thread peterx
From: Steve Sistare postcopy_after_devices and migration_in_postcopy_after_devices are no longer used, so delete them. Signed-off-by: Steve Sistare Reviewed-by: Peter Xu Link: https://lore.kernel.org/r/1708622920-68779-6-git-send-email-steven.sist...@oracle.com Signed-off-by: Peter Xu ---

[PULL 20/25] migration: stop vm for cpr

2024-02-27 Thread peterx
From: Steve Sistare When migration for cpr is initiated, stop the vm and set state RUN_STATE_FINISH_MIGRATE before ram is saved. This eliminates the possibility of ram and device state being out of sync, and guarantees that a guest in the suspended state remains suspended, because qmp_cont

[PULL 23/25] migration: Fix qmp_query_migrate mbps value

2024-02-27 Thread peterx
From: Fabiano Rosas The QMP command query_migrate might see incorrect throughput numbers if it runs after we've set the migration completion status but before migration_calculate_complete() has updated s->total_time and s->mbps. The migration status would show COMPLETED, but the throughput

[PULL 18/25] migration: refactor migrate_fd_connect failures

2024-02-27 Thread peterx
From: Steve Sistare Move common code for the error path in migrate_fd_connect to a shared fail label. No functional change. Signed-off-by: Steve Sistare Reviewed-by: Peter Xu Reviewed-by: David Hildenbrand Link:

[PULL 12/25] migration: remove error from notifier data

2024-02-27 Thread peterx
From: Steve Sistare Remove the error object from opaque data passed to notifiers. Use the new error parameter passed to the notifier instead. Signed-off-by: Steve Sistare Reviewed-by: Peter Xu Reviewed-by: David Hildenbrand Link:

[PULL 05/25] migration/multifd: Release recv sem_sync earlier

2024-02-27 Thread peterx
From: Fabiano Rosas Now that multifd_recv_terminate_threads() is called only once, release the recv side sem_sync earlier like we do for the send side. Signed-off-by: Fabiano Rosas Reviewed-by: Peter Xu Link: https://lore.kernel.org/r/20240220224138.24759-6-faro...@suse.de Signed-off-by:

[PULL 14/25] migration: MigrationEvent for notifiers

2024-02-27 Thread peterx
From: Steve Sistare Passing MigrationState to notifiers is unsound because they could access unstable migration state internals or even modify the state. Instead, pass the minimal info needed in a new MigrationEvent struct, which could be extended in the future if needed. Suggested-by: Peter

[PULL 11/25] notify: pass error to notifier with return

2024-02-27 Thread peterx
From: Steve Sistare Pass an error object as the third parameter to "notifier with return" notifiers, so clients no longer need to bundle an error object in the opaque data. The new parameter is used in a later patch. Signed-off-by: Steve Sistare Reviewed-by: Peter Xu Reviewed-by: David

[PULL 10/25] migration/multifd: Drop unnecessary helper to destroy IOC

2024-02-27 Thread peterx
From: Peter Xu Both socket_send_channel_destroy() and multifd_send_channel_destroy() are unnecessary wrappers to destroy an IOC, as the only thing to do is to release the final IOC reference. We have plenty of code that destroys an IOC using direct unref() already; keep that style.

[PULL 06/25] migration/multifd: Cleanup TLS iochannel referencing

2024-02-27 Thread peterx
From: Peter Xu Commit a1af605bd5 ("migration/multifd: fix hangup with TLS-Multifd due to blocking handshake") introduced a thread for TLS channels, which will resolve the issue on blocking the main thread. However in the same commit p->c is slightly abused just to be able to pass over the

[PULL 09/25] migration/multifd: Cleanup outgoing_args in state destroy

2024-02-27 Thread peterx
From: Peter Xu outgoing_args is a global cache of socket address to be reused in multifd. Freeing the cache in per-channel destructor is more or less a hack. Move it to multifd_send_cleanup_state() so it only get checked once. Use a small helper to do so because it's internal of socket.c.

[PULL 07/25] migration/multifd: Drop registered_yank

2024-02-27 Thread peterx
From: Peter Xu With a clear definition of p->c protocol, where we only set it up if the channel is fully established (TLS or non-TLS), registered_yank boolean will have equal meaning of "p->c != NULL". Drop registered_yank by checking p->c instead. Reviewed-by: Fabiano Rosas Link:

[PULL 08/25] migration/multifd: Make multifd_channel_connect() return void

2024-02-27 Thread peterx
From: Peter Xu It never fails, drop the retval and also the Error**. Suggested-by: Avihai Horon Reviewed-by: Fabiano Rosas Link: https://lore.kernel.org/r/20240222095301.171137-4-pet...@redhat.com Signed-off-by: Peter Xu --- migration/multifd.c | 8 +++- 1 file changed, 3 insertions(+),

[PULL 01/25] docs/devel/migration.rst: Document the file transport

2024-02-27 Thread peterx
From: Fabiano Rosas When adding the support for file migration with the file: transport, we missed adding documentation for it. Signed-off-by: Fabiano Rosas Reviewed-by: Peter Xu Link: https://lore.kernel.org/r/20240220224138.24759-2-faro...@suse.de Signed-off-by: Peter Xu ---

[PULL 03/25] tests/qtest/migration: Add a fd + file test

2024-02-27 Thread peterx
From: Fabiano Rosas The fd URI supports an fd that is backed by a file. The code should select between QIOChannelFile and QIOChannelSocket, depending on the type of the fd. Add a test for that. Signed-off-by: Fabiano Rosas Reviewed-by: Peter Xu Link:

[PULL 02/25] tests/qtest/migration: Rename fd_proto test

2024-02-27 Thread peterx
From: Fabiano Rosas Next patch adds another fd test. Rename the existing one closer to what's used on other tests, with the 'precopy' prefix. Signed-off-by: Fabiano Rosas Reviewed-by: Peter Xu Link: https://lore.kernel.org/r/20240220224138.24759-3-faro...@suse.de Signed-off-by: Peter Xu ---

[PULL 04/25] migration/multifd: Remove p->quit from recv side

2024-02-27 Thread peterx
From: Fabiano Rosas Like we did on the sending side, replace the p->quit per-channel flag with a global atomic 'exiting' flag. Signed-off-by: Fabiano Rosas Reviewed-by: Peter Xu Link: https://lore.kernel.org/r/20240220224138.24759-5-faro...@suse.de Signed-off-by: Peter Xu ---

[PULL 00/25] Migration next patches

2024-02-27 Thread peterx
From: Peter Xu The following changes since commit 158a054c4d1a40179f5e83cd7e1cfe65de457b92: Merge tag 'pull-target-arm-20240227-1' of https://git.linaro.org/people/pmaydell/qemu-arm into staging (2024-02-27 15:34:41 +) are available in the Git repository at: https://gitlab.com

Re: [PATCH v4 23/29] plugins: add an API to read registers

2024-02-27 Thread Akihiko Odaki
On 2024/02/27 23:43, Alex Bennée wrote: We can only request a list of registers once the vCPU has been initialised so the user needs to use either call the get function on vCPU initialisation or during the translation phase. We don't expose the reg number to the plugin instead hiding it behind

Re: [PATCH v4 21/29] gdbstub: expose api to find registers

2024-02-27 Thread Akihiko Odaki
On 2024/02/27 23:43, Alex Bennée wrote: Expose an internal API to QEMU to return all the registers for a vCPU. The list containing the details required to called gdb_read_register(). Based-on: <20231025093128.33116-15-akihiko.od...@daynix.com> Cc: Akihiko Odaki Message-Id:

Re: [PATCH 4/4] replay: simple auto-snapshot mode for record

2024-02-27 Thread Pavel Dovgalyuk
On 26.02.2024 10:36, Nicholas Piggin wrote: On Fri Aug 18, 2023 at 2:36 PM AEST, Pavel Dovgalyuk wrote: On 14.08.2023 19:31, Nicholas Piggin wrote: record makes an initial snapshot when the machine is created, to enable reverse-debugging. Often the issue being debugged appears near the end of

[PATCH v1 07/11] vfio/iommufd: Implement host_iommu_device_create callback in iommufd mode

2024-02-27 Thread Zhenzhong Duan
This callback will be used to initialize base and public elements in IOMMUFDDevice. Signed-off-by: Zhenzhong Duan --- hw/vfio/iommufd.c | 10 ++ 1 file changed, 10 insertions(+) diff --git a/hw/vfio/iommufd.c b/hw/vfio/iommufd.c index 9bfddc1360..1c2f5da0d0 100644 ---

[PATCH v1 05/11] vfio: Introduce host_iommu_device_create callback

2024-02-27 Thread Zhenzhong Duan
Introduce host_iommu_device_create callback and a wrapper for it. This callback is used to allocate a host iommu device instance and initialize it based on type. Signed-off-by: Zhenzhong Duan --- include/hw/vfio/vfio-common.h | 1 + include/hw/vfio/vfio-container-base.h | 1 +

[PATCH v1 04/11] vfio: Add HostIOMMUDevice handle into VFIODevice

2024-02-27 Thread Zhenzhong Duan
This handle points to either IOMMULegacyDevice or IOMMUFDDevice variant, neither both. Signed-off-by: Zhenzhong Duan --- include/hw/vfio/vfio-common.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/hw/vfio/vfio-common.h b/include/hw/vfio/vfio-common.h index 8bfb9cbe94..b6676c9f79

[PATCH v1 11/11] backends/iommufd: Introduce helper function iommufd_device_get_info()

2024-02-27 Thread Zhenzhong Duan
Introduce a helper function iommufd_device_get_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 backends/iommufd.c | 23 ++- 2 files

[PATCH v1 09/11] hw/pci: Introduce pci_device_set/unset_iommu_device()

2024-02-27 Thread Zhenzhong Duan
From: Yi Liu This adds pci_device_set/unset_iommu_device() to set/unset HostIOMMUDevice for a given PCIe device. Caller of set should fail if set operation fails. Extract out pci_device_get_iommu_bus_devfn() to facilitate implementation of pci_device_set/unset_iommu_device(). Signed-off-by: Yi

[PATCH v1 10/11] vfio: Pass HostIOMMUDevice to vIOMMU

2024-02-27 Thread Zhenzhong Duan
Support both iommufd and legacy backend. Originally-by: Yi Liu Signed-off-by: Nicolin Chen Signed-off-by: Yi Sun Signed-off-by: Zhenzhong Duan --- hw/vfio/pci.c | 20 +++- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/hw/vfio/pci.c b/hw/vfio/pci.c index

[PATCH v1 03/11] vfio: Introduce IOMMULegacyDevice

2024-02-27 Thread Zhenzhong Duan
Similar as IOMMUFDDevice, IOMMULegacyDevice represents a device in legacy mode and can be used as a communication interface between devices (i.e., VFIO, VDPA) and vIOMMU. Currently it includes nothing legacy specific, but could be extended with any wanted info of legacy mode when necessary.

[PATCH v1 08/11] vfio/pci: Allocate and initialize HostIOMMUDevice after attachment

2024-02-27 Thread Zhenzhong Duan
Signed-off-by: Zhenzhong Duan --- hw/vfio/pci.c | 4 1 file changed, 4 insertions(+) diff --git a/hw/vfio/pci.c b/hw/vfio/pci.c index 4fa387f043..6cc7de5d10 100644 --- a/hw/vfio/pci.c +++ b/hw/vfio/pci.c @@ -3006,6 +3006,9 @@ static void vfio_realize(PCIDevice *pdev, Error **errp)

[PATCH v1 00/11] Add a host IOMMU device abstraction

2024-02-27 Thread Zhenzhong Duan
Hi, Based on Joao's suggestion, the iommufd nesting prerequisite series [1] is further splitted to host IOMMU device abstract part and vIOMMU check/sync part. This series implements the 1st part. This split also faciliates the dirty tracking series [2] and virtio-iommu series [3] to depend on

[PATCH v1 06/11] vfio/container: Implement host_iommu_device_create callback in legacy mode

2024-02-27 Thread Zhenzhong Duan
This callback will be used to initialize base and public elements in IOMMULegacyDevice. Signed-off-by: Zhenzhong Duan --- hw/vfio/container.c | 9 + 1 file changed, 9 insertions(+) diff --git a/hw/vfio/container.c b/hw/vfio/container.c index bd25b9fbad..2e8ff32284 100644 ---

[PATCH v1 01/11] Introduce a common abstract struct HostIOMMUDevice

2024-02-27 Thread Zhenzhong Duan
HostIOMMUDevice will be inherited by two sub classes, legacy and iommufd currently. Introduce a helper function host_iommu_base_device_init to initialize it. Suggested-by: Eric Auger Signed-off-by: Zhenzhong Duan --- include/sysemu/host_iommu_device.h | 22 ++ 1 file

[PATCH v1 02/11] backends/iommufd: Introduce IOMMUFDDevice

2024-02-27 Thread Zhenzhong Duan
IOMMUFDDevice represents a device in iommufd and can be used as a communication interface between devices (i.e., VFIO, VDPA) and vIOMMU. Currently it includes only public iommufd handle and device id which could be used by vIOMMU to get hw IOMMU information. There will also be some elements in

Re: [RFC PATCH 0/5] hw/i386/q35: Decouple virtual SMI# lines and wire them to ICH9 chipset

2024-02-27 Thread Laszlo Ersek
Hi Phil, On 2/26/24 17:49, Philippe Mathieu-Daudé wrote: > Hi, > > This is an experimental series to reduce calls to the > cpu_interrupt() API from generic HW/. I'm trying to use > the ICH9 chipset from a non-x86 machine. Without this > experiment, we can not because cpu_interrupt() is target >

Re: [PATCH] migration: Don't serialize migration while can't switchover

2024-02-27 Thread Peter Xu
On Wed, Feb 28, 2024 at 02:00:26AM +0200, Avihai Horon wrote: > > On 27/02/2024 9:41, Peter Xu wrote: > > External email: Use caution opening links or attachments > > > > > > On Thu, Feb 22, 2024 at 05:56:27PM +0200, Avihai Horon wrote: > > > Currently, migration code serializes device data

RE: [PATCH rfcv2 18/18] intel_iommu: Block migration if cap is updated

2024-02-27 Thread Duan, Zhenzhong
>-Original Message- >From: Joao Martins >Subject: Re: [PATCH rfcv2 18/18] intel_iommu: Block migration if cap is >updated > >On 27/02/2024 02:41, Duan, Zhenzhong wrote: >> >> >>> -Original Message- >>> From: Joao Martins >>> Subject: Re: [PATCH rfcv2 18/18] intel_iommu: Block

[PATCH] hw/misc: zynq_slcr: set SLC_RST bit in REBOOT_STATUS register

2024-02-27 Thread Gregory Anders
When the CPU is reset using PSS_RST_CTRL in the SLCR, bit 19 in REBOOT_STATUS should be set. Refer to page 1602 of the Xilinx Zynq 7000 Technical Reference Manual. Signed-off-by: Gregory Anders --- hw/misc/zynq_slcr.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/hw/misc/zynq_slcr.c

Re: [PATCH 3/5] hw/isa: Embed TYPE_PORT92 in south bridges used in PC machines

2024-02-27 Thread BALATON Zoltan
On Tue, 27 Feb 2024, Bernhard Beschow wrote: Am 27. Februar 2024 21:54:19 UTC schrieb BALATON Zoltan : On Tue, 27 Feb 2024, Bernhard Beschow wrote: Am 21. Februar 2024 11:53:21 UTC schrieb Mark Cave-Ayland : On 18/02/2024 13:16, Bernhard Beschow wrote: Port 92 is an integral part of the

Re: [PATCH] migration: Don't serialize migration while can't switchover

2024-02-27 Thread Avihai Horon
On 27/02/2024 9:41, Peter Xu wrote: External email: Use caution opening links or attachments On Thu, Feb 22, 2024 at 05:56:27PM +0200, Avihai Horon wrote: Currently, migration code serializes device data sending during pre-copy iterative phase. As noted in the code comment, this is done to

Re: [PATCH v4 22/34] migration/multifd: Prepare multifd sync for fixed-ram migration

2024-02-27 Thread Peter Xu
On Tue, Feb 27, 2024 at 11:00:44AM -0300, Fabiano Rosas wrote: > I don't really like the interleaving of file and socket logic at > multifd_recv_sync_main(), but I can live with it. The idea was to share the "wait" part and the semaphore. If you don't like the form of it, an alternative is we

Re: [PATCH 3/5] hw/isa: Embed TYPE_PORT92 in south bridges used in PC machines

2024-02-27 Thread Bernhard Beschow
Am 27. Februar 2024 21:54:19 UTC schrieb BALATON Zoltan : >On Tue, 27 Feb 2024, Bernhard Beschow wrote: >> Am 21. Februar 2024 11:53:21 UTC schrieb Mark Cave-Ayland >> : >>> On 18/02/2024 13:16, Bernhard Beschow wrote: Port 92 is an integral part of the PIIX and ICH south bridges, so

[PATCH] mips: do not list individual devices from configs/

2024-02-27 Thread Paolo Bonzini
Add new "select" and "imply" directives if needed. The resulting config-devices.mak files are the same as before. Note that builds without default devices will become much smaller than before; for this reason, it's necessary to use only the bare minimum of USB functions, in particular only those

[QEMU][PATCH v3 0/7] Xen: support grant mappings.

2024-02-27 Thread Vikram Garhwal
Hi, This patch series add support for grant mappings as a pseudo RAM region for Xen. Enabling grant mappings patches(first 6) are written by Juergen in 2021. QEMU Virtio device provides an emulated backends for Virtio frontned devices in Xen. Please set "iommu_platform=on" option when invoking

[QEMU][PATCH v3 7/7] hw: arm: Add grant mapping.

2024-02-27 Thread Vikram Garhwal
Enable grant ram mapping support for Xenpvh machine on ARM. Signed-off-by: Vikram Garhwal Reviewed-by: Stefano Stabellini --- hw/arm/xen_arm.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/hw/arm/xen_arm.c b/hw/arm/xen_arm.c index 32776d94df..b5993ef2a6 100644 --- a/hw/arm/xen_arm.c

[QEMU][PATCH v3 2/7] xen: add pseudo RAM region for grant mappings

2024-02-27 Thread Vikram Garhwal
From: Juergen Gross Add a memory region which can be used to automatically map granted memory. It is starting at 0x8000ULL in order to be able to distinguish it from normal RAM. For this reason the xen.ram memory region is expanded, which has no further impact as it is used just as

[QEMU][PATCH v3 4/7] xen: let xen_ram_addr_from_mapcache() return -1 in case of not found entry

2024-02-27 Thread Vikram Garhwal
From: Juergen Gross Today xen_ram_addr_from_mapcache() will either abort() or return 0 in case it can't find a matching entry for a pointer value. Both cases are bad, so change that to return an invalid address instead. Signed-off-by: Juergen Gross Reviewed-by: Stefano Stabellini ---

[QEMU][PATCH v3 1/7] softmmu: physmem: Split ram_block_add()

2024-02-27 Thread Vikram Garhwal
Extract ram block list update to a new function ram_block_add_list(). This is done to support grant mappings which adds a memory region for granted memory and updates the ram_block list. Signed-off-by: Juergen Gross Signed-off-by: Vikram Garhwal Reviewed-by: Stefano Stabellini ---

[QEMU][PATCH v3 3/7] softmmu: let qemu_map_ram_ptr() use qemu_ram_ptr_length()

2024-02-27 Thread Vikram Garhwal
From: Juergen Gross qemu_map_ram_ptr() and qemu_ram_ptr_length() share quite some code, so modify qemu_ram_ptr_length() a little bit and use it for qemu_map_ram_ptr(), too. Signed-off-by: Juergen Gross Signed-off-by: Vikram Garhwal Reviewed-by: Stefano Stabellini --- system/physmem.c | 56

[QEMU][PATCH v3 6/7] xen: add map and unmap callbacks for grant region

2024-02-27 Thread Vikram Garhwal
From: Juergen Gross Add the callbacks for mapping/unmapping guest memory via grants to the special grant memory region. Signed-off-by: Juergen Gross Signed-off-by: Vikram Garhwal --- hw/xen/xen-mapcache.c | 176 +- system/physmem.c | 11 ++- 2

[QEMU][PATCH v3 5/7] memory: add MemoryRegion map and unmap callbacks

2024-02-27 Thread Vikram Garhwal
From: Juergen Gross In order to support mapping and unmapping guest memory dynamically to and from qemu during address_space_[un]map() operations add the map() and unmap() callbacks to MemoryRegionOps. Those will be used e.g. for Xen grant mappings when performing guest I/Os. Signed-off-by:

[RFC PATCH 1/5] target/arm: Add requester ID to memattrs

2024-02-27 Thread Joe Komlodi
I've seen a few different instances where a CPU or a memory region is behind some sort of IOMMU, and the IOMMU translates (or denies) accesses based on the requester ID of the CPU. This patch only does it on ARM CPUs, because I did not see CPU-agnostic code that added CPU attributes when creating

[RFC PATCH 5/5] hw/pci: Add user-defined memattrs

2024-02-27 Thread Joe Komlodi
This adds user-defined bits, which users can set and use on transactions that involve memory attributes. We add it in the MSI function, since the attributes are initialized in that function. We do not add it in pci_dma_rw because the attributes are passed in. Some users might pass in

[RFC PATCH 0/5] memattrs: target/arm: add user-defined and requester ID memattrs

2024-02-27 Thread Joe Komlodi
Hi all, This adds requester IDs to ARM CPUs and adds a "user-defined" memory attribute. The requester ID on ARM CPUs is there because I've seen some cases where there's an IOMMU between a CPU and memory that uses the CPU's requester ID to look up how it should translate, such as an SMMU TBU or

[RFC PATCH 2/5] memattrs: Fix target_tlb_bit whitespace

2024-02-27 Thread Joe Komlodi
checkpatch.pl doesn't like these spaces around the colon, so we may as well fix it up. No functional change. Signed-off-by: Joe Komlodi --- include/exec/memattrs.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/include/exec/memattrs.h b/include/exec/memattrs.h index

[RFC PATCH 3/5] memattrs: Add user-defined attribute

2024-02-27 Thread Joe Komlodi
These are used to represent implementation-specific data. These are based off of AMBA-AXI user signals, but can be used in any implementation. The length of 4-bits is arbitrary. Signed-off-by: Joe Komlodi --- include/exec/memattrs.h | 2 ++ 1 file changed, 2 insertions(+) diff --git

[RFC PATCH 4/5] target/arm: Add user-defined memattrs

2024-02-27 Thread Joe Komlodi
During transactions, these get added to memory attributes at the same time other attributes are added. Similar to the requester ID, these are added on PTWs, GPCs, and descriptor grabbing as well. Signed-off-by: Joe Komlodi --- target/arm/cpu.c | 2 ++ target/arm/cpu.h | 2 ++ target/arm/ptw.c

Re: [PATCH 3/5] hw/isa: Embed TYPE_PORT92 in south bridges used in PC machines

2024-02-27 Thread BALATON Zoltan
On Tue, 27 Feb 2024, Bernhard Beschow wrote: Am 21. Februar 2024 11:53:21 UTC schrieb Mark Cave-Ayland : On 18/02/2024 13:16, Bernhard Beschow wrote: Port 92 is an integral part of the PIIX and ICH south bridges, so instantiate it there. The isapc machine now needs to instantiate it

Re: [PATCH v8 2/2] ppc: spapr: Enable 2nd DAWR on Power10 pSeries machine

2024-02-27 Thread David Gibson
On Tue, Feb 27, 2024 at 10:21:23PM +1000, Nicholas Piggin wrote: > On Fri Feb 2, 2024 at 12:46 AM AEST, Shivaprasad G Bhat wrote: > > As per the PAPR, bit 0 of byte 64 in pa-features property > > indicates availability of 2nd DAWR registers. i.e. If this bit is set, 2nd > > DAWR is present,

Re: [PATCH 08/14] linux-user/elfload: Lock cpu list and mmap during elf_core_dump

2024-02-27 Thread Alex Bennée
Richard Henderson writes: > Do not allow changes to the set of cpus and memory regions > while we are dumping core. > > Signed-off-by: Richard Henderson Reviewed-by: Alex Bennée -- Alex Bennée Virtualisation Tech Lead @ Linaro

Re: [PATCH 3/5] hw/isa: Embed TYPE_PORT92 in south bridges used in PC machines

2024-02-27 Thread Bernhard Beschow
Am 21. Februar 2024 11:53:21 UTC schrieb Mark Cave-Ayland : >On 18/02/2024 13:16, Bernhard Beschow wrote: > >> Port 92 is an integral part of the PIIX and ICH south bridges, so >> instantiate it >> there. The isapc machine now needs to instantiate it explicitly, analoguous >> to >> the RTC.

[PATCH v2 08/21] memory: Add Error** argument to .log_global*() handlers

2024-02-27 Thread Cédric Le Goater
Modify all log_global*() handlers to take an Error** parameter and return a bool. A new MEMORY_LISTENER_CALL_LOG_GLOBAL macro looping on the listeners is introduced to handle a possible error, which will would interrupt the loop if necessary. To be noted a change in

[PATCH v2 06/21] migration: Add Error** argument to .save_setup() handler

2024-02-27 Thread Cédric Le Goater
The purpose is to record a potential error in the migration stream if qemu_savevm_state_setup() fails. Most of the current .save_setup() handlers can be modified to use the Error argument instead of managing their own and calling locally error_report(). The following patches will introduce such

[PATCH v2 04/21] migration: Do not call PRECOPY_NOTIFY_SETUP notifiers in case of error

2024-02-27 Thread Cédric Le Goater
When commit bd2270608fa0 ("migration/ram.c: add a notifier chain for precopy") added PRECOPY_NOTIFY_SETUP notifiers at the end of qemu_savevm_state_setup(), it didn't take into account a possible error in the loop calling vmstate_save() or .save_setup() handlers. Check ret value before calling

[PATCH v2 16/21] vfio: Add Error** argument to .vfio_save_config() handler

2024-02-27 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 v2 11/21] migration: Fix migration termination

2024-02-27 Thread Cédric Le Goater
Handle migration termination when in SETUP state. This can happen if qemu_savevm_state_setup() fails. Signed-off-by: Cédric Le Goater --- migration/migration.c | 4 1 file changed, 4 insertions(+) diff --git a/migration/migration.c b/migration/migration.c index

[PATCH v2 12/21] vfio: Add Error** argument to .set_dirty_page_tracking() handler

2024-02-27 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 --- include/hw/vfio/vfio-container-base.h | 18 -- hw/vfio/common.c

[PATCH v2 21/21] vfio: Extend vfio_set_migration_error() with Error* argument

2024-02-27 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 --- hw/vfio/common.c

[PATCH v2 19/21] vfio: Add Error** argument to .get_dirty_bitmap() handler

2024-02-27 Thread Cédric Le Goater
Let the callers do the error reporting. Add documentation while at it. Signed-off-by: Cédric Le Goater --- include/hw/vfio/vfio-common.h | 4 +- include/hw/vfio/vfio-container-base.h | 17 +++- hw/vfio/common.c | 59 ++-

[PATCH v2 05/21] migration: Add Error** argument to qemu_savevm_state_setup()

2024-02-27 Thread Cédric Le Goater
This prepares ground for the changes coming next which add an Error** argument to the .save_setup() handler. Callers of qemu_savevm_state_setup() now handle the error and fail earlier. This is a functional change that should be examined closely. Signed-off-by: Cédric Le Goater ---

[PATCH v2 20/21] vfio: Also trace event failures in vfio_save_complete_precopy()

2024-02-27 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

[PATCH v2 03/21] migration: Add documentation for SaveVMHandlers

2024-02-27 Thread Cédric Le Goater
The SaveVMHandlers structure is still in use for complex subsystems and devices. Document the handlers since we are going to modify a few later. Signed-off-by: Cédric Le Goater --- include/migration/register.h | 257 +++ 1 file changed, 231 insertions(+), 26

[PATCH v2 10/21] migration: Modify ram_init_bitmaps() to report dirty tracking errors

2024-02-27 Thread Cédric Le Goater
The .save_setup() handler has now an Error** argument that we can use to propagate errors reported by the .log_global_start() handler. Do that for the RAM. The caller qemu_savevm_state_setup() will store the error under the migration stream for later detection in the migration sequence.

[PATCH v2 00/21] migration: Improve error reporting

2024-02-27 Thread Cédric Le Goater
Hello, The motivation behind these changes is to improve error reporting to the upper management layer (libvirt) with a more detailed error, this to let it decide, depending on the reported error, whether to try migration again later. It would be useful in cases where migration fails due to lack

Re: [PATCH v5 3/4] hw: Set virtio-iommu aw-bits default value on pc_q35 and arm virt

2024-02-27 Thread Cédric Le Goater
Hello Eric, On 2/15/24 09:42, Eric Auger wrote: Currently the default input range can extend to 64 bits. On x86, when the virtio-iommu protects vfio devices, the physical iommu may support only 39 bits. Let's set the default to 39, as done for the intel-iommu. On ARM we set 48b as a default

[PATCH v2 09/21] memory: Add Error** argument to the global_dirty_log routines

2024-02-27 Thread Cédric Le Goater
Now that the log_global*() handlers take an Error** parameter and return a bool, do the same for memory_global_dirty_log_start() and memory_global_dirty_log_stop(). The error is reported in the callers for now and it will be propagated in the call stack in the next changes. To be noted a

[PATCH v2 07/21] migration: Add Error** argument to .load_setup() handler

2024-02-27 Thread Cédric Le Goater
This will be useful to report errors at a higher level, mostly in VFIO today. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Cédric Le Goater --- include/migration/register.h | 3 ++- hw/vfio/migration.c | 2 +- migration/ram.c | 3 ++- migration/savevm.c

[PATCH v2 01/21] migration: Report error when shutdown fails

2024-02-27 Thread Cédric Le Goater
This will help detect issues regarding I/O channels usage. Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Peter Xu Signed-off-by: Cédric Le Goater --- migration/qemu-file.c | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/migration/qemu-file.c b/migration/qemu-file.c

[PATCH v2 18/21] memory: Add Error** argument to memory_get_xlat_addr()

2024-02-27 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 Signed-off-by: Cédric Le Goater --- include/exec/memory.h | 15 ++- hw/vfio/common.c | 13 +

  1   2   3   4   5   >