From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1FI6dF-0003Tn-Jx for qemu-devel@nongnu.org; Sat, 11 Mar 2006 11:07:53 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1FI6dE-0003TT-Su for qemu-devel@nongnu.org; Sat, 11 Mar 2006 11:07:53 -0500 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1FI6dE-0003TQ-OM for qemu-devel@nongnu.org; Sat, 11 Mar 2006 11:07:52 -0500 Received: from [65.74.133.6] (helo=mail.codesourcery.com) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA:32) (Exim 4.52) id 1FI6gm-0007WF-KD for qemu-devel@nongnu.org; Sat, 11 Mar 2006 11:11:32 -0500 From: Paul Brook Subject: Re: [Qemu-devel] [PATCH] Check if we really are in userspace Date: Sat, 11 Mar 2006 16:07:48 +0000 References: <20060216164110.GD23684@networkno.de> In-Reply-To: <20060216164110.GD23684@networkno.de> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200603111607.49176.paul@codesourcery.com> Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org > Index: cpu-exec.c > =================================================================== > RCS file: /sources/qemu/qemu/cpu-exec.c,v > retrieving revision 1.73 > diff -u -p -r1.73 cpu-exec.c > --- cpu-exec.c 8 Feb 2006 22:43:39 -0000 1.73 > +++ cpu-exec.c 16 Feb 2006 15:21:03 -0000 > @@ -1089,7 +1089,9 @@ static inline int handle_cpu_signal(unsi > } > > /* see if it is an MMU fault */ > - ret = cpu_mips_handle_mmu_fault(env, address, is_write, 1, 0); > + ret = cpu_mips_handle_mmu_fault(env, address, is_write, > + ((env->hflags & MIPS_HFLAG_MODE) > + == MIPS_HFLAG_UM), 0); > if (ret < 0) > return 0; /* not an MMU fault */ > if (ret == 0) This code is only used when !defined(CONFIG_SOFTMMU), ie. usermode emulation. The i386 code is a leftover of the now-dead qemu-fast. Presumably the ppc code was just copied from these. Paul