From: Rémi Denis-Courmont Date: Tue, 12 Jan 2021 10:45:04 +0000 (+0200) Subject: target/arm: translate NS bit in page-walks X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=588c6dd113b27b8db393c7264297b9d33261692e;p=people%2Fpauldu%2Fqemu.git target/arm: translate NS bit in page-walks Signed-off-by: Rémi Denis-Courmont Reviewed-by: Richard Henderson Message-id: 20210112104511.36576-12-remi.denis.courmont@huawei.com Signed-off-by: Peter Maydell --- diff --git a/target/arm/helper.c b/target/arm/helper.c index ae0ccf72f5..521f85a695 100644 --- a/target/arm/helper.c +++ b/target/arm/helper.c @@ -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;