Re: [PATCH v3 31/70] i386/tdx: Allows mrconfigid/mrowner/mrownerconfig for TDX_INIT_VM

2023-12-19 Thread Xiaoyao Li
On 12/18/2023 9:46 PM, Markus Armbruster wrote: Xiaoyao Li writes: On 12/1/2023 7:00 PM, Markus Armbruster wrote: Xiaoyao Li writes: From: Isaku Yamahata Three sha384 hash values, mrconfigid, mrowner and mrownerconfig, of a TD can be provided for TDX attestation. So far they were hard c

Re: [PATCH RFC v2 00/12] virtio-net: add support for SR-IOV emulation

2023-12-19 Thread Yui Washizu
On 2023/12/10 13:05, Akihiko Odaki wrote: Introduction This series is based on the RFC series submitted by Yui Washizu[1]. See also [2] for the context. This series enables SR-IOV emulation for virtio-net. It is useful to test SR-IOV support on the guest, or to expose several vDP

Re: [RFC 0/3] aio-posix: call ->poll_end() when removing AioHandler

2023-12-19 Thread Fiona Ebner
Am 18.12.23 um 15:49 schrieb Paolo Bonzini: > On Mon, Dec 18, 2023 at 1:41 PM Fiona Ebner wrote: >> I think it's because of nested drains, because when additionally >> checking that the drain count is zero and only executing the loop then, >> that issue doesn't seem to manifest > > But isn't virt

Re: [PATCH v6 02/11] virtio-gpu: Configure new feature flag context_create_with_flags for virglrenderer

2023-12-19 Thread Antonio Caggiano
Hi Huang Rui, Thank you for this new version. All patches which I did not sign off are reviewed by me :) Cheers, Antonio Caggiano On 19/12/2023 08:53, Huang Rui wrote: Configure a new feature flag (context_create_with_flags) for virglrenderer. Originally-by: Antonio Caggiano Signed-off-by:

Re: [PATCH v6 09/11] virtio-gpu: Support Venus capset

2023-12-19 Thread Pierre-Eric Pelloux-Prayer
Hi Ray, Antonio, Le 19/12/2023 à 08:53, Huang Rui a écrit : From: Antonio Caggiano Add support for the Venus capset, which enables Vulkan support through the Venus Vulkan driver for virtio-gpu. Signed-off-by: Antonio Caggiano Signed-off-by: Huang Rui --- No change in v6. hw/display/vir

[PATCH] util: fix build with musl libc on ppc64le

2023-12-19 Thread Natanael Copa
Use PPC_FEATURE2_ISEL and PPC_FEATURE2_VEC_CRYPTO from linux headers instead of the GNU specific PPC_FEATURE2_HAS_ISEL and PPC_FEATURE2_HAS_VEC_CRYPTO. This fixes build with musl libc. Fixes: 623d7e3551a6 (util: Add cpuinfo-ppc.c) Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1861 Signe

[PATCH] hw/arm: add cache controller for Freescale i.MX6

2023-12-19 Thread Nikita Ostrenkov
Signed-off-by: Nikita Ostrenkov --- hw/arm/Kconfig| 1 + hw/arm/fsl-imx6.c | 3 +++ 2 files changed, 4 insertions(+) diff --git a/hw/arm/Kconfig b/hw/arm/Kconfig index 3ada335a24..386f06840c 100644 --- a/hw/arm/Kconfig +++ b/hw/arm/Kconfig @@ -536,6 +536,7 @@ config FSL_IMX6 select IMX_

Re: [PATCH] target/riscv/kvm: do not use non-portable strerrorname_np()

2023-12-19 Thread Peter Maydell
On Mon, 18 Dec 2023 at 18:34, Daniel Henrique Barboza wrote: > On 12/18/23 14:53, Peter Maydell wrote: > > On Mon, 18 Dec 2023 at 17:22, Daniel Henrique Barboza > > wrote: > > We don't seem to worry about that in any of the other > > KVM code -- accel/kvm/ has lots of places that > > use strerror

Re: [PATCH 0/2] support unaligned access for some xHCI registers

2023-12-19 Thread Peter Maydell
On Tue, 19 Dec 2023 at 04:49, Tomoyuki Hirose wrote: > > I would be grateful if you would any comments on my patch. It's on my todo list, but at this point I'm afraid I'm not going to be able to get to it before I break for the holidays, so it will be January before I can look at it. (It's a bit

Re: [PATCH v6 02/11] virtio-gpu: Configure new feature flag context_create_with_flags for virglrenderer

2023-12-19 Thread Huang Rui
On Tue, Dec 19, 2023 at 05:09:27PM +0800, Antonio Caggiano wrote: > Hi Huang Rui, > > Thank you for this new version. > > All patches which I did not sign off are reviewed by me :) Thanks Antonio! May I have your RB in next version? Best Regards, Ray > > Cheers, > Antonio Caggiano > > On 19/

[PATCH 2/2] tap: Use g_spawn_sync() and g_spawn_check_wait_status()

2023-12-19 Thread Akihiko Odaki
g_spawn_sync() gives an informative message if it fails to execute the script instead of reporting exiting status 1. g_spawn_check_wait_status() also gives an message easier to understand than the raw value returned by waitpid(). Signed-off-by: Akihiko Odaki --- net/tap.c | 52 +

[PATCH 1/2] glib-compat: Define g_spawn_check_wait_status()

