Re: [PATCH net] vhost_net: fix possible infinite loop

2019-04-26 Thread Jason Wang
On 2019/4/26 上午1:52, Michael S. Tsirkin wrote: On Thu, Apr 25, 2019 at 03:33:19AM -0400, Jason Wang wrote: When the rx buffer is too small for a packet, we will discard the vq descriptor and retry it for the next packet: while ((sock_len = vhost_net_rx_peek_head_len(net, sock->sk,

Re: [PATCH] Revert "drm/qxl: drop prime import/export callbacks"

2019-04-26 Thread Daniel Vetter
On Fri, Apr 26, 2019 at 7:33 AM Gerd Hoffmann wrote: > > This reverts commit f4c34b1e2a37d5676180901fa6ff188bcb6371f8. > > Simliar to commit a0cecc23cfcb Revert "drm/virtio: drop prime > import/export callbacks". We have to do the same with qxl, > for the same reasons (it breaks DRI3). > > Drop t

[PATCH 00/10] s390: virtio: support protected virtualization

2019-04-26 Thread Halil Pasic
Enhanced virtualization protection technology may require the use of bounce buffers for I/O. While support for this was built into the virtio core, virtio-ccw wasn't changed accordingly. Some background on technology (not part of this series) and the terminology used. * Protected Virtualization (

[PATCH 02/10] virtio/s390: DMA support for virtio-ccw

2019-04-26 Thread Halil Pasic
Currently virtio-ccw devices do not work if the device has VIRTIO_F_IOMMU_PLATFORM. In future we do want to support DMA API with virtio-ccw. Let us do the plumbing, so the feature VIRTIO_F_IOMMU_PLATFORM works with virtio-ccw. Let us also switch from legacy avail/used accessors to the DMA aware o

[PATCH 04/10] s390/mm: force swiotlb for protected virtualization

2019-04-26 Thread Halil Pasic
On s390, protected virtualization guests have to use bounced I/O buffers. That requires some plumbing. Let us make sure, any device that uses DMA API with direct ops correctly is spared from the problems, that a hypervisor attempting I/O to a non-shared page would bring. Signed-off-by: Halil Pas

[PATCH 03/10] virtio/s390: enable packed ring

2019-04-26 Thread Halil Pasic
Nothing precludes to accepting VIRTIO_F_RING_PACKED any more. Signed-off-by: Halil Pasic --- drivers/s390/virtio/virtio_ccw.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/s390/virtio/virtio_ccw.c b/drivers/s390/virtio/virtio_ccw.c index 42832a164546..6d989c360f

[PATCH 05/10] s390/cio: introduce DMA pools to cio

2019-04-26 Thread Halil Pasic
To support protected virtualization cio will need to make sure the memory used for communication with the hypervisor is DMA memory. Let us introduce one global cio, and some tools for pools seated at individual devices. Our DMA pools are implemented as a gen_pool backed with DMA pages. The idea i

[PATCH 01/10] virtio/s390: use vring_create_virtqueue

2019-04-26 Thread Halil Pasic
The commit 2a2d1382fe9d ("virtio: Add improved queue allocation API") establishes a new way of allocating virtqueues (as a part of the effort that taught DMA to virtio rings). In the future we will want virtio-ccw to use the DMA API as well. Let us switch from the legacy method of allocating virt

[PATCH 08/10] virtio/s390: add indirection to indicators access

2019-04-26 Thread Halil Pasic
This will come in handy soon when we pull out the indicators from virtio_ccw_device to a memory area that is shared with the hypervisor (in particular for protected virtualization guests). Signed-off-by: Halil Pasic --- drivers/s390/virtio/virtio_ccw.c | 40 +-

[PATCH 06/10] s390/cio: add basic protected virtualization support

2019-04-26 Thread Halil Pasic
As virtio-ccw devices are channel devices, we need to use the dma area for any communication with the hypervisor. This patch addresses the most basic stuff (mostly what is required for virtio-ccw), and does take care of QDIO or any devices. An interesting side effect is that virtio structures are

[PATCH 07/10] s390/airq: use DMA memory for adapter interrupts

2019-04-26 Thread Halil Pasic
Protected virtualization guests have to use shared pages for airq notifier bit vectors, because hypervisor needs to write these bits. Let us make sure we allocate DMA memory for the notifier bit vectors. Signed-off-by: Halil Pasic --- arch/s390/include/asm/airq.h | 2 ++ drivers/s390/cio/airq.

[PATCH 10/10] virtio/s390: make airq summary indicators DMA

2019-04-26 Thread Halil Pasic
Hypervisor needs to interact with the summary indicators, so these need to be DMA memory as well (at least for protected virtualization guests). Signed-off-by: Halil Pasic --- drivers/s390/virtio/virtio_ccw.c | 24 +--- 1 file changed, 17 insertions(+), 7 deletions(-) diff -

[PATCH 09/10] virtio/s390: use DMA memory for ccw I/O and classic notifiers

2019-04-26 Thread Halil Pasic
Before virtio-ccw could get away with not using DMA API for the pieces of memory it does ccw I/O with. With protected virtualization this has to change, since the hypervisor needs to read and sometimes also write these pieces of memory. The hypervisor is supposed to poke the classic notifiers, if

Re: [PATCH 04/10] s390/mm: force swiotlb for protected virtualization

2019-04-26 Thread Christoph Hellwig
On Fri, Apr 26, 2019 at 08:32:39PM +0200, Halil Pasic wrote: > +EXPORT_SYMBOL_GPL(set_memory_encrypted); > +EXPORT_SYMBOL_GPL(set_memory_decrypted); > +EXPORT_SYMBOL_GPL(sev_active); Why do you export these? I know x86 exports those as well, but it shoudn't be needed there either. _

Re: [RFC PATCH] virtio_ring: Use DMA API if guest memory is encrypted

2019-04-26 Thread Thiago Jung Bauermann
Michael S. Tsirkin writes: > On Wed, Apr 24, 2019 at 10:01:56PM -0300, Thiago Jung Bauermann wrote: >> >> Michael S. Tsirkin writes: >> >> > On Wed, Apr 17, 2019 at 06:42:00PM -0300, Thiago Jung Bauermann wrote: >> >> >> >> Michael S. Tsirkin writes: >> >> >> >> > On Thu, Mar 21, 2019 at 09:0

[PATCH AUTOSEL 5.0 48/79] virtio_pci: fix a NULL pointer reference in vp_del_vqs

2019-04-26 Thread Sasha Levin
From: Longpeng [ Upstream commit 6a8aae68c87349dbbcd46eac380bc43cdb98a13b ] If the msix_affinity_masks is alloced failed, then we'll try to free some resources in vp_free_vectors() that may access it directly. We met the following stack in our production: [ 29.296767] BUG: unable to handle ke

[PATCH AUTOSEL 5.0 65/79] virtio-blk: limit number of hw queues by nr_cpu_ids

2019-04-26 Thread Sasha Levin
From: Dongli Zhang [ Upstream commit bf348f9b78d413e75bb079462751a1d86b6de36c ] When tag_set->nr_maps is 1, the block layer limits the number of hw queues by nr_cpu_ids. No matter how many hw queues are used by virtio-blk, as it has (tag_set->nr_maps == 1), it can use at most nr_cpu_ids hw queue

[PATCH AUTOSEL 4.19 37/53] virtio_pci: fix a NULL pointer reference in vp_del_vqs

2019-04-26 Thread Sasha Levin
From: Longpeng [ Upstream commit 6a8aae68c87349dbbcd46eac380bc43cdb98a13b ] If the msix_affinity_masks is alloced failed, then we'll try to free some resources in vp_free_vectors() that may access it directly. We met the following stack in our production: [ 29.296767] BUG: unable to handle ke

[PATCH AUTOSEL 4.14 20/32] virtio_pci: fix a NULL pointer reference in vp_del_vqs

2019-04-26 Thread Sasha Levin
From: Longpeng [ Upstream commit 6a8aae68c87349dbbcd46eac380bc43cdb98a13b ] If the msix_affinity_masks is alloced failed, then we'll try to free some resources in vp_free_vectors() that may access it directly. We met the following stack in our production: [ 29.296767] BUG: unable to handle ke

[PATCH AUTOSEL 4.19 44/53] virtio-blk: limit number of hw queues by nr_cpu_ids

2019-04-26 Thread Sasha Levin
From: Dongli Zhang [ Upstream commit bf348f9b78d413e75bb079462751a1d86b6de36c ] When tag_set->nr_maps is 1, the block layer limits the number of hw queues by nr_cpu_ids. No matter how many hw queues are used by virtio-blk, as it has (tag_set->nr_maps == 1), it can use at most nr_cpu_ids hw queue

[PATCH AUTOSEL 4.9 13/16] virtio-blk: limit number of hw queues by nr_cpu_ids

2019-04-26 Thread Sasha Levin
From: Dongli Zhang [ Upstream commit bf348f9b78d413e75bb079462751a1d86b6de36c ] When tag_set->nr_maps is 1, the block layer limits the number of hw queues by nr_cpu_ids. No matter how many hw queues are used by virtio-blk, as it has (tag_set->nr_maps == 1), it can use at most nr_cpu_ids hw queue

[PATCH AUTOSEL 4.14 26/32] virtio-blk: limit number of hw queues by nr_cpu_ids

2019-04-26 Thread Sasha Levin
From: Dongli Zhang [ Upstream commit bf348f9b78d413e75bb079462751a1d86b6de36c ] When tag_set->nr_maps is 1, the block layer limits the number of hw queues by nr_cpu_ids. No matter how many hw queues are used by virtio-blk, as it has (tag_set->nr_maps == 1), it can use at most nr_cpu_ids hw queue