Re: [PATCH v5 2/5] ACPI: Move IOMMU setup code out of IORT

2021-06-18 Thread Robin Murphy
On 2021-06-18 16:20, Jean-Philippe Brucker wrote: Extract the code that sets up the IOMMU infrastructure from IORT, since it can be reused by VIOT. Move it one level up into a new acpi_iommu_configure_id() function, which calls the IORT parsing function which in turn calls the acpi_iommu_fwspec_i

Re: [PATCH v5 1/5] ACPI: arm64: Move DMA setup operations out of IORT

2021-06-18 Thread Robin Murphy
On 2021-06-18 16:20, Jean-Philippe Brucker wrote: Extract generic DMA setup code out of IORT, so it can be reused by VIOT. Keep it in drivers/acpi/arm64 for now, since it could break x86 platforms that haven't run this code so far, if they have invalid tables. Reviewed-by: Robin Murphy Revie

Re: [PATCH v5 4/5] iommu/dma: Pass address limit rather than size to iommu_setup_dma_ops()

2021-06-18 Thread Robin Murphy
On 2021-06-18 16:20, Jean-Philippe Brucker wrote: Passing a 64-bit address width to iommu_setup_dma_ops() is valid on virtual platforms, but isn't currently possible. The overflow check in iommu_dma_init_domain() prevents this even when @dma_base isn't 0. Pass a limit address instead of a size, s

Re: [MASSMAIL KLMS] Re: [PATCH v11 11/18] virtio/vsock: dequeue callback for SOCK_SEQPACKET

2021-06-18 Thread Stefano Garzarella
On Fri, Jun 18, 2021 at 07:08:30PM +0300, Arseny Krasnov wrote: On 18.06.2021 18:55, Stefano Garzarella wrote: On Fri, Jun 18, 2021 at 06:04:37PM +0300, Arseny Krasnov wrote: On 18.06.2021 16:44, Stefano Garzarella wrote: Hi Arseny, the series looks great, I have just a question below about s

Re: [PATCH v5 3/5] ACPI: Add driver for the VIOT table

2021-06-18 Thread Rafael J. Wysocki
On Fri, Jun 18, 2021 at 5:33 PM Jean-Philippe Brucker wrote: > > The ACPI Virtual I/O Translation Table describes topology of > para-virtual platforms, similarly to vendor tables DMAR, IVRS and IORT. > For now it describes the relation between virtio-iommu and the endpoints > it manages. > > Three

Re: [PATCH v11 11/18] virtio/vsock: dequeue callback for SOCK_SEQPACKET

2021-06-18 Thread Stefano Garzarella
On Fri, Jun 18, 2021 at 06:04:37PM +0300, Arseny Krasnov wrote: On 18.06.2021 16:44, Stefano Garzarella wrote: Hi Arseny, the series looks great, I have just a question below about seqpacket_dequeue. I also sent a couple a simple fixes, it would be great if you can review them: https://lore.ke

[PATCH v5 4/5] iommu/dma: Pass address limit rather than size to iommu_setup_dma_ops()

2021-06-18 Thread Jean-Philippe Brucker
Passing a 64-bit address width to iommu_setup_dma_ops() is valid on virtual platforms, but isn't currently possible. The overflow check in iommu_dma_init_domain() prevents this even when @dma_base isn't 0. Pass a limit address instead of a size, so callers don't have to fake a size to work around t

[PATCH v5 3/5] ACPI: Add driver for the VIOT table

2021-06-18 Thread Jean-Philippe Brucker
The ACPI Virtual I/O Translation Table describes topology of para-virtual platforms, similarly to vendor tables DMAR, IVRS and IORT. For now it describes the relation between virtio-iommu and the endpoints it manages. Three steps are needed to configure DMA of endpoints: (1) acpi_viot_init(): par

[PATCH v5 5/5] iommu/virtio: Enable x86 support

2021-06-18 Thread Jean-Philippe Brucker
With the VIOT support in place, x86 platforms can now use the virtio-iommu. Because the other x86 IOMMU drivers aren't yet ready to use the acpi_dma_setup() path, x86 doesn't implement arch_setup_dma_ops() at the moment. Similarly to Vt-d and AMD IOMMU, clear the DMA ops and call iommu_setup_dma_o

[PATCH v5 2/5] ACPI: Move IOMMU setup code out of IORT