2023-12-19 Thread Akihiko Odaki
g_spawn_check_exit_status() is renamed to g_spawn_check_wait_status() in 2.70. Signed-off-by: Akihiko Odaki --- include/glib-compat.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/glib-compat.h b/include/glib-compat.h index 43a562974d80..5f76fbd28e6b 100644 --- a/include/glib-com

[PATCH 0/2] tap: Use g_spawn_sync() and g_spawn_check_wait_status()

2023-12-19 Thread Akihiko Odaki
: 9c74490bff6c8886a922008d0c9ce6cae70dd17e change-id: 20231219-glib-034a34bb05d8 Best regards, -- Akihiko Odaki

Re: [PATCH v2] qdev: Report an error for machine without HotplugHandler

2023-12-19 Thread Akihiko Odaki
On 2023/12/18 23:02, Markus Armbruster wrote: Akihiko Odaki writes: On 2023/12/11 15:51, Markus Armbruster wrote: Akihiko Odaki writes: The HotplugHandler of the machine will be used when the parent bus does not exist, but the machine may not have one. Report an error in such a case instea

Re: [PATCH v2 14/14] block: remove outdated AioContext locking comments

2023-12-19 Thread Kevin Wolf
Am 05.12.2023 um 19:20 hat Stefan Hajnoczi geschrieben: > The AioContext lock no longer exists. > > There is one noteworthy change: > > - * More specifically, these functions use BDRV_POLL_WHILE(bs), which > - * requires the caller to be either in the main thread and hold > - * the Blockdri

Re: [PATCH v7] ui/cocoa: Use NSWindow's ability to resize

2023-12-19 Thread Akihiko Odaki
On 2023/12/19 0:07, Rene Engel wrote: --- Ursprüngliche Nachricht --- Von: Akihiko Odaki Datum: 18.12.2023 08:59:41 An: Rene Engel Betreff: Re: [PATCH v7] ui/cocoa: Use NSWindow's ability to resize On 2023/12/17 18:46, Rene Engel wrote: --- Ursprüngliche Nachricht --- Von: Akihiko Odaki D

Re: [PATCH v6 01/11] linux-headers: Update to kernel headers to add venus capset

2023-12-19 Thread Akihiko Odaki
On 2023/12/19 16:53, Huang Rui wrote: Sync up kernel headers to update venus macro till they are merged into mainline. Thanks for sorting things out with the kernel and spec. Signed-off-by: Huang Rui --- Changes in v6: - Venus capset is applied in kernel, so update it in qemu for future us

[PATCH v2] target/riscv: Implement optional CSR mcontext of debug Sdtrig extension

2023-12-19 Thread Alvin Chang via
The debug Sdtrig extension defines an CSR "mcontext". This commit implements its predicate and read/write operations into CSR table. Its value is reset as 0 when the trigger module is reset. Signed-off-by: Alvin Chang --- Changes from v1: Remove dedicated cfg, always implement mcontext. target/

Re: [PATCH v6 05/11] virtio-gpu: Introduce virgl_gpu_resource structure

2023-12-19 Thread Akihiko Odaki
On 2023/12/19 16:53, Huang Rui wrote: Introduce a new virgl_gpu_resource data structure and helper functions for virgl. It's used to add new member which is specific for virgl in following patches of blob memory support. The name is ambigious. It should tell that it's specific for virgl.

Re: [PATCH v2 00/14] aio: remove AioContext lock

2023-12-19 Thread Kevin Wolf
Am 05.12.2023 um 19:19 hat Stefan Hajnoczi geschrieben: > v2: > - Add Patch 2 "scsi: assert that callbacks run in the correct AioContext" > [Kevin] > - Add Patch 7 "block: remove bdrv_co_lock()" [Eric and Kevin] > - Remove stray goto label in Patch 8 [Kevin] > - Fix "eeked" -> "eked" typo in Patch

Re: [External] Re: [PATCH v2 07/20] util/dsa: Implement DSA device start and stop logic.

2023-12-19 Thread Fabiano Rosas
Hao Xiang writes: >> >> > +} >> > + >> > +void dsa_start(void) {} >> > + >> > +void dsa_stop(void) {} >> > + >> > +void dsa_cleanup(void) {} >> > + >> > +#endif >> >> These could all be in the header. > > The function definitions are already in dsa.h Do you mean moving the > function implementati

Re: [PATCH v6 05/11] virtio-gpu: Introduce virgl_gpu_resource structure

2023-12-19 Thread Huang Rui
On Tue, Dec 19, 2023 at 08:35:27PM +0800, Akihiko Odaki wrote: > On 2023/12/19 16:53, Huang Rui wrote: > > Introduce a new virgl_gpu_resource data structure and helper functions > > for virgl. It's used to add new member which is specific for virgl in > > following patches of blob memory support. >

Re: [PULL 57/62] hw/xen: Support MSI mapping to PIRQ

2023-12-19 Thread Peter Maydell
On Thu, 2 Mar 2023 at 12:37, Paolo Bonzini wrote: > > From: David Woodhouse > > The way that Xen handles MSI PIRQs is kind of awful. > > There is a special MSI message which targets a PIRQ. The vector in the > low bits of data must be zero. The low 8 bits of the PIRQ# are in the > destination ID

Re: [PATCH v6 01/11] linux-headers: Update to kernel headers to add venus capset

