Re: [PATCH] vhost-vdpa: fix use-after-free in _compat_vdpa_reset

2023-10-25 Thread Si-Wei Liu
On 10/25/2023 10:26 PM, Michael S. Tsirkin wrote: On Wed, Oct 25, 2023 at 04:13:14PM -0700, Si-Wei Liu wrote: When the vhost-vdpa device is being closed, vhost_vdpa_cleanup() doesn't clean up the vqs pointer after free. This could lead to use-after-tree when _compat_vdpa_reset() tries to acce

Re: [RFC 0/7] vdpa: Add support for iommufd

2023-10-25 Thread Michael S. Tsirkin
On Thu, Oct 26, 2023 at 02:48:07PM +0800, Cindy Lu wrote: > On Thu, Oct 26, 2023 at 2:42 PM Michael S. Tsirkin wrote: > > > > On Sun, Sep 24, 2023 at 01:05:33AM +0800, Cindy Lu wrote: > > > Hi All > > > Really apologize for the delay, this is the draft RFC for > > > iommufd support for vdpa, This

Re: [RFC 0/7] vdpa: Add support for iommufd

2023-10-25 Thread Michael S. Tsirkin
On Sun, Sep 24, 2023 at 01:05:33AM +0800, Cindy Lu wrote: > Hi All > Really apologize for the delay, this is the draft RFC for > iommufd support for vdpa, This code provides the basic function > for iommufd support > > The code was tested and passed in device vdpa_sim_net > The qemu code is > ht

Re: [PATCH v3 4/5] x86/paravirt: switch mixed paravirt/alternative calls to alternative_2

2023-10-25 Thread Juergen Gross via Virtualization
On 26.10.23 04:44, kernel test robot wrote: Hello, kernel test robot noticed "BUG:unable_to_handle_page_fault_for_address" on: commit: b0b8b06548f7984351b503ec5f5c13fa80bae6a2 ("[PATCH v3 4/5] x86/paravirt: switch mixed paravirt/alternative calls to alternative_2") url: https://github.com/i

Re: [PATCH] vhost-vdpa: fix use-after-free in _compat_vdpa_reset

2023-10-25 Thread Michael S. Tsirkin
On Wed, Oct 25, 2023 at 04:13:14PM -0700, Si-Wei Liu wrote: > When the vhost-vdpa device is being closed, vhost_vdpa_cleanup() doesn't > clean up the vqs pointer after free. This could lead to use-after-tree > when _compat_vdpa_reset() tries to access the vqs that are freed already. > Fix is to set

Re: [PATCH v2] virtio_pci: Switch away from deprecated irq_set_affinity_hint

2023-10-25 Thread Xuan Zhuo
On Wed, 25 Oct 2023 16:53:19 +0200, Jakub Sitnicki wrote: > Since commit 65c7cdedeb30 ("genirq: Provide new interfaces for affinity > hints") irq_set_affinity_hint is being phased out. > > Switch to new interfaces for setting and applying irq affinity hints. > > Signed-off-by: Jakub Sitnicki Rev

Re: [PATCH v4 0/7] vdpa: decouple reset of iotlb mapping from device reset

2023-10-25 Thread Si-Wei Liu
Hi Yang Lei, Thanks for testing my patches and reporting! As for the issue, could you please try what I posted in: https://lore.kernel.org/virtualization/1698275594-19204-1-git-send-email-si-wei@oracle.com/ and let me know how it goes? Thank you very much! Thanks, -Siwei On 10/25/2023 2

[PATCH] vhost-vdpa: fix use-after-free in _compat_vdpa_reset

2023-10-25 Thread Si-Wei Liu
When the vhost-vdpa device is being closed, vhost_vdpa_cleanup() doesn't clean up the vqs pointer after free. This could lead to use-after-tree when _compat_vdpa_reset() tries to access the vqs that are freed already. Fix is to set vqs pointer to NULL at the end of vhost_vdpa_cleanup() after gettin

Re: [PATCH V1 vfio 9/9] vfio/virtio: Introduce a vfio driver over virtio devices

2023-10-25 Thread Alex Williamson
On Wed, 25 Oct 2023 17:35:51 +0300 Yishai Hadas wrote: > On 24/10/2023 22:57, Alex Williamson wrote: > > On Tue, 17 Oct 2023 16:42:17 +0300 > > Yishai Hadas wrote: > > > >> Introduce a vfio driver over virtio devices to support the legacy > >> interface functionality for VFs. > >> > >> Backgro

Re: [PATCH V1 vfio 6/9] virtio-pci: Introduce APIs to execute legacy IO admin commands

