qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] sparc32 don't mark page dirty when failing
@ 2010-01-31  2:27 Artyom Tarasenko
  2010-01-31  9:49 ` [Qemu-devel] " Blue Swirl
  0 siblings, 1 reply; 2+ messages in thread
From: Artyom Tarasenko @ 2010-01-31  2:27 UTC (permalink / raw)
  To: qemu-devel; +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 <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];

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [Qemu-devel] Re: sparc32 don't mark page dirty when failing
  2010-01-31  2:27 [Qemu-devel] sparc32 don't mark page dirty when failing Artyom Tarasenko
@ 2010-01-31  9:49 ` Blue Swirl
  0 siblings, 0 replies; 2+ messages in thread
From: Blue Swirl @ 2010-01-31  9:49 UTC (permalink / raw)
  To: Artyom Tarasenko; +Cc: qemu-devel, Artyom Tarasenko

Thanks, applied.


On Sun, Jan 31, 2010 at 4:27 AM, Artyom Tarasenko
<atar4qemu@googlemail.com> wrote:
> 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];
>

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2010-01-31  9:49 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-01-31  2:27 [Qemu-devel] sparc32 don't mark page dirty when failing Artyom Tarasenko
2010-01-31  9:49 ` [Qemu-devel] " Blue Swirl

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).