diff options
Diffstat (limited to 'target-i386')
-rw-r--r-- | target-i386/helper2.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/target-i386/helper2.c b/target-i386/helper2.c index f05a284f96..cbf17caa11 100644 --- a/target-i386/helper2.c +++ b/target-i386/helper2.c @@ -670,7 +670,7 @@ int cpu_x86_handle_mmu_fault(CPUX86State *env, target_ulong addr, #endif { /* XXX: load them when cr3 is loaded ? */ - pdpe_addr = ((env->cr[3] & ~0x1f) + ((addr >> 30) << 3)) & + pdpe_addr = ((env->cr[3] & ~0x1f) + ((addr >> 27) & 0x18)) & env->a20_mask; pdpe = ldq_phys(pdpe_addr); if (!(pdpe & PG_PRESENT_MASK)) { @@ -765,7 +765,7 @@ int cpu_x86_handle_mmu_fault(CPUX86State *env, target_ulong addr, uint32_t pde; /* page directory entry */ - pde_addr = ((env->cr[3] & ~0xfff) + ((addr >> 20) & ~3)) & + pde_addr = ((env->cr[3] & ~0xfff) + ((addr >> 20) & 0xffc)) & env->a20_mask; pde = ldl_phys(pde_addr); if (!(pde & PG_PRESENT_MASK)) { @@ -910,7 +910,7 @@ target_phys_addr_t cpu_get_phys_page_debug(CPUState *env, target_ulong addr) } else #endif { - pdpe_addr = ((env->cr[3] & ~0x1f) + ((addr >> 30) << 3)) & + pdpe_addr = ((env->cr[3] & ~0x1f) + ((addr >> 27) & 0x18)) & env->a20_mask; pdpe = ldl_phys(pdpe_addr); if (!(pdpe & PG_PRESENT_MASK)) @@ -940,7 +940,7 @@ target_phys_addr_t cpu_get_phys_page_debug(CPUState *env, target_ulong addr) page_size = 4096; } else { /* page directory entry */ - pde_addr = ((env->cr[3] & ~0xfff) + ((addr >> 20) & ~3)) & env->a20_mask; + pde_addr = ((env->cr[3] & ~0xfff) + ((addr >> 20) & 0xffc)) & env->a20_mask; pde = ldl_phys(pde_addr); if (!(pde & PG_PRESENT_MASK)) return -1; |