2021-06-18 Thread Jean-Philippe Brucker
Extract the code that sets up the IOMMU infrastructure from IORT, since it can be reused by VIOT. Move it one level up into a new acpi_iommu_configure_id() function, which calls the IORT parsing function which in turn calls the acpi_iommu_fwspec_init() helper. Signed-off-by: Jean-Philippe Brucker

[PATCH v5 1/5] ACPI: arm64: Move DMA setup operations out of IORT

2021-06-18 Thread Jean-Philippe Brucker
Extract generic DMA setup code out of IORT, so it can be reused by VIOT. Keep it in drivers/acpi/arm64 for now, since it could break x86 platforms that haven't run this code so far, if they have invalid tables. Reviewed-by: Eric Auger Signed-off-by: Jean-Philippe Brucker --- drivers/acpi/arm64/

[PATCH v5 0/5] Add support for ACPI VIOT

2021-06-18 Thread Jean-Philippe Brucker
Add a driver for the ACPI VIOT table, which provides topology information for para-virtual IOMMUs. Enable virtio-iommu on non-devicetree platforms, including x86. Since v4 [1]: * Fixes (comments, wrong argument, unused variable) * Removed patch 5 that wrongly moved set_dma_ops(dev, NULL) into dma-

Re: [PATCH v6 2/2] virtio-vsock: SOCK_SEQPACKET description

2021-06-18 Thread Stefano Garzarella
On Mon, May 24, 2021 at 09:34:15PM +0300, Arseny Krasnov wrote: This adds description of SOCK_SEQPACKET socket type support for virtio-vsock. Signed-off-by: Arseny Krasnov --- virtio-vsock.tex | 26 +- 1 file changed, 21 insertions(+), 5 deletions(-) diff --git a/virtio-

Re: [PATCH v6 1/2] virtio-vsock: use C style defines for constants

2021-06-18 Thread Stefano Garzarella
On Mon, May 24, 2021 at 09:33:50PM +0300, Arseny Krasnov wrote: This: 1) Replaces enums with C style "defines", because use of enums is not documented, while "defines" are widely used in spec. 2) Adds defines for some constants. Reviewed-by: Stefan Hajnoczi Signed-off-by: Arseny Krasnov --

Re: [PATCH v11 11/18] virtio/vsock: dequeue callback for SOCK_SEQPACKET

2021-06-18 Thread Stefano Garzarella
On Fri, Jun 18, 2021 at 09:51:44AM -0400, Michael S. Tsirkin wrote: On Fri, Jun 18, 2021 at 03:44:23PM +0200, Stefano Garzarella wrote: Hi Arseny, the series looks great, I have just a question below about seqpacket_dequeue. I also sent a couple a simple fixes, it would be great if you can revi

Re: [PATCH v11 11/18] virtio/vsock: dequeue callback for SOCK_SEQPACKET

2021-06-18 Thread Michael S. Tsirkin
On Fri, Jun 18, 2021 at 03:44:23PM +0200, Stefano Garzarella wrote: > Hi Arseny, > the series looks great, I have just a question below about > seqpacket_dequeue. > > I also sent a couple a simple fixes, it would be great if you can review > them: > https://lore.kernel.org/netdev/20210618133526.30

Re: [PATCH v11 00/18] virtio/vsock: introduce SOCK_SEQPACKET support

2021-06-18 Thread Michael S. Tsirkin
On Fri, Jun 11, 2021 at 09:00:13PM +, patchwork-bot+netdev...@kernel.org wrote: > Hello: > > This series was applied to netdev/net-next.git (refs/heads/master): > > On Fri, 11 Jun 2021 14:07:40 +0300 you wrote: > > This patchset implements support of SOCK_SEQPACKET for virtio > > transport.

Re: [PATCH v11 11/18] virtio/vsock: dequeue callback for SOCK_SEQPACKET

2021-06-18 Thread Stefano Garzarella
Hi Arseny, the series looks great, I have just a question below about seqpacket_dequeue. I also sent a couple a simple fixes, it would be great if you can review them: https://lore.kernel.org/netdev/20210618133526.300347-1-sgarz...@redhat.com/ On Fri, Jun 11, 2021 at 02:12:38PM +0300, Arse

[PATCH net-next 3/3] vsock/virtio: remove redundant `copy_failed` variable

2021-06-18 Thread Stefano Garzarella
When memcpy_to_msg() fails in virtio_transport_seqpacket_do_dequeue(), we already set `dequeued_len` with the negative error value returned by memcpy_to_msg(). So we can directly check `dequeued_len` value instead of using a dedicated flag variable to skip the copy path for the rest of fragments.

