aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBen Hutchings <benh@debian.org>2020-09-11 04:20:20 +0100
committerBen Hutchings <benh@debian.org>2020-09-11 04:20:20 +0100
commitcad8e2ba122ea380ec03119024ed7e05880a71cd (patch)
treef937e830e0e08bb0b67014c65d2f01a640126f61
parentf7bf587a1794faaa43de139e085b638557252bd8 (diff)
downloadkernel_replicant_linux-cad8e2ba122ea380ec03119024ed7e05880a71cd.tar.gz
kernel_replicant_linux-cad8e2ba122ea380ec03119024ed7e05880a71cd.tar.bz2
kernel_replicant_linux-cad8e2ba122ea380ec03119024ed7e05880a71cd.zip
drm/virtio: Revert "drm/virtio: Call the right shmem helpers"
Fixes a regression that causes virtio_gpu to crash pretty quickly.
-rw-r--r--debian/changelog1
-rw-r--r--debian/patches/bugfix/all/drm-virtio-revert-drm-virtio-call-the-right-shmem-he.patch50
-rw-r--r--debian/patches/series1
3 files changed, 52 insertions, 0 deletions
diff --git a/debian/changelog b/debian/changelog
index 808476c39054..02c59e7abb1a 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -8,6 +8,7 @@ linux (5.9~rc4-1~exp1) UNRELEASED; urgency=medium
* Makefile: Do not check for libelf when building OOT module
* udeb: Move any compression modules to kernel-image; drop compress-modules
* libtraceevent1: Update symbols list for functions added in 5.9
+ * drm/virtio: Revert "drm/virtio: Call the right shmem helpers"
-- Ben Hutchings <benh@debian.org> Mon, 07 Sep 2020 02:19:34 +0100
diff --git a/debian/patches/bugfix/all/drm-virtio-revert-drm-virtio-call-the-right-shmem-he.patch b/debian/patches/bugfix/all/drm-virtio-revert-drm-virtio-call-the-right-shmem-he.patch
new file mode 100644
index 000000000000..2f31ee77a0a4
--- /dev/null
+++ b/debian/patches/bugfix/all/drm-virtio-revert-drm-virtio-call-the-right-shmem-he.patch
@@ -0,0 +1,50 @@
+From: Gurchetan Singh <gurchetansingh@chromium.org>
+Date: Mon, 15 Jun 2020 16:05:00 -0700
+Subject: drm/virtio: Revert "drm/virtio: Call the right shmem helpers"
+Origin: https://cgit.freedesktop.org/drm/drm-misc/commit?id=51c3b0cc32d2e17581fce5b487ee95bbe9e8270a
+
+This reverts commit d323bb44e4d23802eb25d13de1f93f2335bd60d0.
+
+Fixes a double-free regression:
+
+[ 4.357928] drm_gem_shmem_free_object+0xb4/0x100
+[ 4.358983] virtio_gpu_dequeue_ctrl_func+0xd9/0x290
+[ 4.360343] process_one_work+0x1d2/0x3a0
+[ 4.361581] worker_thread+0x45/0x3c0
+[ 4.362645] kthread+0xf6/0x130
+[ 4.363543] ? process_one_work+0x3a0/0x3a0
+[ 4.364770] ? kthread_park+0x80/0x80
+[ 4.365799] ret_from_fork+0x35/0x40
+[ 4.367103] Modules linked in:
+[ 4.367958] CR2: 0000000000000018
+[ 4.368857] ---[ end trace db84f7a2974d5c79 ]---
+[ 4.370118] RIP: 0010:dma_direct_unmap_sg+0x1f/0x60
+
+In addition, virtio has it's own set of dma-ops so there's not an
+obviously clean way to transition to shmem helpers.
+
+Fixes: d323bb44e4d2 ("drm/virtio: Call the right shmem helpers")
+Signed-off-by: Gurchetan Singh <gurchetansingh@chromium.org>
+Link: http://patchwork.freedesktop.org/patch/msgid/20200615230500.551-1-gurchetansingh@chromium.org
+Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
+---
+ drivers/gpu/drm/virtio/virtgpu_object.c | 8 +++++++-
+ 1 file changed, 7 insertions(+), 1 deletion(-)
+
+--- a/drivers/gpu/drm/virtio/virtgpu_object.c
++++ b/drivers/gpu/drm/virtio/virtgpu_object.c
+@@ -151,7 +151,13 @@ static int virtio_gpu_object_shmem_init(
+ if (ret < 0)
+ return -EINVAL;
+
+- shmem->pages = drm_gem_shmem_get_pages_sgt(&bo->base.base);
++ /*
++ * virtio_gpu uses drm_gem_shmem_get_sg_table instead of
++ * drm_gem_shmem_get_pages_sgt because virtio has it's own set of
++ * dma-ops. This is discouraged for other drivers, but should be fine
++ * since virtio_gpu doesn't support dma-buf import from other devices.
++ */
++ shmem->pages = drm_gem_shmem_get_sg_table(&bo->base.base);
+ if (!shmem->pages) {
+ drm_gem_shmem_unpin(&bo->base.base);
+ return -EINVAL;
diff --git a/debian/patches/series b/debian/patches/series
index 8b05377db2d3..7c8d65e7bfab 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -84,6 +84,7 @@ bugfix/all/fs-add-module_softdep-declarations-for-hard-coded-cr.patch
bugfix/all/partially-revert-usb-kconfig-using-select-for-usb_co.patch
debian/makefile-do-not-check-for-libelf-when-building-oot-module.patch
bugfix/all/partially-revert-net-socket-implement-64-bit-timestamps.patch
+bugfix/all/drm-virtio-revert-drm-virtio-call-the-right-shmem-he.patch
# Miscellaneous features