twx-linux/include/uapi/linux
Alex Williamson 1ef3e2bc04 vfio/iommu_type1: Multi-IOMMU domain support
We currently have a problem that we cannot support advanced features
of an IOMMU domain (ex. IOMMU_CACHE), because we have no guarantee
that those features will be supported by all of the hardware units
involved with the domain over its lifetime.  For instance, the Intel
VT-d architecture does not require that all DRHDs support snoop
control.  If we create a domain based on a device behind a DRHD that
does support snoop control and enable SNP support via the IOMMU_CACHE
mapping option, we cannot then add a device behind a DRHD which does
not support snoop control or we'll get reserved bit faults from the
SNP bit in the pagetables.  To add to the complexity, we can't know
the properties of a domain until a device is attached.

We could pass this problem off to userspace and require that a
separate vfio container be used, but we don't know how to handle page
accounting in that case.  How do we know that a page pinned in one
container is the same page as a different container and avoid double
billing the user for the page.

The solution is therefore to support multiple IOMMU domains per
container.  In the majority of cases, only one domain will be required
since hardware is typically consistent within a system.  However, this
provides us the ability to validate compatibility of domains and
support mixed environments where page table flags can be different
between domains.

To do this, our DMA tracking needs to change.  We currently try to
coalesce user mappings into as few tracking entries as possible.  The
problem then becomes that we lose granularity of user mappings.  We've
never guaranteed that a user is able to unmap at a finer granularity
than the original mapping, but we must honor the granularity of the
original mapping.  This coalescing code is therefore removed, allowing
only unmaps covering complete maps.  The change in accounting is
fairly small here, a typical QEMU VM will start out with roughly a
dozen entries, so it's arguable if this coalescing was ever needed.

