Re: [PATCH v8 4/7] migration/multifd: add qpl compression method

2024-06-12 Thread Fabiano Rosas
Fabiano Rosas writes: > Yuan Liu writes: > >> add the Query Processing Library (QPL) compression method >> >> Introduce the qpl as a new multifd migration compression method, it can >> use In-Memory Analytics Accelerator(IAA) to accelerate compression and >> decompression, which can not only

Re: [PATCH v8 6/7] migration/multifd: implement qpl compression and decompression

2024-06-12 Thread Fabiano Rosas
Yuan Liu writes: > QPL compression and decompression will use IAA hardware path if the IAA > hardware is available. Otherwise the QPL library software path is used. > > The hardware path will automatically fall back to QPL software path if > the IAA queues are busy. In some scenarios, this may

Re: [PATCH 0/5] Reinstate ability to use Qemu on pre-SSE4.1 x86 hosts

2024-06-12 Thread Alexander Monakov
On Wed, 12 Jun 2024, Paolo Bonzini wrote: > On Wed, Jun 12, 2024 at 3:34 PM Alexander Monakov wrote: > > On Wed, 12 Jun 2024, Paolo Bonzini wrote: > > > > I found out from the mailing list. My Core2-based desktop would be > > > > affected. > > > > > > Do you run QEMU on it? With KVM or TCG? >

Re: [PATCH v8 4/7] migration/multifd: add qpl compression method

2024-06-12 Thread Fabiano Rosas
Yuan Liu writes: > add the Query Processing Library (QPL) compression method > > Introduce the qpl as a new multifd migration compression method, it can > use In-Memory Analytics Accelerator(IAA) to accelerate compression and > decompression, which can not only reduce network bandwidth

Re: [PATCH] hw/usb/hcd-ohci: Fix ohci_service_td: accept valid TDs

2024-06-12 Thread Alex Bennée
David Hubbard writes: > From: Cord Amfmgm > > This changes the way the ohci emulation handles a Transfer Descriptor with > "Current Buffer Pointer" set to "Buffer End" + 1. > > The OHCI spec 4.3.1.2 Table 4-2 allows td.cbp to be one byte more than td.be > to signal the buffer has zero length.

Re: [RFC PATCH v2 21/22] qapi: Inline and remove QERR_UNSUPPORTED definition

2024-06-12 Thread Philippe Mathieu-Daudé
On 12/6/24 15:07, Markus Armbruster wrote: Philippe Mathieu-Daudé writes: Michael, Konstantin, QERR_UNSUPPORTED is only used by QGA. Do you mind giving our maintainer's position on Markus analysis so we can know how to proceed with this definition? Daniel Berrangé recently posted patches

Re: [PATCH 0/5] Reinstate ability to use Qemu on pre-SSE4.1 x86 hosts

2024-06-12 Thread Paolo Bonzini
On Wed, Jun 12, 2024 at 3:34 PM Alexander Monakov wrote: > On Wed, 12 Jun 2024, Paolo Bonzini wrote: > > > I found out from the mailing list. My Core2-based desktop would be > > > affected. > > > > Do you run QEMU on it? With KVM or TCG? > > Excuse me? Are you going to ask for SSH access to

Re: [PATCH 0/5] Reinstate ability to use Qemu on pre-SSE4.1 x86 hosts

2024-06-12 Thread Alexander Monakov
On Wed, 12 Jun 2024, Paolo Bonzini wrote: > > I found out from the mailing list. My Core2-based desktop would be affected. > > Do you run QEMU on it? With KVM or TCG? Excuse me? Are you going to ask for SSH access to ensure my computer really exists and is in working order? Can you tell me

Re: [PATCH v2] accel/tcg: Fix typo causing tb->page_addr[1] to not be recorded

2024-06-12 Thread Anton Johansson via
On 12/06/24, Philippe Mathieu-Daudé wrote: > On 12/6/24 15:15, Anton Johansson wrote: > > For TBs crossing page boundaries, the 2nd page will never be > > recorded/removed, as the index of the 2nd page is computed from the > > address of the 1st page. This is due to a typo, fix it. > > Please

[PATCH v3] accel/tcg: Fix typo causing tb->page_addr[1] to not be recorded

2024-06-12 Thread Anton Johansson via
For TBs crossing page boundaries, the 2nd page will never be recorded/removed, as the index of the 2nd page is computed from the address of the 1st page. This is due to a typo, fix it. Cc: qemu-sta...@nongnu.org Fixes: deba78709a ("accel/tcg: Always lock pages before translation") Signed-off-by:

Re: [RFC PATCH v2 21/22] qapi: Inline and remove QERR_UNSUPPORTED definition

2024-06-12 Thread Konstantin Kostiuk
Hi Markus and Philippe, I agree to remove QERR_UNSUPPORTED and have more specific errors or even remove the functions from the schema in some cases instead of copy-paste QERR_UNSUPPORTED from platform to platform. Best Regards, Konstantin Kostiuk. On Wed, Jun 12, 2024 at 4:07 PM Markus

[PATCH 2/3] memory: Constify IOMMUTLBEvent in memory_region_notify_iommu()

2024-06-12 Thread Philippe Mathieu-Daudé
@event access is read-only. Signed-off-by: Philippe Mathieu-Daudé --- include/exec/memory.h | 2 +- system/memory.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/include/exec/memory.h b/include/exec/memory.h index 2bf5e23b6a..2d7c278b9f 100644 ---

[PATCH 3/3] hw/i386/iommu: Constify IOMMUTLBEvent in vtd_page_walk_hook prototype

