diff options
author | bellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162> | 2005-12-04 18:46:06 +0000 |
---|---|---|
committer | bellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162> | 2005-12-04 18:46:06 +0000 |
commit | 54ca9095f046dfa03c3d093cc55f6d76b61864e1 (patch) | |
tree | 74098cc1e45c4856187f86016c104c8019ee40f2 /target-i386/helper2.c | |
parent | 56c8f68f1d2e45ad740de8c01780c7a4830d2098 (diff) | |
download | qemu-54ca9095f046dfa03c3d093cc55f6d76b61864e1.tar.gz qemu-54ca9095f046dfa03c3d093cc55f6d76b61864e1.tar.bz2 qemu-54ca9095f046dfa03c3d093cc55f6d76b61864e1.zip |
generate GPF if non canonical addresses
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@1681 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'target-i386/helper2.c')
-rw-r--r-- | target-i386/helper2.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/target-i386/helper2.c b/target-i386/helper2.c index 678c94168d..cb896cb5ec 100644 --- a/target-i386/helper2.c +++ b/target-i386/helper2.c @@ -566,6 +566,7 @@ int cpu_x86_handle_mmu_fault(CPUX86State *env, target_ulong addr, env->cr[2] = addr; env->error_code = (is_write << PG_ERROR_W_BIT); env->error_code |= PG_ERROR_U_MASK; + env->exception_index = EXCP0E_PAGE; return 1; } @@ -620,8 +621,9 @@ int cpu_x86_handle_mmu_fault(CPUX86State *env, target_ulong addr, /* test virtual address sign extension */ sext = (int64_t)addr >> 47; if (sext != 0 && sext != -1) { - error_code = 0; - goto do_fault; + env->error_code = 0; + env->exception_index = EXCP0D_GPF; + return 1; } pml4e_addr = ((env->cr[3] & ~0xfff) + (((addr >> 39) & 0x1ff) << 3)) & @@ -862,6 +864,7 @@ int cpu_x86_handle_mmu_fault(CPUX86State *env, target_ulong addr, (env->cr[4] & CR4_PAE_MASK)) error_code |= PG_ERROR_I_D_MASK; env->error_code = error_code; + env->exception_index = EXCP0E_PAGE; return 1; } |