2023-10-25 Thread Michael S. Tsirkin
On Wed, Oct 25, 2023 at 05:03:55PM +0300, Yishai Hadas wrote: > > Yes - I think some kind of API will be needed to setup/cleanup. > > Then 1st call to setup would do the list/use dance? some ref counting? > > OK, we may work to come in V2 with that option in place. > > Please note that the initia

Re: [PATCH V1 vfio 9/9] vfio/virtio: Introduce a vfio driver over virtio devices

2023-10-25 Thread Michael S. Tsirkin
On Wed, Oct 25, 2023 at 05:35:51PM +0300, Yishai Hadas wrote: > > Do we want to make this only probe the correct subsystem vendor ID or do > > we want to emulate the subsystem vendor ID as well? I don't see this is > > correct without one of those options. > > Looking in the 1.x spec we can see t

[PATCH v2] virtio_pci: Switch away from deprecated irq_set_affinity_hint

2023-10-25 Thread Jakub Sitnicki via Virtualization
Since commit 65c7cdedeb30 ("genirq: Provide new interfaces for affinity hints") irq_set_affinity_hint is being phased out. Switch to new interfaces for setting and applying irq affinity hints. Signed-off-by: Jakub Sitnicki --- v2: - Leave cpumask_copy as is. We can't pass pointer to stack memor

Re: [PATCH V1 vfio 9/9] vfio/virtio: Introduce a vfio driver over virtio devices

2023-10-25 Thread Yishai Hadas via Virtualization
On 24/10/2023 22:57, Alex Williamson wrote: On Tue, 17 Oct 2023 16:42:17 +0300 Yishai Hadas wrote: Introduce a vfio driver over virtio devices to support the legacy interface functionality for VFs. Background, from the virtio spec [1]. -

Re: [PATCH V1 vfio 6/9] virtio-pci: Introduce APIs to execute legacy IO admin commands

2023-10-25 Thread Yishai Hadas via Virtualization
On 25/10/2023 16:44, Michael S. Tsirkin wrote: On Wed, Oct 25, 2023 at 04:00:43PM +0300, Yishai Hadas wrote: On 25/10/2023 13:17, Michael S. Tsirkin wrote: On Wed, Oct 25, 2023 at 12:18:32PM +0300, Yishai Hadas wrote: On 25/10/2023 0:01, Michael S. Tsirkin wrote: On Tue, Oct 17, 2023 at

Re: [PATCH v3 1/5] x86/paravirt: move some functions and defines to alternative

2023-10-25 Thread Juergen Gross via Virtualization
On 25.10.23 15:44, Borislav Petkov wrote: On Wed, Oct 25, 2023 at 03:31:07PM +0200, Juergen Gross wrote: There is #define nop() asm volatile ("nop") in arch/x86/include/asm/special_insns.h already. Then call it "nop_func" or so. Okay. It might not be needed now, but are you sure we won

Re: [PATCH v3 1/5] x86/paravirt: move some functions and defines to alternative

2023-10-25 Thread Borislav Petkov
On Wed, Oct 25, 2023 at 03:31:07PM +0200, Juergen Gross wrote: > There is > > #define nop() asm volatile ("nop") > > in arch/x86/include/asm/special_insns.h already. Then call it "nop_func" or so. > It might not be needed now, but are you sure we won't need it in future? No, I'm not. What I'm

Re: [PATCH V1 vfio 6/9] virtio-pci: Introduce APIs to execute legacy IO admin commands

2023-10-25 Thread Michael S. Tsirkin
On Wed, Oct 25, 2023 at 04:00:43PM +0300, Yishai Hadas wrote: > On 25/10/2023 13:17, Michael S. Tsirkin wrote: > > On Wed, Oct 25, 2023 at 12:18:32PM +0300, Yishai Hadas wrote: > > > On 25/10/2023 0:01, Michael S. Tsirkin wrote: > > > > > > On Tue, Oct 17, 2023 at 04:42:14PM +0300, Yishai Had

Re: [PATCH v3 1/5] x86/paravirt: move some functions and defines to alternative

2023-10-25 Thread Juergen Gross via Virtualization
On 25.10.23 12:34, Borislav Petkov wrote: On Thu, Oct 19, 2023 at 11:15:16AM +0200, Juergen Gross wrote: +/* Low-level backend functions usable from alternative code replacements. */ +DEFINE_ASM_FUNC(x86_nop, "", .entry.text); +EXPORT_SYMBOL_GPL(x86_nop); This is all x86 code so you don't real

