]> git.proxmox.com Git - mirror_qemu.git/commitdiff
generate GPF if non canonical addresses
authorbellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162>
Sun, 4 Dec 2005 18:46:06 +0000 (18:46 +0000)
committerbellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162>
Sun, 4 Dec 2005 18:46:06 +0000 (18:46 +0000)
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@1681 c046a42c-6fe2-441c-8c8c-71466251a162

cpu-exec.c
target-i386/helper.c
target-i386/helper2.c

index 89bf8b85e1606e122d5d7dcfc6b54081b83eee23..7c056d40b6dbeeef39923bc8fd5fd4897a8feab7 100644 (file)
@@ -904,7 +904,7 @@ static inline int handle_cpu_signal(unsigned long pc, unsigned long address,
         /* we restore the process signal mask as the sigreturn should
            do it (XXX: use sigsetjmp) */
         sigprocmask(SIG_SETMASK, old_set, NULL);
-        raise_exception_err(EXCP0E_PAGE, env->error_code);
+        raise_exception_err(env->exception_index, env->error_code);
     } else {
         /* activate soft MMU for this block */
         env->hflags |= HF_SOFTMMU_MASK;
index 6939cb76c1e4f6b4826ec731d393919c82a2290f..5c1d6cd80df3b42f3449dd7a87b889dd65931173 100644 (file)
@@ -3478,9 +3478,9 @@ void tlb_fill(target_ulong addr, int is_write, int is_user, void *retaddr)
             }
         }
         if (retaddr)
-            raise_exception_err(EXCP0E_PAGE, env->error_code);
+            raise_exception_err(env->exception_index, env->error_code);
         else
-            raise_exception_err_norestore(EXCP0E_PAGE, env->error_code);
+            raise_exception_err_norestore(env->exception_index, env->error_code);
     }
     env = saved_env;
 }
index 678c94168d543d856467d75d6f63acb2bd473487..cb896cb5ec8bb12766c4999cc5aeae243d75b998 100644 (file)
@@ -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;
 }