2023-12-19 Thread Huang Rui
On Tue, Dec 19, 2023 at 08:20:22PM +0800, Akihiko Odaki wrote: > On 2023/12/19 16:53, Huang Rui wrote: > > Sync up kernel headers to update venus macro till they are merged into > > mainline. > > Thanks for sorting things out with the kernel and spec. > > > > > Signed-off-by: Huang Rui > > ---

Re: [PATCH 0/4] virtio-blk: prepare for the multi-queue block layer

2023-12-19 Thread Kevin Wolf
Am 14.09.2023 um 16:00 hat Stefan Hajnoczi geschrieben: > The virtio-blk device will soon be able to assign virtqueues to IOThreads, > eliminating the single IOThread bottleneck. In order to do that, the I/O code > path must support running in multiple threads. > > This patch series removes the Ai

[RFC PATCH] xen_arm: its: Introduce arm_gicv3_its_xen

2023-12-19 Thread Mykyta Poturai
Introduce the Xen variant of Arm ITS. It is hooked into the mmio subsystem and recieves MSI messages. Upon receiving the MSI messages it gets transfered to the Xen hypervisor with the new device model call for further processing. This change will allow for virtio-pci backends to send MSI interrupt

Re: [PATCH v6 01/11] linux-headers: Update to kernel headers to add venus capset

2023-12-19 Thread Peter Maydell
On Tue, 19 Dec 2023 at 13:49, Huang Rui wrote: > > On Tue, Dec 19, 2023 at 08:20:22PM +0800, Akihiko Odaki wrote: > > On 2023/12/19 16:53, Huang Rui wrote: > > > Sync up kernel headers to update venus macro till they are merged into > > > mainline. > > > > Thanks for sorting things out with the ke

Re: [PATCH v1 1/5] tests/qtest: Add a helper to query the QEMU version

2023-12-19 Thread Thomas Huth
On 07/12/2023 16.58, Fabiano Rosas wrote: Signed-off-by: Fabiano Rosas --- tests/qtest/libqtest.c | 24 tests/qtest/libqtest.h | 10 ++ 2 files changed, 34 insertions(+) diff --git a/tests/qtest/libqtest.c b/tests/qtest/libqtest.c index f33a210861..7cee68a83

Re: [PATCH v1 2/5] tests/qtest/migration: Add infrastructure to skip tests on older QEMUs

2023-12-19 Thread Thomas Huth
On 08/12/2023 16.02, Fabiano Rosas wrote: Fabiano Rosas writes: We can run the migration tests with two different QEMU binaries to test migration compatibility between QEMU versions. This means we'll be running the tests with an older QEMU in either source or destination. We need to avoid try

[PATCH 1/1] docs/system/riscv: document acpi parameter of virt machine

2023-12-19 Thread Heinrich Schuchardt
Since QEMU v8.0.0 the RISC-V virt machine has a switch to disable ACPI table generation. Add it to the documentation. Fixes: 168b8c29cedb ("hw/riscv/virt: Add a switch to disable ACPI") Signed-off-by: Heinrich Schuchardt --- docs/system/riscv/virt.rst | 5 + 1 file changed, 5 insertions(+)

Re: [PATCH v2] string-output-visitor: show structs as ""

2023-12-19 Thread Markus Armbruster
Stefan Hajnoczi writes: > StringOutputVisitor crashes when it visits a struct because > ->start_struct() is NULL. > > Show "" instead of crashing. This is necessary because the > virtio-blk-pci iothread-vq-mapping parameter that I'd like to introduce > soon is a list of IOThreadMapping structs. >

Re: [PATCH] target/i386: Give IRQs a chance when resetting HF_INHIBIT_IRQ_MASK

2023-12-19 Thread Ruihan Li
Hi all, On Mon, Dec 11, 2023 at 03:01:48AM +0800, Ruihan Li wrote: > When emulated with QEMU, interrupts will never come in the following > loop. However, if the NOP instruction is uncommented, interrupts will > fire as normal. > > loop: > cli > call do_sti >

Re: [PATCH v2] string-output-visitor: show structs as ""

2023-12-19 Thread Stefan Hajnoczi
On Tue, 19 Dec 2023 at 09:49, Markus Armbruster wrote: > > Stefan Hajnoczi writes: > > > StringOutputVisitor crashes when it visits a struct because > > ->start_struct() is NULL. > > > > Show "" instead of crashing. This is necessary because the > > virtio-blk-pci iothread-vq-mapping parameter th

Re: [PATCH v2 1/4] scsi: only access SCSIDevice->requests from one thread

2023-12-19 Thread Kevin Wolf
Am 04.12.2023 um 17:42 hat Stefan Hajnoczi geschrieben: > Stop depending on the AioContext lock and instead access > SCSIDevice->requests from only one thread at a time: > - When the VM is running only the BlockBackend's AioContext may access > the requests list. > - When the VM is stopped only t

Re: [PATCH v2 1/2] qdev: add IOThreadVirtQueueMappingList property type

2023-12-19 Thread Stefan Hajnoczi
On Sat, Oct 14, 2023 at 09:35:14AM +0200, Markus Armbruster wrote: > Stefan Hajnoczi writes: > > +## > > +# @IOThreadVirtQueueMappings: > > +# > > +# IOThreadVirtQueueMapping list. This struct is not actually used but the > > +# IOThreadVirtQueueMappingList type it generates is! > > Two spaces be

Re: [PATCH 1/1] docs/system/riscv: document acpi parameter of virt machine

