From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NWvZN-0003i6-Kx for qemu-devel@nongnu.org; Mon, 18 Jan 2010 12:39:17 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NWvZJ-0003ht-8q for qemu-devel@nongnu.org; Mon, 18 Jan 2010 12:39:17 -0500 Received: from [199.232.76.173] (port=37567 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NWvZJ-0003hq-3F for qemu-devel@nongnu.org; Mon, 18 Jan 2010 12:39:13 -0500 Received: from mail-pz0-f190.google.com ([209.85.222.190]:37365) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NWvZI-00037E-OO for qemu-devel@nongnu.org; Mon, 18 Jan 2010 12:39:12 -0500 Received: by pzk28 with SMTP id 28so1740190pzk.4 for ; Mon, 18 Jan 2010 09:39:11 -0800 (PST) MIME-Version: 1.0 In-Reply-To: References: <1263590936-17505-1-git-send-email-atar4qemu@google.com> From: Blue Swirl Date: Mon, 18 Jan 2010 17:38:49 +0000 Message-ID: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: [Qemu-devel] Re: sparc32 do_unassigned_access overhaul v2 List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Artyom Tarasenko Cc: qemu-devel@nongnu.org On Mon, Jan 18, 2010 at 4:17 PM, Artyom Tarasenko wrote: > Btw, what is the following hack for in do_unassigned_access? > > > =C2=A0 =C2=A0saved_env =3D env; > =C2=A0 =C2=A0env =3D cpu_single_env; > //... > =C2=A0 =C2=A0env =3D saved_env; env is a host CPU register, see for example target-sparc/exec.h. Code which is called directly from translated code (and cpu-exec.c) is compiled this way. I'm not sure if do_unassigned_access will ever be called from outside of translated code, grep hits were from exec.c, cpu-exec.c and op_helper.c. > I wonder whether I modify the correct env here: > > =C2=A0 env =3D saved_env; > > + =C2=A0 =C2=A0/* flush neverland mappings created during no-fault mode, > + =C2=A0 =C2=A0 =C2=A0 so the sequential MMU faults report proper fault t= ypes */ > + =C2=A0 =C2=A0if (env->mmuregs[0] & MMU_NF) { > + =C2=A0 =C2=A0 =C2=A0 =C2=A0tlb_flush(env, 1); > + =C2=A0 =C2=A0} Right, if env was NULL when entering the function, it will crash.