summaryrefslogtreecommitdiff
path: root/target-mips/helper.c
diff options
context:
space:
mode:
Diffstat (limited to 'target-mips/helper.c')
-rw-r--r--target-mips/helper.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/target-mips/helper.c b/target-mips/helper.c
index e7d7887524..3151e0ae96 100644
--- a/target-mips/helper.c
+++ b/target-mips/helper.c
@@ -148,10 +148,9 @@ static int get_physical_address (CPUState *env, target_ulong *physical,
}
} else if (address < 0xC000000000000000ULL) {
/* xkphys */
- /* XXX: Assumes PABITS = 36 (correct for MIPS64R1) */
if (kernel_mode && KX &&
- (address & 0x07FFFFFFFFFFFFFFULL) <= 0x0000000FFFFFFFFFULL) {
- *physical = address & 0x0000000FFFFFFFFFULL;
+ (address & 0x07FFFFFFFFFFFFFFULL) <= env->PAMask) {
+ *physical = address & env->PAMask;
*prot = PAGE_READ | PAGE_WRITE;
} else {
ret = TLBRET_BADADDR;