Re: [RFC PATCH v6 04/22] af_vsock: implement SEQPACKET receive loop

2021-03-12 Thread Stefano Garzarella
On Sun, Mar 07, 2021 at 08:59:45PM +0300, Arseny Krasnov wrote: This adds receive loop for SEQPACKET. It looks like receive loop for STREAM, but there is a little bit difference: 1) It doesn't call notify callbacks. 2) It doesn't care about 'SO_SNDLOWAT' and 'SO_RCVLOWAT' values, because there

Re: [RFC PATCH v6 08/22] af_vsock: update comments for stream sockets

2021-03-12 Thread Stefano Garzarella
On Sun, Mar 07, 2021 at 09:01:05PM +0300, Arseny Krasnov wrote: This replaces 'stream' to 'connection oriented' in comments as SEQPACKET is also connection oriented. Signed-off-by: Arseny Krasnov --- net/vmw_vsock/af_vsock.c | 31 +-- 1 file changed, 17

Re: [RFC PATCH v6 07/22] af_vsock: rest of SEQPACKET support

2021-03-12 Thread Stefano Garzarella
On Sun, Mar 07, 2021 at 09:00:47PM +0300, Arseny Krasnov wrote: This does rest of SOCK_SEQPACKET support: 1) Adds socket ops for SEQPACKET type. 2) Allows to create socket with SEQPACKET type. Signed-off-by: Arseny Krasnov --- include/net/af_vsock.h | 1 + net/vmw_vsock/af_vsock.c | 36

[PATCH] vhost: Fix vhost_vq_reset()

2021-03-12 Thread Laurent Vivier
vhost_reset_is_le() is vhost_init_is_le(), and in the case of cross-endian legacy, vhost_init_is_le() depends on vq->user_be. vq->user_be is set by vhost_disable_cross_endian(). But in vhost_vq_reset(), we have: vhost_reset_is_le(vq); vhost_disable_cross_endian(vq); And so user_be is

Re: [RFC PATCH v6 04/22] af_vsock: implement SEQPACKET receive loop

2021-03-12 Thread Stefano Garzarella
On Sun, Mar 07, 2021 at 08:59:45PM +0300, Arseny Krasnov wrote: This adds receive loop for SEQPACKET. It looks like receive loop for STREAM, but there is a little bit difference: 1) It doesn't call notify callbacks. 2) It doesn't care about 'SO_SNDLOWAT' and 'SO_RCVLOWAT' values, because there

Re: [RFC PATCH v6 10/22] virtio/vsock: simplify credit update function API

2021-03-12 Thread Stefano Garzarella
On Sun, Mar 07, 2021 at 09:01:44PM +0300, Arseny Krasnov wrote: This function is static and 'hdr' arg was always NULL. Signed-off-by: Arseny Krasnov --- net/vmw_vsock/virtio_transport_common.c | 7 +++ 1 file changed, 3 insertions(+), 4 deletions(-) Reviewed-by: Stefano Garzarella

Re: [RFC PATCH v6 02/22] af_vsock: separate wait data loop

2021-03-12 Thread Stefano Garzarella
On Sun, Mar 07, 2021 at 08:59:01PM +0300, Arseny Krasnov wrote: This moves wait loop for data to dedicated function, because later it will be used by SEQPACKET data receive loop. While moving the code around, let's update an old comment. Signed-off-by: Arseny Krasnov ---

Re: [RFC PATCH v6 06/22] af_vsock: implement send logic for SEQPACKET

2021-03-12 Thread Stefano Garzarella
On Sun, Mar 07, 2021 at 09:00:26PM +0300, Arseny Krasnov wrote: This adds some logic to current stream enqueue function for SEQPACKET support: 1) Use transport's seqpacket enqueue callback. 2) Return value from enqueue function is whole record length or error for SOCK_SEQPACKET.

Re: [RFC PATCH v6 09/22] virtio/vsock: set packet's type in virtio_transport_send_pkt_info()

2021-03-12 Thread Stefano Garzarella
On Sun, Mar 07, 2021 at 09:01:22PM +0300, Arseny Krasnov wrote: This moves passing type of packet from 'info' structure to 'virtio_ transport_send_pkt_info()' function. There is no need to set type of packet which differs from type of socket. Since at current time only stream type is supported,

Re: [PATCH 14/17] iommu: remove DOMAIN_ATTR_DMA_USE_FLUSH_QUEUE

2021-03-12 Thread Robin Murphy
On 2021-03-11 08:26, Christoph Hellwig wrote: On Wed, Mar 10, 2021 at 06:39:57PM +, Robin Murphy wrote: Actually... Just mirroring the iommu_dma_strict value into struct iommu_domain should solve all of that with very little boilerplate code. Yes, my initial thought was to directly

Re: [RFC PATCH v6 01/22] af_vsock: update functions for connectible socket

2021-03-12 Thread Stefano Garzarella
On Sun, Mar 07, 2021 at 08:58:39PM +0300, Arseny Krasnov wrote: This prepares af_vsock.c for SEQPACKET support: some functions such as setsockopt(), getsockopt(), connect(), recvmsg(), sendmsg() are shared between both types of sockets, so rename them in general manner. Signed-off-by: Arseny

Re: [RFC PATCH v6 12/22] virtio/vsock: fetch length for SEQPACKET record

