summaryrefslogtreecommitdiff
path: root/target-i386
diff options
context:
space:
mode:
authorbellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162>2004-02-07 20:42:14 +0000
committerbellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162>2004-02-07 20:42:14 +0000
commit34f715e754adad52939d7b187fec655ddf3e0ba8 (patch)
tree37e98ceff31fd7674741cf585829a3c229e36b07 /target-i386
parentcae61cef8976a819e590df66068f056e758c7429 (diff)
downloadqemu-34f715e754adad52939d7b187fec655ddf3e0ba8.tar.gz
fixed WP semantics
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@606 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'target-i386')
-rw-r--r--target-i386/helper2.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/target-i386/helper2.c b/target-i386/helper2.c
index 47a93cddfa..f5c31d0df0 100644
--- a/target-i386/helper2.c
+++ b/target-i386/helper2.c
@@ -320,7 +320,7 @@ int cpu_x86_handle_mmu_fault(CPUX86State *env, uint32_t addr,
if (is_write && !(pde & PG_RW_MASK))
goto do_fault_protect;
} else {
- if ((env->cr[0] & CR0_WP_MASK) && (pde & PG_USER_MASK) &&
+ if ((env->cr[0] & CR0_WP_MASK) &&
is_write && !(pde & PG_RW_MASK))
goto do_fault_protect;
}
@@ -358,7 +358,7 @@ int cpu_x86_handle_mmu_fault(CPUX86State *env, uint32_t addr,
if (is_write && !(ptep & PG_RW_MASK))
goto do_fault_protect;
} else {
- if ((env->cr[0] & CR0_WP_MASK) && (ptep & PG_USER_MASK) &&
+ if ((env->cr[0] & CR0_WP_MASK) &&
is_write && !(ptep & PG_RW_MASK))
goto do_fault_protect;
}
@@ -382,7 +382,7 @@ int cpu_x86_handle_mmu_fault(CPUX86State *env, uint32_t addr,
if (ptep & PG_RW_MASK)
prot |= PROT_WRITE;
} else {
- if (!(env->cr[0] & CR0_WP_MASK) || !(ptep & PG_USER_MASK) ||
+ if (!(env->cr[0] & CR0_WP_MASK) ||
(ptep & PG_RW_MASK))
prot |= PROT_WRITE;
}