2024-06-12 Thread Philippe Mathieu-Daudé
@event access is read-only. Signed-off-by: Philippe Mathieu-Daudé --- hw/i386/intel_iommu.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/hw/i386/intel_iommu.c b/hw/i386/intel_iommu.c index cc8e59674e..c4350e0ff0 100644 --- a/hw/i386/intel_iommu.c +++

[PATCH 0/3] memory: Constify IOMMUTLBEvent in memory_region_notify_iommu*()

2024-06-12 Thread Philippe Mathieu-Daudé
Trivial patches using const IOMMUTLBEvent. Philippe Mathieu-Daudé (3): memory: Constify IOMMUTLBEvent in memory_region_notify_iommu_one() memory: Constify IOMMUTLBEvent in memory_region_notify_iommu() hw/i386/iommu: Constify IOMMUTLBEvent in vtd_page_walk_hook prototype

[PATCH 1/3] memory: Constify IOMMUTLBEvent in memory_region_notify_iommu_one()

2024-06-12 Thread Philippe Mathieu-Daudé
@event access is read-only. Signed-off-by: Philippe Mathieu-Daudé --- include/exec/memory.h | 2 +- system/memory.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/include/exec/memory.h b/include/exec/memory.h index 1be58f694c..2bf5e23b6a 100644 ---

[PULL 13/15] tests/unit/test-smp-parse: Test "modules" and "dies" combination case

2024-06-12 Thread Thomas Huth
From: Zhao Liu Since i386 PC machine supports both "modules" and "dies" in -smp, add the "modules" and "dies" combination test case to match the actual topology usage scenario. Signed-off-by: Zhao Liu Tested-by: Yongwei Ma Message-ID: <20240529061925.350323-8-zhao1@intel.com>

[PULL 03/15] tests/qtest/libqtest: add qtest_has_cpu_model() api

2024-06-12 Thread Thomas Huth
From: Ani Sinha Added a new test api qtest_has_cpu_model() in order to check availability of some cpu models in the current QEMU binary. The specific architecture of the QEMU binary is selected using the QTEST_QEMU_BINARY environment variable. This api would be useful to run tests against some

[PULL 15/15] tests/tcg/s390x: Allow specifying extra QEMU options on the command line

2024-06-12 Thread Thomas Huth
From: Ilya Leoshkevich The use case for this is `make check-tcg EXTFLAGS="-accel kvm"`, which allows validating the system TCG testcases on real hardware. EXTFLAGS name is borrowed from tests/tcg/xtensa/Makefile.softmmu-target. While at it, use += instead of = in order to be consistent with the

[PULL 04/15] tests/qtest/x86: check for availability of older cpu models before running tests

2024-06-12 Thread Thomas Huth
From: Ani Sinha It is better to check if some older cpu models like 486, athlon, pentium, penryn, phenom, core2duo etc are available before running their corresponding tests. Some downstream distributions may no longer support these older cpu models. Signature of add_feature_test() has been

[PULL 14/15] tests/unit/test-smp-parse: Test the full 8-levels topology hierarchy

2024-06-12 Thread Thomas Huth
From: Zhao Liu With module level, QEMU now support 8-levels topology hierarchy. Cover "modules" in SMP_CONFIG_WITH_FULL_TOPO related cases. Signed-off-by: Zhao Liu Tested-by: Yongwei Ma Message-ID: <20240529061925.350323-9-zhao1@intel.com> Signed-off-by: Thomas Huth ---

[PULL 12/15] tests/unit/test-smp-parse: Test "modules" parameter in -smp

2024-06-12 Thread Thomas Huth
From: Zhao Liu Cover the module cases in test-smp-parse. Signed-off-by: Zhao Liu Tested-by: Yongwei Ma Message-ID: <20240529061925.350323-7-zhao1@intel.com> Signed-off-by: Thomas Huth --- tests/unit/test-smp-parse.c | 112 +--- 1 file changed, 103

[PULL 00/15] CPU-related test updates

2024-06-12 Thread Thomas Huth
The following changes since commit 80e8f0602168f451a93e71cbb1d59e93d745e62e: Merge tag 'bsd-user-misc-2024q2-pull-request' of gitlab.com:bsdimp/qemu into staging (2024-06-09 11:21:55 -0700) are available in the Git repository at: https://gitlab.com/thuth/qemu.git

[PULL 08/15] tests/unit/test-smp-parse: Fix comment of parameters=1 case

2024-06-12 Thread Thomas Huth
From: Zhao Liu SMP_CONFIG_WITH_FULL_TOPO hasn't support module level, so the parameter should indicate the "clusters". Additionally, reorder the parameters of -smp to match the topology hierarchy order. Signed-off-by: Zhao Liu Reviewed-by: Thomas Huth Tested-by: Yongwei Ma Message-ID:

[PULL 02/15] qtest/x86/numa-test: do not use the obsolete 'pentium' cpu

2024-06-12 Thread Thomas Huth
From: Ani Sinha 'pentium' cpu is old and obsolete and should be avoided for running tests if its not strictly needed. Use 'max' cpu instead for generic non-cpu specific numa test. Reviewed-by: Thomas Huth Reviewed-by: Igor Mammedov Tested-by: Mario Casquero Signed-off-by: Ani Sinha

[PULL 11/15] tests/unit/test-smp-parse: Make test cases aware of module level

2024-06-12 Thread Thomas Huth
From: Zhao Liu Currently, -smp supports module level. It is necessary to consider the effects of module in the test cases to ensure that the calculations are correct. This is also the preparation to add module test cases. Signed-off-by: Zhao Liu Reviewed-by: Thomas Huth Tested-by: Yongwei Ma

[PULL 07/15] tests/unit/test-smp-parse: Fix comments of drawers and books case

2024-06-12 Thread Thomas Huth
From: Zhao Liu Fix the comments to match the actual configurations. Signed-off-by: Zhao Liu Reviewed-by: Thomas Huth Tested-by: Yongwei Ma Message-ID: <20240529061925.350323-2-zhao1@intel.com> Signed-off-by: Thomas Huth --- tests/unit/test-smp-parse.c | 8 1 file changed, 4

[PULL 01/15] tests/avocado: Update LoongArch bios file

2024-06-12 Thread Thomas Huth
From: Song Gao The VM uses old bios to boot up only 1 cpu, causing the test case to fail. Update the bios to solve this problem. Reported-by: Thomas Huth Signed-off-by: Song Gao Message-ID: <20240604030058.2327145-1-gaos...@loongson.cn> Signed-off-by: Thomas Huth ---

[PULL 09/15] tests/unit/test-smp-parse: Fix an invalid topology case

2024-06-12 Thread Thomas Huth
From: Zhao Liu Adjust the "cpus" parameter to match the comment configuration. Signed-off-by: Zhao Liu Reviewed-by: Thomas Huth Tested-by: Yongwei Ma Message-ID: <20240529061925.350323-4-zhao1@intel.com> Signed-off-by: Thomas Huth --- tests/unit/test-smp-parse.c | 2 +- 1 file changed,

Re: [PATCH RESEND v7 10/12] hostmem: add a new memory backend based on POSIX shm_open()

2024-06-12 Thread Markus Armbruster
Stefano Garzarella writes: > shm_open() creates and opens a new POSIX shared memory object. > A POSIX shared memory object allows creating memory backend with an > associated file descriptor that can be shared with external processes > (e.g. vhost-user). > > The new `memory-backend-shm` can be

[PULL 05/15] meson: Remove libibumad dependence

2024-06-12 Thread Thomas Huth
From: zhenwei pi RDMA based migration has no dependence on libumad. libibverbs and librdmacm are enough. libumad was used by rdmacm-mux which has been already removed. It's remained mistakenly. Fixes: 1dfd42c4264b ("hw/rdma: Remove deprecated pvrdma device and rdmacm-mux helper") Cc: Philippe

[PULL 10/15] tests/unit/test-smp-parse: Use default parameters=0 when not set in -smp

2024-06-12 Thread Thomas Huth
From: Zhao Liu Since -smp allows parameters=1 whether the level is supported by machine, to avoid the test scenarios where the parameter defaults to 1 cause some errors to be masked, explicitly set undesired parameters to 0. Signed-off-by: Zhao Liu Reviewed-by: Thomas Huth Tested-by: Yongwei

[PULL 06/15] test: Remove libibumad dependence

2024-06-12 Thread Thomas Huth
From: zhenwei pi Remove libibumad dependence from the test environment. Suggested-by: Philippe Mathieu-Daudé Signed-off-by: zhenwei pi Reviewed-by: Philippe Mathieu-Daudé Message-ID: <20240611105427.61395-3-pizhen...@bytedance.com> Signed-off-by: Thomas Huth ---

Re: [PATCH v5 1/1] qga/linux: Add new api 'guest-network-get-route'

2024-06-12 Thread Konstantin Kostiuk
Hi Daniel and Philippe Is it ok to add the version filed to the GuestNetworkRoute struct to indicate that this is an IPv4 or an IPv6 route or is it better to have two different structures? Best Regards, Konstantin Kostiuk. On Wed, Jun 12, 2024 at 3:53 PM Daniel P. Berrangé wrote: > On Wed,

Re: [PATCH v2] accel/tcg: Fix typo causing tb->page_addr[1] to not be recorded

2024-06-12 Thread Philippe Mathieu-Daudé
On 12/6/24 15:15, Anton Johansson wrote: For TBs crossing page boundaries, the 2nd page will never be recorded/removed, as the index of the 2nd page is computed from the address of the 1st page. This is due to a typo, fix it. Please keep these tags as they are useful when backporting

[PATCH v2] accel/tcg: Fix typo causing tb->page_addr[1] to not be recorded

2024-06-12 Thread Anton Johansson via
For TBs crossing page boundaries, the 2nd page will never be recorded/removed, as the index of the 2nd page is computed from the address of the 1st page. This is due to a typo, fix it. Signed-off-by: Anton Johansson Reviewed-by: Manos Pitsidianakis Reviewed-by: Philippe Mathieu-Daudé ---

Re: [PATCH 3/3] semihosting: Restrict to TCG

2024-06-12 Thread Philippe Mathieu-Daudé
Hi Paolo, On 30/5/24 15:58, Philippe Mathieu-Daudé wrote: On 30/5/24 09:31, Paolo Bonzini wrote: On Thu, May 30, 2024 at 9:22 AM Philippe Mathieu-Daudé wrote: On 30/5/24 08:02, Paolo Bonzini wrote: On Wed, May 29, 2024 at 5:56 PM Philippe Mathieu-Daudé wrote: It is pointless to build

[PATCH RESEND v7 00/12] vhost-user: support any POSIX system (tested on macOS, FreeBSD, OpenBSD)

2024-06-12 Thread Stefano Garzarella
This series should be in a good shape, in which tree should we queue it? @Micheal would your tree be okay? Thanks, Stefano Changelog v1: https://patchew.org/QEMU/20240228114759.44758-1-sgarz...@redhat.com/ v2: https://patchew.org/QEMU/20240326133936.125332-1-sgarz...@redhat.com/ v3:

[PATCH RESEND v7 01/12] libvhost-user: set msg.msg_control to NULL when it is empty