2023-12-19 Thread Daniel Henrique Barboza
On 12/19/23 11:38, Heinrich Schuchardt wrote: Since QEMU v8.0.0 the RISC-V virt machine has a switch to disable ACPI table generation. Add it to the documentation. Fixes: 168b8c29cedb ("hw/riscv/virt: Add a switch to disable ACPI") Signed-off-by: Heinrich Schuchardt --- Reviewed-by: Daniel

[PATCH v3 0/4] virtio-blk: add iothread-vq-mapping parameter

2023-12-19 Thread Stefan Hajnoczi
v3: - Rebased onto Kevin's block branch - Add StringOutputVisitor "" patch to fix "info qtree" crash - Fix QAPI schema formatting [Markus] - Eliminate unnecessary local variable in get_iothread_vq_mapping_list() [Markus] virtio-blk and virtio-scsi devices need a way to specify the mapping between

[PATCH v3 1/4] qdev-properties: alias all object class properties

2023-12-19 Thread Stefan Hajnoczi
qdev_alias_all_properties() aliases a DeviceState's qdev properties onto an Object. This is used for VirtioPCIProxy types so that --device virtio-blk-pci has properties of its embedded --device virtio-blk-device object. Currently this function is implemented using qdev properties. Change the funct

[PATCH v3 2/4] string-output-visitor: show structs as ""

2023-12-19 Thread Stefan Hajnoczi
StringOutputVisitor crashes when it visits a struct because ->start_struct() is NULL. Show "" instead of crashing. This is necessary because the virtio-blk-pci iothread-vq-mapping parameter that I'd like to introduce soon is a list of IOThreadMapping structs. This patch is a quick fix to solve th

[PATCH v3 3/4] qdev: add IOThreadVirtQueueMappingList property type

2023-12-19 Thread Stefan Hajnoczi
virtio-blk and virtio-scsi devices will need a way to specify the mapping between IOThreads and virtqueues. At the moment all virtqueues are assigned to a single IOThread or the main loop. This single thread can be a CPU bottleneck, so it is necessary to allow finer-grained assignment to spread the

[PATCH v3 4/4] virtio-blk: add iothread-vq-mapping parameter

2023-12-19 Thread Stefan Hajnoczi
Add the iothread-vq-mapping parameter to assign virtqueues to IOThreads. Store the vq:AioContext mapping in the new struct VirtIOBlockDataPlane->vq_aio_context[] field and refactor the code to use the per-vq AioContext instead of the BlockDriverState's AioContext. Reimplement --device virtio-blk-p

Re: [PATCH v2 04/14] aio: make aio_context_acquire()/aio_context_release() a no-op

2023-12-19 Thread Kevin Wolf
Am 05.12.2023 um 19:20 hat Stefan Hajnoczi geschrieben: > aio_context_acquire()/aio_context_release() has been replaced by > fine-grained locking to protect state shared by multiple threads. The > AioContext lock still plays the role of balancing locking in > AIO_WAIT_WHILE() and many functions in

Re: [PATCH v2 06/14] block: remove AioContext locking

2023-12-19 Thread Kevin Wolf
Am 05.12.2023 um 19:20 hat Stefan Hajnoczi geschrieben: > This is the big patch that removes > aio_context_acquire()/aio_context_release() from the block layer and > affected block layer users. > > There isn't a clean way to split this patch and the reviewers are likely > the same group of people,

Re: [PATCH v2 1/4] scsi: only access SCSIDevice->requests from one thread

2023-12-19 Thread Stefan Hajnoczi
On Tue, 19 Dec 2023 at 10:12, Kevin Wolf wrote: > > Am 04.12.2023 um 17:42 hat Stefan Hajnoczi geschrieben: > > Stop depending on the AioContext lock and instead access > > SCSIDevice->requests from only one thread at a time: > > - When the VM is running only the BlockBackend's AioContext may acce

Re: [PATCH 0/3] Add "num-prio-bits" property for Cortex-M devices

2023-12-19 Thread Peter Maydell
On Sun, 17 Dec 2023 at 07:37, Samuel Tardieu wrote: > > > > Samuel Tardieu (3): > > hw/intc/armv7m_nvic: add "num-prio-bits" property > > hw/arm/armv7m: alias the NVIC "num-prio-bits" property > > hw/arm/socs: configure priority bits for existing SOCs > > Any idea to why patchew fails to app

Re: [PATCH] hw/arm: add cache controller for Freescale i.MX6

2023-12-19 Thread Peter Maydell
On Tue, 19 Dec 2023 at 10:55, Nikita Ostrenkov wrote: > > Signed-off-by: Nikita Ostrenkov > --- > hw/arm/Kconfig| 1 + > hw/arm/fsl-imx6.c | 3 +++ > 2 files changed, 4 insertions(+) Thanks for this patch; it looks fairly obviously right, but I wanted to let you know I won't be able to do p

Re: [PATCH v2 1/2] qdev: add IOThreadVirtQueueMappingList property type

2023-12-19 Thread Kevin Wolf
Am 19.12.2023 um 16:13 hat Stefan Hajnoczi geschrieben: > On Sat, Oct 14, 2023 at 09:35:14AM +0200, Markus Armbruster wrote: > > Stefan Hajnoczi writes: > > > +## > > > +# @IOThreadVirtQueueMappings: > > > +# > > > +# IOThreadVirtQueueMapping list. This struct is not actually used but the > > > +#

Re: [PATCH v4 00/45] Raspberry Pi 4B machine

