From patchwork Sun Jan 31 02:27:36 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Artyom Tarasenko X-Patchwork-Id: 44102 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 4928DB7D35 for ; Sun, 31 Jan 2010 13:28:24 +1100 (EST) Received: from localhost ([127.0.0.1]:59223 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NbPXv-0003U7-HZ for incoming@patchwork.ozlabs.org; Sat, 30 Jan 2010 21:28:19 -0500 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) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=domainkey-signature:received:received:from:to:cc:subject:date :message-id:x-mailer; bh=TE9s7kcQPa0yjVeXBp89dCD05A8iUrWTCsOOCozuPzY=; b=e1SVbYa7nGavc5epobnLb/VcJLSfRMhfIjtj8iemZKShhBRcP/NjMOgrtYT6VaUb6a aTgB7xpHCyKb38z7SRmvMDhJKaYa/vWIsff5BFau+tsYB7kDQnWjGC/s2CvVjsCNhlhm G49VnqJuKD60QEzW9pPiMhZpnwWkImHBz1ltA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma; h=from:to:cc:subject:date:message-id:x-mailer; b=sKwdZUKgkq+23A/7RZ2USsAmaOzvRU6pqSWhRXhf0PmoyDW2nvLNyWLlLqT6xgOMFA y0CEnfhxJlAGBgsSo/V8BnfFI4s/8fEWt/Aq2uwTcQW9TBqBpGO0ZDGpqeIzBIsuAbPI 0mSqNyrNE4pd+0OuS9Kyqwqx8vjPv+JH0uXek= Received: by 10.87.58.21 with SMTP id l21mr4630614fgk.49.1264904860499; Sat, 30 Jan 2010 18:27:40 -0800 (PST) Received: from localhost (g228053222.adsl.alicedsl.de [92.228.53.222]) by mx.google.com with ESMTPS id l12sm10203637fgb.5.2010.01.30.18.27.37 (version=TLSv1/SSLv3 cipher=RC4-MD5); Sat, 30 Jan 2010 18:27:39 -0800 (PST) From: Artyom Tarasenko To: qemu-devel@nongnu.org Date: Sun, 31 Jan 2010 03:27:36 +0100 Message-Id: <1264904856-12569-1-git-send-email-atar4qemu@google.com> X-Mailer: git-send-email 1.6.2.5 X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) Cc: Blue Swirl , Artyom Tarasenko Subject: [Qemu-devel] sparc32 don't mark page dirty when failing X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org 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];