[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH] x86: clear NX bit from address in cpu_get_phys_page
From: |
andrzej zaborowski |
Subject: |
[Qemu-devel] [PATCH] x86: clear NX bit from address in cpu_get_phys_page_debug |
Date: |
Fri, 13 Feb 2009 06:41:34 +0100 |
All bits outside of PHYS_ADDR_MASK are zeroed in
cpu_x86_handle_mmu_fault to produce the physical address, but not in
cpu_get_phys_page_debug. The return value of
cpu_get_phys_page_debug() is directly added to phys_ram_base by users
so if the NX bit was set in the PTE, qemu will try to access outside
phys_ram_base.
(This is my interpretation of the error but I'm no expert on x86)
Cheers
--- a/target-i386/helper.c
+++ b/target-i386/helper.c
@@ -1274,7 +1274,7 @@ target_phys_addr_t
cpu_get_phys_page_debug(CPUState *env, target_ulong addr)
}
page_offset = (addr & TARGET_PAGE_MASK) & (page_size - 1);
- paddr = (pte & TARGET_PAGE_MASK) + page_offset;
+ paddr = (pte & PHYS_ADDR_MASK) + page_offset;
return paddr;
}
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Qemu-devel] [PATCH] x86: clear NX bit from address in cpu_get_phys_page_debug,
andrzej zaborowski <=