[PATCH net-next 2/3] vsock: rename vsock_wait_data()

2021-06-18 Thread Stefano Garzarella
vsock_wait_data() is used only by STREAM and SEQPACKET sockets, so let's rename it to vsock_connectible_wait_data(), using the same nomenclature (connectible) used in other functions after the introduction of SEQPACKET. Signed-off-by: Stefano Garzarella --- net/vmw_vsock/af_vsock.c | 14

[PATCH net-next 1/3] vsock: rename vsock_has_data()

2021-06-18 Thread Stefano Garzarella
vsock_has_data() is used only by STREAM and SEQPACKET sockets, so let's rename it to vsock_connectible_has_data(), using the same nomenclature (connectible) used in other functions after the introduction of SEQPACKET. Signed-off-by: Stefano Garzarella --- net/vmw_vsock/af_vsock.c | 4 ++-- 1 fil

[PATCH net-next 0/3] vsock: small fixes for seqpacket support

2021-06-18 Thread Stefano Garzarella
This series contains few patches to clean up a bit the code of seqpacket recently merged in the net-next tree. No functionality changes. Signed-off-by: Stefano Garzarella Stefano Garzarella (3): vsock: rename vsock_has_data() vsock: rename vsock_wait_data() vsock/virtio: remove redundant

Re: [PATCH] virtio_net: Enable MSI-X vector for ctrl queue

2021-06-18 Thread Michael S. Tsirkin
On Fri, Jun 18, 2021 at 04:26:25PM +0900, Keiichi Watanabe wrote: > When we use vhost-user backend on the host, MSI-X vector should be set > so that the vmm can get an irq FD and send it to the backend device > process with vhost-user protocol. > Since whether the vector is set for a queue is deter

[PATCH v7 0/2] x86/sev: Fixes for SEV-ES Guest Support

2021-06-18 Thread Joerg Roedel
From: Joerg Roedel Hi, please find here the next iteration of my pending fixes for SEV-ES guest support in Linux. This version addresses the comments I received from Peter on the previous version, in particular: - Removed IRQ disable/enable calls in the ap-hlt loop code - Made _

[PATCH v7 2/2] x86/sev: Split up runtime #VC handler for correct state tracking

2021-06-18 Thread Joerg Roedel
From: Joerg Roedel Split up the #VC handler code into a from-user and a from-kernel part. This allows clean and correct state tracking, as the #VC handler needs to enter NMI-state when raised from kernel mode and plain IRQ state when raised from user-mode. Fixes: 62441a1fb532 ("x86/sev-es: Corre

[PATCH v7 1/2] x86/sev: Make sure IRQs are disabled while GHCB is active

2021-06-18 Thread Joerg Roedel
From: Joerg Roedel The #VC handler only cares about IRQs being disabled while the GHCB is active, as it must not be interrupted by something which could cause another #VC while it holds the GHCB (NMI is the exception for which the backup GHCB exits). Make sure nothing interrupts the code path wh

Re: [PATCH v4 5/6] iommu/dma: Simplify calls to iommu_setup_dma_ops()

2021-06-18 Thread Robin Murphy
On 2021-06-18 11:50, Jean-Philippe Brucker wrote: On Wed, Jun 16, 2021 at 06:02:39PM +0100, Robin Murphy wrote: diff --git a/drivers/iommu/dma-iommu.c b/drivers/iommu/dma-iommu.c index c62e19bed302..175f8eaeb5b3 100644 --- a/drivers/iommu/dma-iommu.c +++ b/drivers/iommu/dma-iommu.c @@ -1322,7 +1

Re: [PATCH v6 1/2] x86/sev: Make sure IRQs are disabled while GHCB is active

2021-06-18 Thread Peter Zijlstra
On Fri, Jun 18, 2021 at 10:17:54AM +0200, Joerg Roedel wrote: > On Thu, Jun 17, 2021 at 05:38:46PM +0200, Peter Zijlstra wrote: > > I'm getting (with all of v6.1 applied): > > > > vmlinux.o: warning: objtool: __sev_es_nmi_complete()+0x1bf: call to panic() > > leaves .noinstr.text section > > > >

Re: [PATCH v4 5/6] iommu/dma: Simplify calls to iommu_setup_dma_ops()

2021-06-18 Thread Jean-Philippe Brucker
On Wed, Jun 16, 2021 at 06:02:39PM +0100, Robin Murphy wrote: > > diff --git a/drivers/iommu/dma-iommu.c b/drivers/iommu/dma-iommu.c > > index c62e19bed302..175f8eaeb5b3 100644 > > --- a/drivers/iommu/dma-iommu.c > > +++ b/drivers/iommu/dma-iommu.c > > @@ -1322,7 +1322,9 @@ void iommu_setup_dma_ops

