From: Richard Henderson Date: Sat, 5 Oct 2024 12:32:49 +0000 (-0700) Subject: target/hppa: Handle alignment faults in hppa_get_physical_address X-Git-Tag: v9.2.0-rc0~53^2~10 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=5d29587b451b6b86738f62378f8e4fc98c22388f;p=thirdparty%2Fqemu.git 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 Signed-off-by: Richard Henderson --- diff --git a/target/hppa/mem_helper.c b/target/hppa/mem_helper.c index f71cedd7a9c..d38054da8a8 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;