From: Greg Kroah-Hartman Date: Wed, 20 Mar 2019 19:20:31 +0000 (+0100) Subject: drop virtio broken patches from 5.0.y and 4.19.y X-Git-Tag: v3.18.137~61 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=d2b3784d2a1669c14350af2cb241f39431a3dc9d;p=thirdparty%2Fkernel%2Fstable-queue.git drop virtio broken patches from 5.0.y and 4.19.y --- diff --git a/queue-4.19/series b/queue-4.19/series index 0c7b5610a47..cd091c08dde 100644 --- a/queue-4.19/series +++ b/queue-4.19/series @@ -157,8 +157,6 @@ clocksource-drivers-exynos_mct-clear-timer-interrupt-when-shutdown.patch clocksource-drivers-arch_timer-workaround-for-allwinner-a64-timer-instability.patch s390-setup-fix-early-warning-messages.patch s390-virtio-handle-find-on-invalid-queue-gracefully.patch -virtio-introduce-virtio_max_dma_size.patch -virtio-blk-consider-virtio_max_dma_size-for-maximum-segment-size.patch scsi-virtio_scsi-don-t-send-sc-payload-with-tmfs.patch scsi-aacraid-fix-performance-issue-on-logical-drives.patch scsi-sd-optimal-i-o-size-should-be-a-multiple-of-physical-block-size.patch diff --git a/queue-4.19/virtio-blk-consider-virtio_max_dma_size-for-maximum-segment-size.patch b/queue-4.19/virtio-blk-consider-virtio_max_dma_size-for-maximum-segment-size.patch deleted file mode 100644 index e852d253e57..00000000000 --- a/queue-4.19/virtio-blk-consider-virtio_max_dma_size-for-maximum-segment-size.patch +++ /dev/null @@ -1,55 +0,0 @@ -From fd1068e1860e44aaaa337b516df4518d1ce98da1 Mon Sep 17 00:00:00 2001 -From: Joerg Roedel -Date: Thu, 7 Feb 2019 12:59:17 +0100 -Subject: virtio-blk: Consider virtio_max_dma_size() for maximum segment size - -From: Joerg Roedel - -commit fd1068e1860e44aaaa337b516df4518d1ce98da1 upstream. - -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. - -Cc: stable@vger.kernel.org -Reviewed-by: Konrad Rzeszutek Wilk -Reviewed-by: Christoph Hellwig -Signed-off-by: Joerg Roedel -Signed-off-by: Michael S. Tsirkin -Signed-off-by: Greg Kroah-Hartman - ---- - drivers/block/virtio_blk.c | 10 ++++++---- - 1 file changed, 6 insertions(+), 4 deletions(-) - ---- a/drivers/block/virtio_blk.c -+++ b/drivers/block/virtio_blk.c -@@ -630,7 +630,7 @@ static int virtblk_probe(struct virtio_d - struct request_queue *q; - int err, index; - -- u32 v, blk_size, sg_elems, opt_io_size; -+ u32 v, blk_size, max_size, sg_elems, opt_io_size; - u16 min_io_size; - u8 physical_block_exp, alignment_offset; - -@@ -733,14 +733,16 @@ static int virtblk_probe(struct virtio_d - /* No real sector limit. */ - blk_queue_max_hw_sectors(q, -1U); - -+ max_size = virtio_max_dma_size(vdev); -+ - /* Host can optionally specify maximum segment size and number of - * segments. */ - err = virtio_cread_feature(vdev, VIRTIO_BLK_F_SIZE_MAX, - struct virtio_blk_config, size_max, &v); - if (!err) -- blk_queue_max_segment_size(q, v); -- else -- blk_queue_max_segment_size(q, -1U); -+ max_size = min(max_size, v); -+ -+ blk_queue_max_segment_size(q, max_size); - - /* Host can optionally specify the block size of the device */ - err = virtio_cread_feature(vdev, VIRTIO_BLK_F_BLK_SIZE, diff --git a/queue-4.19/virtio-introduce-virtio_max_dma_size.patch b/queue-4.19/virtio-introduce-virtio_max_dma_size.patch deleted file mode 100644 index fe8463a6bf6..00000000000 --- a/queue-4.19/virtio-introduce-virtio_max_dma_size.patch +++ /dev/null @@ -1,62 +0,0 @@ -From e6d6dd6c875eb3c9b69bb640419405726e6e0bbe Mon Sep 17 00:00:00 2001 -From: Joerg Roedel -Date: Thu, 7 Feb 2019 12:59:16 +0100 -Subject: virtio: Introduce virtio_max_dma_size() - -From: Joerg Roedel - -commit e6d6dd6c875eb3c9b69bb640419405726e6e0bbe upstream. - -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 implementations might also -have limits. - -Use the new dma_max_mapping_size() function to determine the -maximum mapping size when DMA-API is in use for virtio. - -Cc: stable@vger.kernel.org -Reviewed-by: Konrad Rzeszutek Wilk -Reviewed-by: Christoph Hellwig -Signed-off-by: Joerg Roedel -Signed-off-by: Michael S. Tsirkin -Signed-off-by: Greg Kroah-Hartman - ---- - drivers/virtio/virtio_ring.c | 11 +++++++++++ - include/linux/virtio.h | 2 ++ - 2 files changed, 13 insertions(+) - ---- a/drivers/virtio/virtio_ring.c -+++ b/drivers/virtio/virtio_ring.c -@@ -1013,6 +1013,17 @@ struct virtqueue *__vring_new_virtqueue( - } - EXPORT_SYMBOL_GPL(__vring_new_virtqueue); - -+size_t virtio_max_dma_size(struct virtio_device *vdev) -+{ -+ size_t max_segment_size = SIZE_MAX; -+ -+ if (vring_use_dma_api(vdev)) -+ max_segment_size = dma_max_mapping_size(&vdev->dev); -+ -+ return max_segment_size; -+} -+EXPORT_SYMBOL_GPL(virtio_max_dma_size); -+ - static void *vring_alloc_queue(struct virtio_device *vdev, size_t size, - dma_addr_t *dma_handle, gfp_t flag) - { ---- a/include/linux/virtio.h -+++ b/include/linux/virtio.h -@@ -157,6 +157,8 @@ int virtio_device_freeze(struct virtio_d - int virtio_device_restore(struct virtio_device *dev); - #endif - -+size_t virtio_max_dma_size(struct virtio_device *vdev); -+ - #define virtio_device_for_each_vq(vdev, vq) \ - list_for_each_entry(vq, &vdev->vqs, list) - diff --git a/queue-5.0/series b/queue-5.0/series index adac86dc39a..77310acb6c7 100644 --- a/queue-5.0/series +++ b/queue-5.0/series @@ -76,8 +76,6 @@ clocksource-drivers-arch_timer-workaround-for-allwinner-a64-timer-instability.pa s390-vfio_ap-link-the-vfio_ap-devices-to-the-vfio_ap-bus-subsystem.patch s390-setup-fix-early-warning-messages.patch s390-virtio-handle-find-on-invalid-queue-gracefully.patch -virtio-introduce-virtio_max_dma_size.patch -virtio-blk-consider-virtio_max_dma_size-for-maximum-segment-size.patch scsi-virtio_scsi-don-t-send-sc-payload-with-tmfs.patch scsi-aacraid-fix-performance-issue-on-logical-drives.patch scsi-sd-optimal-i-o-size-should-be-a-multiple-of-physical-block-size.patch diff --git a/queue-5.0/virtio-blk-consider-virtio_max_dma_size-for-maximum-segment-size.patch b/queue-5.0/virtio-blk-consider-virtio_max_dma_size-for-maximum-segment-size.patch deleted file mode 100644 index ea054b3f9ba..00000000000 --- a/queue-5.0/virtio-blk-consider-virtio_max_dma_size-for-maximum-segment-size.patch +++ /dev/null @@ -1,55 +0,0 @@ -From fd1068e1860e44aaaa337b516df4518d1ce98da1 Mon Sep 17 00:00:00 2001 -From: Joerg Roedel -Date: Thu, 7 Feb 2019 12:59:17 +0100 -Subject: virtio-blk: Consider virtio_max_dma_size() for maximum segment size - -From: Joerg Roedel - -commit fd1068e1860e44aaaa337b516df4518d1ce98da1 upstream. - -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. - -Cc: stable@vger.kernel.org -Reviewed-by: Konrad Rzeszutek Wilk -Reviewed-by: Christoph Hellwig -Signed-off-by: Joerg Roedel -Signed-off-by: Michael S. Tsirkin -Signed-off-by: Greg Kroah-Hartman - ---- - drivers/block/virtio_blk.c | 10 ++++++---- - 1 file changed, 6 insertions(+), 4 deletions(-) - ---- a/drivers/block/virtio_blk.c -+++ b/drivers/block/virtio_blk.c -@@ -723,7 +723,7 @@ static int virtblk_probe(struct virtio_d - struct request_queue *q; - int err, index; - -- u32 v, blk_size, sg_elems, opt_io_size; -+ u32 v, blk_size, max_size, sg_elems, opt_io_size; - u16 min_io_size; - u8 physical_block_exp, alignment_offset; - -@@ -826,14 +826,16 @@ static int virtblk_probe(struct virtio_d - /* No real sector limit. */ - blk_queue_max_hw_sectors(q, -1U); - -+ max_size = virtio_max_dma_size(vdev); -+ - /* Host can optionally specify maximum segment size and number of - * segments. */ - err = virtio_cread_feature(vdev, VIRTIO_BLK_F_SIZE_MAX, - struct virtio_blk_config, size_max, &v); - if (!err) -- blk_queue_max_segment_size(q, v); -- else -- blk_queue_max_segment_size(q, -1U); -+ max_size = min(max_size, v); -+ -+ blk_queue_max_segment_size(q, max_size); - - /* Host can optionally specify the block size of the device */ - err = virtio_cread_feature(vdev, VIRTIO_BLK_F_BLK_SIZE, diff --git a/queue-5.0/virtio-introduce-virtio_max_dma_size.patch b/queue-5.0/virtio-introduce-virtio_max_dma_size.patch deleted file mode 100644 index c36f8e92dcc..00000000000 --- a/queue-5.0/virtio-introduce-virtio_max_dma_size.patch +++ /dev/null @@ -1,62 +0,0 @@ -From e6d6dd6c875eb3c9b69bb640419405726e6e0bbe Mon Sep 17 00:00:00 2001 -From: Joerg Roedel -Date: Thu, 7 Feb 2019 12:59:16 +0100 -Subject: virtio: Introduce virtio_max_dma_size() - -From: Joerg Roedel - -commit e6d6dd6c875eb3c9b69bb640419405726e6e0bbe upstream. - -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 implementations might also -have limits. - -Use the new dma_max_mapping_size() function to determine the -maximum mapping size when DMA-API is in use for virtio. - -Cc: stable@vger.kernel.org -Reviewed-by: Konrad Rzeszutek Wilk -Reviewed-by: Christoph Hellwig -Signed-off-by: Joerg Roedel -Signed-off-by: Michael S. Tsirkin -Signed-off-by: Greg Kroah-Hartman - ---- - drivers/virtio/virtio_ring.c | 11 +++++++++++ - include/linux/virtio.h | 2 ++ - 2 files changed, 13 insertions(+) - ---- a/drivers/virtio/virtio_ring.c -+++ b/drivers/virtio/virtio_ring.c -@@ -271,6 +271,17 @@ static bool vring_use_dma_api(struct vir - return false; - } - -+size_t virtio_max_dma_size(struct virtio_device *vdev) -+{ -+ size_t max_segment_size = SIZE_MAX; -+ -+ if (vring_use_dma_api(vdev)) -+ max_segment_size = dma_max_mapping_size(&vdev->dev); -+ -+ return max_segment_size; -+} -+EXPORT_SYMBOL_GPL(virtio_max_dma_size); -+ - static void *vring_alloc_queue(struct virtio_device *vdev, size_t size, - dma_addr_t *dma_handle, gfp_t flag) - { ---- a/include/linux/virtio.h -+++ b/include/linux/virtio.h -@@ -157,6 +157,8 @@ int virtio_device_freeze(struct virtio_d - int virtio_device_restore(struct virtio_device *dev); - #endif - -+size_t virtio_max_dma_size(struct virtio_device *vdev); -+ - #define virtio_device_for_each_vq(vdev, vq) \ - list_for_each_entry(vq, &vdev->vqs, list) -