]> git.baikalelectronics.ru Git - kernel.git/commit
arm64: Fix TTBR + PAN + 52-bit PA logic in cpu_do_switch_mm
authorSteve Capper <steve.capper@arm.com>
Wed, 24 Jan 2018 08:27:08 +0000 (08:27 +0000)
committerCatalin Marinas <catalin.marinas@arm.com>
Fri, 26 Jan 2018 18:23:17 +0000 (18:23 +0000)
commit0d4c83b615c2294338f58b58e03de532f979eeda
treefca3a39f0042db178584d91eef67f046abe3c2ab
parentffab82e1efecb60a5fce106f4134a3682e22a36d
arm64: Fix TTBR + PAN + 52-bit PA logic in cpu_do_switch_mm

In cpu_do_switch_mm(.) with ARM64_SW_TTBR0_PAN=y we apply phys_to_ttbr
to a value that already has an ASID inserted into the upper bits. For
52-bit PA configurations this then can give us TTBR0_EL1 registers that
cause translation table walks to attempt to access non-zero PA[51:48]
spuriously. Ultimately leading to a Synchronous External Abort on level
1 translation.

This patch re-arranges the logic in cpu_do_switch_mm(.) such that
phys_to_ttbr is called before the ASID is inserted into the TTBR0 value.

Fixes: 1737921ff9e7 ("arm64: kpti: Fix the interaction between ASID switching and software PAN")
Acked-by: Suzuki K Poulose <suzuki.poulose@arm.com>
Tested-by: Kristina Martsenko <kristina.martsenko@arm.com>
Reviewed-by: Kristina Martsenko <kristina.martsenko@arm.com>
Signed-off-by: Steve Capper <steve.capper@arm.com>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
arch/arm64/mm/proc.S