]> xenbits.xensource.com Git - qemu-xen.git/commitdiff
target/arm: translate NS bit in page-walks
authorRémi Denis-Courmont <remi.denis.courmont@huawei.com>
Tue, 12 Jan 2021 10:45:04 +0000 (12:45 +0200)
committerPeter Maydell <peter.maydell@linaro.org>
Tue, 19 Jan 2021 14:38:52 +0000 (14:38 +0000)
Signed-off-by: Rémi Denis-Courmont <remi.denis.courmont@huawei.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20210112104511.36576-12-remi.denis.courmont@huawei.com
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
target/arm/helper.c

index ae0ccf72f58a2f8f348480c0bd04ca6b3e1e6988..521f85a695ae3f559dc7703a90609d96a5922ec4 100644 (file)
@@ -10430,6 +10430,18 @@ static hwaddr S1_ptw_translate(CPUARMState *env, ARMMMUIdx mmu_idx,
             fi->s1ptw = true;
             return ~0;
         }
+
+        if (arm_is_secure_below_el3(env)) {
+            /* Check if page table walk is to secure or non-secure PA space. */
+            if (*is_secure) {
+                *is_secure = !(env->cp15.vstcr_el2.raw_tcr & VSTCR_SW);
+            } else {
+                *is_secure = !(env->cp15.vtcr_el2.raw_tcr & VTCR_NSW);
+            }
+        } else {
+            assert(!*is_secure);
+        }
+
         addr = s2pa;
     }
     return addr;