From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NbWR3-0001Oy-3N for qemu-devel@nongnu.org; Sun, 31 Jan 2010 04:49:41 -0500 Received: from [199.232.76.173] (port=45902 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NbWR1-0001O7-Qb for qemu-devel@nongnu.org; Sun, 31 Jan 2010 04:49:39 -0500 Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1NbWR1-00028n-10 for qemu-devel@nongnu.org; Sun, 31 Jan 2010 04:49:39 -0500 Received: from mail-px0-f189.google.com ([209.85.216.189]:48117) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NbWR0-00028h-NB for qemu-devel@nongnu.org; Sun, 31 Jan 2010 04:49:38 -0500 Received: by pxi27 with SMTP id 27so2898904pxi.4 for ; Sun, 31 Jan 2010 01:49:37 -0800 (PST) MIME-Version: 1.0 In-Reply-To: <1264904856-12569-1-git-send-email-atar4qemu@google.com> References: <1264904856-12569-1-git-send-email-atar4qemu@google.com> From: Blue Swirl Date: Sun, 31 Jan 2010 11:49:17 +0200 Message-ID: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: [Qemu-devel] Re: 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: Artyom Tarasenko Cc: qemu-devel@nongnu.org, Artyom Tarasenko Thanks, applied. On Sun, Jan 31, 2010 at 4:27 AM, Artyom Tarasenko 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 > --- > 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, targe= t_phys_addr_t *physical, > =C2=A0 =C2=A0 =C2=A0 =C2=A0 } > =C2=A0 =C2=A0 } > > + =C2=A0 =C2=A0/* check access */ > + =C2=A0 =C2=A0access_perms =3D (pde & PTE_ACCESS_MASK) >> PTE_ACCESS_SHI= FT; > + =C2=A0 =C2=A0error_code =3D access_table[*access_index][access_perms]; > + =C2=A0 =C2=A0if (error_code && !((env->mmuregs[0] & MMU_NF) && is_user)= ) > + =C2=A0 =C2=A0 =C2=A0 =C2=A0return error_code; > + > =C2=A0 =C2=A0 /* update page modified and dirty bits */ > =C2=A0 =C2=A0 is_dirty =3D (rw & 1) && !(pde & PG_MODIFIED_MASK); > =C2=A0 =C2=A0 if (!(pde & PG_ACCESSED_MASK) || is_dirty) { > @@ -193,11 +199,6 @@ static int get_physical_address(CPUState *env, targe= t_phys_addr_t *physical, > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 pde |=3D PG_MODIFIED_MASK; > =C2=A0 =C2=A0 =C2=A0 =C2=A0 stl_phys_notdirty(pde_ptr, pde); > =C2=A0 =C2=A0 } > - =C2=A0 =C2=A0/* check access */ > - =C2=A0 =C2=A0access_perms =3D (pde & PTE_ACCESS_MASK) >> PTE_ACCESS_SHI= FT; > - =C2=A0 =C2=A0error_code =3D access_table[*access_index][access_perms]; > - =C2=A0 =C2=A0if (error_code && !((env->mmuregs[0] & MMU_NF) && is_user)= ) > - =C2=A0 =C2=A0 =C2=A0 =C2=A0return error_code; > > =C2=A0 =C2=A0 /* the page can be put in the TLB */ > =C2=A0 =C2=A0 *prot =3D perm_table[is_user][access_perms]; >