2023-12-19 Thread Peter Maydell
On Fri, 8 Dec 2023 at 02:32, Sergey Kambalin wrote: > > Introducing Raspberry Pi 4B model. > It contains new BCM2838 SoC, PCIE subsystem, > RNG200, Thermal sensor and Genet network controller. > > It can work with recent linux kernels 6.x.x. > Two avocado tests was added to check that. > > Unit te

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

2023-12-19 Thread Alex Bennée
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 in the

Re: [PATCH v4 00/45] Raspberry Pi 4B machine

2023-12-19 Thread Kambalin, Sergey
Thank you a lot for the review Peter! May I kindly ask you to take just a brief look at the first patches of GENET? I'd like to know if I've chosen the right way to replace bitfields with QEMU REG32/FIELD32 macros. Thanks, Sergey Kambalin Software Developer, Auriga Inc. ___

Re: [PATCH v4 00/45] Raspberry Pi 4B machine

2023-12-19 Thread Peter Maydell
On Tue, 19 Dec 2023 at 16:18, Kambalin, Sergey wrote: > > Thank you a lot for the review Peter! > > > May I kindly ask you to take just a brief look at the first patches of GENET? > I'd like to know if I've chosen the right way to replace bitfields with QEMU > REG32/FIELD32 macros. The FIELD a

Re: [PATCH v1 1/5] tests/qtest: Add a helper to query the QEMU version

2023-12-19 Thread Fabiano Rosas
Thomas Huth writes: > On 07/12/2023 16.58, Fabiano Rosas wrote: >> Signed-off-by: Fabiano Rosas >> --- >> tests/qtest/libqtest.c | 24 >> tests/qtest/libqtest.h | 10 ++ >> 2 files changed, 34 insertions(+) >> >> diff --git a/tests/qtest/libqtest.c b/tests/q

Re: [PATCH v1 2/5] tests/qtest/migration: Add infrastructure to skip tests on older QEMUs

2023-12-19 Thread Fabiano Rosas
Thomas Huth writes: > On 08/12/2023 16.02, Fabiano Rosas wrote: >> Fabiano Rosas writes: >> >>> We can run the migration tests with two different QEMU binaries to >>> test migration compatibility between QEMU versions. This means we'll >>> be running the tests with an older QEMU in either sourc

Re: [PATCH v4 00/45] Raspberry Pi 4B machine

2023-12-19 Thread Kambalin, Sergey
Thanks! I know about the 'offset' parameter, but in this particular case I use these structures as layouts only and don't 'switch' over them. So I decided to set the offsets to 0 in order to simplify the code. And extra thanks for highlighting the potential issue with memcpy() 😊. I'll fix it

Re: [PATCH v4 00/45] Raspberry Pi 4B machine

2023-12-19 Thread Kambalin, Sergey
Thanks! I know about the 'offset' parameter, but in this particular case I use these structures as layouts only and don't 'switch' over them. So I decided to set the offsets to 0 in order to simplify the code. And extra thanks for highlighting the potential issue with memcpy() 😊. I'll fix it

Re: [PATCH 1/2] tcg: Remove unreachable code

2023-12-19 Thread Peter Maydell
On Thu, 14 Dec 2023 at 23:32, Samuel Tardieu wrote: > > The `fail_rx`/`fail` block is only entered while `buf_rx` is equal to > its initial value `MAP_FAILED`. The `munmap(buf_rx, size);` was never > executed. > > Resolves: https://gitlab.com/qemu-project/qemu/-/issues/2030 > Signed-off-by: Samuel

Re: [PATCH 2/2] tcg: Jump after always false condition

2023-12-19 Thread Peter Maydell
On Thu, 14 Dec 2023 at 23:32, Samuel Tardieu wrote: > > `buf_rw` is always `NULL` when jumping to the `fail` label. Move the > label `down` after the `if (buf_rw) { ... }` statement. > > Signed-off-by: Samuel Tardieu > --- > tcg/region.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) >

Re: [PATCH 2/2] tcg: Jump after always false condition

2023-12-19 Thread Samuel Tardieu
Peter Maydell writes: So, well, all of this is definitely removing dead code, but on the other hand it's also moving away from the coding-style pattern the function has at the moment, which is "there is a fail-and-exit codepath which is robust against wherever you might choose to jump to it,

Re: [PATCH v2 04/14] aio: make aio_context_acquire()/aio_context_release() a no-op

2023-12-19 Thread Kevin Wolf
Am 19.12.2023 um 16:28 hat Kevin Wolf geschrieben: > Am 05.12.2023 um 19:20 hat Stefan Hajnoczi geschrieben: > > aio_context_acquire()/aio_context_release() has been replaced by > > fine-grained locking to protect state shared by multiple threads. The > > AioContext lock still plays the role of bal

[PATCH v2 1/2] tcg: Remove unreachable code

2023-12-19 Thread Samuel Tardieu
The `fail_rx`/`fail` block is only entered while `buf_rx` is equal to its initial value `MAP_FAILED`. The `munmap(buf_rx, size);` was never executed. Resolves: https://gitlab.com/qemu-project/qemu/-/issues/2030 Signed-off-by: Samuel Tardieu Reviewed-by: Peter Maydell --- tcg/region.c | 4 +---

[PATCH v2 0/2] tcg: Jump after always false condition

2023-12-19 Thread Samuel Tardieu
Unreachable code in an error handling block is listed in issue https://gitlab.com/qemu-project/qemu/-/issues/2030. After removing this code, the `fail` label is now immediately followed by a test whose condition can never be true when coming explicitly via this label. Moving the label down preserv

