aboutsummaryrefslogtreecommitdiff
path: root/target-sparc
diff options
context:
space:
mode:
authorArtyom Tarasenko <atar4qemu@googlemail.com>2010-01-31 03:27:36 +0100
committerBlue Swirl <blauwirbel@gmail.com>2010-01-31 07:49:26 +0000
commit698235aab6f55e960203dc2ef9a3a580982dae2f (patch)
tree0208a804dddd194b6901d01b00b886894efc86eb /target-sparc
parent95819af01519c810aa2b9b4a6bcc944eca6d80d0 (diff)
sparc32 don't mark page dirty when failing
if the access check fails, the page can not be modified and shouldn't be marked dirty. The patch fixes the "hsfs_putpage: dirty HSFS page" error in Solaris guests. Signed-off-by: Artyom Tarasenko <atar4qemu@gmail.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Diffstat (limited to 'target-sparc')
-rw-r--r--target-sparc/helper.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/target-sparc/helper.c b/target-sparc/helper.c
index b5b4e7ca74..ffe93e3d44 100644
--- a/target-sparc/helper.c
+++ b/target-sparc/helper.c
@@ -185,6 +185,12 @@ static int get_physical_address(CPUState *env, target_phys_addr_t *physical,
}
}
+ /* check access */
+ access_perms = (pde & PTE_ACCESS_MASK) >> PTE_ACCESS_SHIFT;
+ error_code = access_table[*access_index][access_perms];
+ if (error_code && !((env->mmuregs[0] & MMU_NF) && is_user))
+ return error_code;
+
/* update page modified and dirty bits */
is_dirty = (rw & 1) && !(pde & PG_MODIFIED_MASK);
if (!(pde & PG_ACCESSED_MASK) || is_dirty) {
@@ -193,11 +199,6 @@ static int get_physical_address(CPUState *env, target_phys_addr_t *physical,
pde |= PG_MODIFIED_MASK;
stl_phys_notdirty(pde_ptr, pde);
}
- /* check access */
- access_perms = (pde & PTE_ACCESS_MASK) >> PTE_ACCESS_SHIFT;
- error_code = access_table[*access_index][access_perms];
- if (error_code && !((env->mmuregs[0] & MMU_NF) && is_user))
- return error_code;
/* the page can be put in the TLB */
*prot = perm_table[is_user][access_perms];