diff options
author | Marc Zyngier <marc.zyngier@arm.com> | 2015-11-16 05:28:18 -0500 |
---|---|---|
committer | Christoffer Dall <christoffer.dall@linaro.org> | 2015-11-24 11:58:14 -0500 |
commit | 498cd5c32be6e32bc0f8efcad48ab094bb2bfdf3 (patch) | |
tree | a82a2907c46684fcb8d15909de334dc48459a22e /arch/arm64/kvm | |
parent | c0f0963464c24e034b858441205455bf2a5d93ad (diff) |
arm64: KVM: Add workaround for Cortex-A57 erratum 834220
Cortex-A57 parts up to r1p2 can misreport Stage 2 translation faults
when a Stage 1 permission fault or device alignment fault should
have been reported.
This patch implements the workaround (which is to validate that the
Stage-1 translation actually succeeds) by using code patching.
Cc: stable@vger.kernel.org
Reviewed-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
Signed-off-by: Christoffer Dall <christoffer.dall@linaro.org>
Diffstat (limited to 'arch/arm64/kvm')
-rw-r--r-- | arch/arm64/kvm/hyp.S | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/arch/arm64/kvm/hyp.S b/arch/arm64/kvm/hyp.S index 1599701ef044..ff2e038f0007 100644 --- a/arch/arm64/kvm/hyp.S +++ b/arch/arm64/kvm/hyp.S | |||
@@ -1015,9 +1015,15 @@ el1_trap: | |||
1015 | b.ne 1f // Not an abort we care about | 1015 | b.ne 1f // Not an abort we care about |
1016 | 1016 | ||
1017 | /* This is an abort. Check for permission fault */ | 1017 | /* This is an abort. Check for permission fault */ |
1018 | alternative_if_not ARM64_WORKAROUND_834220 | ||
1018 | and x2, x1, #ESR_ELx_FSC_TYPE | 1019 | and x2, x1, #ESR_ELx_FSC_TYPE |
1019 | cmp x2, #FSC_PERM | 1020 | cmp x2, #FSC_PERM |
1020 | b.ne 1f // Not a permission fault | 1021 | b.ne 1f // Not a permission fault |
1022 | alternative_else | ||
1023 | nop // Use the permission fault path to | ||
1024 | nop // check for a valid S1 translation, | ||
1025 | nop // regardless of the ESR value. | ||
1026 | alternative_endif | ||
1021 | 1027 | ||
1022 | /* | 1028 | /* |
1023 | * Check for Stage-1 page table walk, which is guaranteed | 1029 | * Check for Stage-1 page table walk, which is guaranteed |