[PATCH v2 2/2] tcg: Make the cleanup-on-error path unique

2023-12-19 Thread Samuel Tardieu
By calling `error_setg_errno()` before jumping to the cleanup-on-error path at the `fail` label, the cleanup path is clearer. Signed-off-by: Samuel Tardieu --- tcg/region.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tcg/region.c b/tcg/region.c index 467e51cf6f..478

[PULL 11/47] vfio/container: Move vrdl_list to base container

2023-12-19 Thread Cédric Le Goater
From: Zhenzhong Duan No functional change intended. Signed-off-by: Zhenzhong Duan Reviewed-by: Cédric Le Goater Signed-off-by: Cédric Le Goater --- include/hw/vfio/vfio-common.h | 11 include/hw/vfio/vfio-container-base.h | 11 hw/vfio/common.c

[PULL 13/47] vfio/container: Move dirty_pgsizes and max_dirty_bitmap_size to base container

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

[PULL 07/47] vfio/container: Switch to IOMMU BE set_dirty_page_tracking/query_dirty_bitmap API

2023-12-19 Thread Cédric Le Goater
From: Eric Auger dirty_pages_supported field is also moved to the base container No functional change intended. Signed-off-by: Eric Auger Signed-off-by: Yi Liu Signed-off-by: Yi Sun Signed-off-by: Zhenzhong Duan Reviewed-by: Cédric Le Goater Signed-off-by: Cédric Le Goater --- include/hw

[PULL 14/47] vfio/container: Move iova_ranges to base container

2023-12-19 Thread Cédric Le Goater
From: Zhenzhong Duan Meanwhile remove the helper function vfio_free_container as it only calls g_free now. No functional change intended. Signed-off-by: Zhenzhong Duan Reviewed-by: Cédric Le Goater Signed-off-by: Cédric Le Goater --- include/hw/vfio/vfio-common.h | 1 - include/hw/

[PULL 06/47] vfio/container: Move space field to base container

2023-12-19 Thread Cédric Le Goater
From: Eric Auger Move the space field to the base object. Also the VFIOAddressSpace now contains a list of base containers. No functional change intended. Signed-off-by: Eric Auger Signed-off-by: Yi Liu Signed-off-by: Yi Sun Signed-off-by: Zhenzhong Duan Reviewed-by: Cédric Le Goater Signe

[PULL 00/47] vfio queue

2023-12-19 Thread Cédric Le Goater
The following changes since commit bd00730ec0f621706d0179768436f82c39048499: Open 9.0 development tree (2023-12-19 09:46:22 -0500) are available in the Git repository at: https://github.com/legoater/qemu/ tags/pull-vfio-20231219 for you to fetch changes up to

[PULL 19/47] vfio/spapr: Move hostwin_list into spapr container

2023-12-19 Thread Cédric Le Goater
From: Zhenzhong Duan No functional changes intended. Signed-off-by: Zhenzhong Duan Reviewed-by: Cédric Le Goater Signed-off-by: Cédric Le Goater --- include/hw/vfio/vfio-common.h | 1 - hw/vfio/spapr.c | 36 +++ 2 files changed, 20 insertions(+)

[PULL 04/47] vfio/common: Introduce vfio_container_init/destroy helper

2023-12-19 Thread Cédric Le Goater
From: Zhenzhong Duan This adds two helper functions vfio_container_init/destroy which will be used by both legacy and iommufd containers to do base container specific initialization and release. No functional change intended. Suggested-by: Cédric Le Goater Signed-off-by: Zhenzhong Duan Review

[PULL 01/47] vfio: Introduce base object for VFIOContainer and targeted interface

2023-12-19 Thread Cédric Le Goater
From: Zhenzhong Duan Introduce a dumb VFIOContainerBase object and its targeted interface. This is willingly not a QOM object because we don't want it to be visible from the user interface. The VFIOContainerBase will be smoothly populated in subsequent patches as well as interfaces. No functiona

[PULL 34/47] vfio/ap: Make vfio cdev pre-openable by passing a file handle

2023-12-19 Thread Cédric Le Goater
From: Zhenzhong Duan This gives management tools like libvirt a chance to open the vfio cdev with privilege and pass FD to qemu. This way qemu never needs to have privilege to open a VFIO or iommu cdev node. Signed-off-by: Zhenzhong Duan Reviewed-by: Matthew Rosato Reviewed-by: Cédric Le Goate

[PULL 24/47] vfio/iommufd: Relax assert check for iommufd backend

2023-12-19 Thread Cédric Le Goater
From: Zhenzhong Duan Currently iommufd doesn't support dirty page sync yet, but it will not block us doing live migration if VFIO migration is force enabled. So in this case we allow set_dirty_page_tracking to be NULL. Note we don't need same change for query_dirty_bitmap because when dirty page

[PULL 20/47] backends/iommufd: Introduce the iommufd object

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

[PULL 16/47] vfio/spapr: Introduce spapr backend and target interface

2023-12-19 Thread Cédric Le Goater
From: Zhenzhong Duan Introduce an empty spapr backend which will hold spapr specific content, currently only prereg_listener and hostwin_list. Also introduce two spapr specific callbacks add/del_window into VFIOIOMMUOps. Instantiate a spapr ops with a helper setup_spapr_ops and assign it to bcon