Re: [RFC v1 3/6] vhost/vsock: add support for vhost dgram.

2021-06-18 Thread Stefano Garzarella
We should use le16_to_cpu when accessing pkt->hdr fields. On Wed, Jun 09, 2021 at 11:24:55PM +, Jiang Wang wrote: This patch supports dgram on vhost side, including tx and rx. The vhost send packets asynchronously. Signed-off-by: Jiang Wang --- drivers/vhost/vsock.c | 199 +

Re: [RFC v1 2/6] virtio/vsock: add support for virtio datagram

2021-06-18 Thread Stefano Garzarella
On Wed, Jun 09, 2021 at 11:24:54PM +, Jiang Wang wrote: This patch add support for virtio dgram for the driver. Implemented related functions for tx and rx, enqueue and dequeue. Send packets synchronously to give sender indication when the virtqueue is full. Refactored virtio_transport_send_p

Re: [RFC v1 6/6] virtio/vsock: add sysfs for rx buf len for dgram

2021-06-18 Thread Stefano Garzarella
On Wed, Jun 09, 2021 at 11:24:58PM +, Jiang Wang wrote: Make rx buf len configurable via sysfs Signed-off-by: Jiang Wang --- net/vmw_vsock/virtio_transport.c | 37 +++-- 1 file changed, 35 insertions(+), 2 deletions(-) diff --git a/net/vmw_vsock/virtio_transp

Re: [RFC v1 5/6] vhost/vsock: add kconfig for vhost dgram support

2021-06-18 Thread Stefano Garzarella
On Wed, Jun 09, 2021 at 11:24:57PM +, Jiang Wang wrote: Also change number of vqs according to the config Signed-off-by: Jiang Wang --- drivers/vhost/Kconfig | 8 drivers/vhost/vsock.c | 11 --- 2 files changed, 16 insertions(+), 3 deletions(-) As we already discussed, I t

Re: [RFC v1 2/6] virtio/vsock: add support for virtio datagram

2021-06-18 Thread Stefano Garzarella
On Wed, Jun 09, 2021 at 11:24:54PM +, Jiang Wang wrote: This patch add support for virtio dgram for the driver. Implemented related functions for tx and rx, enqueue and dequeue. Send packets synchronously to give sender indication when the virtqueue is full. Refactored virtio_transport_send_p

Re: [RFC v1 1/6] virtio/vsock: add VIRTIO_VSOCK_F_DGRAM feature bit

2021-06-18 Thread Stefano Garzarella
On Wed, Jun 09, 2021 at 11:24:53PM +, Jiang Wang wrote: When this feature is enabled, allocate 5 queues, otherwise, allocate 3 queues to be compatible with old QEMU versions. Signed-off-by: Jiang Wang --- drivers/vhost/vsock.c | 3 +- include/linux/virtio_vsock.h | 9 +

Re: [RFC v1 0/6] virtio/vsock: introduce SOCK_DGRAM support

2021-06-18 Thread Stefano Garzarella
On Wed, Jun 09, 2021 at 11:24:52PM +, Jiang Wang wrote: This patchset implements support of SOCK_DGRAM for virtio transport. Datagram sockets are connectionless and unreliable. To avoid unfair contention with stream and other sockets, add two more virtqueues and a new feature bit to indicate

Re: [PATCH v4 4/6] iommu/dma: Pass address limit rather than size to iommu_setup_dma_ops()

2021-06-18 Thread Jean-Philippe Brucker
On Wed, Jun 16, 2021 at 05:28:59PM +0200, Eric Auger wrote: > Hi Jean, > > On 6/10/21 9:51 AM, Jean-Philippe Brucker wrote: > > diff --git a/arch/arm64/mm/dma-mapping.c b/arch/arm64/mm/dma-mapping.c > > index 4bf1dd3eb041..7bd1d2199141 100644 > > --- a/arch/arm64/mm/dma-mapping.c > > +++ b/arch/ar

Re: [PATCH v4 2/6] ACPI: Move IOMMU setup code out of IORT