2024-06-12 Thread Stefano Garzarella
On some OS (e.g. macOS) sendmsg() returns -1 (errno EINVAL) if the `struct msghdr` has the field `msg_controllen` set to 0, but `msg_control` is not NULL. Reviewed-by: Eric Blake Reviewed-by: David Hildenbrand Reviewed-by: Philippe Mathieu-Daudé Tested-by: Philippe Mathieu-Daudé Acked-by:

[PATCH v1 14/16] vfio/container: Remove VFIOContainerBase::ops

2024-06-12 Thread Cédric Le Goater
Instead, use VFIO_IOMMU_GET_CLASS() to get the class pointer. Signed-off-by: Cédric Le Goater --- include/hw/vfio/vfio-container-base.h | 1 - hw/vfio/common.c | 2 +- hw/vfio/container-base.c | 37 +-- hw/vfio/container.c

[PATCH v1 15/16] vfio/container: Remove vfio_container_init()

2024-06-12 Thread Cédric Le Goater
It's now empty. Signed-off-by: Cédric Le Goater --- include/hw/vfio/vfio-container-base.h | 2 -- hw/vfio/container-base.c | 5 - hw/vfio/container.c | 3 --- hw/vfio/iommufd.c | 1 - 4 files changed, 11 deletions(-) diff --git

[PATCH RESEND v7 12/12] tests/qtest/vhost-user-test: add a test case for memory-backend-shm

2024-06-12 Thread Stefano Garzarella
`memory-backend-shm` can be used with vhost-user devices, so let's add a new test case for it. Acked-by: Thomas Huth Acked-by: Stefan Hajnoczi Reviewed-by: David Hildenbrand Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Stefano Garzarella --- tests/qtest/vhost-user-test.c | 23

[PATCH RESEND v7 02/12] libvhost-user: fail vu_message_write() if sendmsg() is failing

2024-06-12 Thread Stefano Garzarella
In vu_message_write() we use sendmsg() to send the message header, then a write() to send the payload. If sendmsg() fails we should avoid sending the payload, since we were unable to send the header. Discovered before fixing the issue with the previous patch, where sendmsg() failed on macOS due

Re: [RFC PATCH v2 21/22] qapi: Inline and remove QERR_UNSUPPORTED definition

2024-06-12 Thread Markus Armbruster
Philippe Mathieu-Daudé writes: > Michael, Konstantin, QERR_UNSUPPORTED is only used by QGA. > > Do you mind giving our maintainer's position on Markus > analysis so we can know how to proceed with this definition? Daniel Berrangé recently posted patches that get rid of most instances of

[PATCH v1 06/16] vfio/container: Simplify vfio_container_init()

2024-06-12 Thread Cédric Le Goater
Assign the base container VFIOAddressSpace 'space' pointer in vfio_address_space_insert(). To be noted that vfio_connect_container() will assign the 'space' pointer later in the execution flow. This should not have any consequence. Signed-off-by: Cédric Le Goater ---

[PATCH v1 13/16] vfio/container: Introduce an instance_init() handler

2024-06-12 Thread Cédric Le Goater
This allows us to move the initialization code from vfio_container_init(), which we will soon remove. Signed-off-by: Cédric Le Goater --- hw/vfio/container-base.c | 19 +-- 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/hw/vfio/container-base.c

Re: assert fails in s390x TCG

2024-06-12 Thread Claudio Fontana
On 6/12/24 14:41, Philippe Mathieu-Daudé wrote: > On 28/7/23 18:43, Richard Henderson wrote: >> On 7/28/23 09:05, Richard Henderson wrote: >>> It's the page containing both code and a page table entry that >>> concerns me.  It seems like a kernel bug, though obviously we >>> shouldn't crash. 

[PATCH RESEND v7 10/12] hostmem: add a new memory backend based on POSIX shm_open()

2024-06-12 Thread Stefano Garzarella
shm_open() creates and opens a new POSIX shared memory object. A POSIX shared memory object allows creating memory backend with an associated file descriptor that can be shared with external processes (e.g. vhost-user). The new `memory-backend-shm` can be used as an alternative when

[PATCH RESEND v7 07/12] vhost-user: enable frontends on any POSIX system

2024-06-12 Thread Stefano Garzarella
The vhost-user protocol is not really Linux-specific so let's enable vhost-user frontends for any POSIX system. In vhost_net.c we use VHOST_FILE_UNBIND which is defined in a Linux specific header, let's define it for other systems as well. Reviewed-by: Philippe Mathieu-Daudé Tested-by: Philippe

[PATCH RESEND v7 09/12] contrib/vhost-user-blk: enable it on any POSIX system

2024-06-12 Thread Stefano Garzarella
Let's make the code more portable by adding defines from block/file-posix.c to support O_DIRECT in other systems (e.g. macOS). vhost-user-server.c is a dependency, let's enable it for any POSIX system. Acked-by: Stefan Hajnoczi Reviewed-by: Philippe Mathieu-Daudé Tested-by: Philippe

[PATCH RESEND v7 05/12] contrib/vhost-user-blk: fix bind() using the right size of the address

2024-06-12 Thread Stefano Garzarella
On macOS passing `-s /tmp/vhost.socket` parameter to the vhost-user-blk application, the bind was done on `/tmp/vhost.socke` pathname, missing the last character. This sounds like one of the portability problems described in the unix(7) manpage: Pathname sockets When binding a socket

[PATCH RESEND v7 03/12] libvhost-user: mask F_INFLIGHT_SHMFD if memfd is not supported

