aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Henderson <richard.henderson@linaro.org>2024-10-05 05:32:49 -0700
committerRichard Henderson <richard.henderson@linaro.org>2024-10-13 11:27:05 -0700
commit5d29587b451b6b86738f62378f8e4fc98c22388f (patch)
treee0614e9d5115cea9a3ca5f9b127c91f2bbcf9819
parentd73d4a5d78cabc55c837bc3303326659d8bc23a0 (diff)
downloadqemu-5d29587b451b6b86738f62378f8e4fc98c22388f.zip
qemu-5d29587b451b6b86738f62378f8e4fc98c22388f.tar.gz
qemu-5d29587b451b6b86738f62378f8e4fc98c22388f.tar.bz2
target/hppa: Handle alignment faults in hppa_get_physical_address
In Chapter 5, Interruptions, the group 3 exceptions lists "Unaligned data reference trap" has higher priority than "Data memory break trap". Reviewed-by: Helge Deller <deller@gmx.de> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
-rw-r--r--target/hppa/mem_helper.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/target/hppa/mem_helper.c b/target/hppa/mem_helper.c
index f71cedd..d38054d 100644
--- a/target/hppa/mem_helper.c
+++ b/target/hppa/mem_helper.c
@@ -221,7 +221,7 @@ int hppa_get_physical_address(CPUHPPAState *env, vaddr addr, int mmu_idx,
g_assert_not_reached();
}
prot = PAGE_READ | PAGE_WRITE | PAGE_EXEC;
- goto egress;
+ goto egress_align;
}
/* Find a valid tlb entry that matches the virtual address. */
@@ -323,6 +323,11 @@ int hppa_get_physical_address(CPUHPPAState *env, vaddr addr, int mmu_idx,
}
}
+ egress_align:
+ if (addr & ((1u << memop_alignment_bits(mop)) - 1)) {
+ ret = EXCP_UNALIGN;
+ }
+
egress:
*pphys = phys;
*pprot = prot;