linux/drivers/xen
David Vrabel 923b2919e2 xen/gntdev: mark userspace PTEs as special on x86 PV guests
In an x86 PV guest, get_user_pages_fast() on a userspace address range
containing foreign mappings does not work correctly because the M2P
lookup of the MFN from a userspace PTE may return the wrong page.

Force get_user_pages_fast() to fail on such addresses by marking the PTEs
as special.

If Xen has XENFEAT_gnttab_map_avail_bits (available since at least
4.0), we can do so efficiently in the grant map hypercall.  Otherwise,
it needs to be done afterwards.  This is both inefficient and racy
(the mapping is visible to the task before we fixup the PTEs), but
will be fine for well-behaved applications that do not use the mapping
until after the mmap() system call returns.

Guests with XENFEAT_auto_translated_physmap (ARM and x86 HVM or PVH)
do not need this since get_user_pages() has always worked correctly
for them.

Signed-off-by: David Vrabel <david.vrabel@citrix.com>
Reviewed-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
2015-01-28 14:04:21 +00:00
..
events xen/events: support threaded irqs for interdomain event channels 2014-09-23 13:36:19 +00:00
xen-pciback xen-pciback: drop SR-IOV VFs when PF driver unloads 2014-12-04 12:42:03 +00:00
xenbus xen: remove DEFINE_XENBUS_DRIVER() macro 2014-10-06 10:27:57 +01:00
xenfs xen: Convert printks to pr_<level> 2013-06-28 11:19:58 -04:00
acpi.c xen / ACPI: notify xen when reduced hardware sleep is available 2013-07-31 14:22:35 +02:00
balloon.c xen: remove scratch frames for ballooned pages and m2p override 2015-01-28 14:03:10 +00:00
biomerge.c
cpu_hotplug.c xen: Convert printks to pr_<level> 2013-06-28 11:19:58 -04:00
dbgp.c xen: Use dev_is_pci() to check whether it is pci device 2014-01-07 09:53:33 -05:00
efi.c efi: dmi: add support for SMBIOS 3.0 UEFI configuration table 2014-11-05 09:03:16 +01:00
evtchn.c xen/evtchn: support more than 4096 ports 2014-01-06 10:07:50 -05:00
fallback.c xen-pciback: notify hypervisor about devices intended to be assigned to guests 2013-03-22 10:20:55 -04:00
features.c
gntalloc.c xen/gntalloc: safely delete grefs in add_grefs() undo path 2014-09-04 13:14:05 +01:00
gntdev.c xen/gntdev: mark userspace PTEs as special on x86 PV guests 2015-01-28 14:04:21 +00:00
grant-table.c xen/grant-table: add a mechanism to safely unmap pages that are in use 2015-01-28 14:03:14 +00:00
Kconfig xen-scsiback: Add Xen PV SCSI backend driver 2014-09-23 13:36:19 +00:00
Makefile xen-scsiback: Add Xen PV SCSI backend driver 2014-09-23 13:36:19 +00:00
manage.c xen/manage: Always freeze/thaw processes when suspend/resuming 2014-09-02 15:36:59 +01:00
mcelog.c xen: Convert printks to pr_<level> 2013-06-28 11:19:58 -04:00
pci.c xen/pci: Allocate memory for physdev_pci_device_add's optarr 2014-10-23 16:24:02 +01:00
pcpu.c drivers: xen: Include appropriate header file in pcpu.c 2014-02-28 15:26:08 -05:00
platform-pci.c drivers: xen: Mark function as static in platform-pci.c 2014-02-28 15:26:04 -05:00
privcmd.c xen: privcmd: do not return pages which we have failed to unmap 2013-12-06 17:55:56 +00:00
privcmd.h
swiotlb-xen.c Revert "swiotlb-xen: pass dev_addr to swiotlb_tbl_unmap_single" 2014-12-10 14:58:35 +00:00
sys-hypervisor.c xen: sysfs: fix build warning. 2012-10-19 15:17:51 -04:00
tmem.c xen/tmem: mark xen_tmem_init() __init 2015-01-23 11:55:24 +00:00
xen-acpi-cpuhotplug.c ACPI: Drop acpi_evaluate_hotplug_ost() and ACPI_HOTPLUG_OST 2014-02-22 00:50:49 +01:00
xen-acpi-memhotplug.c ACPI: Drop acpi_evaluate_hotplug_ost() and ACPI_HOTPLUG_OST 2014-02-22 00:50:49 +01:00
xen-acpi-pad.c ACPI / PAD / xen: use acpi_evaluate_ost() to replace open-coded version 2014-02-21 00:27:47 +01:00
xen-acpi-processor.c xen-acpi-processor: Don't display errors when we get -ENOSYS 2014-05-23 12:34:00 -04:00
xen-balloon.c xen: Convert printks to pr_<level> 2013-06-28 11:19:58 -04:00
xen-scsiback.c xen/grant-table: add helpers for allocating pages 2015-01-28 14:03:12 +00:00
xen-selfballoon.c drivers:xen-selfballoon:reset 'frontswap_inertia_counter' after frontswap_shrink 2014-02-28 15:26:12 -05:00
xen-stub.c xen/acpi: remove redundant acpi/acpi_drivers.h include 2013-03-11 13:53:02 -04:00