Re: [PATCH] block/mirror: add 'write-blocking-after-ready' copy mode

2023-01-31 Thread Denis V. Lunev
On 1/31/23 18:44, Vladimir Sementsov-Ogievskiy wrote: + Den Den, I remember we thought about that, and probably had a solution? Another possible approach to get benefits from both modes is to switch to blocking mode after first loop of copying. [*] Hmm. Thinking about proposed solution it se

Re: virtio-sound Google Summer of Code project?

2023-01-31 Thread Stefan Hajnoczi
On Tue, 31 Jan 2023 at 12:43, Alex Bennée wrote: > > > Stefan Hajnoczi writes: > > > On Sun, 29 Jan 2023 at 17:10, Stefan Hajnoczi wrote: > >> > >> Hi Shreyansh, Gerd, and Laurent, > >> The last virtio-sound RFC was sent in February last year. It was a > >> spare time project. Understandably it'

[PATCH qemu 0/1] MAC address falls to permanent

2023-01-31 Thread Vlao Mao
A bug was found with the vmxnet3 driver, after changing the MAC address and rebooting, it falls into the category of a permanent address until the VM is turned off. Here is log output: -bash-4.4# ip a 1: lo: mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1 link/loopback 00:00:00:00:

[PATCH] tests/tcg/s390x: Use -nostdlib for softmmu tests

