kernel_optimize_test/drivers
Alexey Kardashevskiy 6cdd978213 vfio: add external user support
VFIO is designed to be used via ioctls on file descriptors
returned by VFIO.

However in some situations support for an external user is required.
The first user is KVM on PPC64 (SPAPR TCE protocol) which is going to
use the existing VFIO groups for exclusive access in real/virtual mode
on a host to avoid passing map/unmap requests to the user space which
would made things pretty slow.

The protocol includes:

1. do normal VFIO init operation:
	- opening a new container;
	- attaching group(s) to it;
	- setting an IOMMU driver for a container.
When IOMMU is set for a container, all groups in it are
considered ready to use by an external user.

2. User space passes a group fd to an external user.
The external user calls vfio_group_get_external_user()
to verify that:
	- the group is initialized;
	- IOMMU is set for it.
If both checks passed, vfio_group_get_external_user()
increments the container user counter to prevent
the VFIO group from disposal before KVM exits.

3. The external user calls vfio_external_user_iommu_id()
to know an IOMMU ID. PPC64 KVM uses it to link logical bus
number (LIOBN) with IOMMU ID.

4. When the external KVM finishes, it calls
vfio_group_put_external_user() to release the VFIO group.
This call decrements the container user counter.
Everything gets released.

The "vfio: Limit group opens" patch is also required for the consistency.

Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
2013-08-05 10:52:36 -06:00
..
accessibility printk: move braille console support into separate braille.[ch] files 2013-07-31 14:41:03 -07:00
acpi
amba
ata
atm
auxdisplay
base
bcma
block
bluetooth Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/bluetooth/bluetooth 2013-07-31 15:11:50 -04:00
bus
cdrom
char parisc: agp/parisc-agp: allow binding of user memory to the AGP GART 2013-07-31 23:42:00 +02:00
clk
clocksource
connector
cpufreq
cpuidle
crypto
dca
devfreq
dio
dma
edac
eisa
extcon
firewire
firmware dmi_scan: add comments on dmi_present() and the loop in dmi_scan_machine() 2013-07-31 14:41:02 -07:00
fmc
gpio
gpu drm/radeon: fix 64 bit divide in SI spm code 2013-08-04 11:03:14 +10:00
hid Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/hid 2013-08-02 14:22:15 -07:00
hsi
hv
hwmon hwmon: (max6697) fix MAX6581 ideality 2013-08-03 07:04:50 -07:00
hwspinlock
i2c
ide
idle
iio
infiniband Merge branches 'cma', 'cxgb3', 'cxgb4', 'ipoib', 'misc', 'mlx4', 'mlx5', 'nes', 'ocrdma' and 'qib' into for-next 2013-07-31 14:24:06 -07:00
input
iommu
ipack
irqchip
isdn
leds
lguest
macintosh powerpc/windfarm: Fix noisy slots-fan on Xserve (rm31) 2013-08-01 13:11:47 +10:00
mailbox
md
media
memory
memstick
message
mfd
misc
mmc
mtd
net Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2013-08-03 15:00:23 -07:00
nfc
ntb
nubus
of
oprofile
parisc parisc: Fix interrupt routing for C8000 serial ports 2013-07-31 23:42:32 +02:00
parport
pci PCI updates for v3.11: 2013-08-02 13:12:52 -07:00
pcmcia
pinctrl
platform
pnp
power
pps
ps3
ptp
pwm
rapidio rapidio: fix use after free in rio_unregister_scan() 2013-07-31 14:41:02 -07:00
regulator
remoteproc
reset
rpmsg
rtc drivers/rtc/rtc-twl.c: fix: rtcX/wakealarm attribute isn't created 2013-07-31 14:41:03 -07:00
s390
sbus
scsi
sfi
sh
sn
spi
ssb
staging
target
tc
thermal
tty parisc: Fix interrupt routing for C8000 serial ports 2013-07-31 23:42:32 +02:00
uio
usb
uwb
vfio vfio: add external user support 2013-08-05 10:52:36 -06:00
vhost
video Small fbdev fixes 2013-07-31 17:54:24 -07:00
virt
virtio
vlynq
vme
w1
watchdog
xen Fixes: 2013-07-31 11:37:43 -07:00
zorro
Kconfig
Makefile