Re: [PATCH] s390: protvirt: virtio: Refuse device without IOMMU

2020-06-10 Thread Jason Wang
On 2020/6/10 下午9:11, Pierre Morel wrote: Protected Virtualisation protects the memory of the guest and do not allow a the host to access all of its memory. Let's refuse a VIRTIO device which does not use IOMMU protected access. Signed-off-by: Pierre Morel ---

Re: [PATCH RFC v6 02/11] vhost: use batched get_vq_desc version

2020-06-10 Thread Jason Wang
On 2020/6/10 下午7:05, Michael S. Tsirkin wrote: +EXPORT_SYMBOL_GPL(vhost_get_vq_desc); /* Reverse the effect of vhost_get_vq_desc. Useful for error handling. */ void vhost_discard_vq_desc(struct vhost_virtqueue *vq, int n) { + unfetch_descs(vq); vq->last_avail_idx -= n;

Re: [PATCH V3] vdpa: introduce virtio pci driver

2020-06-10 Thread Jason Wang
On 2020/6/10 下午4:51, Michael S. Tsirkin wrote: On Wed, Jun 10, 2020 at 04:25:06PM +0800, Jason Wang wrote: + +#define VP_VDPA_FEATURES \ + ((1ULL << VIRTIO_F_ANY_LAYOUT)| \ This is presumably for transitional devices only. In fact looking at code it seems that only

Re: [GIT PULL] virtio: features, fixes

2020-06-10 Thread pr-tracker-bot
The pull request you sent on Wed, 10 Jun 2020 00:44:55 -0400: > https://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost.git tags/for_linus has been merged into torvalds/linux.git: https://git.kernel.org/torvalds/c/09102704c67457c6cdea6c0394c34843484a852c Thank you! -- Deet-doot-dot, I am a

Re: [GIT PULL] virtio: features, fixes

2020-06-10 Thread Linus Torvalds
On Tue, Jun 9, 2020 at 9:45 PM Michael S. Tsirkin wrote: > > I also upgraded the machine I used to sign > the tag (didn't change the key) - hope the signature is still ok. If not > pls let me know! All looks normal as far as I can tell, Linus

Re: [PATCH] s390: protvirt: virtio: Refuse device without IOMMU

2020-06-10 Thread Halil Pasic
On Wed, 10 Jun 2020 15:11:51 +0200 Pierre Morel wrote: > Protected Virtualisation protects the memory of the guest and > do not allow a the host to access all of its memory. > > Let's refuse a VIRTIO device which does not use IOMMU > protected access. > Should we ever get a virtio-ccw device

Re: [PATCH] s390: protvirt: virtio: Refuse device without IOMMU

2020-06-10 Thread Pierre Morel
On 2020-06-10 16:53, Cornelia Huck wrote: On Wed, 10 Jun 2020 16:37:55 +0200 Pierre Morel wrote: On 2020-06-10 15:24, Cornelia Huck wrote: On Wed, 10 Jun 2020 15:11:51 +0200 Pierre Morel wrote: Protected Virtualisation protects the memory of the guest and do not allow a the host to

Re: [PATCH RFC v7 03/14] vhost: use batched get_vq_desc version

2020-06-10 Thread Michael S. Tsirkin
On Wed, Jun 10, 2020 at 02:37:50PM +0200, Eugenio Perez Martin wrote: > > +/* This function returns a value > 0 if a descriptor was found, or 0 if > > none were found. > > + * A negative code is returned on error. */ > > +static int fetch_descs(struct vhost_virtqueue *vq) > > +{ > > + int

Re: [PATCH RFC v7 03/14] vhost: use batched get_vq_desc version

2020-06-10 Thread Michael S. Tsirkin
On Wed, Jun 10, 2020 at 04:29:29PM +0200, Eugenio Pérez wrote: > On Wed, 2020-06-10 at 07:36 -0400, Michael S. Tsirkin wrote: > > As testing shows no performance change, switch to that now. > > > > Signed-off-by: Michael S. Tsirkin > > Signed-off-by: Eugenio Pérez > > Link:

Re: [PATCH] s390: protvirt: virtio: Refuse device without IOMMU

2020-06-10 Thread Cornelia Huck
On Wed, 10 Jun 2020 16:37:55 +0200 Pierre Morel wrote: > On 2020-06-10 15:24, Cornelia Huck wrote: > > On Wed, 10 Jun 2020 15:11:51 +0200 > > Pierre Morel wrote: > > > >> Protected Virtualisation protects the memory of the guest and > >> do not allow a the host to access all of its memory. >

Re: [PATCH] s390: protvirt: virtio: Refuse device without IOMMU

2020-06-10 Thread Pierre Morel
On 2020-06-10 15:24, Cornelia Huck wrote: On Wed, 10 Jun 2020 15:11:51 +0200 Pierre Morel wrote: Protected Virtualisation protects the memory of the guest and do not allow a the host to access all of its memory. Let's refuse a VIRTIO device which does not use IOMMU protected access.

Re: [PATCH] s390: protvirt: virtio: Refuse device without IOMMU

2020-06-10 Thread Cornelia Huck
On Wed, 10 Jun 2020 15:11:51 +0200 Pierre Morel wrote: > Protected Virtualisation protects the memory of the guest and > do not allow a the host to access all of its memory. > > Let's refuse a VIRTIO device which does not use IOMMU > protected access. > > Signed-off-by: Pierre Morel > --- >

[PATCH] s390: protvirt: virtio: Refuse device without IOMMU

2020-06-10 Thread Pierre Morel
Protected Virtualisation protects the memory of the guest and do not allow a the host to access all of its memory. Let's refuse a VIRTIO device which does not use IOMMU protected access. Signed-off-by: Pierre Morel --- drivers/s390/virtio/virtio_ccw.c | 5 + 1 file changed, 5 insertions(+)

[PATCH RFC v7 02/14] fixup! vhost: option to fetch descriptors through an independent struct

2020-06-10 Thread Michael S. Tsirkin
--- drivers/vhost/vhost.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/vhost/vhost.c b/drivers/vhost/vhost.c index 180b7b58c76b..11433d709651 100644 --- a/drivers/vhost/vhost.c +++ b/drivers/vhost/vhost.c @@ -2614,7 +2614,7 @@ int vhost_get_vq_desc_batch(struct

[PATCH RFC v7 12/14] vhost/scsi: switch to buf APIs

2020-06-10 Thread Michael S. Tsirkin
Switch to buf APIs. Doing this exposes a spec violation in vhost scsi: all used bufs are marked with length 0. Fix that is left for another day. Signed-off-by: Michael S. Tsirkin --- drivers/vhost/scsi.c | 73 ++-- 1 file changed, 44 insertions(+), 29

[PATCH RFC v7 09/14] vhost/net: convert to new API: heads->bufs

2020-06-10 Thread Michael S. Tsirkin
Convert vhost net to use the new format-agnostic API. In particular, don't poke at vq internals such as the heads array. Signed-off-by: Michael S. Tsirkin --- drivers/vhost/net.c | 154 +++- 1 file changed, 82 insertions(+), 72 deletions(-) diff --git

[PATCH RFC v7 14/14] vhost: drop head based APIs

2020-06-10 Thread Michael S. Tsirkin
Everyone's using buf APIs, no need for head based ones anymore. Signed-off-by: Michael S. Tsirkin --- drivers/vhost/vhost.c | 64 ++- drivers/vhost/vhost.h | 12 2 files changed, 8 insertions(+), 68 deletions(-) diff --git

[PATCH RFC v7 03/14] vhost: use batched get_vq_desc version

2020-06-10 Thread Michael S. Tsirkin
As testing shows no performance change, switch to that now. Signed-off-by: Michael S. Tsirkin Signed-off-by: Eugenio Pérez Link: https://lore.kernel.org/r/20200401183118.8334-3-epere...@redhat.com Signed-off-by: Michael S. Tsirkin --- drivers/vhost/test.c | 2 +- drivers/vhost/vhost.c |

[PATCH RFC v7 00/14] vhost: ring format independence

2020-06-10 Thread Michael S. Tsirkin
This intentionally leaves "fixup" changes separate - hopefully that is enough to fix vhost-net crashes reported here, but it helps me keep track of what changed. I will naturally squash them later when we are done. This adds infrastructure required for supporting multiple ring formats. The idea

[PATCH RFC v7 13/14] vhost/vsock: switch to the buf API

2020-06-10 Thread Michael S. Tsirkin
A straight-forward conversion. Signed-off-by: Michael S. Tsirkin --- drivers/vhost/vsock.c | 30 ++ 1 file changed, 18 insertions(+), 12 deletions(-) diff --git a/drivers/vhost/vsock.c b/drivers/vhost/vsock.c index a483cec31d5c..61c6d3dd2ae3 100644 ---

[PATCH RFC v7 04/14] vhost/net: pass net specific struct pointer

2020-06-10 Thread Michael S. Tsirkin
In preparation for further cleanup, pass net specific pointer to ubuf callbacks so we can move net specific fields out to net structures. Signed-off-by: Michael S. Tsirkin --- drivers/vhost/net.c | 14 +++--- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git

[PATCH RFC v7 10/14] vhost/net: avoid iov length math

2020-06-10 Thread Michael S. Tsirkin
Now that API exposes buffer length, we no longer need to scan IOVs to figure it out. Signed-off-by: Michael S. Tsirkin --- drivers/vhost/net.c | 8 +++- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/drivers/vhost/net.c b/drivers/vhost/net.c index 830fe84912a5..0b509be8d7b1

[PATCH RFC v7 06/14] vhost: format-independent API for used buffers

2020-06-10 Thread Michael S. Tsirkin
Add a new API that doesn't assume used ring, heads, etc. For now, we keep the old APIs around to make it easier to convert drivers. Signed-off-by: Michael S. Tsirkin --- drivers/vhost/vhost.c | 52 ++- drivers/vhost/vhost.h | 17 +- 2 files

[PATCH RFC v7 07/14] fixup! vhost: format-independent API for used buffers

2020-06-10 Thread Michael S. Tsirkin
--- drivers/vhost/vhost.c | 23 ++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/drivers/vhost/vhost.c b/drivers/vhost/vhost.c index e5763d81bf0f..7a587b13095c 100644 --- a/drivers/vhost/vhost.c +++ b/drivers/vhost/vhost.c @@ -2421,7 +2421,7 @@ int

[PATCH RFC v7 11/14] vhost/test: convert to the buf API

2020-06-10 Thread Michael S. Tsirkin
Signed-off-by: Michael S. Tsirkin --- drivers/vhost/test.c | 20 +++- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/drivers/vhost/test.c b/drivers/vhost/test.c index 7d69778aaa26..12304eb8da15 100644 --- a/drivers/vhost/test.c +++ b/drivers/vhost/test.c @@ -44,9

[PATCH RFC v7 05/14] vhost: reorder functions

2020-06-10 Thread Michael S. Tsirkin
Reorder functions in the file to not rely on forward declarations, in preparation to making them static down the road. Signed-off-by: Michael S. Tsirkin --- drivers/vhost/vhost.c | 26 +- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git

Re: [PATCH RFC v6 02/11] vhost: use batched get_vq_desc version

2020-06-10 Thread Michael S. Tsirkin
On Wed, Jun 10, 2020 at 11:14:49AM +0800, Jason Wang wrote: > > On 2020/6/8 下午8:52, Michael S. Tsirkin wrote: > > As testing shows no performance change, switch to that now. > > > > Signed-off-by: Michael S. Tsirkin > > Signed-off-by: Eugenio Pérez > > Link:

Re: [PATCH] virtio-mem: silence a static checker warning

2020-06-10 Thread David Hildenbrand
> Am 10.06.2020 um 10:59 schrieb Dan Carpenter : > > Smatch complains that "rc" can be uninitialized if we hit the "break;" > statement on the first iteration through the loop. I suspect that this > can't happen in real life, but returning a zero literal is cleaner and > silence the static

Re: [PATCH] vhost_vdpa: Fix potential underflow in vhost_vdpa_mmap()

2020-06-10 Thread Michael S. Tsirkin
On Wed, Jun 10, 2020 at 11:58:52AM +0300, Dan Carpenter wrote: > The "vma->vm_pgoff" variable is an unsigned long so if it's larger than > INT_MAX then "index" can be negative leading to an underflow. Fix this > by changing the type of "index" to "unsigned long". > > Fixes: ddd89d0a059d

Re: [PATCH] virtio-mem: silence a static checker warning

2020-06-10 Thread Michael S. Tsirkin
On Wed, Jun 10, 2020 at 11:59:11AM +0300, Dan Carpenter wrote: > Smatch complains that "rc" can be uninitialized if we hit the "break;" > statement on the first iteration through the loop. I suspect that this > can't happen in real life, but returning a zero literal is cleaner and > silence the

[PATCH] vhost_vdpa: Fix potential underflow in vhost_vdpa_mmap()

2020-06-10 Thread Dan Carpenter
The "vma->vm_pgoff" variable is an unsigned long so if it's larger than INT_MAX then "index" can be negative leading to an underflow. Fix this by changing the type of "index" to "unsigned long". Fixes: ddd89d0a059d ("vhost_vdpa: support doorbell mapping via mmap") Signed-off-by: Dan Carpenter

Re: [PATCH v2] mm/balloon_compaction: Fix trivial spelling

2020-06-10 Thread Sergei Shtylyov
Hello! On 09.06.2020 17:34, Kieran Bingham wrote: The word 'descriptor' is misspelled throughout the tree. Fix it up accordingly: decriptors -> descriptors decriptor -> descriptor really. ;-) Signed-off-by: Kieran Bingham Reviewed-by: David Hildenbrand ---

[PATCH] virtio-mem: silence a static checker warning

2020-06-10 Thread Dan Carpenter
Smatch complains that "rc" can be uninitialized if we hit the "break;" statement on the first iteration through the loop. I suspect that this can't happen in real life, but returning a zero literal is cleaner and silence the static checker warning. Signed-off-by: Dan Carpenter ---

Re: [PATCH V3] vdpa: introduce virtio pci driver

2020-06-10 Thread Michael S. Tsirkin
On Wed, Jun 10, 2020 at 04:25:06PM +0800, Jason Wang wrote: > > > + > > > +#define VP_VDPA_FEATURES \ > > > + ((1ULL << VIRTIO_F_ANY_LAYOUT) | \ > > > > This is presumably for transitional devices only. In fact looking at > > code it seems that only net in legacy mode accepts

Re: [PATCH V3] vdpa: introduce virtio pci driver

2020-06-10 Thread Jason Wang
On 2020/6/10 下午3:08, Michael S. Tsirkin wrote: On Wed, Jun 10, 2020 at 02:52:17PM +0800, Jason Wang wrote: This patch introduce a vDPA driver for virtio-pci device. It bridges the virtio-pci control command to the vDPA bus. This will be used for developing new features for both software vDPA

Re: [PATCH V3] vdpa: introduce virtio pci driver

2020-06-10 Thread Michael S. Tsirkin
On Wed, Jun 10, 2020 at 02:52:17PM +0800, Jason Wang wrote: > This patch introduce a vDPA driver for virtio-pci device. It bridges > the virtio-pci control command to the vDPA bus. This will be used for > developing new features for both software vDPA framework and hardware > vDPA feature. > >

[PATCH V3] vdpa: introduce virtio pci driver

2020-06-10 Thread Jason Wang
This patch introduce a vDPA driver for virtio-pci device. It bridges the virtio-pci control command to the vDPA bus. This will be used for developing new features for both software vDPA framework and hardware vDPA feature. Compared to vdpa_sim, it has several advantages: - it's a real device

Re: [PATCH RESEND V2] vdpa: introduce virtio pci driver

2020-06-10 Thread Jason Wang
On 2020/6/10 下午2:21, Michael S. Tsirkin wrote: On Wed, Jun 10, 2020 at 02:16:26PM +0800, Jason Wang wrote: On 2020/6/10 下午2:07, Michael S. Tsirkin wrote: On Wed, Jun 10, 2020 at 01:49:51PM +0800, Jason Wang wrote: This patch introduce a vDPA driver for virtio-pci device. It bridges the

Re: [PATCH RESEND V2] vdpa: introduce virtio pci driver

2020-06-10 Thread Michael S. Tsirkin
On Wed, Jun 10, 2020 at 02:16:26PM +0800, Jason Wang wrote: > > On 2020/6/10 下午2:07, Michael S. Tsirkin wrote: > > On Wed, Jun 10, 2020 at 01:49:51PM +0800, Jason Wang wrote: > > > This patch introduce a vDPA driver for virtio-pci device. It bridges > > > the virtio-pci control command to the

Re: [PATCH RESEND V2] vdpa: introduce virtio pci driver

2020-06-10 Thread Jason Wang
On 2020/6/10 下午2:07, Michael S. Tsirkin wrote: On Wed, Jun 10, 2020 at 01:49:51PM +0800, Jason Wang wrote: This patch introduce a vDPA driver for virtio-pci device. It bridges the virtio-pci control command to the vDPA bus. This will be used for developing new features for both software vDPA

Re: [PATCH RESEND V2] vdpa: introduce virtio pci driver

2020-06-10 Thread Michael S. Tsirkin
On Wed, Jun 10, 2020 at 01:49:51PM +0800, Jason Wang wrote: > This patch introduce a vDPA driver for virtio-pci device. It bridges > the virtio-pci control command to the vDPA bus. This will be used for > developing new features for both software vDPA framework and hardware > vDPA feature. > >