android_kernel_oneplus_msm8998/arch/powerpc
Alexey Kardashevskiy f1ff979f97 powerpc/powernv/ioda2: Gracefully fail if too many TCE levels requested
[ Upstream commit 7aafac11e308d37ed3c509829bb43d80c1811ac3 ]

The IODA2 specification says that a 64 DMA address cannot use top 4 bits
(3 are reserved and one is a "TVE select"); bottom page_shift bits
cannot be used for multilevel table addressing either.

The existing IODA2 table allocation code aligns the minimum TCE table
size to PAGE_SIZE so in the case of 64K system pages and 4K IOMMU pages,
we have 64-4-12=48 bits. Since 64K page stores 8192 TCEs, i.e. needs
13 bits, the maximum number of levels is 48/13 = 3 so we physically
cannot address more and EEH happens on DMA accesses.

This adds a check that too many levels were requested.

It is still possible to have 5 levels in the case of 4K system page size.

Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
Acked-by: Gavin Shan <gwshan@linux.vnet.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-12-16 10:33:54 +01:00
..
boot powerpc/corenet: explicitly disable the SDHC controller on kmcoge4 2017-11-15 17:13:09 +01:00
configs powerpc updates for 4.4 2015-11-05 23:38:43 -08:00
crypto crypto: powerpc/md5 - use md5 IV MD5_HX instead of their raw value 2015-05-18 12:20:20 +08:00
include Revert "powerpc/numa: Fix percpu allocations to be NUMA aware" 2017-08-06 19:19:40 -07:00
kernel powerpc/signal: Properly handle return value from uprobe_deny_signal() 2017-11-30 08:37:24 +00:00
kvm KVM: PPC: Book 3S: XICS: correct the real mode ICP rejecting counter 2017-11-15 17:13:09 +01:00
lib powerpc: Fix emulation of mfocrf in emulate_step() 2017-07-27 15:06:05 -07:00
math-emu
mm powerpc/slb: Force a full SLB flush when we insert for a bad EA 2017-06-29 12:48:52 +02:00
net net: filter: make JITs zero A for SKF_AD_ALU_XOR_X 2016-01-06 00:43:52 -05:00
oprofile powerpc: Remove mtmsrd(), use existing mtmsr() 2015-07-13 15:47:28 +10:00
perf powerpc updates for 4.4 2015-11-05 23:38:43 -08:00
platforms powerpc/powernv/ioda2: Gracefully fail if too many TCE levels requested 2017-12-16 10:33:54 +01:00
sysdev axonram: Fix gendisk handling 2017-12-16 10:33:53 +01:00
xmon powerpc/xmon: Add some more elements to the existing PACA dump list 2015-10-15 20:32:02 +11:00
Kconfig security/keys: add CONFIG_KEYS_COMPAT to Kconfig 2017-11-18 11:11:07 +01:00
Kconfig.debug powerpc: Make STRICT_MM_TYPECHECKS a config option 2015-05-11 19:53:59 +10:00
Makefile powerpc/cell: Drop CONFIG_TUNE_CELL in favour of CONFIG_CELL_CPU 2015-10-19 19:51:18 +11:00
relocs_check.sh powerpc: Convert relocs_check to a shell script using grep 2015-03-23 14:47:39 +11:00