diff options
author | Laurent Vivier | 2020-12-20 17:35:39 +0100 |
---|---|---|
committer | Michael S. Tsirkin | 2021-02-05 14:52:58 +0100 |
commit | 2d9e7d4cddd901a3cb57d2fc150186c70b7139a7 (patch) | |
tree | 1f132158659da1345265525b3e92b94d2c9e3619 /chardev/char-stdio.c | |
parent | virtio: move 'use-disabled-flag' property to hw_compat_4_2 (diff) | |
download | qemu-2d9e7d4cddd901a3cb57d2fc150186c70b7139a7.tar.gz qemu-2d9e7d4cddd901a3cb57d2fc150186c70b7139a7.tar.xz qemu-2d9e7d4cddd901a3cb57d2fc150186c70b7139a7.zip |
virtio-mmio: fix guest kernel crash with SHM regions
In the kernel, virtio_gpu_init() uses virtio_get_shm_region()
since
commit 6076a9711dc5 ("drm/virtio: implement blob resources: probe for host visible region")
but vm_get_shm_region() unconditionally uses VIRTIO_MMIO_SHM_SEL to
get the address and the length of the region.
commit 38e895487afc ("virtio: Implement get_shm_region for MMIO transport"
As this is not implemented in QEMU, address and length are 0 and passed
as is to devm_request_mem_region() that triggers a crash:
[drm:virtio_gpu_init] *ERROR* Could not reserve host visible region
Unable to handle kernel NULL pointer dereference at virtual address (ptrval)
According to the comments in the kernel, a non existent shared region
has a length of (u64)-1.
This is what we return now with this patch to disable the region.
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
Message-Id: <20201220163539.2255963-1-laurent@vivier.eu>
Acked-by: Gerd Hoffmann <kraxel@redhat.com>
Reviewed-by: Stefano Garzarella <sgarzare@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Diffstat (limited to 'chardev/char-stdio.c')
0 files changed, 0 insertions, 0 deletions