Skip to content

Commit 5f538f7

Browse files
hdellerrth7680
authored andcommitted
target/hppa: Raise exception 26 on emulated hardware
On PCXS chips (PA7000, pa 1.1a), trap qemu#18 is raised on memory faults, while all later chips (>= PA7100) generate either trap qemu#26, qemu#27 or qemu#28 (depending on the fault type). Since the current qemu emulation emulates a B160L machine (with a PA7300LC PCX-L2 chip, we should raise trap qemu#26 (EXCP_DMAR) instead of qemu#18 (EXCP_DMP) on access faults by the Linux kernel to page zero. With the patch we now get the correct output (I tested against real hardware): Kernel Fault: Code=26 (Data memory access rights trap) instead of: Kernel Fault: Code=18 (Data memory protection/unaligned access trap) Signed-off-by: Helge Deller <[email protected]> Message-Id: <[email protected]> Signed-off-by: Richard Henderson <[email protected]>
1 parent 0955837 commit 5f538f7

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Diff for: target/hppa/mem_helper.c

+2-1
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,8 @@ int hppa_get_physical_address(CPUHPPAState *env, vaddr addr, int mmu_idx,
137137

138138
if (unlikely(!(prot & type))) {
139139
/* The access isn't allowed -- Inst/Data Memory Protection Fault. */
140-
ret = (type & PAGE_EXEC ? EXCP_IMP : EXCP_DMP);
140+
ret = (type & PAGE_EXEC ? EXCP_IMP :
141+
prot & PAGE_READ ? EXCP_DMP : EXCP_DMAR);
141142
goto egress;
142143
}
143144

0 commit comments

Comments
 (0)