Commit 34f715e754adad52939d7b187fec655ddf3e0ba8

Authored by bellard
1 parent cae61cef

fixed WP semantics


git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@606 c046a42c-6fe2-441c-8c8c-71466251a162
Showing 1 changed file with 3 additions and 3 deletions
target-i386/helper2.c
@@ -320,7 +320,7 @@ int cpu_x86_handle_mmu_fault(CPUX86State *env, uint32_t addr, @@ -320,7 +320,7 @@ int cpu_x86_handle_mmu_fault(CPUX86State *env, uint32_t addr,
320 if (is_write && !(pde & PG_RW_MASK)) 320 if (is_write && !(pde & PG_RW_MASK))
321 goto do_fault_protect; 321 goto do_fault_protect;
322 } else { 322 } else {
323 - if ((env->cr[0] & CR0_WP_MASK) && (pde & PG_USER_MASK) && 323 + if ((env->cr[0] & CR0_WP_MASK) &&
324 is_write && !(pde & PG_RW_MASK)) 324 is_write && !(pde & PG_RW_MASK))
325 goto do_fault_protect; 325 goto do_fault_protect;
326 } 326 }
@@ -358,7 +358,7 @@ int cpu_x86_handle_mmu_fault(CPUX86State *env, uint32_t addr, @@ -358,7 +358,7 @@ int cpu_x86_handle_mmu_fault(CPUX86State *env, uint32_t addr,
358 if (is_write && !(ptep & PG_RW_MASK)) 358 if (is_write && !(ptep & PG_RW_MASK))
359 goto do_fault_protect; 359 goto do_fault_protect;
360 } else { 360 } else {
361 - if ((env->cr[0] & CR0_WP_MASK) && (ptep & PG_USER_MASK) && 361 + if ((env->cr[0] & CR0_WP_MASK) &&
362 is_write && !(ptep & PG_RW_MASK)) 362 is_write && !(ptep & PG_RW_MASK))
363 goto do_fault_protect; 363 goto do_fault_protect;
364 } 364 }
@@ -382,7 +382,7 @@ int cpu_x86_handle_mmu_fault(CPUX86State *env, uint32_t addr, @@ -382,7 +382,7 @@ int cpu_x86_handle_mmu_fault(CPUX86State *env, uint32_t addr,
382 if (ptep & PG_RW_MASK) 382 if (ptep & PG_RW_MASK)
383 prot |= PROT_WRITE; 383 prot |= PROT_WRITE;
384 } else { 384 } else {
385 - if (!(env->cr[0] & CR0_WP_MASK) || !(ptep & PG_USER_MASK) || 385 + if (!(env->cr[0] & CR0_WP_MASK) ||
386 (ptep & PG_RW_MASK)) 386 (ptep & PG_RW_MASK))
387 prot |= PROT_WRITE; 387 prot |= PROT_WRITE;
388 } 388 }