2021-06-18 Thread Robin Murphy
On 2021-06-18 08:41, Jean-Philippe Brucker wrote: Hi Eric, On Wed, Jun 16, 2021 at 11:35:13AM +0200, Eric Auger wrote: -const struct iommu_ops *iort_iommu_configure_id(struct device *dev, - const u32 *id_in) +int iort_iommu_configure_id(struct devic

Re: [PATCH V3 1/3] gpio: Add virtio-gpio driver

2021-06-18 Thread Linus Walleij
On Wed, Jun 16, 2021 at 5:52 PM Enrico Weigelt, metux IT consult wrote: > On 16.06.21 05:30, Bjorn Andersson wrote: > > > Combined with the virtio-i2c effort this could provide an alternative by > > simply tunneling the busses and GPIOs into Linux and use standard iio > > drivers, for cases where

[PATCH] eventfd: Enlarge recursion limit to allow vhost to work

2021-06-18 Thread He Zhe
commit b5e683d5cab8 ("eventfd: track eventfd_signal() recursion depth") introduces a percpu counter that tracks the percpu recursion depth and warn if it greater than zero, to avoid potential deadlock and stack overflow. However sometimes different eventfds may be used in parallel. Specifically, w

Re: [PATCH v8 03/10] eventfd: Increase the recursion depth of eventfd_signal()

2021-06-18 Thread He Zhe
On 6/18/21 11:29 AM, Yongji Xie wrote: > On Thu, Jun 17, 2021 at 4:34 PM He Zhe wrote: >> >> >> On 6/15/21 10:13 PM, Xie Yongji wrote: >>> Increase the recursion depth of eventfd_signal() to 1. This >>> is the maximum recursion depth we have found so far, which >>> can be triggered with the fol

Re: [PATCH v6 1/2] x86/sev: Make sure IRQs are disabled while GHCB is active

2021-06-18 Thread Joerg Roedel
On Thu, Jun 17, 2021 at 05:00:48PM +0200, Peter Zijlstra wrote: > I think this is broken, at this point RCU is quite dead on this CPU and > local_irq_save/restore include tracing and all sorts. > > Also, shouldn't IRQs already be disabled by the time we get here? Yes it is, I removed these calls,

Re: [PATCH v6 1/2] x86/sev: Make sure IRQs are disabled while GHCB is active

2021-06-18 Thread Joerg Roedel
On Thu, Jun 17, 2021 at 05:38:46PM +0200, Peter Zijlstra wrote: > I'm getting (with all of v6.1 applied): > > vmlinux.o: warning: objtool: __sev_es_nmi_complete()+0x1bf: call to panic() > leaves .noinstr.text section > > $ ./scripts/faddr2line defconfig-build/vmlinux __sev_es_nmi_complete+0x1bf

Re: [PATCH v4 3/6] ACPI: Add driver for the VIOT table

2021-06-18 Thread Jean-Philippe Brucker
On Thu, Jun 17, 2021 at 01:50:59PM +0200, Rafael J. Wysocki wrote: > > diff --git a/drivers/acpi/bus.c b/drivers/acpi/bus.c > > index be7da23fad76..b835ca702ff0 100644 > > --- a/drivers/acpi/bus.c > > +++ b/drivers/acpi/bus.c > > @@ -27,6 +27,7 @@ > > #include > > #endif > > #include > > +#inc

Re: [PATCH v4 3/6] ACPI: Add driver for the VIOT table

2021-06-18 Thread Jean-Philippe Brucker
On Wed, Jun 16, 2021 at 03:26:08PM +0200, Eric Auger wrote: > > + default: > > + pr_warn("Unsupported node %x\n", hdr->type); > > + ret = 0; > > + goto err_free; > > + } > > + > > + /* > > +* To be compatible with future versions of the table which may includ

Re: [PATCH v4 2/6] ACPI: Move IOMMU setup code out of IORT

2021-06-18 Thread Jean-Philippe Brucker
Hi Eric, On Wed, Jun 16, 2021 at 11:35:13AM +0200, Eric Auger wrote: > > -const struct iommu_ops *iort_iommu_configure_id(struct device *dev, > > - const u32 *id_in) > > +int iort_iommu_configure_id(struct device *dev, const u32 *id_in) > > { > > stru

Re: [PATCH] vhost-vdpa: fix bug-"v->vqs" and "v" don't free

2021-06-18 Thread Jason Wang
在 2021/6/18 下午2:53, Cai Huoqing 写道: "v->vqs" and "v" don't free when "cdev_device_add" returns error Signed-off-by: Cai Huoqing --- drivers/vhost/vdpa.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/vhost/vdpa.c b/drivers/vhost/vdpa.c index fb41db3da611..6e5d5df5ee70 100644