From 0f8921b432b200e1431c5573d2962df232f80b9a Mon Sep 17 00:00:00 2001 From: Giacomo Travaglini Date: Thu, 16 Nov 2017 17:44:12 +0000 Subject: [PATCH] arm: Enable ns registers access in secure mode Arm security extension introduced register banking between secure and non-secure mode. This has been removed in armv8 using AArch64 in EL3, where the decoded register is by default the non-secure version. Using non-secure register infos(flags) was preventing secure execution to access the register with the MRC/MCR at EL1. The patch updates the following banked registers' flags so that their non-secure version can be accessed in secure mode: MISCREG_CSSELR, MISCREG_SCTLR, MISCREG_ACTLR, MISCREG_TTBR0, MISCREG_TTBR1, MISCREG_TTBCR, MISCREG_DACR, MISCREG_DFSR, MISCREG_IFSR, MISCREG_ADFSR, MISCREG_AIFSR, MISCREG_DFAR, MISCREG_IFAR, MISCREG_PAR, MISCREG_PRRR, MISCREG_MAIR0, MISCREG_NMRR, MISCREG_MAIR1, MISCREG_AMAIR0, MISCREG_AMAIR1, MISCREG_VBAR, MISCREG_CONTEXTIDR, MISCREG_TPIDRURW, MISCREG_TPIDRURO, MISCREG_TPIDRPRW, MISCREG_CNTP_TVAL, MISCREG_CNTP_CTL, MISCREG_CNTP_CVAL For those registers the following permission bits have been set: MISCREG_PRI_S_RD MISCREG_PRI_S_WR Change-Id: Ib881c526e75d69e313f8ef66eb78fc704de6bf59 Signed-off-by: Giacomo Travaglini Reviewed-by: Giacomo Gabrielli Reviewed-on: https://gem5-review.googlesource.com/6201 Reviewed-by: Andreas Sandberg Maintainer: Andreas Sandberg --- src/arch/arm/miscregs.cc | 56 ++++++++++++++++++++-------------------- 1 file changed, 28 insertions(+), 28 deletions(-) diff --git a/src/arch/arm/miscregs.cc b/src/arch/arm/miscregs.cc index d31c84ca6..d08f75142 100644 --- a/src/arch/arm/miscregs.cc +++ b/src/arch/arm/miscregs.cc @@ -344,7 +344,7 @@ bitset miscRegInfo[NUM_MISCREGS] = { // MISCREG_CSSELR bitset(string("00000000000000010001")), // MISCREG_CSSELR_NS - bitset(string("11001100110000100001")), + bitset(string("11001111110000100001")), // MISCREG_CSSELR_S bitset(string("00110011000000100001")), // MISCREG_VPIDR @@ -354,13 +354,13 @@ bitset miscRegInfo[NUM_MISCREGS] = { // MISCREG_SCTLR bitset(string("00000000000000010001")), // MISCREG_SCTLR_NS - bitset(string("11001100110000100001")), + bitset(string("11001111110000100001")), // MISCREG_SCTLR_S bitset(string("00110011000000100001")), // MISCREG_ACTLR bitset(string("00000000000000010001")), // MISCREG_ACTLR_NS - bitset(string("11001100110000100001")), + bitset(string("11001111110000100001")), // MISCREG_ACTLR_S bitset(string("00110011000000100001")), // MISCREG_CPACR @@ -388,19 +388,19 @@ bitset miscRegInfo[NUM_MISCREGS] = { // MISCREG_TTBR0 bitset(string("00000000000000010001")), // MISCREG_TTBR0_NS - bitset(string("11001100110000100001")), + bitset(string("11001111110000100001")), // MISCREG_TTBR0_S bitset(string("00110011000000100001")), // MISCREG_TTBR1 bitset(string("00000000000000010001")), // MISCREG_TTBR1_NS - bitset(string("11001100110000100001")), + bitset(string("11001111110000100001")), // MISCREG_TTBR1_S bitset(string("00110011000000100001")), // MISCREG_TTBCR bitset(string("00000000000000010001")), // MISCREG_TTBCR_NS - bitset(string("11001100110000100001")), + bitset(string("11001111110000100001")), // MISCREG_TTBCR_S bitset(string("00110011000000100001")), // MISCREG_HTCR @@ -410,31 +410,31 @@ bitset miscRegInfo[NUM_MISCREGS] = { // MISCREG_DACR bitset(string("00000000000000010001")), // MISCREG_DACR_NS - bitset(string("11001100110000100001")), + bitset(string("11001111110000100001")), // MISCREG_DACR_S bitset(string("00110011000000100001")), // MISCREG_DFSR bitset(string("00000000000000010001")), // MISCREG_DFSR_NS - bitset(string("11001100110000100001")), + bitset(string("11001111110000100001")), // MISCREG_DFSR_S bitset(string("00110011000000100001")), // MISCREG_IFSR bitset(string("00000000000000010001")), // MISCREG_IFSR_NS - bitset(string("11001100110000100001")), + bitset(string("11001111110000100001")), // MISCREG_IFSR_S bitset(string("00110011000000100001")), // MISCREG_ADFSR bitset(string("00000000000000010100")), // MISCREG_ADFSR_NS - bitset(string("11001100110000100100")), + bitset(string("11001111110000100100")), // MISCREG_ADFSR_S bitset(string("00110011000000100100")), // MISCREG_AIFSR bitset(string("00000000000000010100")), // MISCREG_AIFSR_NS - bitset(string("11001100110000100100")), + bitset(string("11001111110000100100")), // MISCREG_AIFSR_S bitset(string("00110011000000100100")), // MISCREG_HADFSR @@ -446,13 +446,13 @@ bitset miscRegInfo[NUM_MISCREGS] = { // MISCREG_DFAR bitset(string("00000000000000010001")), // MISCREG_DFAR_NS - bitset(string("11001100110000100001")), + bitset(string("11001111110000100001")), // MISCREG_DFAR_S bitset(string("00110011000000100001")), // MISCREG_IFAR bitset(string("00000000000000010001")), // MISCREG_IFAR_NS - bitset(string("11001100110000100001")), + bitset(string("11001111110000100001")), // MISCREG_IFAR_S bitset(string("00110011000000100001")), // MISCREG_HDFAR @@ -468,7 +468,7 @@ bitset miscRegInfo[NUM_MISCREGS] = { // MISCREG_PAR bitset(string("00000000000000010001")), // MISCREG_PAR_NS - bitset(string("11001100110000100001")), + bitset(string("11001111110000100001")), // MISCREG_PAR_S bitset(string("00110011000000100001")), // MISCREG_ICIALLU @@ -618,37 +618,37 @@ bitset miscRegInfo[NUM_MISCREGS] = { // MISCREG_PRRR bitset(string("00000000000000010001")), // MISCREG_PRRR_NS - bitset(string("11001100110000100001")), + bitset(string("11001111110000100001")), // MISCREG_PRRR_S bitset(string("00110011000000100001")), // MISCREG_MAIR0 bitset(string("00000000000000010001")), // MISCREG_MAIR0_NS - bitset(string("11001100110000100001")), + bitset(string("11001111110000100001")), // MISCREG_MAIR0_S bitset(string("00110011000000100001")), // MISCREG_NMRR bitset(string("00000000000000010001")), // MISCREG_NMRR_NS - bitset(string("11001100110000100001")), + bitset(string("11001111110000100001")), // MISCREG_NMRR_S bitset(string("00110011000000100001")), // MISCREG_MAIR1 bitset(string("00000000000000010001")), // MISCREG_MAIR1_NS - bitset(string("11001100110000100001")), + bitset(string("11001111110000100001")), // MISCREG_MAIR1_S bitset(string("00110011000000100001")), // MISCREG_AMAIR0 bitset(string("00000000000000010001")), // MISCREG_AMAIR0_NS - bitset(string("11001100110000100001")), + bitset(string("11001111110000100001")), // MISCREG_AMAIR0_S bitset(string("00110011000000100001")), // MISCREG_AMAIR1 bitset(string("00000000000000010001")), // MISCREG_AMAIR1_NS - bitset(string("11001100110000100001")), + bitset(string("11001111110000100001")), // MISCREG_AMAIR1_S bitset(string("00110011000000100001")), // MISCREG_HMAIR0 @@ -662,7 +662,7 @@ bitset miscRegInfo[NUM_MISCREGS] = { // MISCREG_VBAR bitset(string("00000000000000010001")), // MISCREG_VBAR_NS - bitset(string("11001100110000100001")), + bitset(string("11001111110000100001")), // MISCREG_VBAR_S bitset(string("00110011000000100001")), // MISCREG_MVBAR @@ -678,25 +678,25 @@ bitset miscRegInfo[NUM_MISCREGS] = { // MISCREG_CONTEXTIDR bitset(string("00000000000000010001")), // MISCREG_CONTEXTIDR_NS - bitset(string("11001100110000100001")), + bitset(string("11001111110000100001")), // MISCREG_CONTEXTIDR_S bitset(string("00110011000000100001")), // MISCREG_TPIDRURW bitset(string("00000000000000010001")), // MISCREG_TPIDRURW_NS - bitset(string("11001100111111100001")), + bitset(string("11001111111111100001")), // MISCREG_TPIDRURW_S bitset(string("00110011000000100001")), // MISCREG_TPIDRURO bitset(string("00000000000000010001")), // MISCREG_TPIDRURO_NS - bitset(string("11001100110101100001")), + bitset(string("11001111110101100001")), // MISCREG_TPIDRURO_S bitset(string("00110011000000100001")), // MISCREG_TPIDRPRW bitset(string("00000000000000010001")), // MISCREG_TPIDRPRW_NS - bitset(string("11001100110000100001")), + bitset(string("11001111110000100001")), // MISCREG_TPIDRPRW_S bitset(string("00110011000000100001")), // MISCREG_HTPIDR @@ -708,13 +708,13 @@ bitset miscRegInfo[NUM_MISCREGS] = { // MISCREG_CNTP_TVAL bitset(string("00000000000000010001")), // MISCREG_CNTP_TVAL_NS - bitset(string("11001100111111100001")), + bitset(string("11001111111111100001")), // MISCREG_CNTP_TVAL_S bitset(string("00110011001111100000")), // MISCREG_CNTP_CTL bitset(string("00000000000000010001")), // MISCREG_CNTP_CTL_NS - bitset(string("11001100111111100001")), + bitset(string("11001111111111100001")), // MISCREG_CNTP_CTL_S bitset(string("00110011001111100000")), // MISCREG_CNTV_TVAL @@ -762,7 +762,7 @@ bitset miscRegInfo[NUM_MISCREGS] = { // MISCREG_CNTP_CVAL bitset(string("00000000000000010001")), // MISCREG_CNTP_CVAL_NS - bitset(string("11001100111111100001")), + bitset(string("11001111111111100001")), // MISCREG_CNTP_CVAL_S bitset(string("00110011001111100000")), // MISCREG_CNTV_CVAL -- 2.30.2