android_kernel_xiaomi_sm8450/drivers/xen
Keith Busch be8af3b6c8 swiotlb-xen: provide the "max_mapping_size" method
commit bff2a2d453a1b683378b4508b86b84389f551a00 upstream.

There's a bug that when using the XEN hypervisor with bios with large
multi-page bio vectors on NVMe, the kernel deadlocks [1].

The deadlocks are caused by inability to map a large bio vector -
dma_map_sgtable always returns an error, this gets propagated to the block
layer as BLK_STS_RESOURCE and the block layer retries the request
indefinitely.

XEN uses the swiotlb framework to map discontiguous pages into contiguous
runs that are submitted to the PCIe device. The swiotlb framework has a
limitation on the length of a mapping - this needs to be announced with
the max_mapping_size method to make sure that the hardware drivers do not
create larger mappings.

Without max_mapping_size, the NVMe block driver would create large
mappings that overrun the maximum mapping size.

Reported-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
Link: https://lore.kernel.org/stable/ZTNH0qtmint%2FzLJZ@mail-itl/ [1]
Tested-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
Suggested-by: Christoph Hellwig <hch@lst.de>
Cc: stable@vger.kernel.org
Signed-off-by: Keith Busch <kbusch@kernel.org>
Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Acked-by: Stefano Stabellini <sstabellini@kernel.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Link: https://lore.kernel.org/r/151bef41-e817-aea9-675-a35fdac4ed@redhat.com
Signed-off-by: Juergen Gross <jgross@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-12-08 08:46:10 +01:00
..
events xen/events: fix delayed eoi list handling 2023-11-28 16:54:54 +00:00
xen-pciback xen-pciback: Consider INTx disabled when MSI/MSI-X is enabled 2023-11-20 11:06:49 +01:00
xenbus xen/xenbus: fix return type in xenbus_file_read() 2022-08-25 11:38:02 +02:00
xenfs
acpi.c
arm-device.c
balloon.c
biomerge.c
cpu_hotplug.c
dbgp.c
efi.c
evtchn.c
features.c x86/xen: Remove undefined behavior in setup_features() 2022-06-29 08:59:48 +02:00
gntalloc.c xen/gntalloc: don't use gnttab_query_foreign_access() 2022-03-11 12:11:54 +01:00
gntdev-common.h xen/gntdev: Accommodate VMA splitting 2022-10-30 09:41:18 +01:00
gntdev-dmabuf.c
gntdev-dmabuf.h
gntdev.c xen/gntdev: Prevent leaking grants 2022-11-03 23:57:50 +09:00
grant-table.c xen/grants: prevent integer overflow in gnttab_dma_alloc_pages() 2022-09-08 11:11:38 +02:00
Kconfig
Makefile
manage.c
mcelog.c
mem-reservation.c
pci.c
pcpu.c ACPI: processor: Fix evaluating _PDC method when running as Xen dom0 2023-05-17 11:47:42 +02:00
platform-pci.c xen/platform-pci: add missing free_irq() in error path 2022-12-02 17:40:05 +01:00
privcmd-buf.c
privcmd.c xen/privcmd: Fix a possible warning in privcmd_ioctl_mmap_resource() 2023-01-14 10:15:21 +01:00
privcmd.h
pvcalls-back.c xen/pvcalls-back: fix double frees with pvcalls_new_active_socket() 2023-05-30 12:57:58 +01:00
pvcalls-front.c xen/pvcalls: use alloc/free_pages_exact() 2022-03-11 12:11:54 +01:00
pvcalls-front.h
swiotlb-xen.c swiotlb-xen: provide the "max_mapping_size" method 2023-12-08 08:46:10 +01:00
sys-hypervisor.c
time.c
unpopulated-alloc.c
xen-acpi-cpuhotplug.c
xen-acpi-memhotplug.c
xen-acpi-pad.c
xen-acpi-processor.c
xen-balloon.c
xen-front-pgdir-shbuf.c
xen-scsiback.c
xen-stub.c
xlate_mmu.c xen: unexport __init-annotated xen_xlate_map_ballooned_pages() 2022-06-14 18:32:40 +02:00