android_kernel_oneplus_msm8998/drivers
Michael S. Tsirkin 9e5e2625a2 UPSTREAM: virtio: new feature to detect IOMMU device quirk
The interaction between virtio and IOMMUs is messy.

On most systems with virtio, physical addresses match bus addresses,
and it doesn't particularly matter which one we use to program
the device.

On some systems, including Xen and any system with a physical device
that speaks virtio behind a physical IOMMU, we must program the IOMMU
for virtio DMA to work at all.

On other systems, including SPARC and PPC64, virtio-pci devices are
enumerated as though they are behind an IOMMU, but the virtio host
ignores the IOMMU, so we must either pretend that the IOMMU isn't
there or somehow map everything as the identity.

Add a feature bit to detect that quirk: VIRTIO_F_IOMMU_PLATFORM.

Any device with this feature bit set to 0 needs a quirk and has to be
passed physical addresses (as opposed to bus addresses) even though
the device is behind an IOMMU.

Note: it has to be a per-device quirk because for example, there could
be a mix of passed-through and virtual virtio devices. As another
example, some devices could be implemented by an out of process
hypervisor backend (in case of qemu vhost, or vhost-user) and so support
for an IOMMU needs to be coded up separately.

It would be cleanest to handle this in IOMMU core code, but that needs
per-device DMA ops. While we are waiting for that to be implemented, use
a work-around in virtio core.

Note: a "noiommu" feature is a quirk - add a wrapper to make
that clear.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
(cherry picked from commit 1a937693993ff10d7e80cca6ddd55f3000aa6376)
[astrachan: should fix CONFIG_IOMMU builds]
Bug: 121166534
Test: Ran cuttlefish with android-4.4 + VSOCKETS, VMWARE_VMCI_VSOCKETS
Signed-off-by: Alistair Strachan <astrachan@google.com>