[PULL 23/47] vfio/iommufd: Implement the iommufd backend

2023-12-19 Thread Cédric Le Goater
From: Yi Liu The iommufd backend is implemented based on the new /dev/iommu user API. This backend obviously depends on CONFIG_IOMMUFD. So far, the iommufd backend doesn't support dirty page sync yet. Co-authored-by: Eric Auger Signed-off-by: Yi Liu Signed-off-by: Zhenzhong Duan Reviewed-by:

[PULL 10/47] vfio/container: Move pgsizes and dma_max_mappings to base container

2023-12-19 Thread Cédric Le Goater
From: Eric Auger No functional change intended. Signed-off-by: Eric Auger Signed-off-by: Yi Liu Signed-off-by: Yi Sun Signed-off-by: Zhenzhong Duan Reviewed-by: Cédric Le Goater Signed-off-by: Cédric Le Goater --- include/hw/vfio/vfio-common.h | 2 -- include/hw/vfio/vfio-contain

[PULL 33/47] vfio/ap: Allow the selection of a given iommu backend

2023-12-19 Thread Cédric Le Goater
From: Zhenzhong Duan Now we support two types of iommu backends, let's add the capability to select one of them. This depends on whether an iommufd object has been linked with the vfio-ap device: if the user wants to use the legacy backend, it shall not link the vfio-ap device with any iommufd o

[PULL 27/47] vfio/pci: Introduce a vfio pci hot reset interface

2023-12-19 Thread Cédric Le Goater
From: Zhenzhong Duan Legacy vfio pci and iommufd cdev have different process to hot reset vfio device, expand current code to abstract out pci_hot_reset callback for legacy vfio, this same interface will also be used by iommufd cdev vfio device. Rename vfio_pci_hot_reset to vfio_legacy_pci_hot_r

[PULL 35/47] vfio/ccw: Allow the selection of a given iommu backend

2023-12-19 Thread Cédric Le Goater
From: Zhenzhong Duan Now we support two types of iommu backends, let's add the capability to select one of them. This depends on whether an iommufd object has been linked with the vfio-ccw device: If the user wants to use the legacy backend, it shall not link the vfio-ccw device with any iommufd

[PULL 05/47] vfio/common: Move giommu_list in base container

2023-12-19 Thread Cédric Le Goater
From: Eric Auger Move the giommu_list field in the base container and store the base container in the VFIOGuestIOMMU. No functional change intended. Signed-off-by: Eric Auger Signed-off-by: Yi Liu Signed-off-by: Yi Sun Signed-off-by: Zhenzhong Duan Reviewed-by: Cédric Le Goater Signed-off-

[PULL 31/47] vfio/platform: Allow the selection of a given iommu backend

2023-12-19 Thread Cédric Le Goater
From: Zhenzhong Duan Now we support two types of iommu backends, let's add the capability to select one of them. This depends on whether an iommufd object has been linked with the vfio-platform device: If the user wants to use the legacy backend, it shall not link the vfio-platform device with a

[PULL 40/47] hw/i386: Activate IOMMUFD for q35 machines

2023-12-19 Thread Cédric Le Goater
Signed-off-by: Cédric Le Goater Signed-off-by: Zhenzhong Duan Reviewed-by: Eric Auger Tested-by: Nicolin Chen Signed-off-by: Cédric Le Goater --- hw/i386/Kconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/hw/i386/Kconfig b/hw/i386/Kconfig index 55850791df4148f5535eb06b76e09dabf75d84

[PULL 12/47] vfio/container: Move listener to base container

2023-12-19 Thread Cédric Le Goater
From: Eric Auger Move listener to base container. Also error and initialized fields are moved at the same time. No functional change intended. Signed-off-by: Eric Auger Signed-off-by: Yi Liu Signed-off-by: Yi Sun Signed-off-by: Zhenzhong Duan Reviewed-by: Cédric Le Goater Signed-off-by: Cé

[PULL 42/47] vfio/platform: Move VFIODevice initializations in vfio_platform_instance_init

2023-12-19 Thread Cédric Le Goater
From: Zhenzhong Duan Some of the VFIODevice initializations is in vfio_platform_realize, move all of them in vfio_platform_instance_init. No functional change intended. Suggested-by: Cédric Le Goater Signed-off-by: Zhenzhong Duan Reviewed-by: Philippe Mathieu-Daudé Tested-by: Nicolin Chen S

[PULL 37/47] vfio: Make VFIOContainerBase poiner parameter const in VFIOIOMMUOps callbacks

2023-12-19 Thread Cédric Le Goater
From: Zhenzhong Duan Some of the callbacks in VFIOIOMMUOps pass VFIOContainerBase poiner, those callbacks only need read access to the sub object of VFIOContainerBase. So make VFIOContainerBase, VFIOContainer and VFIOIOMMUFDContainer as const in these callbacks. Local functions called by those c

[PULL 38/47] hw/arm: Activate IOMMUFD for virt machines

2023-12-19 Thread Cédric Le Goater
Signed-off-by: Cédric Le Goater Signed-off-by: Zhenzhong Duan Reviewed-by: Eric Auger Tested-by: Eric Auger Tested-by: Nicolin Chen Signed-off-by: Cédric Le Goater --- hw/arm/Kconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/hw/arm/Kconfig b/hw/arm/Kconfig index 3ada335a24374d4d54

[PULL 08/47] vfio/container: Move per container device list in base container

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

