Re: INFO: task hung in vhost_init_device_iotlb

2019-01-29 Thread Michael S. Tsirkin
On Tue, Jan 29, 2019 at 01:22:02AM -0800, syzbot wrote: > Hello, > > syzbot found the following crash on: > > HEAD commit:983542434e6b Merge tag 'edac_fix_for_5.0' of git://git.ker.. > git tree: upstream > console output: https://syzkaller.appspot.com/x/log.txt?x=17476498c0 > kernel

[PATCH 1/3] drm/irq: Don't check for DRIVER_HAVE_IRQ in drm_irq_(un)install

2019-01-29 Thread Daniel Vetter
If a non-legacy driver calls these it's valid to assume there is interrupt support. The flag is really only needed for legacy drivers, which control IRQ enabling/disabling through the DRM_IOCTL_CONTROL legacy IOCTL. Also remove all the flag usage from non-legacy drivers. v2: Review from Emil: - i

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

2019-01-29 Thread Michael S. Tsirkin
On Wed, Jan 30, 2019 at 11:05:42AM +0800, Jason Wang wrote: > > On 2019/1/30 上午10:36, Michael S. Tsirkin wrote: > > On Wed, Jan 30, 2019 at 10:24:01AM +0800, Jason Wang wrote: > > > On 2019/1/30 上午3:02, Michael S. Tsirkin wrote: > > > > On Tue, Jan 29, 2019 at 03:42:44PM -0200, Thiago Jung Bauerma

[PATCH 0/5 v4] Fix virtio-blk issue with SWIOTLB

2019-01-29 Thread Joerg Roedel
Hi, here is the fourth version of this patch-set. Previous versions can be found here: V1: https://lore.kernel.org/lkml/20190110134433.15672-1-j...@8bytes.org/ V2: https://lore.kernel.org/lkml/20190115132257.6426-1-j...@8bytes.org/ V3: https://lore.kernel.org/lkml/2019

[PATCH 4/5] virtio: Introduce virtio_max_dma_size()

2019-01-29 Thread Joerg Roedel
From: Joerg Roedel This function returns the maximum segment size for a single dma transaction of a virtio device. The possible limit comes from the SWIOTLB implementation in the Linux kernel, that has an upper limit of (currently) 256kb of contiguous memory it can map. Other DMA-API implementati

Re: [PATCH v2] drm/qxl: use ttm_tt

2019-01-29 Thread Noralf Trønnes
Den 29.01.2019 09.25, skrev Gerd Hoffmann: > qxl device will not dma, so we don't need ttm_dma_tt. Go use ttm_tt > instead, to avoid wasting resources (swiotlb bounce buffers for > example). > > Signed-off-by: Gerd Hoffmann > --- Acked-by: Noralf Trønnes _

[PATCH 5/5] virtio-blk: Consider virtio_max_dma_size() for maximum segment size

2019-01-29 Thread Joerg Roedel
From: Joerg Roedel Segments can't be larger than the maximum DMA mapping size supported on the platform. Take that into account when setting the maximum segment size for a block device. Reviewed-by: Konrad Rzeszutek Wilk Signed-off-by: Joerg Roedel --- drivers/block/virtio_blk.c | 10 ++--

[PATCH 1/5] swiotlb: Introduce swiotlb_max_mapping_size()

2019-01-29 Thread Joerg Roedel
From: Joerg Roedel The function returns the maximum size that can be remapped by the SWIOTLB implementation. This function will be later exposed to users through the DMA-API. Reviewed-by: Konrad Rzeszutek Wilk Signed-off-by: Joerg Roedel --- include/linux/swiotlb.h | 5 + kernel/dma/swiot

[PATCH v2] drm/qxl: use ttm_tt

2019-01-29 Thread Gerd Hoffmann
qxl device will not dma, so we don't need ttm_dma_tt. Go use ttm_tt instead, to avoid wasting resources (swiotlb bounce buffers for example). Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/qxl/qxl_ttm.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/gpu

Re: [PATCH 5/5] virtio-blk: Consider virtio_max_dma_size() for maximum segment size

2019-01-29 Thread Christoph Hellwig
On Mon, Jan 28, 2019 at 12:14:33PM -0500, Michael S. Tsirkin wrote: > On Mon, Jan 28, 2019 at 09:05:26AM +0100, Christoph Hellwig wrote: > > On Thu, Jan 24, 2019 at 10:51:51AM +0100, Joerg Roedel wrote: > > > On Thu, Jan 24, 2019 at 09:42:21AM +0100, Christoph Hellwig wrote: > > > > Yes. But more

[PATCH 2/5] swiotlb: Add is_swiotlb_active() function

