kernel_optimize_test/drivers/xen
Demi Marie Obenour 7a99c7c32c xen/gntdev: Ignore failure to unmap INVALID_GRANT_HANDLE
commit 166d3863231667c4f64dee72b77d1102cdfad11f upstream.

The error paths of gntdev_mmap() can call unmap_grant_pages() even
though not all of the pages have been successfully mapped.  This will
trigger the WARN_ON()s in __unmap_grant_pages_done().  The number of
warnings can be very large; I have observed thousands of lines of
warnings in the systemd journal.

Avoid this problem by only warning on unmapping failure if the handle
being unmapped is not INVALID_GRANT_HANDLE.  The handle field of any
page that was not successfully mapped will be INVALID_GRANT_HANDLE, so
this catches all cases where unmapping can legitimately fail.

Fixes: dbe97cff7dd9 ("xen/gntdev: Avoid blocking in unmap_grant_pages()")
Cc: stable@vger.kernel.org
Suggested-by: Juergen Gross <jgross@suse.com>
Signed-off-by: Demi Marie Obenour <demi@invisiblethingslab.com>
Reviewed-by: Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>
Reviewed-by: Juergen Gross <jgross@suse.com>
Link: https://lore.kernel.org/r/20220710230522.1563-1-demi@invisiblethingslab.com
Signed-off-by: Juergen Gross <jgross@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-07-29 17:19:07 +02:00
..
events
xen-pciback xen-pciback: Fix return in pm_ctrl_init() 2021-11-18 14:04:25 +01:00
xenbus xen/xenbus: don't let xenbus_grant_ring() remove grants in error case 2022-03-11 12:11:54 +01:00
xenfs
acpi.c
arm-device.c
balloon.c xen/balloon: add late_initcall_sync() for initial ballooning done 2021-11-18 14:03:49 +01:00
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: Avoid blocking in unmap_grant_pages() 2022-07-07 17:52:20 +02:00
gntdev-dmabuf.c
gntdev-dmabuf.h
gntdev.c xen/gntdev: Ignore failure to unmap INVALID_GRANT_HANDLE 2022-07-29 17:19:07 +02:00
grant-table.c xen/gnttab: fix gnttab_end_foreign_access() without page specified 2022-03-11 12:11:54 +01:00
Kconfig
Makefile
manage.c
mcelog.c
mem-reservation.c
pci.c
pcpu.c
platform-pci.c
privcmd-buf.c
privcmd.c
privcmd.h
pvcalls-back.c
pvcalls-front.c xen/pvcalls: use alloc/free_pages_exact() 2022-03-11 12:11:54 +01:00
pvcalls-front.h
swiotlb-xen.c
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