2024-06-12 Thread Stefano Garzarella
libvhost-user will panic when receiving VHOST_USER_GET_INFLIGHT_FD message if MFD_ALLOW_SEALING is not defined, since it's not able to create a memfd. VHOST_USER_GET_INFLIGHT_FD is used only if VHOST_USER_PROTOCOL_F_INFLIGHT_SHMFD is negotiated. So, let's mask that feature if the backend is not

Re: [PATCH v7 00/13] vhost-user: support any POSIX system (tested on macOS, FreeBSD, OpenBSD)

2024-06-12 Thread Stefano Garzarella
Ooops, wrong cover letter. I just resent the whole series. Sorry for the confusion. Stefano On Wed, Jun 12, 2024 at 2:59 PM Stefano Garzarella wrote: > > This series should be in a good shape, in which tree should we queue it? > @Micheal would your tree be okay? > > Thanks, > Stefano > >

[PATCH RESEND v7 11/12] tests/qtest/vhost-user-blk-test: use memory-backend-shm

2024-06-12 Thread Stefano Garzarella
`memory-backend-memfd` is available only on Linux while the new `memory-backend-shm` can be used on any POSIX-compliant operating system. Let's use it so we can run the test in multiple environments. Since we are here, let`s remove `share=on` which is the default for shm (and also for memfd).

[PATCH v1 16/16] vfio/container: Introduce vfio_iommu_legacy_instance_init()

2024-06-12 Thread Cédric Le Goater
Just as we did for the VFIOContainerBase object, introduce an instance_init() handler for the legacy VFIOContainer object and do the specific initialization there. Signed-off-by: Cédric Le Goater --- hw/vfio/container.c | 9 - 1 file changed, 8 insertions(+), 1 deletion(-) diff --git

[PATCH v1 00/16] vfio: QOMify VFIOContainer

2024-06-12 Thread Cédric Le Goater
Hello, The series starts with simple changes (patch 1-4). Two of which were initialy sent by Joao in a series adding VFIO migration support with vIOMMU [1]. The changes following prepare VFIOContainer for QOMification, switch the container models to QOM when ready and add some final cleanups.

[PATCH v1 10/16] vfio/container: Discover IOMMU type before creating the container

2024-06-12 Thread Cédric Le Goater
Since the QEMU struct type representing the VFIO container is deduced from the IOMMU type exposed by the host, this type should be well defined *before* creating the container struct. This will be necessary to instantiate a QOM object of the correct type in future changes. Rework vfio_set_iommu()

[PATCH v1 09/16] vfio/container: Introduce vfio_create_container()

2024-06-12 Thread Cédric Le Goater
This routine allocates the QEMU struct type representing the VFIO container. It is minimal currently and future changes will do more initialization. Signed-off-by: Cédric Le Goater --- hw/vfio/container.c | 19 +++ 1 file changed, 15 insertions(+), 4 deletions(-) diff --git

[PATCH v1 07/16] vfio/container: Modify vfio_get_iommu_type() to use a container fd

2024-06-12 Thread Cédric Le Goater
The 'container' pointer has no other use than its 'fd' attribute. Simplify the prototype to ease future changes. Signed-off-by: Cédric Le Goater --- hw/vfio/container.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/hw/vfio/container.c b/hw/vfio/container.c index

[PATCH v1 05/16] vfio/container: Introduce vfio_address_space_insert()

2024-06-12 Thread Cédric Le Goater
It will ease future changes. Signed-off-by: Cédric Le Goater --- include/hw/vfio/vfio-common.h | 2 ++ hw/vfio/common.c | 6 ++ hw/vfio/container.c | 2 +- hw/vfio/iommufd.c | 2 +- 4 files changed, 10 insertions(+), 2 deletions(-) diff --git

[PATCH v1 03/16] vfio/common: Move dirty tracking ranges update to helper

2024-06-12 Thread Cédric Le Goater
From: Joao Martins Separate the changes that updates the ranges from the listener, to make it reusable in preparation to expand its use to vIOMMU support. Signed-off-by: Joao Martins [ clg: - Rebased on upstream - Introduced vfio_dirty_tracking_update_range() ] Signed-off-by: Cédric Le

[PATCH RESEND v7 08/12] libvhost-user: enable it on any POSIX system

2024-06-12 Thread Stefano Garzarella
The vhost-user protocol is not really Linux-specific so let's enable libvhost-user for any POSIX system. Compiling it on macOS and FreeBSD some problems came up: - avoid to include linux/vhost.h which is available only on Linux (vhost_types.h contains many of the things we need) - macOS doesn't

[PATCH v1 01/16] vfio: Make vfio_devices_dma_logging_start() return bool

2024-06-12 Thread Cédric Le Goater
Since vfio_devices_dma_logging_start() takes an 'Error **' argument, best practices suggest to return a bool. See the api/error.h Rules section. It will simplify potential changes coming after. vfio_container_set_dirty_page_tracking() could be modified in the same way but the errno value can be

[PATCH RESEND v7 06/12] contrib/vhost-user-*: use QEMU bswap helper functions

2024-06-12 Thread Stefano Garzarella
Let's replace the calls to le*toh() and htole*() with qemu/bswap.h helpers to make the code more portable. Suggested-by: Philippe Mathieu-Daudé Reviewed-by: Philippe Mathieu-Daudé Tested-by: Philippe Mathieu-Daudé Acked-by: Stefan Hajnoczi Reviewed-by: David Hildenbrand Signed-off-by:

[PATCH v1 11/16] vfio/container: Change VFIOContainerBase to use QOM

2024-06-12 Thread Cédric Le Goater
VFIOContainerBase was made a QOM interface because we believed that a QOM object would expose all the IOMMU backends to the QEMU machine and human interface. This only applies to user creatable devices or objects. Change the VFIOContainerBase nature from interface to object and make the necessary