2019-01-29 Thread Joerg Roedel
From: Joerg Roedel This function will be used from dma_direct code to determine the maximum segment size of a dma mapping. Reviewed-by: Konrad Rzeszutek Wilk Signed-off-by: Joerg Roedel --- include/linux/swiotlb.h | 6 ++ kernel/dma/swiotlb.c| 9 + 2 files changed, 15 insertio

[PATCH 3/5] dma: Introduce dma_max_mapping_size()

2019-01-29 Thread Joerg Roedel
From: Joerg Roedel The function returns the maximum size that can be mapped using DMA-API functions. The patch also adds the implementation for direct DMA and a new dma_map_ops pointer so that other implementations can expose their limit. Reviewed-by: Konrad Rzeszutek Wilk Signed-off-by: Joerg

Re: [PATCH net] vhost: fix OOB in get_rx_bufs()

2019-01-29 Thread David Miller
From: Jason Wang Date: Mon, 28 Jan 2019 15:05:05 +0800 > After batched used ring updating was introduced in commit e2b3b35eb989 > ("vhost_net: batch used ring update in rx"). We tend to batch heads in > vq->heads for more than one packet. But the quota passed to > get_rx_bufs() was not correctly

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

2019-01-29 Thread Michael S. Tsirkin
On Wed, Jan 30, 2019 at 10:24:01AM +0800, Jason Wang wrote: > > On 2019/1/30 上午3:02, Michael S. Tsirkin wrote: > > On Tue, Jan 29, 2019 at 03:42:44PM -0200, Thiago Jung Bauermann wrote: > > > Fixing address of powerpc mailing list. > > > > > > Thiago Jung Bauermann writes: > > > > > > > Hello,

Re: [PATCH net] vhost: fix OOB in get_rx_bufs()

2019-01-29 Thread Stefan Hajnoczi
On Mon, Jan 28, 2019 at 03:05:05PM +0800, Jason Wang wrote: > After batched used ring updating was introduced in commit e2b3b35eb989 > ("vhost_net: batch used ring update in rx"). We tend to batch heads in > vq->heads for more than one packet. But the quota passed to > get_rx_bufs() was not correct

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

2019-01-29 Thread Jason Wang
On 2019/1/30 上午10:36, Michael S. Tsirkin wrote: On Wed, Jan 30, 2019 at 10:24:01AM +0800, Jason Wang wrote: On 2019/1/30 上午3:02, Michael S. Tsirkin wrote: On Tue, Jan 29, 2019 at 03:42:44PM -0200, Thiago Jung Bauermann wrote: Fixing address of powerpc mailing list. Thiago Jung Bauermann wri

Re: [PATCH net] vhost: fix OOB in get_rx_bufs()

2019-01-29 Thread David Miller
From: David Miller Date: Tue, 29 Jan 2019 15:10:26 -0800 (PST) > Yeah the CVE pushed my hand a little bit, and I knew I was going to > send Linus a pull request today because David Watson needs some TLS > changes in net-next. I also want to make a general comment for the record. If I let pa

Re: [PATCH net] vhost: fix OOB in get_rx_bufs()

2019-01-29 Thread Michael S. Tsirkin
On Tue, Jan 29, 2019 at 03:38:10PM -0800, David Miller wrote: > From: David Miller > Date: Tue, 29 Jan 2019 15:10:26 -0800 (PST) > > > Yeah the CVE pushed my hand a little bit, and I knew I was going to > > send Linus a pull request today because David Watson needs some TLS > > changes in net-nex

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

2019-01-29 Thread Jason Wang
On 2019/1/30 上午3:02, Michael S. Tsirkin wrote: On Tue, Jan 29, 2019 at 03:42:44PM -0200, Thiago Jung Bauermann wrote: Fixing address of powerpc mailing list. Thiago Jung Bauermann writes: Hello, With Christoph's rework of the DMA API that recently landed, the patch below is the only change

Re: [PATCH net] vhost: fix OOB in get_rx_bufs()