2021-03-12 Thread Stefano Garzarella
On Sun, Mar 07, 2021 at 09:02:31PM +0300, Arseny Krasnov wrote: This adds transport callback which tries to fetch record begin marker from socket's rx queue. It is called from af_vsock.c before reading data packets of record. Signed-off-by: Arseny Krasnov --- include/linux/virtio_vsock.h

Re: [PATCH v7] i2c: virtio: add a virtio i2c frontend driver

2021-03-12 Thread Jie Deng
On 2021/3/12 16:11, Viresh Kumar wrote: On 12-03-21, 15:51, Jie Deng wrote: On 2021/3/12 14:10, Viresh Kumar wrote: I saw your email about wrong version being sent, I already wrote some reviews. Sending them anyway for FWIW :) On 12-03-21, 21:33, Jie Deng wrote: +struct virtio_i2c { +

Re: [PATCH v7] i2c: virtio: add a virtio i2c frontend driver

2021-03-12 Thread Arnd Bergmann
On Fri, Mar 12, 2021 at 2:33 PM Jie Deng wrote: > + > +/** > + * struct virtio_i2c_req - the virtio I2C request structure > + * @out_hdr: the OUT header of the virtio I2C message > + * @buf: the buffer into which data is read, or from which it's written > + * @in_hdr: the IN header of the virtio

Re: linux-next: Tree for Mar 11 [drivers/vdpa/virtio_pci/vp_vdpa.ko]

2021-03-12 Thread Jason Wang
On 2021/3/12 2:18 上午, Randy Dunlap wrote: On 3/10/21 9:14 PM, Stephen Rothwell wrote: Hi all, Warning: Some of the branches in linux-next are still based on v5.12-rc1, so please be careful if you are trying to bisect a bug. News: if your -next included tree is based on Linus' tree tag

[PATCH v3 1/8] x86/boot/compressed/64: Cleanup exception handling before booting kernel

2021-03-12 Thread Joerg Roedel
From: Joerg Roedel Disable the exception handling before booting the kernel to make sure any exceptions that happen during early kernel boot are not directed to the pre-decompression code. Signed-off-by: Joerg Roedel --- arch/x86/boot/compressed/idt_64.c | 14 ++

[PATCH v3 3/8] x86/boot/compressed/64: Reload CS in startup_32

2021-03-12 Thread Joerg Roedel
From: Joerg Roedel Exception handling in the startup_32 boot path requires the CS selector to be correctly set up. Reload it from the current GDT. Signed-off-by: Joerg Roedel --- arch/x86/boot/compressed/head_64.S | 9 - 1 file changed, 8 insertions(+), 1 deletion(-) diff --git

[PATCH v3 6/8] x86/boot/compressed/64: Add CPUID sanity check to 32-bit boot-path

2021-03-12 Thread Joerg Roedel
From: Joerg Roedel The 32-bit #VC handler has no GHCB and can only handle CPUID exit codes. It is needed by the early boot code to handle #VC exceptions raised in verify_cpu() and to get the position of the C bit. But the CPUID information comes from the hypervisor, which is untrusted and might

[PATCH v3 0/8] x86/seves: Support 32-bit boot path and other updates

2021-03-12 Thread Joerg Roedel
From: Joerg Roedel Hi, these patches add support for the 32-bit boot in the decompressor code. This is needed to boot an SEV-ES guest on some firmware and grub versions. The patches also add the necessary CPUID sanity checks and a 32-bit version of the C-bit check. Other updates included here:

[PATCH v3 2/8] x86/sev: Do not require Hypervisor CPUID bit for SEV guests

2021-03-12 Thread Joerg Roedel
From: Joerg Roedel A malicious hypervisor could disable the CPUID intercept for an SEV or SEV-ES guest and trick it into the no-SEV boot path, where it could potentially reveal secrets. This is not an issue for SEV-SNP guests, as the CPUID intercept can't be disabled for those. Remove the

[PATCH v3 5/8] x86/boot/compressed/64: Add 32-bit boot #VC handler

2021-03-12 Thread Joerg Roedel
From: Joerg Roedel Add a #VC exception handler which is used when the kernel still executes in protected mode. This boot-path already uses CPUID, which will cause #VC exceptions in an SEV-ES guest. Signed-off-by: Joerg Roedel --- arch/x86/boot/compressed/head_64.S | 6 ++

[PATCH v3 7/8] x86/boot/compressed/64: Check SEV encryption in 32-bit boot-path

2021-03-12 Thread Joerg Roedel
From: Joerg Roedel Check whether the hypervisor reported the correct C-bit when running as an SEV guest. Using a wrong C-bit position could be used to leak sensitive data from the guest to the hypervisor. Signed-off-by: Joerg Roedel --- arch/x86/boot/compressed/head_64.S | 83

[PATCH v3 4/8] x86/boot/compressed/64: Setup IDT in startup_32 boot path

2021-03-12 Thread Joerg Roedel
From: Joerg Roedel This boot path needs exception handling when it is used with SEV-ES. Setup an IDT and provide a helper function to write IDT entries for use in 32-bit protected mode. Signed-off-by: Joerg Roedel --- arch/x86/boot/compressed/head_64.S | 72 ++ 1

[PATCH v3 8/8] x86/sev-es: Replace open-coded hlt-loops with sev_es_terminate()

2021-03-12 Thread Joerg Roedel
From: Joerg Roedel There are a few places left in the SEV-ES C code where hlt loops and/or terminate requests are implemented. Replace them all with calls to sev_es_terminate(). Signed-off-by: Joerg Roedel --- arch/x86/boot/compressed/sev-es.c | 12 +++-