From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NbPXN-0003T0-Ay for qemu-devel@nongnu.org; Sat, 30 Jan 2010 21:27:45 -0500 Received: from [199.232.76.173] (port=37291 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NbPXM-0003Se-LD for qemu-devel@nongnu.org; Sat, 30 Jan 2010 21:27:44 -0500 Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1NbPXK-0003Ca-8o for qemu-devel@nongnu.org; Sat, 30 Jan 2010 21:27:44 -0500 Received: from fg-out-1718.google.com ([72.14.220.157]:47081) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NbPXJ-0003CI-Tl for qemu-devel@nongnu.org; Sat, 30 Jan 2010 21:27:42 -0500 Received: by fg-out-1718.google.com with SMTP id 19so346932fgg.10 for ; Sat, 30 Jan 2010 18:27:40 -0800 (PST) From: Artyom Tarasenko Date: Sun, 31 Jan 2010 03:27:36 +0100 Message-Id: <1264904856-12569-1-git-send-email-atar4qemu@google.com> Subject: [Qemu-devel] sparc32 don't mark page dirty when failing List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Blue Swirl , Artyom Tarasenko 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 --- diff --git a/target-sparc/helper.c b/target-sparc/helper.c index b5b4e7c..ffe93e3 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];