aboutsummaryrefslogtreecommitdiff
path: root/target/arm/tlb_helper.c
diff options
context:
space:
mode:
authorRémi Denis-Courmont <remi.denis.courmont@huawei.com>2021-01-12 12:45:07 +0200
committerPeter Maydell <peter.maydell@linaro.org>2021-01-19 14:38:52 +0000
commit9861248f637ecf11113b04b0b5c7b13c9aa06f09 (patch)
treeab672e892f18a1b7958025416ef720082c0fb11f /target/arm/tlb_helper.c
parentb1a10c868f9b2b09e64009b43450e9a86697d9f3 (diff)
target/arm: set HPFAR_EL2.NS on secure stage 2 faults
Signed-off-by: Rémi Denis-Courmont <remi.denis.courmont@huawei.com> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Message-id: 20210112104511.36576-15-remi.denis.courmont@huawei.com Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'target/arm/tlb_helper.c')
-rw-r--r--target/arm/tlb_helper.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/target/arm/tlb_helper.c b/target/arm/tlb_helper.c
index b35dc8a011..df85079d9f 100644
--- a/target/arm/tlb_helper.c
+++ b/target/arm/tlb_helper.c
@@ -63,6 +63,9 @@ static void QEMU_NORETURN arm_deliver_fault(ARMCPU *cpu, vaddr addr,
if (fi->stage2) {
target_el = 2;
env->cp15.hpfar_el2 = extract64(fi->s2addr, 12, 47) << 4;
+ if (arm_is_secure_below_el3(env) && fi->s1ns) {
+ env->cp15.hpfar_el2 |= HPFAR_NS;
+ }
}
same_el = (arm_current_el(env) == target_el);