We also move IOMMU domain creation to the point where a group is
attached to the container.  An interesting side-effect of this is that
we now have access to the device at the time of domain creation and
can probe the devices within the group to determine the bus_type.
This finally makes vfio_iommu_type1 completely device/bus agnostic.
In fact, each IOMMU domain can host devices on different buses managed
by different physical IOMMUs, and present a single DMA mapping
interface to the user.  When a new domain is created, mappings are
replayed to bring the IOMMU pagetables up to the state of the current
container.  And of course, DMA mapping and unmapping automatically
traverse all of the configured IOMMU domains.

Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
Cc: Varun Sethi <Varun.Sethi@freescale.com>
2014-02-26 11:38:36 -07:00
..
byteorder
caif caif: Remove my bouncing email address. 2013-04-23 13:25:51 -04:00
can can: add explicit copyrights to can's netlink header 2013-09-21 15:43:12 +02:00
cifs cifs: Move and expand MAX_SERVER_SIZE definition 2013-09-08 14:34:22 -05:00
dvb [media] demux.h: Remove duplicated enum 2013-04-08 06:53:15 -03:00
genwqe GenWQE PCI support, health monitoring and recovery 2013-12-18 16:51:15 -08:00
hdlc
hsi
isdn
mmc
netfilter Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/pablo/nf-next 2014-01-10 14:50:02 -05:00
netfilter_arp
netfilter_bridge uapi: Convert some uses of 6 to ETH_ALEN 2013-08-02 12:33:54 -07:00
netfilter_ipv4 uapi: Convert some uses of 6 to ETH_ALEN 2013-08-02 12:33:54 -07:00
netfilter_ipv6 netfilter: fix struct ip6t_frag field description 2013-04-02 12:25:57 +02:00
nfsd
raid md: Change handling of save_raid_disk and metadata update during recovery. 2014-01-14 16:44:21 +11:00
spi
sunrpc
tc_act net_sched: act: pick a different type for act_xt 2014-01-16 17:24:11 -08:00
tc_ematch
usb USB: move the definition of USB_MAXCHILDREN 2013-07-16 15:33:02 -07:00
wimax uapi: Convert some uses of 6 to ETH_ALEN 2013-08-02 12:33:54 -07:00
a.out.h
acct.h UAPI: fix endianness conditionals in linux/acct.h 2013-03-13 15:21:48 -07:00
adb.h
adfs_fs.h
affs_hardblocks.h
agpgart.h
aio_abi.h UAPI: fix endianness conditionals in linux/aio_abi.h 2013-03-13 15:21:48 -07:00
apm_bios.h apm-emulation: add hibernation APM events to support suspend2disk 2014-01-07 13:50:28 +01:00
arcfb.h
atalk.h
atm_eni.h
atm_he.h
atm_idt77105.h
atm_nicstar.h
atm_tcp.h
atm_zatm.h
atm.h
atmapi.h
atmarp.h
atmbr2684.h
atmclip.h
atmdev.h
atmioc.h
atmlec.h
atmmpc.h
atmppp.h
atmsap.h
atmsvc.h
audit.h Merge git://git.infradead.org/users/eparis/audit 2014-01-23 18:08:10 -08:00
auto_fs4.h
auto_fs.h unbreak automounter support on 64-bit kernel with 32-bit userspace (v2) 2013-02-08 20:42:18 +01:00
auxvec.h powerpc: Add HWCAP2 aux entry 2013-04-26 16:08:16 +10:00
ax25.h
b1lli.h
baycom.h
bcache.h bcache: Add bch_btree_keys_u64s_remaining() 2014-01-08 13:05:13 -08:00
bcm933xx_hcs.h MIPS: BCM63XX: recognize Cable Modem firmware format 2013-07-01 15:10:53 +02:00
bfs_fs.h
binfmts.h
blkpg.h
blktrace_api.h
bpqether.h
bsg.h
btrfs.h Revert "btrfs: add ioctl to export size of global metadata reservation" 2014-02-14 13:42:13 -08:00
can.h
capability.h
capi.h
cciss_defs.h
cciss_ioctl.h
cdrom.h libata: identify and init ZPODD devices 2013-01-21 15:40:35 -05:00
cgroupstats.h
chio.h
cm4000_cs.h Omnikey Cardman 4000: pull in ioctl.h in user header 2013-08-28 19:26:38 -07:00
cn_proc.h connector: Added coredumping event to the process connector 2013-03-20 13:23:21 -04:00
coda_psdev.h
coda.h
coff.h
connector.h Drivers: hv: Add a new driver to support host initiated backup 2013-03-15 12:12:36 -07:00
const.h linux/const.h: Add _BITUL() and _BITULL() 2013-06-25 15:50:04 -07:00
cramfs_fs.h
cuda.h
cyclades.h
cycx_cfm.h
dcbnl.h
dccp.h
dlm_device.h
dlm_netlink.h
dlm_plock.h
dlm.h
dlmconstants.h
dm-ioctl.h dm: allow remove to be deferred 2013-11-09 18:20:22 -05:00
dm-log-userspace.h dm log userspace: allow mark requests to piggyback on flush requests 2014-01-21 23:46:27 -05:00
dn.h include/uapi/linux/dn.h: pull in ioctl.h header 2014-01-23 16:36:55 -08:00
dqblk_xfs.h quota: Add a new quotactl command Q_XGETQSTATV 2013-08-20 16:53:58 -05:00
edd.h
efs_fs_sb.h
elf-em.h Drop remaining references to H8/300 architecture 2013-09-16 18:20:24 -07:00
elf-fdpic.h
elf.h metag: ptrace: Implement NT_METAG_TLS 2013-03-27 14:37:47 +00:00
elfcore.h
errno.h
errqueue.h
ethtool.h net: ethtool: disambiguate XCVR_* meaning 2013-05-27 22:42:50 -07:00
eventpoll.h epoll: drop EPOLLWAKEUP if PM_SLEEP is disabled 2013-12-03 15:35:52 +01:00
fadvise.h
falloc.h
fanotify.h
fb.h
fcntl.h
fd.h floppy: bail out in open() if drive is not responding to block0 read 2014-01-17 11:12:06 +01:00
fdreg.h
fib_rules.h fib_rules: fix suppressor names and default values 2013-08-03 10:40:23 -07:00
fiemap.h ext4: add support for extent pre-caching 2013-08-16 22:05:14 -04:00
filter.h filter: add ANC_PAY_OFFSET instruction for loading payload start offset 2013-03-20 13:15:45 -04:00
firewire-cdev.h firewire: fix libdc1394/FlyCap2 iso event regression 2013-07-27 20:24:36 +02:00
firewire-constants.h
flat.h
fs.h fs: bump inode and dentry counters to long 2013-09-10 18:56:29 -04:00
fsl_hypervisor.h
fuse.h fuse: add flag to turn on async direct IO 2013-05-01 14:37:21 +02:00
futex.h
gameport.h
gen_stats.h net_sched: add 64bit rate estimators 2013-06-11 02:51:03 -07:00
genetlink.h genetlink/pmcraid: use proper genetlink multicast API 2013-11-28 18:26:30 -05:00
gfs2_ondisk.h GFS2: Add hints to directory leaf blocks 2014-01-08 12:14:57 +00:00
gigaset_dev.h
hash_info.h crypto: provide single place for hash algo information 2013-10-25 17:14:03 -04:00
hdlc.h
hdlcdrv.h
hdreg.h
hid.h
hiddev.h
hidraw.h
hpet.h
hsr_netlink.h net/hsr: Add support for the High-availability Seamless Redundancy protocol (HSRv0) 2013-11-03 23:20:14 -05:00
hw_breakpoint.h perf: Make perf build for x86 with UAPI disintegration applied 2012-11-19 22:21:03 +00:00
hysdn_if.h
i2c-dev.h
i2c.h
i2o-dev.h
i8k.h
icmp.h
icmpv6.h ICMPv6: treat dest unreachable codes 5 and 6 as EACCES, not EPROTO 2013-09-03 22:11:44 -04:00
if_addr.h ipv6 addrconf: add IFA_F_NOPREFIXROUTE flag to suppress creation of IP6 routes 2014-01-15 17:00:40 -08:00
if_addrlabel.h
if_alg.h
if_arcnet.h
if_arp.h net: if_arp: add ARPHRD_6LOWPAN type 2013-12-11 12:57:55 -08:00
if_bonding.h bonding: modify the old and add new xmit hash policies 2013-10-03 15:36:38 -04:00
if_bridge.h uapi: Convert some uses of 6 to ETH_ALEN 2013-08-02 12:33:54 -07:00
if_cablemodem.h if_cablemodem.h: Add parenthesis around ioctl macros 2013-05-08 13:13:30 -07:00
if_eql.h
if_ether.h net/hsr: Add support for the High-availability Seamless Redundancy protocol (HSRv0) 2013-11-03 23:20:14 -05:00
if_fc.h
if_fddi.h
if_frad.h
if_hippi.h
if_infiniband.h
if_link.h rtnetlink: remove IFLA_BOND_SLAVE definition 2014-01-24 00:36:48 -08:00
if_ltalk.h
if_packet.h af_packet: Add Queue mapping mode to af_packet fanout operation 2014-01-22 17:35:50 -08:00
if_phonet.h
if_plip.h
if_ppp.h
if_pppol2tp.h
if_pppox.h pptp: fix byte order warnings 2013-08-13 15:10:22 -07:00
if_slip.h
if_team.h
if_tun.h tun: Get skfilter layout 2013-08-21 12:21:45 -07:00
if_tunnel.h sit: allow to configure 6rd tunnels via netlink 2012-11-20 13:43:28 -05:00
if_vlan.h net/8021q: Implement Multiple VLAN Registration Protocol (MVRP) 2013-02-10 20:37:22 -05:00
if_x25.h
if.h net: Add layer 2 hardware acceleration operations for macvlan devices 2013-11-07 19:11:41 -05:00
igmp.h
in6.h inet: defines IPPROTO_* needed for module alias generation 2014-02-06 21:18:06 -08:00
in_route.h
in.h ipv4: introduce new IP_MTU_DISCOVER mode IP_PMTUDISC_INTERFACE 2013-11-05 21:52:27 -05:00
inet_diag.h
inotify.h
input.h Input: define KEY_WWAN for Wireless WAN 2013-12-16 02:20:40 -08:00
ioctl.h
ip6_tunnel.h
ip_vs.h ipvs: fix the IPVS_CMD_ATTR_MAX definition 2013-10-15 10:36:01 +09:00
ip.h Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2013-08-26 16:37:08 -04:00
ipc.h
ipmi_msgdefs.h
ipmi.h ipmi: remove superfluous kernel/userspace explanation 2013-02-27 19:10:21 -08:00
ipsec.h
ipv6_route.h
ipv6.h ipv6: drop fragmented ndisc packets by default (RFC 6980) 2013-08-29 15:32:08 -04:00
ipx.h
irda.h
irqnr.h
isdn_divertif.h
isdn_ppp.h
isdn.h
isdnif.h
iso_fs.h
ivtv.h
ivtvfb.h
ixjuser.h
jffs2.h
joystick.h
Kbuild zorro/UAPI: Disintegrate include/linux/zorro*.h 2013-11-26 11:09:08 +01:00
kd.h
kdev_t.h
kernel-page-flags.h
kernel.h
kernelcapi.h
kexec.h m68k: Add kexec support 2013-12-08 11:01:47 +01:00
keyboard.h
keyctl.h KEYS: Add per-user_namespace registers for persistent per-UID kerberos caches 2013-09-24 10:35:19 +01:00
kvm_para.h kvm uapi: Add KICK_CPU and PV_UNHALT definition to uapi 2013-08-26 12:46:01 +03:00
kvm.h add support for Hyper-V reference time counter 2014-01-17 10:22:08 +01:00
l2tp.h
libc-compat.h net: sync some IP headers with glibc 2013-09-04 13:12:43 -04:00
limits.h
llc.h
loop.h
lp.h
magic.h Btrfs: add tests for find_lock_delalloc_range 2013-11-11 21:56:51 -05:00
major.h mtd: Move major number definitions to major.h 2013-11-06 23:32:59 -08:00
map_to_7segment.h
matroxfb.h
mdio.h
media.h [media] media: Add pad flag MEDIA_PAD_FL_MUST_CONNECT 2013-12-04 14:59:20 -02:00
mei.h
mempolicy.h mm: numa: Migrate on reference policy 2012-12-11 14:42:48 +00:00
meye.h [media] meye: convert to the control framework 2013-02-05 18:23:47 -02:00
mic_common.h misc: mic: Fix endianness issues. 2013-11-27 11:03:38 -08:00
mic_ioctl.h misc: mic: fix possible signed underflow (undefined behavior) in userspace API 2014-02-07 15:30:34 -08:00
mii.h
minix_fs.h
mman.h
mmtimer.h
module.h module: add flags arg to sys_finit_module() 2012-12-14 13:05:23 +10:30
mqueue.h uapi: Use __kernel_long_t in struct mq_attr 2014-01-20 14:45:33 -08:00
mroute6.h mcast: add multicast proxy support (IPv4 and IPv6) 2013-01-21 13:55:14 -05:00
mroute.h mcast: add multicast proxy support (IPv4 and IPv6) 2013-01-21 13:55:14 -05:00
msdos_fs.h fatfs: add FAT_IOCTL_GET_VOLUME_ID 2013-07-09 10:33:25 -07:00
msg.h uapi: Use __kernel_long_t in struct msgbuf 2014-01-20 14:44:50 -08:00
mtio.h
n_r3964.h
nbd.h nbd: support FLUSH requests 2013-02-27 19:10:22 -08:00
ncp_fs.h
ncp_mount.h
ncp_no.h
ncp.h
neighbour.h neighbour.h: fix comment 2014-01-22 10:34:15 +01:00
net_dropmon.h
net_tstamp.h net_tstamp: Add SIOCGHWTSTAMP ioctl to match SIOCSHWTSTAMP 2013-11-19 19:07:21 +00:00
net.h
netconf.h netconf: rename PROXY_ARP to NEIGH_PROXY 2013-12-22 18:02:43 -05:00
netdevice.h
netfilter_arp.h
netfilter_bridge.h
netfilter_decnet.h
netfilter_ipv4.h
netfilter_ipv6.h
netfilter.h netfilter: nf_tables: add "inet" table for IPv4/IPv6 2014-01-07 23:57:25 +01:00
netlink_diag.h diag: warn about missing first netlink attribute 2013-11-28 18:16:43 -05:00
netlink.h netlink: mmaped netlink: ring setup 2013-04-19 14:57:57 -04:00
netrom.h
nfc.h NFC: Define secure element IO API and commands 2013-09-25 02:30:47 +02:00
nfs2.h
nfs3.h
nfs4_mount.h
nfs4.h uapi: convert u64 to __u64 in exported headers 2014-01-23 16:36:55 -08:00
nfs_fs.h
nfs_idmap.h
nfs_mount.h NFS: stop using NFS_MOUNT_SECFLAVOUR server flag 2013-10-28 15:37:56 -04:00
nfs.h
nfsacl.h
nl80211.h cfg80211: Add support for QoS mapping 2013-12-19 16:29:22 +01:00
nubus.h
nvme.h NVMe: Abort timed out commands 2014-01-27 19:27:53 -05:00
nvram.h
omap3isp.h
omapfb.h
oom.h
openvswitch.h openvswitch: Drop user features if old user space attempted to create datapath 2014-01-06 15:53:00 -08:00
packet_diag.h diag: warn about missing first netlink attribute 2013-11-28 18:16:43 -05:00
param.h
parport.h
patchkey.h
pci_regs.h Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next 2014-01-25 11:17:34 -08:00
pci.h
perf_event.h uapi: convert u64 to __u64 in exported headers 2014-01-23 16:36:55 -08:00
personality.h
pfkeyv2.h
pg.h
phantom.h
phonet.h
pkt_cls.h net: sched: cls_bpf: add BPF-based classifier 2013-10-29 17:33:17 -04:00
pkt_sched.h net: pkt_sched: PIE AQM scheme 2014-01-06 15:13:01 -05:00
pktcdvd.h
pmu.h
poll.h
posix_types.h
ppdev.h
ppp_defs.h
ppp-comp.h
ppp-ioctl.h include/uapi/linux/ppp-ioctl.h: pull in ppp_defs.h 2014-01-23 16:36:55 -08:00
pps.h
prctl.h
ptp_clock.h
ptrace.h ptrace: add ability to get/set signal-blocked mask 2013-07-03 16:08:01 -07:00
qnx4_fs.h
qnxtypes.h
quota.h
radeonfb.h
random.h random32: move rnd_state to linux/random.h 2013-11-11 14:32:14 -05:00
raw.h
rds.h
reboot.h
reiserfs_fs.h
reiserfs_xattr.h xattr: Constify ->name member of "struct xattr". 2013-07-25 19:30:03 +10:00
resource.h uapi: Use __kernel_long_t/__kernel_ulong_t in <linux/resource.h> 2014-01-20 14:44:17 -08:00
rfkill.h rfkill: Add NFC to the list of supported radios 2013-04-12 16:54:38 +02:00
romfs_fs.h
rose.h
route.h
rtc.h
rtnetlink.h tcp: introduce a per-route knob for quick ack 2013-06-19 23:06:51 -07:00
scc.h
sched.h sched: Move SCHED_RESET_ON_FORK into attr::sched_flags 2014-01-16 09:27:17 +01:00
screen_info.h
sctp.h sctp: Fix FSF address in file headers 2013-12-06 12:37:56 -05:00
sdla.h
seccomp.h
securebits.h
selinux_netlink.h
sem.h
serial_core.h Merge git://git.kernel.org/pub/scm/linux/kernel/git/cmetcalf/linux-tile 2013-09-06 11:14:33 -07:00
serial_reg.h Revert "OMAP: UART: Keep the TX fifo full when possible" 2013-08-27 16:02:18 -07:00
serial.h
serio.h
shm.h uapi: Use __kernel_ulong_t in shmid64_ds/shminfo64/shm_info 2014-01-20 14:45:25 -08:00
signal.h unify SS_ONSTACK/SS_DISABLE definitions 2012-12-19 18:07:39 -05:00
signalfd.h
snmp.h tcp: auto corking 2013-12-06 12:51:41 -05:00
sock_diag.h
socket.h
sockios.h net_tstamp: Add SIOCGHWTSTAMP ioctl to match SIOCSHWTSTAMP 2013-11-19 19:07:21 +00:00
som.h
sonet.h
sonypi.h
sound.h
soundcard.h
stat.h
stddef.h
string.h
suspend_ioctls.h
swab.h byteorder: allow arch to opt to use GCC intrinsics for byteswapping 2012-12-06 01:22:31 +00:00
synclink.h
sysctl.h
sysinfo.h
taskstats.h
tcp_metrics.h tcp: metrics: New netlink attribute for src IP and dumped in netlink reply 2014-01-10 17:38:18 -05:00
tcp.h tcp: TCP_NOTSENT_LOWAT socket option 2013-07-24 17:54:48 -07:00
telephony.h
termios.h
time.h timekeeping: Add CLOCK_TAI clockid 2013-03-22 16:19:59 -07:00
times.h
timex.h uapi: Use __kernel_long_t in struct timex 2014-01-20 14:44:05 -08:00
tiocl.h
tipc_config.h tipc: update code comments to reflect new uapi header path 2013-06-17 15:53:00 -07:00
tipc.h tipc: update code comments to reflect new uapi header path 2013-06-17 15:53:00 -07:00
toshiba.h
tty_flags.h
tty.h
types.h
udf_fs_i.h
udp.h
uhid.h HID: uhid: use generic hidinput_input_event() 2013-07-31 10:33:05 +02:00
uinput.h
uio.h
ultrasound.h
un.h
unistd.h
unix_diag.h diag: warn about missing first netlink attribute 2013-11-28 18:16:43 -05:00
usbdevice_fs.h
utime.h
utsname.h
uuid.h
uvcvideo.h
v4l2-common.h
v4l2-controls.h [media] s5p-mfc: Add controls to set vp8 enc profile 2014-01-13 10:59:11 -02:00
v4l2-dv-timings.h [media] v4l2-dv-timings.h: remove duplicate V4L2_DV_BT_DMT_1366X768P60 2013-08-18 08:13:51 -03:00
v4l2-mediabus.h [media] v4l: Add media format codes for AHSV8888 on 32-bit busses 2013-12-11 09:21:37 -02:00
v4l2-subdev.h
veth.h
vfio.h vfio/iommu_type1: Multi-IOMMU domain support 2014-02-26 11:38:36 -07:00
vhost.h tcm_vhost: header split up 2013-05-02 13:40:15 +03:00
videodev2.h [media] videodev2: Set vb2_rect's width and height as unsigned 2014-01-07 08:02:39 -02:00
virtio_9p.h
virtio_balloon.h virtio: do not export "u16" and "u64" to userspace 2013-04-02 16:42:58 +10:30
virtio_blk.h
virtio_config.h virtio: VIRTIO_F_ANY_LAYOUT feature 2013-07-09 10:47:45 +09:30
virtio_console.h Simple warning fix for module sections. If too late to pull, no big deal. 2013-07-03 13:09:06 -07:00
virtio_ids.h caif_virtio: Introduce caif over virtio 2013-03-20 14:06:06 +10:30
virtio_net.h uapi: Convert some uses of 6 to ETH_ALEN 2013-08-02 12:33:54 -07:00
virtio_pci.h virtio_pci: better macro exported in uapi 2013-05-20 12:08:09 +09:30
virtio_ring.h
virtio_rng.h
vm_sockets.h VSOCK: Split vm_sockets.h into kernel/uapi 2013-03-08 12:24:48 -05:00
vsp1.h [media] v4l: vsp1: Add LUT support 2013-12-11 09:25:20 -02:00
vt.h
wait.h
wanrouter.h wanrouter: delete now orphaned header content, files/drivers 2013-01-31 19:56:35 -05:00
watchdog.h
wimax.h
wireless.h
x25.h
xattr.h Btrfs: add support for inode properties 2014-01-28 13:20:24 -08:00
xfrm.h xfrm: allow to avoid copying DSCP during encapsulation 2013-03-06 07:02:45 +01:00
zorro_ids.h zorro/UAPI: Disintegrate include/linux/zorro*.h 2013-11-26 11:09:08 +01:00
zorro.h zorro/UAPI: Use proper types (endianness/size) in <linux/zorro.h> 2013-11-26 11:09:09 +01:00