From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1F9mTQ-0004S9-Q9 for qemu-devel@nongnu.org; Thu, 16 Feb 2006 11:59:21 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1F9mRg-0002Uy-9z for qemu-devel@nongnu.org; Thu, 16 Feb 2006 11:57:35 -0500 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1F9mBY-0002Gn-Ov for qemu-devel@nongnu.org; Thu, 16 Feb 2006 11:40:52 -0500 Received: from [193.7.176.20] (helo=bender.bawue.de) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_3DES_EDE_CBC_SHA:24) (Exim 4.52) id 1F9mGi-00049t-NZ for qemu-devel@nongnu.org; Thu, 16 Feb 2006 11:46:13 -0500 Received: from lagash (unknown [194.74.144.146]) (using TLSv1 with cipher DES-CBC3-SHA (168/168 bits)) (No client certificate requested) by bender.bawue.de (Postfix) with ESMTP id 2900245247 for ; Thu, 16 Feb 2006 17:40:51 +0100 (MET) Received: from ths by lagash with local (Exim 4.60) (envelope-from ) id 1F9mBq-0000RP-C8 for qemu-devel@nongnu.org; Thu, 16 Feb 2006 16:41:10 +0000 Date: Thu, 16 Feb 2006 16:41:10 +0000 Message-ID: <20060216164110.GD23684@networkno.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline From: Thiemo Seufer Subject: [Qemu-devel] [PATCH] Check if we really are in userspace 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 Hello All, this tests for MIPS if we are in userspace when handling a TLB fault. For some of the other architectures this may also be a bug, only ppc and x86 handle this so far. Thiemo 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)