[PULL 45/47] vfio: Introduce a helper function to initialize VFIODevice

2023-12-19 Thread Cédric Le Goater
From: Zhenzhong Duan Introduce a helper function to replace the common code to initialize VFIODevice in pci, platform, ap and ccw VFIO device. No functional change intended. Suggested-by: Cédric Le Goater Signed-off-by: Zhenzhong Duan Tested-by: Nicolin Chen Signed-off-by: Cédric Le Goater

[PULL 21/47] util/char_dev: Add open_cdev()

2023-12-19 Thread Cédric Le Goater
From: Yi Liu /dev/vfio/devices/vfioX may not exist. In that case it is still possible to open /dev/char/$major:$minor instead. Add helper function to abstract the cdev open. Suggested-by: Jason Gunthorpe Signed-off-by: Yi Liu Signed-off-by: Zhenzhong Duan Reviewed-by: Cédric Le Goater Review

[PULL 09/47] vfio/container: Convert functions to base container

2023-12-19 Thread Cédric Le Goater
From: Eric Auger In the prospect to get rid of VFIOContainer refs in common.c lets convert misc functions to use the base container object instead: vfio_devices_all_dirty_tracking vfio_devices_all_device_dirty_tracking vfio_devices_all_running_and_mig_active vfio_devices_query_dirty_bitmap vfio_

[PULL 32/47] vfio/platform: Make vfio cdev pre-openable by passing a file handle

2023-12-19 Thread Cédric Le Goater
From: Zhenzhong Duan This gives management tools like libvirt a chance to open the vfio cdev with privilege and pass FD to qemu. This way qemu never needs to have privilege to open a VFIO or iommu cdev node. Signed-off-by: Zhenzhong Duan Reviewed-by: Cédric Le Goater Tested-by: Nicolin Chen S

[PULL 47/47] hw/ppc/Kconfig: Imply VFIO_PCI

2023-12-19 Thread Cédric Le Goater
When the legacy and iommufd backends were introduced, a set of common vfio-pci routines were exported in pci.c for both backends to use : vfio_pci_pre_reset vfio_pci_get_pci_hot_reset_info vfio_pci_host_match vfio_pci_post_reset This introduced a build failure on PPC when --without-defaul

[PULL 15/47] vfio/container: Implement attach/detach_device

2023-12-19 Thread Cédric Le Goater
From: Eric Auger No functional change intended. Signed-off-by: Eric Auger Signed-off-by: Yi Liu Signed-off-by: Yi Sun Signed-off-by: Zhenzhong Duan Reviewed-by: Cédric Le Goater Signed-off-by: Cédric Le Goater --- hw/vfio/common.c| 16 hw/vfio/container.c | 12 +--

[PULL 02/47] vfio/container: Introduce a empty VFIOIOMMUOps

2023-12-19 Thread Cédric Le Goater
From: Zhenzhong Duan This empty VFIOIOMMUOps named vfio_legacy_ops will hold all general IOMMU ops of legacy container. Signed-off-by: Zhenzhong Duan Reviewed-by: Cédric Le Goater Signed-off-by: Cédric Le Goater --- include/hw/vfio/vfio-common.h | 2 +- hw/vfio/container.c | 5

[PULL 22/47] vfio/common: return early if space isn't empty

2023-12-19 Thread Cédric Le Goater
From: Zhenzhong Duan This is a trivial optimization. If there is active container in space, vfio_reset_handler will never be unregistered. So revert the check of space->containers and return early. Signed-off-by: Zhenzhong Duan Reviewed-by: Cédric Le Goater Reviewed-by: Eric Auger Tested-by:

[PULL 26/47] vfio/pci: Extract out a helper vfio_pci_get_pci_hot_reset_info

2023-12-19 Thread Cédric Le Goater
From: Zhenzhong Duan This helper will be used by both legacy and iommufd backends. No functional changes intended. Signed-off-by: Zhenzhong Duan Reviewed-by: Cédric Le Goater Reviewed-by: Eric Auger Tested-by: Eric Auger Tested-by: Nicolin Chen Signed-off-by: Cédric Le Goater --- hw/vfio

[PULL 18/47] vfio/spapr: Move prereg_listener into spapr container

2023-12-19 Thread Cédric Le Goater
From: Zhenzhong Duan No functional changes intended. Signed-off-by: Zhenzhong Duan Reviewed-by: Cédric Le Goater Signed-off-by: Cédric Le Goater --- include/hw/vfio/vfio-common.h | 1 - hw/vfio/spapr.c | 24 2 files changed, 16 insertions(+), 9 deletio

[PULL 43/47] vfio/ap: Move VFIODevice initializations in vfio_ap_instance_init

2023-12-19 Thread Cédric Le Goater
From: Zhenzhong Duan Some of the VFIODevice initializations is in vfio_ap_realize, move all of them in vfio_ap_instance_init. No functional change intended. Suggested-by: Cédric Le Goater Signed-off-by: Zhenzhong Duan Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Eric Farman Tested-by: N

[PULL 25/47] vfio/iommufd: Add support for iova_ranges and pgsizes

2023-12-19 Thread Cédric Le Goater
From: Zhenzhong Duan Some vIOMMU such as virtio-iommu use IOVA ranges from host side to setup reserved ranges for passthrough device, so that guest will not use an IOVA range beyond host support. Use an uAPI of IOMMUFD to get IOVA ranges of host side and pass to vIOMMU just like the legacy backe

  1   2   3   >