Skip to content

Commit

Permalink
target-mips: fix updating BadVAddr for misaligned accesses
Browse files Browse the repository at this point in the history
Update BadVAddr correctly for the case of misaligned block accesses.
The address reported by BadVAddr on page permission or TLB miss exceptions
must be a byte address in the misaligned access for a page on which the
exception is reported, but may be any such byte address.
It is not required to be the lowest.

Updates for qemu#17

Signed-off-by: Yongbok Kim <yongbok.kim@imgtec.com>
  • Loading branch information
yongbok committed Feb 5, 2015
1 parent cc19cea commit 3e5e2b5
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions target-mips/helper.c
Original file line number Diff line number Diff line change
Expand Up @@ -758,6 +758,9 @@ bool cpu_mips_validate_access(CPUMIPSState *env, target_ulong address,
ret = get_physical_address(env, &physical, &prot,
addr, rw, access_type);
if (ret != TLBRET_MATCH) {
if (ret != TLBRET_BADADDR && addr > badvaddr) {
badvaddr = addr;
}
raise_mmu_exception(env, badvaddr, rw, ret);
return false;
}
Expand Down

0 comments on commit 3e5e2b5

Please sign in to comment.