From: Artyom Tarasenko <atar4qemu@googlemail.com>
To: qemu-devel@nongnu.org
Cc: Blue Swirl <blauwirbel@gmail.com>,
Artyom Tarasenko <atar4qemu@gmail.com>
Subject: [Qemu-devel] sparc32 don't mark page dirty when failing
Date: Sun, 31 Jan 2010 03:27:36 +0100 [thread overview]
Message-ID: <1264904856-12569-1-git-send-email-atar4qemu@google.com> (raw)
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>
---
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];
next reply other threads:[~2010-01-31 2:27 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-01-31 2:27 Artyom Tarasenko [this message]
2010-01-31 9:49 ` [Qemu-devel] Re: sparc32 don't mark page dirty when failing Blue Swirl
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1264904856-12569-1-git-send-email-atar4qemu@google.com \
--to=atar4qemu@googlemail.com \
--cc=atar4qemu@gmail.com \
--cc=blauwirbel@gmail.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).