2019-01-29 Thread David Miller
From: "Michael S. Tsirkin" Date: Tue, 29 Jan 2019 17:54:44 -0500 > On Mon, Jan 28, 2019 at 10:54:44PM -0800, David Miller wrote: >> From: Jason Wang >> Date: Mon, 28 Jan 2019 15:05:05 +0800 >> >> > After batched used ring updating was introduced in commit e2b3b35eb989 >> > ("vhost_net: batch us

Re: [PATCH net] vhost: fix OOB in get_rx_bufs()

2019-01-29 Thread Michael S. Tsirkin
On Mon, Jan 28, 2019 at 10:54:44PM -0800, David Miller wrote: > From: Jason Wang > Date: Mon, 28 Jan 2019 15:05:05 +0800 > > > After batched used ring updating was introduced in commit e2b3b35eb989 > > ("vhost_net: batch used ring update in rx"). We tend to batch heads in > > vq->heads for more t

Re: [PATCH v2 net 5/7] virtio_net: Don't process redirected XDP frames when XDP is disabled

2019-01-29 Thread Michael S. Tsirkin
On Tue, Jan 29, 2019 at 09:45:57AM +0900, Toshiaki Makita wrote: > Commit 8dcc5b0ab0ec ("virtio_net: fix ndo_xdp_xmit crash towards dev not > ready for XDP") tried to avoid access to unexpected sq while XDP is > disabled, but was not complete. > > There was a small window which causes out of bound

Re: [PATCH v2 net 7/7] virtio_net: Differentiate sk_buff and xdp_frame on freeing

2019-01-29 Thread Michael S. Tsirkin
On Tue, Jan 29, 2019 at 09:45:59AM +0900, Toshiaki Makita wrote: > We do not reset or free up unused buffers when enabling/disabling XDP, > so it can happen that xdp_frames are freed after disabling XDP or > sk_buffs are freed after enabling XDP on xdp tx queues. > Thus we need to handle both forms

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

2019-01-29 Thread Michael S. Tsirkin
On Tue, Jan 29, 2019 at 03:42:44PM -0200, Thiago Jung Bauermann wrote: > > Fixing address of powerpc mailing list. > > Thiago Jung Bauermann writes: > > > Hello, > > > > With Christoph's rework of the DMA API that recently landed, the patch > > below is the only change needed in virtio to make

Re: [PATCH v7 0/7] Add virtio-iommu driver

2019-01-29 Thread Michael S. Tsirkin
On Mon, Jan 21, 2019 at 11:29:05AM +, Jean-Philippe Brucker wrote: > Hi, > > On 18/01/2019 15:51, Michael S. Tsirkin wrote: > > > > On Tue, Jan 15, 2019 at 12:19:52PM +, Jean-Philippe Brucker wrote: > >> Implement the virtio-iommu driver, following specification v0.9 [1]. > >> > >> This i

Re: [PATCH 3/5] dma: Introduce dma_max_mapping_size()

2019-01-29 Thread Christoph Hellwig
On Tue, Jan 29, 2019 at 09:43:40AM +0100, Joerg Roedel wrote: > From: Joerg Roedel > > The function returns the maximum size that can be mapped > using DMA-API functions. The patch also adds the > implementation for direct DMA and a new dma_map_ops pointer > so that other implementations can expo

Re: [PATCH 4/5] virtio: Introduce virtio_max_dma_size()

2019-01-29 Thread Christoph Hellwig
On Tue, Jan 29, 2019 at 09:43:41AM +0100, Joerg Roedel wrote: > From: Joerg Roedel > > This function returns the maximum segment size for a single > dma transaction of a virtio device. The possible limit comes > from the SWIOTLB implementation in the Linux kernel, that > has an upper limit of (cu

Re: [PATCH 5/5] virtio-blk: Consider virtio_max_dma_size() for maximum segment size

2019-01-29 Thread Christoph Hellwig
On Tue, Jan 29, 2019 at 09:43:42AM +0100, Joerg Roedel wrote: > From: Joerg Roedel > > Segments can't be larger than the maximum DMA mapping size > supported on the platform. Take that into account when > setting the maximum segment size for a block device. > > Reviewed-by: Konrad Rzeszutek Wilk

Re: [PATCH 2/5] swiotlb: Add is_swiotlb_active() function

2019-01-29 Thread Christoph Hellwig
On Tue, Jan 29, 2019 at 09:43:39AM +0100, Joerg Roedel wrote: > From: Joerg Roedel > > This function will be used from dma_direct code to determine > the maximum segment size of a dma mapping. > > Reviewed-by: Konrad Rzeszutek Wilk > Signed-off-by: Joerg Roedel Looks good, Reviewed-by: Chris

Re: [PATCH 1/5] swiotlb: Introduce swiotlb_max_mapping_size()

2019-01-29 Thread Christoph Hellwig
On Tue, Jan 29, 2019 at 09:43:38AM +0100, Joerg Roedel wrote: > From: Joerg Roedel > > The function returns the maximum size that can be remapped > by the SWIOTLB implementation. This function will be later > exposed to users through the DMA-API. > > Reviewed-by: Konrad Rzeszutek Wilk > Signed-

Re: [PATCH] virtio_net: Introduce extended RSC feature

2019-01-29 Thread Michael S. Tsirkin
On Tue, Jan 29, 2019 at 02:52:36PM +0200, Yuri Benditovich wrote: > VIRTIO_NET_F_RSC_EXT feature bit indicates that the device > is able to provide extended RSC information. When the feature > is active and 'gso_type' field in received packet is not GSO_NONE, > the device reports number of coalesce