Re: [PATCH V1 vfio 6/9] virtio-pci: Introduce APIs to execute legacy IO admin commands

2023-10-25 Thread Michael S. Tsirkin
On Wed, Oct 25, 2023 at 04:00:43PM +0300, Yishai Hadas wrote: > On 25/10/2023 13:17, Michael S. Tsirkin wrote: > > On Wed, Oct 25, 2023 at 12:18:32PM +0300, Yishai Hadas wrote: > > > On 25/10/2023 0:01, Michael S. Tsirkin wrote: > > > > > > On Tue, Oct 17, 2023 at 04:42:14PM +0300, Yishai Had

Re: [PATCH V1 vfio 6/9] virtio-pci: Introduce APIs to execute legacy IO admin commands

2023-10-25 Thread Yishai Hadas via Virtualization
On 25/10/2023 13:17, Michael S. Tsirkin wrote: On Wed, Oct 25, 2023 at 12:18:32PM +0300, Yishai Hadas wrote: On 25/10/2023 0:01, Michael S. Tsirkin wrote: On Tue, Oct 17, 2023 at 04:42:14PM +0300, Yishai Hadas wrote: Introduce APIs to execute legacy IO admin commands. I

Re: [PATCH v3 1/5] x86/paravirt: move some functions and defines to alternative

2023-10-25 Thread Borislav Petkov
On Thu, Oct 19, 2023 at 11:15:16AM +0200, Juergen Gross wrote: > +/* Low-level backend functions usable from alternative code replacements. */ > +DEFINE_ASM_FUNC(x86_nop, "", .entry.text); > +EXPORT_SYMBOL_GPL(x86_nop); This is all x86 code so you don't really need the "x86_" prefix - "nop" is per

Re: [PATCH V1 vfio 6/9] virtio-pci: Introduce APIs to execute legacy IO admin commands

2023-10-25 Thread Michael S. Tsirkin
On Wed, Oct 25, 2023 at 12:18:32PM +0300, Yishai Hadas wrote: > On 25/10/2023 0:01, Michael S. Tsirkin wrote: > > On Tue, Oct 17, 2023 at 04:42:14PM +0300, Yishai Hadas wrote: > > Introduce APIs to execute legacy IO admin commands. > > It includes: list_query/use, io_legacy_r

[PATCH v4] ALSA: virtio: use ack callback

2023-10-25 Thread Matias Ezequiel Vara Larsen
This commit uses the ack() callback to determine when a buffer has been updated, then exposes it to guest. The current mechanism splits a dma buffer into descriptors that are exposed to the device. This dma buffer is shared with the user application. When the device consumes a buffer, the driver m

Re: [PATCH V1 vfio 6/9] virtio-pci: Introduce APIs to execute legacy IO admin commands

2023-10-25 Thread Yishai Hadas via Virtualization
Re sending as previous reply was by mistake not in a text format. On 25/10/2023 0:01, Michael S. Tsirkin wrote: On Tue, Oct 17, 2023 at 04:42:14PM +0300, Yishai Hadas wrote: Introduce APIs to execute legacy IO admin commands. It includes: list_query/use, io_legacy_read/write, io_legacy_notify_

Re: [PATCH V1 vfio 6/9] virtio-pci: Introduce APIs to execute legacy IO admin commands

2023-10-25 Thread Yishai Hadas via Virtualization
On 25/10/2023 0:01, Michael S. Tsirkin wrote: On Tue, Oct 17, 2023 at 04:42:14PM +0300, Yishai Hadas wrote: Introduce APIs to execute legacy IO admin commands. It includes: list_query/use, io_legacy_read/write, io_legacy_notify_info. Those APIs will be used by the next patches from this series

RE: [PATCH V1 vfio 0/9] Introduce a vfio driver over virtio devices

2023-10-25 Thread Tian, Kevin
> From: Jason Gunthorpe > Sent: Monday, October 23, 2023 11:43 PM > > On Mon, Oct 23, 2023 at 09:33:23AM -0600, Alex Williamson wrote: > > > > Alex, > > > Are you fine to leave the provisioning of the VF including the control > > > of its transitional capability in the device hands as was sugges

Re: [PATCH v4] vsock/virtio: initialize the_virtio_vsock before using VQs

2023-10-25 Thread Stefano Garzarella
On Tue, Oct 24, 2023 at 10:17:42PM +0300, Alexandru Matei wrote: Once VQs are filled with empty buffers and we kick the host, it can send connection requests. If the_virtio_vsock is not initialized before, replies are silently dropped and do not reach the host. virtio_transport_send_pkt() can qu