[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 10/20] target/hppa: Fix priority of T, D, and B page faults
From: |
Richard Henderson |
Subject: |
[PATCH 10/20] target/hppa: Fix priority of T, D, and B page faults |
Date: |
Sat, 5 Oct 2024 08:25:41 -0700 |
Drop the 'else' so that ret is overridden with the
highest priority fault.
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
target/hppa/mem_helper.c | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/target/hppa/mem_helper.c b/target/hppa/mem_helper.c
index f027c494e2..f71cedd7a9 100644
--- a/target/hppa/mem_helper.c
+++ b/target/hppa/mem_helper.c
@@ -288,7 +288,7 @@ int hppa_get_physical_address(CPUHPPAState *env, vaddr
addr, int mmu_idx,
}
/*
- * In priority order, check for conditions which raise faults.
+ * In reverse priority order, check for conditions which raise faults.
* Remove PROT bits that cover the condition we want to check,
* so that the resulting PROT will force a re-check of the
* architectural TLB entry for the next access.
@@ -299,13 +299,15 @@ int hppa_get_physical_address(CPUHPPAState *env, vaddr
addr, int mmu_idx,
/* The T bit is set -- Page Reference Fault. */
ret = EXCP_PAGE_REF;
}
- } else if (!ent->d) {
+ }
+ if (unlikely(!ent->d)) {
prot &= PAGE_READ | PAGE_EXEC;
if (type & PAGE_WRITE) {
/* The D bit is not set -- TLB Dirty Bit Fault. */
ret = EXCP_TLB_DIRTY;
}
- } else if (unlikely(ent->b)) {
+ }
+ if (unlikely(ent->b)) {
prot &= PAGE_READ | PAGE_EXEC;
if (type & PAGE_WRITE) {
/*
--
2.43.0
- Re: [PATCH 03/20] include/exec/memop: Move get_alignment_bits from tcg.h, (continued)
- [PATCH 04/20] include/exec/memop: Rename get_alignment_bits, Richard Henderson, 2024/10/05
- [PATCH 05/20] include/exec/memop: Introduce memop_atomicity_bits, Richard Henderson, 2024/10/05
- [PATCH 06/20] hw/core/tcg-cpu-ops: Introduce tlb_fill_align hook, Richard Henderson, 2024/10/05
- [PATCH 07/20] accel/tcg: Use the tlb_fill_align hook, Richard Henderson, 2024/10/05
- [PATCH 08/20] target/hppa: Add MemOp argument to hppa_get_physical_address, Richard Henderson, 2024/10/05
- [PATCH 09/20] target/hppa: Perform access rights before protection id check, Richard Henderson, 2024/10/05
- [PATCH 11/20] target/hppa: Handle alignment faults in hppa_get_physical_address, Richard Henderson, 2024/10/05
- [PATCH 10/20] target/hppa: Fix priority of T, D, and B page faults,
Richard Henderson <=
- [PATCH 12/20] target/hppa: Add hppa_cpu_tlb_fill_align, Richard Henderson, 2024/10/05
- [PATCH 15/20] target/arm: Pass MemOp to get_phys_addr_gpc, Richard Henderson, 2024/10/05
- [PATCH 13/20] target/arm: Pass MemOp to get_phys_addr, Richard Henderson, 2024/10/05
- [PATCH 16/20] target/arm: Pass MemOp to get_phys_addr_nogpc, Richard Henderson, 2024/10/05
- [PATCH 19/20] target/arm: Move device detection earlier in get_phys_addr_lpae, Richard Henderson, 2024/10/05
- [PATCH 20/20] target/arm: Fix alignment fault priority in get_phys_addr_lpae, Richard Henderson, 2024/10/05