linux/drivers
Cho KyongHo 66a7ed84b3 iommu/exynos: Apply workaround of caching fault page table entries
This patch contains 2 workaround for the System MMU v3.x.

System MMU v3.2 and v3.3 has FLPD cache that caches first level page
table entries to reduce page table walking latency. However, the
FLPD cache is filled with a first level page table entry even though
it is not accessed by a master H/W because System MMU v3.3
speculatively prefetches page table entries that may be accessed
in the near future by the master H/W.
The prefetched FLPD cache entries are not invalidated by iommu_unmap()
because iommu_unmap() only unmaps and invalidates the page table
entries that is mapped.

Because exynos-iommu driver discards a second level page table when
it needs to be replaced with another second level page table or
a first level page table entry with 1MB mapping, It is required to
invalidate FLPD cache that may contain the first level page table
entry that points to the second level page table.

Another workaround of System MMU v3.3 is initializing the first level
page table entries with the second level page table which is filled
with all zeros. This prevents System MMU prefetches 'fault' first
level page table entry which may lead page fault on access to 16MiB
wide.

System MMU 3.x fetches consecutive page table entries by a page
table walking to maximize bus utilization and to minimize TLB miss
panelty.
Unfortunately, functional problem is raised with the fetching behavior
because it fetches 'fault' page table entries that specifies no
translation information and that a valid translation information will
be written to in the near future. The logic in the System MMU generates
page fault with the cached fault entries that is no longer coherent
with the page table which is updated.

There is another workaround that must be implemented by I/O virtual
memory manager: any two consecutive I/O virtual memory area must have
a hole between the two that is larger than or equal to 128KiB.
Also, next I/O virtual memory area must be started from the next
128KiB boundary.

0            128K           256K               384K             512K
|-------------|---------------|-----------------|----------------|
|area1---------------->|.........hole...........|<--- area2 -----

The constraint is depicted above.
The size is selected by the calculation followed:
 - System MMU can fetch consecutive 64 page table entries at once
   64 * 4KiB = 256KiB. This is the size between 128K ~ 384K of the
   above picture. This style of fetching is 'block fetch'. It fetches
   the page table entries predefined consecutive page table entries
   including the entry that is the reason of the page table walking.
 - System MMU can prefetch upto consecutive 32 page table entries.
   This is the size between 256K ~ 384K.