[PATCH RESEND v7 04/12] vhost-user-server: do not set memory fd non-blocking

2024-06-12 Thread Stefano Garzarella
In vhost-user-server we set all fd received from the other peer in non-blocking mode. For some of them (e.g. memfd, shm_open, etc.) it's not really needed, because we don't use these fd with blocking operations, but only to map memory. In addition, in some systems this operation can fail (e.g. in

[PATCH v1 08/16] vfio/container: Introduce vfio_get_iommu_class_name()

2024-06-12 Thread Cédric Le Goater
Rework vfio_get_iommu_class() to return a literal class name instead of a class object. We will need this name to instantiate the object later on. Since the default case asserts, remove the error report as QEMU will simply abort before. Signed-off-by: Cédric Le Goater --- hw/vfio/container.c |

[PATCH v1 12/16] vfio/container: Switch to QOM

2024-06-12 Thread Cédric Le Goater
Instead of allocating the container struct, create a QOM object of the appropriate type. Signed-off-by: Cédric Le Goater --- hw/vfio/container.c | 6 +++--- hw/vfio/iommufd.c | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/hw/vfio/container.c b/hw/vfio/container.c

[PATCH v1 04/16] vfio/common: Extract vIOMMU code from vfio_sync_dirty_bitmap()

2024-06-12 Thread Cédric Le Goater
From: Avihai Horon Extract vIOMMU code from vfio_sync_dirty_bitmap() to a new function and restructure the code. This is done in preparation for optimizing vIOMMU deviice dirty page tracking. No functional changes intended. Signed-off-by: Avihai Horon Signed-off-by: Joao Martins [ clg: -

[PATCH v1 02/16] vfio: Remove unused declarations from vfio-common.h

2024-06-12 Thread Cédric Le Goater
These were forgotten in the recent cleanups. Signed-off-by: Cédric Le Goater --- include/hw/vfio/vfio-common.h | 4 1 file changed, 4 deletions(-) diff --git a/include/hw/vfio/vfio-common.h b/include/hw/vfio/vfio-common.h index

[PATCH v7 00/13] vhost-user: support any POSIX system (tested on macOS, FreeBSD, OpenBSD)

2024-06-12 Thread Stefano Garzarella
This series should be in a good shape, in which tree should we queue it? @Micheal would your tree be okay? Thanks, Stefano Changelog v1: https://patchew.org/QEMU/20240228114759.44758-1-sgarz...@redhat.com/ v2: https://patchew.org/QEMU/20240326133936.125332-1-sgarz...@redhat.com/ v3:

Re: [PATCH v5 1/1] qga/linux: Add new api 'guest-network-get-route'

2024-06-12 Thread Daniel P . Berrangé
On Wed, Jun 12, 2024 at 02:48:24PM +0200, Philippe Mathieu-Daudé wrote: > Hi Dehan, > > On 12/6/24 12:31, Dehan Meng wrote: > > The Route information of the Linux VM needs to be used > > by administrators and users when debugging network problems > > and troubleshooting. > > > > Signed-off-by:

Re: [PATCH v3] hw/arm/virt: Avoid unexpected warning from Linux guest on host with Fujitsu CPUs

2024-06-12 Thread Philippe Mathieu-Daudé
On 12/6/24 14:48, Peter Maydell wrote: On Wed, 12 Jun 2024 at 13:33, Philippe Mathieu-Daudé wrote: Hi Zhenyu, On 12/6/24 04:05, Zhenyu Zhang wrote: diff --git a/hw/arm/virt.c b/hw/arm/virt.c index 3c93c0c0a6..3cefac6d43 100644 --- a/hw/arm/virt.c +++ b/hw/arm/virt.c @@ -271,6 +271,17 @@

Re: [PATCH v3] hw/arm/virt: Avoid unexpected warning from Linux guest on host with Fujitsu CPUs

2024-06-12 Thread Peter Maydell
On Wed, 12 Jun 2024 at 13:33, Philippe Mathieu-Daudé wrote: > > Hi Zhenyu, > > On 12/6/24 04:05, Zhenyu Zhang wrote: > > diff --git a/hw/arm/virt.c b/hw/arm/virt.c > > index 3c93c0c0a6..3cefac6d43 100644 > > --- a/hw/arm/virt.c > > +++ b/hw/arm/virt.c > > @@ -271,6 +271,17 @@ static void

Re: [PATCH v5 1/1] qga/linux: Add new api 'guest-network-get-route'

2024-06-12 Thread Philippe Mathieu-Daudé
Hi Dehan, On 12/6/24 12:31, Dehan Meng wrote: The Route information of the Linux VM needs to be used by administrators and users when debugging network problems and troubleshooting. Signed-off-by: Dehan Meng --- qga/commands-posix.c | 81

[PATCH v5 4/5] vvfat: Fix reading files with non-continuous clusters

2024-06-12 Thread Amjad Alsharafi
When reading with `read_cluster` we get the `mapping` with `find_mapping_for_cluster` and then we call `open_file` for this mapping. The issue appear when its the same file, but a second cluster that is not immediately after it, imagine clusters `500 -> 503`, this will give us 2 mappings one has

[PATCH v5 5/5] iotests: Add `vvfat` tests

2024-06-12 Thread Amjad Alsharafi
Added several tests to verify the implementation of the vvfat driver. We needed a way to interact with it, so created a basic `fat16.py` driver that handled writing correct sectors for us. Added `vvfat` to the non-generic formats, as its not a normal image format. Signed-off-by: Amjad Alsharafi

[PATCH v5 3/5] vvfat: Fix wrong checks for cluster mappings invariant

2024-06-12 Thread Amjad Alsharafi
How this `abort` was intended to check for was: - if the `mapping->first_mapping_index` is not the same as `first_mapping_index`, which **should** happen only in one case, when we are handling the first mapping, in that case `mapping->first_mapping_index == -1`, in all other cases, the other

[PATCH v5 2/5] vvfat: Fix usage of `info.file.offset`

2024-06-12 Thread Amjad Alsharafi
The field is marked as "the offset in the file (in clusters)", but it was being used like this `cluster_size*(nums)+mapping->info.file.offset`, which is incorrect. Signed-off-by: Amjad Alsharafi --- block/vvfat.c | 11 +++ 1 file changed, 7 insertions(+), 4 deletions(-) diff --git

[PATCH v5 0/5] vvfat: Fix write bugs for large files and add iotests

2024-06-12 Thread Amjad Alsharafi
These patches fix some bugs found when modifying files in vvfat. First, there was a bug when writing to the cluster 2 or above of a file, it will copy the cluster before it instead, so, when writing to cluster=2, the content of cluster=1 will be copied into disk instead in its place. Another

[PATCH v5 1/5] vvfat: Fix bug in writing to middle of file

2024-06-12 Thread Amjad Alsharafi
Before this commit, the behavior when calling `commit_one_file` for example with `offset=0x2000` (second cluster), what will happen is that we won't fetch the next cluster from the fat, and instead use the first cluster for the read operation. This is due to off-by-one error here, where `i=0x2000

Re: [RFC PATCH] memory: Introduce memory region fetch operation

2024-06-12 Thread Peter Maydell
On Wed, 12 Jun 2024 at 10:02, Ethan Chen via wrote: > > Allow the memory region to have different behaviors for read and fetch > operations. > > For example RISCV IOPMP will raise interrupt when cpu try to fetch a > non-excutable region. It actually raises an interrupt rather than it being a

Re: assert fails in s390x TCG

2024-06-12 Thread Philippe Mathieu-Daudé
On 28/7/23 18:43, Richard Henderson wrote: On 7/28/23 09:05, Richard Henderson wrote: It's the page containing both code and a page table entry that concerns me.  It seems like a kernel bug, though obviously we shouldn't crash.  I'm not sure what to do about it. Bah.  Of course it's not a

Re: [PATCH] accel/tcg: Fix typo causing tb->page_addr[1] to not be recorded

2024-06-12 Thread Philippe Mathieu-Daudé
On 11/6/24 23:58, Anton Johansson via wrote: For TBs crossing page boundaries, the 2nd page will never be recorded/removed, as the index of the 2nd page is computed from the address of the 1st page. This is due to a typo, fix it. Cc: qemu-sta...@nongnu.org Fixes: deba78709a ("accel/tcg: Always

Re: [PATCH v3] hw/arm/virt: Avoid unexpected warning from Linux guest on host with Fujitsu CPUs

2024-06-12 Thread Philippe Mathieu-Daudé
Hi Zhenyu, On 12/6/24 04:05, Zhenyu Zhang wrote: Multiple warning messages and corresponding backtraces are observed when Linux guest is booted on the host with Fujitsu CPUs. One of them is shown as below. [0.032443] [ cut here ] [0.032446] uart-pl011

Re: [RFC PATCH v2 3/5] rust: add PL011 device model

2024-06-12 Thread Paolo Bonzini
I think this is extremely useful to show where we could go in the task of creating more idiomatic bindings. On Tue, Jun 11, 2024 at 12:34 PM Manos Pitsidianakis wrote: > +fn main() { > +println!("cargo::rerun-if-env-changed=MESON_BUILD_DIR"); > +

Re: QEMU plugin past, present and future examples

2024-06-12 Thread Philippe Mathieu-Daudé
Hi Robert, On 11/6/24 18:53, Robert Henry wrote: QEMU plugin experts: A few years I wrote a plugin for QEMU that saves the instruction stream to a file for offline analysis.  QEMU could fly along at about 10MIPS and the disk would soon fill up with large protobuf files.  The offline

Re: [RFC PATCH v2 21/22] qapi: Inline and remove QERR_UNSUPPORTED definition

2024-06-12 Thread Philippe Mathieu-Daudé
Michael, Konstantin, QERR_UNSUPPORTED is only used by QGA. Do you mind giving our maintainer's position on Markus analysis so we can know how to proceed with this definition? Regards, Phil. On 5/10/23 13:22, Markus Armbruster wrote: Philippe Mathieu-Daudé writes: Address the comment added

Re: [PATCH 0/5] Reinstate ability to use Qemu on pre-SSE4.1 x86 hosts

2024-06-12 Thread Daniel P . Berrangé
On Wed, Jun 12, 2024 at 01:51:31PM +0200, Paolo Bonzini wrote: > On Wed, Jun 12, 2024 at 1:38 PM Daniel P. Berrangé > wrote: > > This isn't anything to do with the distro installer. The use case is that > > the distro wants all its software to be able to run on the x86_64 baseline > > it has

Re: [PATCH 0/5] Reinstate ability to use Qemu on pre-SSE4.1 x86 hosts

2024-06-12 Thread Paolo Bonzini
On Wed, Jun 12, 2024 at 2:11 PM Alexander Monakov wrote: > > > On Wed, 12 Jun 2024, Paolo Bonzini wrote: > > > Ahah, nice. :) I'm pretty sure that, when I tested "pf = > > (__builtin_popcount(x) & 1) * 4;", it was generating a call to > > __builtin_popcountsi2. > > Why write

Re: [PATCH 0/5] Reinstate ability to use Qemu on pre-SSE4.1 x86 hosts

2024-06-12 Thread Alexander Monakov
On Wed, 12 Jun 2024, Paolo Bonzini wrote: > Ahah, nice. :) I'm pretty sure that, when I tested "pf = > (__builtin_popcount(x) & 1) * 4;", it was generating a call to > __builtin_popcountsi2. Why write '__builtin_popcount(x) & 1' when you can write '__builtin_parity(x)' in the first place? >

Re: [PATCH v3 0/4] hw/mips/loongson3_virt: Implement IPI support

2024-06-12 Thread Jiaxun Yang
在2024年6月5日六月 上午3:15,Jiaxun Yang写道: > Hi all, > > This series enabled IPI support for loongson3 virt board, loosely > based on my previous work[1]. > It generalized loongarch_ipi device to share among both loongarch > and MIPS machines. > > Thanks A genttle ping :-) Thanks - Jiaxun > > [1]: >

Re: [PATCH v3 00/13] riscv: QEMU RISC-V IOMMU Support

2024-06-12 Thread Daniel Henrique Barboza
On 6/12/24 4:50 AM, LIU Zhiwei wrote: On 2024/6/11 18:13, Daniel Henrique Barboza wrote: Hi Zhiwei, On 6/10/24 10:51 PM, LIU Zhiwei wrote: Hi Daniel, I want to know if we can use the IOMMU and IOPMP at the same time. AFAIK we can. They're not mutually exclusive since they offer

Re: [PATCH 0/5] Reinstate ability to use Qemu on pre-SSE4.1 x86 hosts

2024-06-12 Thread Paolo Bonzini
On Wed, Jun 12, 2024 at 1:46 PM Alexander Monakov wrote: > > > On Wed, 12 Jun 2024, Paolo Bonzini wrote: > > > On Wed, Jun 12, 2024 at 1:19 PM Alexander Monakov > > wrote: > > > On Wed, 12 Jun 2024, Paolo Bonzini wrote: > > > > I didn't do this because of RHEL9, I did it because it's silly that

Re: [PATCH 0/5] Reinstate ability to use Qemu on pre-SSE4.1 x86 hosts

2024-06-12 Thread Paolo Bonzini
On Wed, Jun 12, 2024 at 1:38 PM Daniel P. Berrangé wrote: > This isn't anything to do with the distro installer. The use case is that > the distro wants all its software to be able to run on the x86_64 baseline > it has chosen to build with. Sure, and they can patch the packages if their wish is

Re: [PATCH 0/5] Reinstate ability to use Qemu on pre-SSE4.1 x86 hosts

2024-06-12 Thread Alexander Monakov
On Wed, 12 Jun 2024, Paolo Bonzini wrote: > On Wed, Jun 12, 2024 at 1:19 PM Alexander Monakov wrote: > > On Wed, 12 Jun 2024, Paolo Bonzini wrote: > > > I didn't do this because of RHEL9, I did it because it's silly that > > > QEMU cannot use POPCNT and has to waste 2% of the L1 d-cache to > >

Re: [PATCH v3 1/4] qom: allow to mark objects as deprecated or not secure.

2024-06-12 Thread Markus Armbruster
Daniel P. Berrangé writes: > On Wed, Jun 12, 2024 at 01:07:44PM +0200, Markus Armbruster wrote: >> Gerd Hoffmann writes: >> >> > Add flags to ObjectClass for objects which are deprecated or not secure. >> > Add 'deprecated' and 'not-secure' bools to ObjectTypeInfo, report in >> >

Re: [PATCH v3 0/4] allow to deprecate objects and devices

2024-06-12 Thread Markus Armbruster
Gerd Hoffmann writes: > Put some infrastructure in place to allow tagging objects (including > devices) as deprected. Use it to mark the ohci pci host adapter and > the usb hub as deprecated. I can see usb-hub [PATCH 2], but not "ohci pci host adapter". Peeking at the change log below...

Re: [PATCH 0/5] Reinstate ability to use Qemu on pre-SSE4.1 x86 hosts

2024-06-12 Thread Daniel P . Berrangé
On Wed, Jun 12, 2024 at 01:12:43PM +0200, Paolo Bonzini wrote: > On Wed, Jun 12, 2024 at 1:04 PM Daniel P. Berrangé > wrote: > > > > On Wed, Jun 12, 2024 at 01:55:20PM +0300, Alexander Monakov wrote: > > > Hello, > > > > > > I'm sending straightforward reverts to recent patches that bumped

Re: [PATCH 0/5] Reinstate ability to use Qemu on pre-SSE4.1 x86 hosts

2024-06-12 Thread Paolo Bonzini
On Wed, Jun 12, 2024 at 1:19 PM Alexander Monakov wrote: > On Wed, 12 Jun 2024, Paolo Bonzini wrote: > > I didn't do this because of RHEL9, I did it because it's silly that > > QEMU cannot use POPCNT and has to waste 2% of the L1 d-cache to > > compute the x86 parity flag (and POPCNT was

Re: [PATCH] scripts/qcow2-to-stdout.py: Add script to write qcow2 images to stdout

2024-06-12 Thread Manos Pitsidianakis
On Wed, 12 Jun 2024 12:21, Alberto Garcia wrote: On Wed 12 Jun 2024 09:01:01 AM +03, Manos Pitsidianakis wrote: Hello Alberto, Hello Manos! > This is equivalent to using qemu-img to convert a file to qcow2 and > then writing the result to stdout, with the difference that this > tool does

<    1   2   3   >