Change-Id: If09b9b34a2410de7453d2c38812550615e098b10
2019-05-15 14:34:43 +00:00
..
accessibility
acpi ACPI / SBS: Fix GPE storm on recent MacBookPro's 2019-04-27 09:33:58 +02:00
amba
android FROMGIT: binder: create node flag to request sender's security context 2019-03-04 23:28:09 +00:00
ata sata_rcar: fix deferred probing 2019-02-20 10:13:08 +01:00
atm atm: he: fix sign-extension overflow on large shift 2019-03-23 08:44:16 +01:00
auxdisplay
base This is the 4.4.177 stable release 2019-03-23 09:28:32 +01:00
bcma
block block/swim3: Fix -EBUSY error when re-opening device after unmount 2019-02-20 10:13:13 +01:00
bluetooth Revert "Bluetooth: h5: Fix missing dependency on BT_HCIUART_SERDEV" 2018-11-27 16:08:01 +01:00
bus
cdrom cdrom: Fix race condition in cdrom_sysctl_register 2019-04-27 09:33:52 +02:00
char tpm/tpm_i2c_atmel: Return -E2BIG when the transfer is incomplete 2019-04-27 09:34:00 +02:00
clk clk: ingenic: Fix round_rate misbehaving with non-integer dividers 2019-03-23 08:44:36 +01:00
clocksource This is the 4.4.177 stable release 2019-03-23 09:28:32 +01:00
connector
cpufreq Fix merge issue with 4.4.177 2019-04-08 13:03:22 +00:00
cpuidle This is the 4.4.175 stable release 2019-02-20 10:44:26 +01:00
crypto crypto: crypto4xx - properly set IV after de- and encrypt 2019-04-27 09:34:00 +02:00
dca
devfreq PM / devfreq: tegra: fix error return code in tegra_devfreq_probe() 2018-11-10 07:41:40 -08:00
dio
dma dmaengine: tegra: avoid overflow of byte tracking 2019-04-27 09:33:53 +02:00
dma-buf
edac EDAC, i7core: Fix memleaks and use-after-free on probe and remove 2018-10-10 08:52:06 +02:00
eisa
extcon extcon: usb-gpio: Don't miss event during suspend/resume 2019-04-03 06:23:18 +02:00
firewire
firmware efi: stub: define DISABLE_BRANCH_PROFILING for all architectures 2019-04-03 06:23:20 +02:00
fmc
fpga
gpio gpio: gpio-omap: fix level interrupt idling 2019-04-27 09:33:48 +02:00
gpu UPSTREAM: virtio: make find_vqs() checkpatch.pl-friendly 2019-05-14 17:56:52 -07:00
hid hid-sensor-hub.c: fix wrong do_div() usage 2019-04-03 06:23:21 +02:00
hsi
hv Drivers: hv: vmbus: Return -EINVAL for the sys files for unopened channels 2019-01-13 10:05:27 +01:00
hwmon hwmon: (lm80) Fix missing unlock on error in set_fan_div() 2019-02-23 09:05:13 +01:00
hwspinlock
hwtracing coresight: etm4x: Add support to enable ETMv4.2 2019-04-27 09:33:50 +02:00
i2c i2c: core-smbus: prevent stack corruption on read I2C_BLOCK_DATA 2019-04-27 09:33:47 +02:00
ide ide: pmac: add of_node_put() 2018-12-21 14:09:52 +01:00
idle
iio io: accel: kxcjk1013: restore the range after resume. 2019-04-27 09:34:01 +02:00
infiniband IB/mlx4: Fix race condition between catas error reset and aliasguid flows 2019-04-27 09:33:56 +02:00
input This is the 4.4.177 stable release 2019-03-23 09:28:32 +01:00
iommu iommu/dmar: Fix buffer overflow during PCI bus notification 2019-04-27 09:33:59 +02:00
ipack
irqchip This is the 4.4.177 stable release 2019-03-23 09:28:32 +01:00
isdn mISDN: hfcpci: Test both vendor & device ID for Digium HFC4S 2019-04-03 06:23:25 +02:00
leds leds: lp55xx: fix null deref on firmware load failure 2019-04-27 09:33:51 +02:00
lguest
lightnvm
macintosh macintosh/via-pmu: Add missing mmio accessors 2018-09-19 22:48:57 +02:00
mailbox
mcb
md This is the 4.4.179 stable release 2019-04-30 13:25:38 +02:00
media media: s5p-jpeg: Check for fmt_ver_flag when doing fmt enumeration 2019-04-27 09:33:53 +02:00
memory memory: tegra: Apply interrupts mask per SoC 2018-08-06 16:24:38 +02:00
memstick memstick: Prevent memstick host from getting runtime suspended during card detection 2019-02-20 10:13:09 +01:00
message
mfd mfd: mc13xxx: Fix a missing check of a register-read failure 2019-03-23 08:44:16 +01:00
misc UPSTREAM: virtio: make find_vqs() checkpatch.pl-friendly 2019-05-14 17:56:52 -07:00
mmc This is the 4.4.179 stable release 2019-04-30 13:25:38 +02:00
mtd This is the 4.4.175 stable release 2019-02-20 10:44:26 +01:00
net UPSTREAM: virt_wifi: Remove REGULATORY_WIPHY_SELF_MANAGED 2019-05-14 17:59:20 -07:00
nfc This is the 4.4.175 stable release 2019-02-20 10:44:26 +01:00
ntb
nubus
nvdimm libnvdimm: Hold reference on parent while scheduling async init 2018-11-21 09:27:34 +01:00
nvme nvme-pci: initialize queue memory before interrupts 2018-07-11 16:03:47 +02:00
nvmem
of This is the 4.4.166 stable release 2018-12-01 10:09:35 +01:00
oprofile
parisc
parport parport_pc: fix find_superio io compare code, should use equal test. 2019-03-23 08:44:37 +01:00
pci PCI: Add function 1 DMA alias quirk for Marvell 9170 SATA controller 2019-04-27 09:33:56 +02:00
pcmcia pcmcia: Implement CLKRUN protocol disabling for Ricoh bridges 2018-11-21 09:27:30 +01:00
perf
phy
pinctrl pinctrl: meson: meson8b: fix the sdxc_a data 1..3 pins 2019-03-23 08:44:33 +01:00
platform This is the 4.4.177 stable release 2019-03-23 09:28:32 +01:00
pnp
power This is the 4.4.170 stable release 2019-01-13 10:36:32 +01:00
powercap
pps
ps3
ptp ptp: check gettime64 return code in PTP_SYS_OFFSET ioctl 2019-02-20 10:13:05 +01:00
pwm pwm: tiehrpwm: Fix disabling of output of PWMs 2018-09-09 20:04:35 +02:00
rapidio
ras
regulator regulator: act8865: Fix act8600_sudcdc_voltage_ranges setting 2019-04-27 09:33:53 +02:00
remoteproc UPSTREAM: virtio: make find_vqs() checkpatch.pl-friendly 2019-05-14 17:56:52 -07:00
reset
rpmsg UPSTREAM: virtio: make find_vqs() checkpatch.pl-friendly 2019-05-14 17:56:52 -07:00
rtc This is the 4.4.178 stable release 2019-04-03 10:21:44 +02:00
s390 UPSTREAM: virtio: make find_vqs() checkpatch.pl-friendly 2019-05-14 17:56:52 -07:00
sbus drivers/sbus/char: add of_node_put() 2018-12-21 14:09:52 +01:00
scsi This is the 4.4.179 stable release 2019-04-30 13:25:38 +02:00
sfi
sh
sn
soc soc/tegra: fuse: Fix illegal free of IO base address 2019-04-27 09:33:52 +02:00
spi spi: bcm2835: Unbreak the build of esoteric configs 2019-01-13 10:05:31 +01:00
spmi
ssb
staging ANDROID: Communicates LMK events to userland where they can be logged 2019-05-08 10:25:20 +01:00
target scsi: target/iscsi: Avoid iscsit_release_commands_from_conn() deadlock 2019-03-23 08:44:35 +01:00
tc TC: Set DMA masks for devices 2018-11-21 09:27:36 +01:00
tee
thermal thermal/int340x_thermal: fix mode setting 2019-04-27 09:33:57 +02:00
thunderbolt
tty This is the 4.4.179 stable release 2019-04-30 13:25:38 +02:00
uio uio: Fix an Oops on load 2018-11-27 16:08:02 +01:00
usb This is the 4.4.179 stable release 2019-04-30 13:25:38 +02:00
uwb uwb: hwa-rc: fix memory leak at probe 2018-10-10 08:52:04 +02:00
vfio
vhost UPSTREAM: vhost/vsock: fix reset orphans race with close timeout 2019-05-14 17:57:04 -07:00
video This is the 4.4.179 stable release 2019-04-30 13:25:38 +02:00
virt mm: replace get_user_pages() write/force parameters with gup_flags 2018-12-17 21:55:16 +01:00
virtio UPSTREAM: virtio: new feature to detect IOMMU device quirk 2019-05-15 14:34:43 +00:00
vlynq
vme
w1 This is the 4.4.164 stable release 2018-11-21 11:40:16 +01:00
watchdog
xen xen: xlate_mmu: add missing header to fix 'W=1' warning 2018-12-17 21:55:11 +01:00
zorro
Kconfig
Makefile UPSTREAM: vhost: drop vringh dependency 2019-05-14 17:56:58 -07:00