Signed-off-by: Cho KyongHo <pullip.cho@samsung.com>
Signed-off-by: Shaik Ameer Basha <shaik.ameer@samsung.com>
Signed-off-by: Joerg Roedel <jroedel@suse.de>
2014-05-13 19:13:00 +02:00
..
accessibility
acpi Merge branches 'acpi-ec' and 'acpi-processor' 2014-05-03 00:20:31 +02:00
amba ARM: SoC: driver changes 2014-04-05 15:37:40 -07:00
ata Merge branch 'for-3.15-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/libata 2014-04-24 09:57:02 -07:00
atm
auxdisplay
base drivercore: deferral race condition fix 2014-04-29 15:44:05 +01:00
bcma bcma: gpio: register 32 GPIOs on BCM5357 2014-03-27 14:20:04 -04:00
block floppy: don't write kernel-only members to FDRAWCMD ioctl output 2014-05-05 07:46:56 -07:00
bluetooth Bluetooth: Add support for Lite-on [04ca:3007] 2014-04-25 09:47:16 +03:00
bus ARM: SoC: driver changes 2014-04-05 15:37:40 -07:00
cdrom
char agp: info leak in agpioc_info_wrap() 2014-05-06 13:05:00 -07:00
clk vexpress: Initialise the sysregs before setting up the clocks 2014-05-04 11:35:29 +01:00
clocksource Merge branch 'clockevents/3.15-fixes' of git://git.linaro.org/people/daniel.lezcano/linux into timers/urgent 2014-04-29 19:26:58 +02:00
connector net: Use netlink_ns_capable to verify the permisions of netlink messages 2014-04-24 13:44:54 -04:00
cpufreq cpufreq: ppc-corenet-cpufreq: Fix __udivdi3 modpost error 2014-04-29 01:28:17 +02:00
cpuidle Merge branch 'pm-cpuidle' 2014-04-08 13:27:40 +02:00
crypto Merge git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6 2014-04-03 09:28:16 -07:00
dca
devfreq
dio
dma dma: fix eDMA driver as a subsys_initcall 2014-04-16 12:03:47 +05:30
edac Merge branch 'v4l_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media 2014-04-04 09:50:07 -07:00
eisa
extcon
firewire
firmware Merge branch 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2014-04-11 11:58:33 -07:00
fmc
gpio A few fixes for the GPIO tree: 2014-04-22 09:28:02 -07:00
gpu Merge branch 'mullins' of git://people.freedesktop.org/~deathsimple/linux into drm-fixes 2014-05-07 09:10:28 +10:00
hid Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/hid 2014-05-07 16:07:58 -07:00
hsi
hv Drivers: hv: vmbus: Negotiate version 3.0 when running on ws2012r2 hosts 2014-04-16 14:14:07 -07:00
hwmon Revert "hwmon: (coretemp) Refine TjMax detection" 2014-05-01 04:07:52 -07:00
hwspinlock
i2c Merge branch 'i2c/for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux 2014-04-09 08:45:40 -07:00
ide
idle intel_idle: fix IVT idle state table setting 2014-04-21 23:36:07 +02:00
iio iio: adc: Nothing in ADC should be a bool CONFIG 2014-04-26 11:22:16 +01:00
infiniband RDMA/cxgb4: Update Kconfig to include Chelsio T5 adapter 2014-04-28 17:29:41 -07:00
input Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input 2014-05-08 14:06:45 -07:00
iommu iommu/exynos: Apply workaround of caching fault page table entries 2014-05-13 19:13:00 +02:00
ipack
irqchip mvebu irqchip ifxes for v3.15 2014-04-29 19:23:22 +02:00
isdn hisax/icc: add missing semicolon after label 2014-04-22 21:22:47 -04:00
leds Merge branch 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/cooloney/linux-leds 2014-04-10 09:06:10 -07:00
lguest drivers/lguest/page_tables.c: rename do_set_pte() 2014-04-07 16:35:52 -07:00
macintosh
mailbox
mcb drivers: mcb: fix memory leak in chameleon_parse_cells() error path 2014-04-16 12:28:47 -07:00
md A few dm-thinp fixes for changes merged in 3.15-rc1. 2014-05-02 14:14:02 -07:00
media platform: Fix timberdale dependencies 2014-04-16 11:57:27 +05:30
memory
memstick
message PCI changes for the v3.15 merge window: 2014-04-01 15:14:04 -07:00
mfd mmc: rtsx: Revert "mmc: rtsx: add support for pre_req and post_req" 2014-05-08 08:44:50 +01:00
misc misc: Grammar s/addition/additional/ 2014-04-16 12:28:47 -07:00
mmc mmc: rtsx: Revert "mmc: rtsx: add support for pre_req and post_req" 2014-05-08 08:44:50 +01:00
mtd MTD update for 3.15-rc5 2014-05-07 16:28:52 -07:00
net net: macb: Fix race between HW and driver 2014-05-05 17:11:18 -04:00
nfc
ntb ntb: Use pci_enable_msix_range() instead of pci_enable_msix() 2014-04-07 10:59:20 -07:00
nubus
of of/irq: do irq resolution in platform_get_irq 2014-04-24 21:40:22 +01:00
oprofile
parisc
parport
pci PCI: tegra: Use new OF interrupt mapping when possible 2014-04-16 10:24:32 -06:00
pcmcia PCI changes for the v3.15 merge window: 2014-04-01 15:14:04 -07:00
phy phy: fix kernel oops in phy_lookup() 2014-04-24 12:53:38 -07:00
pinctrl sh-pfc: r8a7791: Fix definition of MOD_SEL3 2014-04-23 16:09:53 +02:00
platform alienware-wmi: cover some scenarios where memory allocations would fail 2014-04-10 12:11:56 -04:00
pnp asmlinkage: Add explicit __visible to drivers/*, lib/*, kernel/* 2014-05-05 16:07:46 -07:00
power power/reset: vexpress: Fix restart/power off operation 2014-04-24 17:20:50 +01:00
powercap CPU hotplug notifiers registration fixes for 3.15-rc1 2014-04-07 14:55:46 -07:00
pps
ps3
ptp net: ptp: move PTP classifier in its own file 2014-04-01 16:43:18 -04:00
pwm Shiraz has moved 2014-04-18 16:40:08 -07:00
rapidio rapidio: rework device hierarchy and introduce mport class of devices 2014-04-07 16:36:07 -07:00
regulator regulator: pbias: Convert to use regmap helper functions 2014-04-14 22:16:25 +01:00
remoteproc
reset Merge branch 'reset/for_v3.15' of git://git.pengutronix.de/git/pza/linux into next/drivers 2014-03-27 01:28:19 +01:00
rpmsg
rtc drivers/rtc/rtc-pcf8523.c: fix month definition 2014-05-06 13:04:58 -07:00
s390 s390/chsc: fix SEI usage on old FW levels 2014-04-17 12:46:28 +02:00
sbus
scsi Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2014-05-05 15:59:46 -07:00
sfi
sh ARM: SoC: sh driver changes 2014-04-05 15:38:41 -07:00
sn
spi Merge remote-tracking branches 'spi/fix/atmel', 'spi/fix/bfin5xx', 'spi/fix/hspi' and 'spi/fix/sirf' into spi-linus 2014-04-23 13:50:18 +01:00
spmi
ssb
staging Second set of fixes for IIO in the 3.15 cycle. 2014-04-30 14:19:23 -07:00
target Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2014-04-12 17:31:22 -07:00
tc
thermal Merge branch 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/rzhang/linux 2014-04-10 09:15:46 -07:00
tty tty: Fix lockless tty buffer race 2014-05-03 18:14:28 -04:00
uio
usb USB: Nokia 5300 should be treated as unusual dev 2014-05-03 19:41:07 -04:00
uwb uwb: don't call spin_unlock_irq in a USB completion handler 2014-04-24 12:45:40 -07:00
vfio VFIO updates for v3.15 include: 2014-04-03 14:05:02 -07:00
vhost Merge branch 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/nab/target-pending 2014-04-12 16:51:08 -07:00
video video: Kconfig: move drm and fb into separate menus 2014-04-17 08:10:20 +03:00
virt
virtio
vlynq
vme vme_tsi148: Utilize to_pci_dev() macro 2014-04-16 14:08:37 -07:00
w1 w1: avoid recursive device_add 2014-04-16 14:07:51 -07:00
watchdog CPU hotplug notifiers registration fixes for 3.15-rc1 2014-04-07 14:55:46 -07:00
xen Xen regression and bug fixes for 3.15-rc1. 2014-04-17 10:54:07 -07:00
zorro
Kconfig
Makefile video: move fbdev to drivers/video/fbdev 2014-04-17 08:10:19 +03:00