[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 19/35] target/arm: Treat LDTR* and STTR* as LDR/STR when NV, NV1
From: |
Peter Maydell |
Subject: |
[PATCH 19/35] target/arm: Treat LDTR* and STTR* as LDR/STR when NV, NV1 is 1, 1 |
Date: |
Mon, 18 Dec 2023 11:32:49 +0000 |
FEAT_NV requires (per I_JKLJK) that when HCR_EL2.{NV,NV1} is {1,1} the
unprivileged-access instructions LDTR, STTR etc behave as normal
loads and stores. Implement the check that handles this.
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
target/arm/tcg/hflags.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/target/arm/tcg/hflags.c b/target/arm/tcg/hflags.c
index f33c0a12741..8f254bf9ccb 100644
--- a/target/arm/tcg/hflags.c
+++ b/target/arm/tcg/hflags.c
@@ -261,8 +261,10 @@ static CPUARMTBFlags rebuild_hflags_a64(CPUARMState *env,
int el, int fp_el,
switch (mmu_idx) {
case ARMMMUIdx_E10_1:
case ARMMMUIdx_E10_1_PAN:
- /* TODO: ARMv8.3-NV */
- DP_TBFLAG_A64(flags, UNPRIV, 1);
+ /* FEAT_NV: NV,NV1 == 1,1 means we don't do UNPRIV accesses */
+ if ((hcr & (HCR_NV | HCR_NV1)) != (HCR_NV | HCR_NV1)) {
+ DP_TBFLAG_A64(flags, UNPRIV, 1);
+ }
break;
case ARMMMUIdx_E20_2:
case ARMMMUIdx_E20_2_PAN:
--
2.34.1
- [PATCH 16/35] target/arm: Trap registers when HCR_EL2.{NV, NV1} == {1, 1}, (continued)
- [PATCH 16/35] target/arm: Trap registers when HCR_EL2.{NV, NV1} == {1, 1}, Peter Maydell, 2023/12/18
- [PATCH 21/35] target/arm: Add FEAT_NV to max, neoverse-n2, neoverse-v1 CPUs, Peter Maydell, 2023/12/18
- [PATCH 23/35] target/arm: Implement VNCR_EL2 register, Peter Maydell, 2023/12/18
- [PATCH 18/35] target/arm: Don't honour PSTATE.PAN when HCR_EL2.{NV, NV1} == {1, 1}, Peter Maydell, 2023/12/18
- [PATCH 13/35] target/arm: Trap sysreg accesses for FEAT_NV, Peter Maydell, 2023/12/18
- [PATCH 19/35] target/arm: Treat LDTR* and STTR* as LDR/STR when NV, NV1 is 1, 1,
Peter Maydell <=
- [PATCH 20/35] target/arm: Handle FEAT_NV page table attribute changes, Peter Maydell, 2023/12/18
- [PATCH 22/35] target/arm: Handle HCR_EL2 accesses for FEAT_NV2 bits, Peter Maydell, 2023/12/18
- [PATCH 24/35] target/arm: Handle FEAT_NV2 changes to when SPSR_EL1.M reports EL2, Peter Maydell, 2023/12/18
- [PATCH 25/35] target/arm: Handle FEAT_NV2 redirection of SPSR_EL2, ELR_EL2, ESR_EL2, FAR_EL2, Peter Maydell, 2023/12/18
- [PATCH 27/35] target/arm: Report VNCR_EL2 based faults correctly, Peter Maydell, 2023/12/18