Skip to content
Commit ec89ab50 authored by Steve Capper's avatar Steve Capper Committed by Catalin Marinas
Browse files

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: 6b88a32c ("arm64: kpti: Fix the interaction between ASID switching and software PAN")
Acked-by: default avatarSuzuki K Poulose <suzuki.poulose@arm.com>
Tested-by: default avatarKristina Martsenko <kristina.martsenko@arm.com>
Reviewed-by: default avatarKristina Martsenko <kristina.martsenko@arm.com>
Signed-off-by: default avatarSteve Capper <steve.capper@arm.com>
Signed-off-by: default avatarCatalin Marinas <catalin.marinas@arm.com>
parent 0ba2e29c
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment