]> git.ipfire.org Git - thirdparty/qemu.git/commitdiff
target/hppa: Handle alignment faults in hppa_get_physical_address
authorRichard Henderson <richard.henderson@linaro.org>
Sat, 5 Oct 2024 12:32:49 +0000 (05:32 -0700)
committerRichard Henderson <richard.henderson@linaro.org>
Sun, 13 Oct 2024 18:27:05 +0000 (11:27 -0700)
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>
target/hppa/mem_helper.c

index f71cedd7a9c2104407c9cde491ef6d323262cc18..d38054da8a84cd84c6b75b739ca250b13e8b52bb 100644 (file)
@@ -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;