[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v3 08/20] target/hppa: Perform access rights before protection id
From: |
Richard Henderson |
Subject: |
[PATCH v3 08/20] target/hppa: Perform access rights before protection id check |
Date: |
Tue, 8 Oct 2024 17:04:41 -0700 |
In Chapter 5, Interruptions, the group 3 exceptions lists
"Data memory access rights trap" in priority order ahead of
"Data memory protection ID trap".
Swap these checks in hppa_get_physical_address.
Reviewed-by: Helge Deller <deller@gmx.de>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
target/hppa/mem_helper.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/target/hppa/mem_helper.c b/target/hppa/mem_helper.c
index a386c80fa4..f027c494e2 100644
--- a/target/hppa/mem_helper.c
+++ b/target/hppa/mem_helper.c
@@ -267,6 +267,12 @@ int hppa_get_physical_address(CPUHPPAState *env, vaddr
addr, int mmu_idx,
goto egress;
}
+ if (unlikely(!(prot & type))) {
+ /* Not allowed -- Inst/Data Memory Access Rights Fault. */
+ ret = (type & PAGE_EXEC) ? EXCP_IMP : EXCP_DMAR;
+ goto egress;
+ }
+
/* access_id == 0 means public page and no check is performed */
if (ent->access_id && MMU_IDX_TO_P(mmu_idx)) {
int access_prot = (hppa_is_pa20(env)
@@ -281,12 +287,6 @@ int hppa_get_physical_address(CPUHPPAState *env, vaddr
addr, int mmu_idx,
prot &= access_prot;
}
- if (unlikely(!(prot & type))) {
- /* Not allowed -- Inst/Data Memory Access Rights Fault. */
- ret = (type & PAGE_EXEC) ? EXCP_IMP : EXCP_DMAR;
- goto egress;
- }
-
/*
* In priority order, check for conditions which raise faults.
* Remove PROT bits that cover the condition we want to check,
--
2.43.0
[PATCH v3 08/20] target/hppa: Perform access rights before protection id check,
Richard Henderson <=
[PATCH v3 13/20] target/arm: Pass MemOp to get_phys_addr_with_space_nogpc, Richard Henderson, 2024/10/08
[PATCH v3 12/20] target/arm: Pass MemOp to get_phys_addr, Richard Henderson, 2024/10/08
[PATCH v3 10/20] target/hppa: Handle alignment faults in hppa_get_physical_address, Richard Henderson, 2024/10/08
[PATCH v3 15/20] target/arm: Pass MemOp to get_phys_addr_nogpc, Richard Henderson, 2024/10/08
[PATCH v3 14/20] target/arm: Pass MemOp to get_phys_addr_gpc, Richard Henderson, 2024/10/08
[PATCH v3 11/20] target/hppa: Implement TCGCPUOps.tlb_fill_align, Richard Henderson, 2024/10/08
[PATCH v3 18/20] target/arm: Move device detection earlier in get_phys_addr_lpae, Richard Henderson, 2024/10/08
[PATCH v3 19/20] target/arm: Implement TCGCPUOps.tlb_fill_align, Richard Henderson, 2024/10/08