linux/arch/powerpc
Alexey Kardashevskiy d28faebe8b powerpc/powernv/ioda2: Gracefully fail if too many TCE levels requested
[ Upstream commit 7aafac11e3 ]

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>
History 2017-12-14 09:28:21 +01:00
..
boot powerpc/corenet: explicitly disable the SDHC controller on kmcoge4 2017-11-15 15:53:13 +01:00
configs Merge branch 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/scottwood/linux into next 2016-10-11 20:07:56 +11:00
crypto powerpc/crypto/crc32c-vpmsum: Fix missing preempt_disable() 2017-04-12 12:41:13 +02:00
include powerpc/64: Fix checksum folding in csum_add() 2017-12-14 09:28:17 +01:00
kernel powerpc/64s: Initialize ISAv3 MMU registers before setting partition table 2017-12-14 09:28:13 +01:00
kvm KVM: PPC: Book 3S: XICS: correct the real mode ICP rejecting counter 2017-11-15 15:53:12 +01:00
lib powerpc: Fix emulation of mfocrf in emulate_step() 2017-07-27 15:08:00 -07:00
math-emu powerpc: Correct emulated mtfsf instruction 2014-04-07 10:33:11 +10:00
mm powerpc/64: Invalidate process table caching after setting process table 2017-12-14 09:28:17 +01:00
net powerpc/bpf: Add support for bpf constant blinding 2016-10-04 20:33:20 +11:00
oprofile powerpc/sparse: Make a bunch of things static 2016-09-13 17:35:47 +10:00
perf powerpc/perf: Add restrictions to PMC5 in power9 DD1 2017-10-21 17:21:38 +02:00
platforms powerpc/powernv/ioda2: Gracefully fail if too many TCE levels requested 2017-12-14 09:28:21 +01:00
scripts powerpc/ftrace: Add Kconfig & Make glue for mprofile-kernel 2016-03-07 14:53:56 +11:00
sysdev axonram: Fix gendisk handling 2017-12-14 09:28:21 +01:00
xmon powerpc/xmon: Don't use ld on 32-bit 2016-09-13 17:37:02 +10:00
Kconfig security/keys: add CONFIG_KEYS_COMPAT to Kconfig 2017-11-18 11:22:24 +01:00
Kconfig.debug powerpc/mm: Catch usage of cpu/mmu_has_feature() before jump label init 2016-08-01 11:15:06 +10:00
Makefile powerpc: Fix compiling a BE kernel with a powerpc64le toolchain 2017-12-14 09:28:17 +01:00
relocs_check.sh powerpc/64: whitelist unresolved modversions CRCs 2016-09-22 14:46:31 +02:00