2023-01-31 Thread Ilya Leoshkevich
The code currently uses -nostartfiles, but this does not prevent linking with libc. On Fedora there is no cross-libc, so the linking step fails. Fix by using the more comprehensive -nostdlib (that's also what probe_target_compiler() checks for as well). Fixes: 503e549e441e ("tests/tcg/s390x: Test

[PATCH qemu 1/1] vmxnet3: add mac address restore upon reset

2023-01-31 Thread Vlao Mao
From: VlaoMao Changing the address with a subsequent reboot makes this address permanent until the vm is turned off Signed-off-by: Vlao Mao --- hw/net/vmxnet3.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/hw/net/vmxnet3.c b/hw/net/vmxnet3.c index 04159c8222..695ca2f923 100644 --- a/

Re: [PATCH v4 08/14] RISC-V: Adding T-Head MemPair extension

2023-01-31 Thread Richard Henderson
On 1/31/23 08:01, Christoph Muellner wrote: +if ((memop & MO_SIZE) == MO_64) { +addr2 = get_address(ctx, a->rs, 8 + (a->sh2 << shamt)); +} else { +addr2 = get_address(ctx, a->rs, 4 + (a->sh2 << shamt)); +} Use memop_size(memop) instead. Otherwise, Reviewed-by: Richa

[PATCH qemu 1/1] vmxnet3: add mac address restore upon reset

2023-01-31 Thread Vlao Mao
Changing the address with a subsequent reboot makes this address permanent until the vm is turned off Signed-off-by: Vlao Mao --- hw/net/vmxnet3.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/hw/net/vmxnet3.c b/hw/net/vmxnet3.c index 04159c8222..695ca2f923 100644 --- a/hw/net/vmxnet3.c

[PATCH qemu 0/1] MAC address falls to permanent

2023-01-31 Thread Vlao Mao
A bug was found with the vmxnet3 driver, after changing the MAC address and rebooting, it falls into the category of a permanent address until the VM is turned off. Here is log output: -bash-4.4# ip a 1: lo: mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1 link/loopback 00:00:00:00:

Re: [PATCH] tests/tcg/s390x: Use -nostdlib for softmmu tests

2023-01-31 Thread Richard Henderson
On 1/31/23 08:20, Ilya Leoshkevich wrote: The code currently uses -nostartfiles, but this does not prevent linking with libc. On Fedora there is no cross-libc, so the linking step fails. Fix by using the more comprehensive -nostdlib (that's also what probe_target_compiler() checks for as well).

Re: [PATCH] configure: Bump minimum Clang version to 10.0

2023-01-31 Thread Alex Bennée
Thomas Huth writes: > Anthony Perard recently reported some problems with Clang v6.0 from > Ubuntu Bionic (with regards to the -Wmissing-braces configure test). > Since we're not officially supporting that version of Ubuntu anymore, > we should better bump our minimum version check in the confi

Re: virtio-sound Google Summer of Code project?

2023-01-31 Thread Alex Bennée
Stefan Hajnoczi writes: > On Tue, 31 Jan 2023 at 12:43, Alex Bennée wrote: >> >> >> Stefan Hajnoczi writes: >> >> > On Sun, 29 Jan 2023 at 17:10, Stefan Hajnoczi wrote: >> >> >> >> Hi Shreyansh, Gerd, and Laurent, >> >> The last virtio-sound RFC was sent in February last year. It was a >> >>

Re: [PATCH] tests/tcg/s390x: Use -nostdlib for softmmu tests

2023-01-31 Thread Alex Bennée
Ilya Leoshkevich writes: > The code currently uses -nostartfiles, but this does not prevent > linking with libc. On Fedora there is no cross-libc, so the linking > step fails. > > Fix by using the more comprehensive -nostdlib (that's also what > probe_target_compiler() checks for as well). > >

Re: virtio-sound Google Summer of Code project?

2023-01-31 Thread Stefan Hajnoczi
On Tue, 31 Jan 2023 at 13:43, Alex Bennée wrote: > > > Stefan Hajnoczi writes: > > > On Tue, 31 Jan 2023 at 12:43, Alex Bennée wrote: > >> > >> > >> Stefan Hajnoczi writes: > >> > >> > On Sun, 29 Jan 2023 at 17:10, Stefan Hajnoczi wrote: > >> >> > >> >> Hi Shreyansh, Gerd, and Laurent, > >> >>

Re: [PATCH qemu 0/1] MAC address falls to permanent

2023-01-31 Thread Peter Maydell
On Tue, 31 Jan 2023 at 18:22, Vlao Mao wrote: > > A bug was found with the vmxnet3 driver, after changing the MAC address > and rebooting, it falls into the category of a permanent address until > the VM is turned off. For some network device models (those where the hardware has an EEPROM and we'

Re: [PATCH qemu 0/1] MAC address falls to permanent

2023-01-31 Thread Влад Мао
I cannot say for sure, but e1000 does not have this behavior, vmxnet3 in vmware also does not behave this way. In addition, the address gets there only after a reboot, it does not get there during normal operation, as you can see from logs i attached. It seems to me that this is not quite the expec

Emulating device configuration / max_virtqueue_pairs in vhost-vdpa and vhost-user

2023-01-31 Thread Eugenio Perez Martin
Hi, The current approach of offering an emulated CVQ to the guest and map the commands to vhost-user is not scaling well: * Some devices already offer it, so the transformation is redundant. * There is no support for commands with variable length (RSS?) We can solve both of them by offering it th

Re: Emulating device configuration / max_virtqueue_pairs in vhost-vdpa and vhost-user

2023-01-31 Thread Eugenio Perez Martin
On Tue, Jan 31, 2023 at 8:10 PM Eugenio Perez Martin wrote: > > Hi, > > The current approach of offering an emulated CVQ to the guest and map > the commands to vhost-user is not scaling well: > * Some devices already offer it, so the transformation is redundant. > * There is no support for command

Re: [XEN PATCH v2 0/3] Configure qemu upstream correctly by default for igd-passthru

2023-01-31 Thread Chuck Zmudzinski
On 1/29/23 7:38 PM, Chuck Zmudzinski wrote: > On 1/25/23 6:19 PM, Chuck Zmudzinski wrote: >> On 1/25/2023 6:37 AM, Anthony PERARD wrote: >>> On Tue, Jan 10, 2023 at 02:32:01AM -0500, Chuck Zmudzinski wrote: >>> > I call attention to the commit message of the first patch which points >>> > out that

[PATCH 5/6] usb/ohci: Add trace points for register access

2023-01-31 Thread BALATON Zoltan
To help debugging add trace points that print values read from or written to the device's registers. Signed-off-by: BALATON Zoltan --- hw/usb/hcd-ohci.c | 19 +++ hw/usb/trace-events | 4 2 files changed, 23 insertions(+) diff --git a/hw/usb/hcd-ohci.c b/hw/usb/hcd-ohci.

[PATCH 2/6] usb/ohci: Code style fix white space errors

2023-01-31 Thread BALATON Zoltan
Signed-off-by: BALATON Zoltan --- hw/usb/hcd-ohci.c | 162 +++--- 1 file changed, 80 insertions(+), 82 deletions(-) diff --git a/hw/usb/hcd-ohci.c b/hw/usb/hcd-ohci.c index 9f138e7f25..b2a2de7964 100644 --- a/hw/usb/hcd-ohci.c +++ b/hw/usb/hcd-ohci.c @@ -6

[PATCH 1/6] usb/ohci: Code style fix comments

2023-01-31 Thread BALATON Zoltan
Signed-off-by: BALATON Zoltan --- hw/usb/hcd-ohci.c | 99 +++ 1 file changed, 49 insertions(+), 50 deletions(-) diff --git a/hw/usb/hcd-ohci.c b/hw/usb/hcd-ohci.c index 9d68036d23..9f138e7f25 100644 --- a/hw/usb/hcd-ohci.c +++ b/hw/usb/hcd-ohci.c @@ -2

[PATCH 3/6] usb/ohci: Code style fix missing braces and extra parenthesis

2023-01-31 Thread BALATON Zoltan
Signed-off-by: BALATON Zoltan --- hw/usb/hcd-ohci.c | 106 ++ 1 file changed, 60 insertions(+), 46 deletions(-) diff --git a/hw/usb/hcd-ohci.c b/hw/usb/hcd-ohci.c index b2a2de7964..c262418181 100644 --- a/hw/usb/hcd-ohci.c +++ b/hw/usb/hcd-ohci.c @@ -4

Re: [PULL 10/56] x86: don't let decompressed kernel image clobber setup_data

2023-01-31 Thread Jason A. Donenfeld
On Mon, Jan 30, 2023 at 03:19:59PM -0500, Michael S. Tsirkin wrote: > From: "Jason A. Donenfeld" > > The setup_data links are appended to the compressed kernel image. Since > the kernel image is typically loaded at 0x10, setup_data lives at > `0x10 + compressed_size`, which does not get r

[PATCH 0/6] OHCI changes

2023-01-31 Thread BALATON Zoltan
Trying to debug some MacOS versions on mac99 with OHCI I've added some debug logging that might be useful to get traces from this device and attempted to implement missing feature. To avoid checkpatch errors start with updating code style for th ewhole file. Regards, BALATON Zoltan BALATON Zoltan

[PATCH 6/6] usb/ohci: Implement resume on connection status change

2023-01-31 Thread BALATON Zoltan
If certain bit is set remote wake up should change state from suspended to resume and generate interrupt. There was a todo comment for this, implement that by moving existing resume logic to a function and call that. Signed-off-by: BALATON Zoltan --- hw/usb/hcd-ohci.c | 23 +-

[PATCH 4/6] usb/ohci: Move a function next to where it is used

2023-01-31 Thread BALATON Zoltan
The ohci_port_set_if_connected() function is only used by ohci_port_set_status(), move next to it to have them at the same place. Signed-off-by: BALATON Zoltan --- hw/usb/hcd-ohci.c | 60 +++ 1 file changed, 30 insertions(+), 30 deletions(-) diff --gi

Re: [PATCH 0/3] util/userfaultfd: Support /dev/userfaultfd

2023-01-31 Thread Peter Xu
On Thu, Jan 26, 2023 at 12:26:45PM -0500, Peter Xu wrote: > On Thu, Jan 26, 2023 at 03:59:33PM +, Daniel P. Berrangé wrote: > > On Thu, Jan 26, 2023 at 10:25:05AM -0500, Peter Xu wrote: > > > On Thu, Jan 26, 2023 at 02:15:11PM +, Dr. David Alan Gilbert wrote: > > > > * Michal Prívozník (mpr

Re: virtio-sound Google Summer of Code project?

2023-01-31 Thread Marc-André Lureau
Hi On Tue, Jan 31, 2023 at 10:20 PM Stefan Hajnoczi wrote: > > On Tue, 31 Jan 2023 at 12:43, Alex Bennée wrote: > > > > > > Stefan Hajnoczi writes: > > > > > On Sun, 29 Jan 2023 at 17:10, Stefan Hajnoczi wrote: > > >> > > >> Hi Shreyansh, Gerd, and Laurent, > > >> The last virtio-sound RFC was

Re: [PATCH 0/3] util/userfaultfd: Support /dev/userfaultfd

2023-01-31 Thread Daniel P . Berrangé
On Tue, Jan 31, 2023 at 02:48:54PM -0500, Peter Xu wrote: > On Thu, Jan 26, 2023 at 12:26:45PM -0500, Peter Xu wrote: > > On Thu, Jan 26, 2023 at 03:59:33PM +, Daniel P. Berrangé wrote: > > > On Thu, Jan 26, 2023 at 10:25:05AM -0500, Peter Xu wrote: > > > > On Thu, Jan 26, 2023 at 02:15:11PM +0

Re: [PATCH v4 08/14] RISC-V: Adding T-Head MemPair extension

2023-01-31 Thread Christoph Müllner
On Tue, Jan 31, 2023 at 7:23 PM Richard Henderson wrote: > > On 1/31/23 08:01, Christoph Muellner wrote: > > +if ((memop & MO_SIZE) == MO_64) { > > +addr2 = get_address(ctx, a->rs, 8 + (a->sh2 << shamt)); > > +} else { > > +addr2 = get_address(ctx, a->rs, 4 + (a->sh2 << sha

[PATCH v5 03/14] RISC-V: Adding XTheadBa ISA extension

2023-01-31 Thread Christoph Muellner
From: Christoph Müllner This patch adds support for the XTheadBa ISA extension. The patch uses the T-Head specific decoder and translation. Co-developed-by: Philipp Tomsich Co-developed-by: LIU Zhiwei Reviewed-by: Alistair Francis Signed-off-by: Christoph Müllner --- Changes in v2: - Add ISA

[PATCH v5 06/14] RISC-V: Adding XTheadCondMov ISA extension

2023-01-31 Thread Christoph Muellner
From: Christoph Müllner This patch adds support for the XTheadCondMov ISA extension. The patch uses the T-Head specific decoder and translation. Co-developed-by: LIU Zhiwei Reviewed-by: Alistair Francis Signed-off-by: Christoph Müllner --- Changes in v2: - Add ISA_EXT_DATA_ENTRY() - Fix inval

[PATCH v5 00/14] Add support for the T-Head vendor extensions

2023-01-31 Thread Christoph Muellner
From: Christoph Müllner This series introduces support for the T-Head vendor extensions, which are implemented e.g. in the XuanTie C906 and XuanTie C910: * XTheadBa * XTheadBb * XTheadBs * XTheadCmo * XTheadCondMov * XTheadFMemIdx * XTheadFmv * XTheadMac * XTheadMemIdx * XTheadMemPair * XTheadSyn

[PATCH v5 01/14] RISC-V: Adding XTheadCmo ISA extension

2023-01-31 Thread Christoph Muellner
From: Christoph Müllner This patch adds support for the XTheadCmo ISA extension. To avoid interfering with standard extensions, decoder and translation are in its own xthead* specific files. Future patches should be able to easily add additional T-Head extension. The implementation does not have

[PATCH v5 02/14] RISC-V: Adding XTheadSync ISA extension

2023-01-31 Thread Christoph Muellner
From: Christoph Müllner This patch adds support for the XTheadSync ISA extension. The patch uses the T-Head specific decoder and translation. The implementation introduces a helper to execute synchronization tasks: helper_tlb_flush_all() performs a synchronized TLB flush on all CPUs. Co-develop

[PATCH v5 05/14] RISC-V: Adding XTheadBs ISA extension

2023-01-31 Thread Christoph Muellner
From: Christoph Müllner This patch adds support for the XTheadBs ISA extension. The patch uses the T-Head specific decoder and translation. Co-developed-by: Philipp Tomsich Co-developed-by: LIU Zhiwei Reviewed-by: Alistair Francis Signed-off-by: Christoph Müllner --- Changes in v2: - Add ISA

[PATCH v5 07/14] RISC-V: Adding T-Head multiply-accumulate instructions

2023-01-31 Thread Christoph Muellner
From: Christoph Müllner This patch adds support for the T-Head MAC instructions. The patch uses the T-Head specific decoder and translation. Co-developed-by: LIU Zhiwei Reviewed-by: Alistair Francis Signed-off-by: Christoph Müllner --- Changes in v2: - Add ISA_EXT_DATA_ENTRY() - Use single de

[PATCH v5 04/14] RISC-V: Adding XTheadBb ISA extension

2023-01-31 Thread Christoph Muellner
From: Christoph Müllner This patch adds support for the XTheadBb ISA extension. The patch uses the T-Head specific decoder and translation. Co-developed-by: Philipp Tomsich Co-developed-by: LIU Zhiwei Reviewed-by: Alistair Francis Signed-off-by: Christoph Müllner --- Changes in v2: - Add ISA

[PATCH v5 14/14] target/riscv: add a MAINTAINERS entry for XThead* extension support

2023-01-31 Thread Christoph Muellner
From: Christoph Müllner The XThead* extensions are maintained by T-Head and VRULL. Adding a point of contact from both companies. Signed-off-by: LIU Zhiwei Reviewed-by: Alistair Francis Signed-off-by: Christoph Müllner --- MAINTAINERS | 8 1 file changed, 8 insertions(+) diff --git

[PATCH v5 08/14] RISC-V: Adding T-Head MemPair extension

2023-01-31 Thread Christoph Muellner
From: Christoph Müllner This patch adds support for the T-Head MemPair instructions. The patch uses the T-Head specific decoder and translation. Co-developed-by: LIU Zhiwei Reviewed-by: Alistair Francis Reviewed-by: Richard Henderson Signed-off-by: Christoph Müllner --- Changes in v2: - Add

[PATCH v5 10/14] RISC-V: Adding T-Head FMemIdx extension

2023-01-31 Thread Christoph Muellner
From: Christoph Müllner This patch adds support for the T-Head FMemIdx instructions. The patch uses the T-Head specific decoder and translation. Co-developed-by: LIU Zhiwei Reviewed-by: Alistair Francis Signed-off-by: Christoph Müllner --- Changes in v2: - Add ISA_EXT_DATA_ENTRY() - Use singl

[PATCH v5 12/14] RISC-V: Add initial support for T-Head C906

2023-01-31 Thread Christoph Muellner
From: Christoph Müllner This patch adds the T-Head C906 to the list of known CPUs. Selecting this CPUs will automatically enable the available ISA extensions of the CPUs (incl. vendor extensions). Co-developed-by: LIU Zhiwei Reviewed-by: Alistair Francis Signed-off-by: Christoph Müllner --- C

[PATCH v5 09/14] RISC-V: Adding T-Head MemIdx extension

2023-01-31 Thread Christoph Muellner
From: Christoph Müllner This patch adds support for the T-Head MemIdx instructions. The patch uses the T-Head specific decoder and translation. Co-developed-by: LIU Zhiwei Reviewed-by: Alistair Francis Signed-off-by: Christoph Müllner --- Changes in v2: - Add ISA_EXT_DATA_ENTRY() - Use single

[PATCH v5 11/14] RISC-V: Set minimum priv version for Zfh to 1.11

2023-01-31 Thread Christoph Muellner
From: Christoph Müllner There are no differences for floating point instructions in priv version 1.11 and 1.12. There is also no dependency for Zfh to priv version 1.12. Therefore allow Zfh to be enabled for priv version 1.11. Acked-by: Alistair Francis Signed-off-by: Christoph Müllner --- ta

[PATCH v5 13/14] RISC-V: Adding XTheadFmv ISA extension

2023-01-31 Thread Christoph Muellner
From: Christoph Müllner This patch adds support for the XTheadFmv ISA extension. The patch uses the T-Head specific decoder and translation. Signed-off-by: LIU Zhiwei Reviewed-by: Alistair Francis Signed-off-by: Christoph Müllner --- target/riscv/cpu.c | 2 + target/

Re: [PATCH 00/17] audio: improve callback interface for audio frontends

2023-01-31 Thread Volker Rümelin
Am 31.01.23 um 15:53 schrieb Marc-André Lureau: Hi On Sun, Jan 15, 2023 at 5:10 PM Volker Rümelin wrote: Based-on: <3b1404eb-a7c5-f64c-3e47-1397c54c4...@t-online.de> ([PATCH 00/11] audio: more improvements) Something didn't work with patchew (https://patchew.org/QEMU/61bd351f-0683-7f58-b746-

Re: virtio-sound Google Summer of Code project?

2023-01-31 Thread Stefan Hajnoczi
On Tue, 31 Jan 2023 at 14:48, Marc-André Lureau wrote: > > Hi > > On Tue, Jan 31, 2023 at 10:20 PM Stefan Hajnoczi wrote: > > > > On Tue, 31 Jan 2023 at 12:43, Alex Bennée wrote: > > > > > > > > > Stefan Hajnoczi writes: > > > > > > > On Sun, 29 Jan 2023 at 17:10, Stefan Hajnoczi > > > > wrot

Re: [PATCH v2 1/4] block: fix detect-zeroes= with BDRV_REQ_REGISTERED_BUF

2023-01-31 Thread Eric Blake
On Mon, Jan 30, 2023 at 04:54:12PM -0500, Stefan Hajnoczi wrote: > When a write request is converted into a write zeroes request by the > detect-zeroes= feature, it is no longer associated with an I/O buffer. > The BDRV_REQ_REGISTERED_BUF flag doesn't make sense without an I/O > buffer and must be

[RFC v3 04/18] vfio/common: Introduce vfio_container_add|del_section_window()

2023-01-31 Thread Eric Auger
Introduce helper functions that isolate the code used for VFIO_SPAPR_TCE_v2_IOMMU. This code relies is IOMMU backend specific whereas the rest of the code in the callers, ie. vfio_listener_region_add|del is not. Signed-off-by: Eric Auger Signed-off-by: Yi Liu --- hw/vfio/common.c | 156

[RFC v3 01/18] scripts/update-linux-headers: Add iommufd.h

2023-01-31 Thread Eric Auger
Update the script to import iommufd.h Signed-off-by: Eric Auger Signed-off-by: Yi Liu --- scripts/update-linux-headers.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/update-linux-headers.sh b/scripts/update-linux-headers.sh index b1ad99cba8..bba3aa7f49 100755 ---

[RFC v3 08/18] vfio/container: Introduce vfio_[attach/detach]_device

2023-01-31 Thread Eric Auger
We want the VFIO devices to be able to use two different IOMMU callbacks, the legacy VFIO one and the new iommufd one. Introduce vfio_[attach/detach]_device which aim at hiding the underlying IOMMU backend (IOCTLs, datatypes, ...). Once vfio_attach_device completes, the device is attached to a se

[RFC v3 06/18] vfio/common: Rename into as.c

2023-01-31 Thread Eric Auger
From: Yi Liu As the file mostly contains code related to VFIOAddressSpaces and MemoryListeners, let's rename it into as.c Signed-off-by: Eric Auger Signed-off-by: Yi Liu --- hw/vfio/{common.c => as.c} | 0 hw/vfio/meson.build| 2 +- 2 files changed, 1 insertion(+), 1 deletion(-) rena

[RFC v3 03/18] vfio/common: Move IOMMU agnostic helpers to a separate file

2023-01-31 Thread Eric Auger
From: Yi Liu Move low-level IOMMU iommu agnostic helpers to a separate helpers.c file. They relate to regions, interrupts and device/region capabilities. Signed-off-by: Eric Auger Signed-off-by: Yi Sun Signed-off-by: Yi Liu --- include/hw/vfio/vfio-common.h | 2 + hw/vfio/common.c

[RFC v3 11/18] vfio/ccw: Use vfio_[attach/detach]_device

2023-01-31 Thread Eric Auger
Let the vfio-ccw device use vfio_attach_device() and vfio_detach_device(), hence hiding the details of the used IOMMU backend. Also now all the devices have been migrated to use the new vfio_attach_device/vfio_detach_device API, let's turn the legacy functions into static functions, local to conta

[RFC v3 05/18] vfio/common: Move legacy VFIO backend code into separate container.c

2023-01-31 Thread Eric Auger
From: Yi Liu Move all the code really dependent on the legacy VFIO container/group into a separate file: container.c. What does remain in common.c is the code related to VFIOAddressSpace and MemoryListeners. Signed-off-by: Eric Auger Signed-off-by: Yi Liu --- - vfio_group_list init before in

[RFC v3 14/18] backends/iommufd: Introduce the iommufd object

2023-01-31 Thread 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 accross several subsyst

[RFC v3 13/18] vfio/container-base: Introduce VFIOContainer reset callback

2023-01-31 Thread Eric Auger
Reset implementation depends on the container backend. Let's introduce a VFIOContainer class function and register a generic reset handler that will be able to call the right reset function depending on the container type. Also, let's move the registration/unregistration to a place that is not back

[RFC v3 02/18] linux-headers: Import vfio.h and iommufd.h

2023-01-31 Thread Eric Auger
From: Yi Liu Partial header update against the following branch: https://github.com/yiliu1765/iommufd/tree/vfio_device_cdev_v1 featuring [PATCH 00/13] Add vfio_device cdev for iommufd support This pulls header updates for kvm.h, iommufd.h and vfio.h. Signed-off-by: Yi Liu Signed-off-by: Yi Sun

[RFC v3 16/18] vfio/iommufd: Implement the iommufd backend

2023-01-31 Thread Eric Auger
From: Yi Liu Add the iommufd backend. The IOMMUFD container class is implemented based on the new /dev/iommu user API. This backend obviously depends on CONFIG_IOMMUFD. So far, the iommufd backend doesn't support live migration and cache coherency yet due to missing support in the host kernel me

[RFC v3 09/18] vfio/platform: Use vfio_[attach/detach]_device

2023-01-31 Thread Eric Auger
Let the vfio-platform device use vfio_attach_device() and vfio_detach_device(), hence hiding the details of the used IOMMU backend. Signed-off-by: Eric Auger Signed-off-by: Yi Liu --- hw/vfio/platform.c | 42 ++ 1 file changed, 2 insertions(+), 40 deletio

[RFC v3 12/18] vfio/container-base: Introduce [attach/detach]_device container callbacks

2023-01-31 Thread Eric Auger
Let's turn attach/detach_device as container callbacks. That way, their implementation can be easily customized for a given backend. For the time being, only the legacy container is supported. Signed-off-by: Eric Auger Signed-off-by: Yi Liu --- include/hw/vfio/vfio-common.h | 1 + inc

[RFC v3 17/18] vfio/iommufd: Add IOAS_COPY_DMA support

2023-01-31 Thread Eric Auger
From: Yi Liu Compared with legacy vfio container BE, one of the benefits provided by iommufd is to reduce the redundant page pinning on kernel side through the usage of IOAS_COPY_DMA. For iommufd containers within the same address space, IOVA mappings can be copied from a source container to dest

[RFC v3 10/18] vfio/ap: Use vfio_[attach/detach]_device

2023-01-31 Thread Eric Auger
Let the vfio-ap device use vfio_attach_device() and vfio_detach_device(), hence hiding the details of the used IOMMU backend. Signed-off-by: Eric Auger Signed-off-by: Yi Liu --- hw/vfio/ap.c | 62 1 file changed, 9 insertions(+), 53 deletions

[RFC v3 15/18] util/char_dev: Add open_cdev()

2023-01-31 Thread Eric Auger
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 --- MAINTAINERS | 6 include/qemu/char_dev.h | 16

Re: [PULL 10/56] x86: don't let decompressed kernel image clobber setup_data

2023-01-31 Thread H. Peter Anvin
On January 30, 2023 12:19:14 PM PST, "Michael S. Tsirkin" wrote: >From: "Jason A. Donenfeld" > >The setup_data links are appended to the compressed kernel image. Since >the kernel image is typically loaded at 0x10, setup_data lives at >`0x10 + compressed_size`, which does not get relocat

[RFC v3 00/18] vfio: Adopt iommufd

2023-01-31 Thread Eric Auger
With the introduction of iommufd, the Linux kernel provides a generic interface for userspace drivers to propagate their DMA mappings to kernel for assigned devices. This series does the porting of the VFIO devices onto the /dev/iommu uapi and let it coexist with the legacy implementation. This QE

[RFC v3 18/18] vfio/as: Allow the selection of a given iommu backend

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

[RFC v3 07/18] vfio: Add base container

2023-01-31 Thread Eric Auger
From: Yi Liu Abstract the VFIOContainer to be a base object. It is supposed to be embedded by legacy VFIO container and later on, into the new iommufd based container. The base container implements generic code such as code related to memory_listener and address space management. The VFIOContain

Re: [PATCH 0/3] util/userfaultfd: Support /dev/userfaultfd

2023-01-31 Thread Peter Xu
On Tue, Jan 31, 2023 at 08:06:55PM +, Daniel P. Berrangé wrote: > On Tue, Jan 31, 2023 at 02:48:54PM -0500, Peter Xu wrote: > > On Thu, Jan 26, 2023 at 12:26:45PM -0500, Peter Xu wrote: > > > On Thu, Jan 26, 2023 at 03:59:33PM +, Daniel P. Berrangé wrote: > > > > On Thu, Jan 26, 2023 at 10:

Re: virtio-sound Google Summer of Code project?

2023-01-31 Thread Marc-André Lureau
Hi On Wed, Feb 1, 2023 at 12:29 AM Stefan Hajnoczi wrote: > > On Tue, 31 Jan 2023 at 14:48, Marc-André Lureau > wrote: > > > > Hi > > > > On Tue, Jan 31, 2023 at 10:20 PM Stefan Hajnoczi wrote: > > > > > > On Tue, 31 Jan 2023 at 12:43, Alex Bennée wrote: > > > > > > > > > > > > Stefan Hajnoczi

Re: [PATCH v2 3/4] qemu-io: add -r option to register I/O buffer

2023-01-31 Thread Eric Blake
On Mon, Jan 30, 2023 at 04:54:14PM -0500, Stefan Hajnoczi wrote: > The blk_register_buf() API is an optimization hint that allows some > block drivers to avoid I/O buffer housekeeping or bounce buffers. > > Add an -r option to register the I/O buffer so that qemu-io can be used > to test the blk_r

Re: [PULL 10/56] x86: don't let decompressed kernel image clobber setup_data

2023-01-31 Thread Jason A. Donenfeld
On Tue, Jan 31, 2023, 15:55 H. Peter Anvin wrote: > On January 30, 2023 12:19:14 PM PST, "Michael S. Tsirkin" > wrote: > >From: "Jason A. Donenfeld" > > > >The setup_data links are appended to the compressed kernel image. Since > >the kernel image is typically loaded at 0x10, setup_data liv

Re: [PULL 10/56] x86: don't let decompressed kernel image clobber setup_data

2023-01-31 Thread Michael S. Tsirkin
On Tue, Jan 31, 2023 at 08:39:08PM +0100, Jason A. Donenfeld wrote: > On Mon, Jan 30, 2023 at 03:19:59PM -0500, Michael S. Tsirkin wrote: > > From: "Jason A. Donenfeld" > > > > The setup_data links are appended to the compressed kernel image. Since > > the kernel image is typically loaded at 0x10

Re: Emulating device configuration / max_virtqueue_pairs in vhost-vdpa and vhost-user

2023-01-31 Thread Michael S. Tsirkin
On Tue, Jan 31, 2023 at 08:11:06PM +0100, Eugenio Perez Martin wrote: > On Tue, Jan 31, 2023 at 8:10 PM Eugenio Perez Martin > wrote: > > > > Hi, > > > > The current approach of offering an emulated CVQ to the guest and map > > the commands to vhost-user is not scaling well: > > * Some devices alr

Re: virtio-sound Google Summer of Code project?

2023-01-31 Thread Stefan Hajnoczi
On Tue, 31 Jan 2023 at 16:19, Marc-André Lureau wrote: > > Hi > > On Wed, Feb 1, 2023 at 12:29 AM Stefan Hajnoczi wrote: > > > > On Tue, 31 Jan 2023 at 14:48, Marc-André Lureau > > wrote: > > > > > > Hi > > > > > > On Tue, Jan 31, 2023 at 10:20 PM Stefan Hajnoczi > > > wrote: > > > > > > > > O

[PATCH] target/hexagon/idef-parser: Remove unused code paths

2023-01-31 Thread Anton Johansson via
Removes code paths used by COF instructions, which are no longer processed by idef-parser. Signed-off-by: Anton Johansson --- target/hexagon/idef-parser/idef-parser.h| 1 - target/hexagon/idef-parser/idef-parser.lex | 27 + target/hexagon/idef-parser/idef-parser.y| 45 +

Re: [PATCH 01/18] vfio/migration: Add VFIO migration pre-copy support

2023-01-31 Thread Alex Williamson
On Tue, 31 Jan 2023 14:44:54 +0200 Avihai Horon wrote: > On 27/01/2023 1:52, Alex Williamson wrote: > > External email: Use caution opening links or attachments > > > > > > On Thu, 26 Jan 2023 20:49:31 +0200 > > Avihai Horon wrote: > > > >> Pre-copy support allows the VFIO device data to be tr

[QEMU][PATCH v5 01/10] hw/i386/xen/: move xen-mapcache.c to hw/xen/

2023-01-31 Thread Vikram Garhwal
xen-mapcache.c contains common functions which can be used for enabling Xen on aarch64 with IOREQ handling. Moving it out from hw/i386/xen to hw/xen to make it accessible for both aarch64 and x86. Signed-off-by: Vikram Garhwal Signed-off-by: Stefano Stabellini --- hw/i386/meson.build

[QEMU][PATCH v5 06/10] hw/xen/xen-hvm-common: skip ioreq creation on ioreq registration failure

2023-01-31 Thread Vikram Garhwal
From: Stefano Stabellini On ARM it is possible to have a functioning xenpv machine with only the PV backends and no IOREQ server. If the IOREQ server creation fails continue to the PV backends initialization. Also, moved the IOREQ registration and mapping subroutine to new function xen_do_ioreq_

[QEMU][PATCH v5 07/10] hw/xen/xen-hvm-common: Use g_new and error_report

2023-01-31 Thread Vikram Garhwal
Replace g_malloc with g_new and perror with error_report. Signed-off-by: Vikram Garhwal Reviewed-by: Stefano Stabellini --- hw/xen/xen-hvm-common.c | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/hw/xen/xen-hvm-common.c b/hw/xen/xen-hvm-common.c index 5e3c7b073f

[QEMU][PATCH v5 02/10] hw/i386/xen: rearrange xen_hvm_init_pc

2023-01-31 Thread Vikram Garhwal
In preparation to moving most of xen-hvm code to an arch-neutral location, move non IOREQ references to: - xen_get_vmport_regs_pfn - xen_suspend_notifier - xen_wakeup_notifier - xen_ram_init towards the end of the xen_hvm_init_pc() function. This is done to keep the common ioreq functions in one

[QEMU][PATCH v5 08/10] meson.build: do not set have_xen_pci_passthrough for aarch64 targets

2023-01-31 Thread Vikram Garhwal
From: Stefano Stabellini have_xen_pci_passthrough is only used for Xen x86 VMs. Signed-off-by: Stefano Stabellini Reviewed-by: Alex Bennée --- meson.build | 2 ++ 1 file changed, 2 insertions(+) diff --git a/meson.build b/meson.build index 6d3b665629..693802adb2 100644 --- a/meson.build +++

[QEMU][PATCH v5 05/10] include/hw/xen/xen_common: return error from xen_create_ioreq_server

2023-01-31 Thread Vikram Garhwal
From: Stefano Stabellini This is done to prepare for enabling xenpv support for ARM architecture. On ARM it is possible to have a functioning xenpv machine with only the PV backends and no IOREQ server. If the IOREQ server creation fails, continue to the PV backends initialization. Signed-off-by

[QEMU][PATCH v5 04/10] xen-hvm: reorganize xen-hvm and move common function to xen-hvm-common

2023-01-31 Thread Vikram Garhwal
From: Stefano Stabellini This patch does following: 1. creates arch_handle_ioreq() and arch_xen_set_memory(). This is done in preparation for moving most of xen-hvm code to an arch-neutral location, move the x86-specific portion of xen_set_memory to arch_xen_set_memory. Also, move han

[QEMU][PATCH v5 10/10] meson.build: enable xenpv machine build for ARM

2023-01-31 Thread Vikram Garhwal
Add CONFIG_XEN for aarch64 device to support build for ARM targets. Signed-off-by: Vikram Garhwal Signed-off-by: Stefano Stabellini Reviewed-by: Alex Bennée --- meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meson.build b/meson.build index 693802adb2..13c4ad101

[QEMU][PATCH v5 09/10] hw/arm: introduce xenpvh machine

2023-01-31 Thread Vikram Garhwal
Add a new machine xenpvh which creates a IOREQ server to register/connect with Xen Hypervisor. Optional: When CONFIG_TPM is enabled, it also creates a tpm-tis-device, adds a TPM emulator and connects to swtpm running on host machine via chardev socket and support TPM functionalities for a guest do

[QEMU][PATCH v5 03/10] hw/i386/xen/xen-hvm: move x86-specific fields out of XenIOState

2023-01-31 Thread Vikram Garhwal
From: Stefano Stabellini In preparation to moving most of xen-hvm code to an arch-neutral location, move: - shared_vmport_page - log_for_dirtybit - dirty_bitmap - suspend - wakeup out of XenIOState struct as these are only used on x86, especially the ones related to dirty logging. Updated XenIOS

[PATCH v5 12/14] Hexagon (target/hexagon) Remove gen_log_predicated_reg_write[_pair]

2023-01-31 Thread Taylor Simpson
We assign the instruction destination register to hex_new_value[num] instead of a TCG temp that gets copied back to hex_new_value[num]. Since we preload hex_new_value for predicated instructions, we don't need the check for slot_cancelled. So, we call gen_log_reg_write instead. We update the hel

[PATCH v5 06/14] Hexagon (target/hexagon) Don't set pkt_has_store_s1 when not needed

2023-01-31 Thread Taylor Simpson
The pkt_has_store_s1 field in CPUHexagonState is only needed in generated helpers for scalar load instructions. See check_noshuf and mem_load[1248] in op_helper.c. We add logic in gen_analyze_funcs.py to set need_pkt_has_store_s1 in DisasContext when it is needed at runtime. Signed-off-by: Taylo

[PATCH v5 14/14] Hexagon (target/hexagon) Improve code gen for predicated HVX instructions

2023-01-31 Thread Taylor Simpson
The following improvements are made for predicated HVX instructions During gen_commit_hvx, unconditionally move the "new" value into the dest Don't set slot_cancelled Remove runtime bookkeeping of which registers were updated Reduce the cases where gen_log_vreg_write[_pair]

[PATCH v5 05/14] Hexagon (target/hexagon) Analyze packet before generating TCG

2023-01-31 Thread Taylor Simpson
We create a new generator that creates an analyze_ function for each instruction. Currently, these functions record the writes to R, P, and C registers by calling ctx_log_reg_write[_pair] or ctx_log_pred_write. During gen_start_packet, we invoke the analyze_ function for each instruction in the p

[PATCH v5 10/14] Hexagon (tests/tcg/hexagon) Enable HVX tests

2023-01-31 Thread Taylor Simpson
Made possible by new toolchain container Signed-off-by: Taylor Simpson --- tests/tcg/hexagon/Makefile.target | 13 - 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/tests/tcg/hexagon/Makefile.target b/tests/tcg/hexagon/Makefile.target index 18e6a5969e..f753b39d91 10064

[PATCH v5 09/14] Hexagon (tests/tcg/hexagon) Remove __builtin from scatter_gather

2023-01-31 Thread Taylor Simpson
Replace __builtin_* with inline assembly The __builtin's are subject to change with different compiler releases, so might break Mark arrays as aligned when accessed as HVX vectors Clean up comments Signed-off-by: Taylor Simpson --- tests/tcg/hexagon/scatter_gather.c | 513 +++

[PATCH v5 02/14] Hexagon (target/hexagon) Add overrides for callr

2023-01-31 Thread Taylor Simpson
Add overrides for J2_callr J2_callrt J2_callrf Signed-off-by: Taylor Simpson --- target/hexagon/gen_tcg.h | 6 ++ target/hexagon/macros.h | 12 +--- target/hexagon/genptr.c | 20 3 files changed, 27 insertions(+), 11 deletions(-) diff --git a/targ

[QEMU][PATCH v5 00/10] Introduce xenpvh machine for arm architecture

2023-01-31 Thread Vikram Garhwal
MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Hi, This series add xenpvh machine for aarch64. Motivation behind creating xenpvh machine with IOREQ and TPM was to enable each guest on Xen aarch64 to have it's own unique and emulated TPM. This series does

[PATCH v5 00/14] Hexagon: COF overrides, new generator, test/bug update

2023-01-31 Thread Taylor Simpson
The idef-parser skips the change-of-flow (COF) instructions, so add overrides The new toolchain allows us to execute the HVX tests New generator enables significant improvement to TCG generation for predicated instructions by removing the need for slot_cancelled Changes in v2 Add a new

[PATCH v5 13/14] Hexagon (target/hexagon) Reduce manipulation of slot_cancelled

2023-01-31 Thread Taylor Simpson
We only need to track slot for predicated stores and predicated HVX instructions. Add arguments to the probe helper functions to indicate if the slot is predicated. Here is a simple example of the differences in the TCG code generated: IN: 0x00400094: 0xf900c102 { if (P0) R2 = and(R0,R1)

[PATCH v5 03/14] Hexagon (target/hexagon) Add overrides for endloop1/endloop01

2023-01-31 Thread Taylor Simpson
Signed-off-by: Taylor Simpson --- target/hexagon/gen_tcg.h | 4 ++ target/hexagon/genptr.c | 79 2 files changed, 83 insertions(+) diff --git a/target/hexagon/gen_tcg.h b/target/hexagon/gen_tcg.h index 9e8f3373ad..6267f51ccc 100644 --- a/target/hexagon/

[PATCH v5 08/14] Hexagon (tests/tcg/hexagon) Update preg_alias.c

2023-01-31 Thread Taylor Simpson
Add control registers (c4, c5) to clobbers list Made possible by new toolchain container Signed-off-by: Taylor Simpson --- tests/tcg/hexagon/preg_alias.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/tcg/hexagon/preg_alias.c b/tests/tcg/hexagon/preg_alias.c

[PATCH v5 11/14] Hexagon (target/hexagon) Change subtract from zero to change sign

2023-01-31 Thread Taylor Simpson
The F2_sffms instruction [r0 -= sfmpy(r1, r2)] doesn't properly handle -0. Previously we would negate the input operand by subtracting from zero. Instead, we negate by changing the sign bit. Test case added to tests/tcg/hexagon/fpstuff.c Signed-off-by: Taylor Simpson --- target/hexagon/op_hel

<    1   2   3   4   >