From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47132) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zz2ZR-0004FE-2q for qemu-devel@nongnu.org; Wed, 18 Nov 2015 08:14:45 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Zz2ZN-0005Tu-1a for qemu-devel@nongnu.org; Wed, 18 Nov 2015 08:14:44 -0500 Received: from mailapp01.imgtec.com ([195.59.15.196]:14702) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zz2ZM-0005Tq-Se for qemu-devel@nongnu.org; Wed, 18 Nov 2015 08:14:40 -0500 References: <1447780434-27700-1-git-send-email-james.hogan@imgtec.com> From: Leon Alrae Message-ID: <564C79B4.9030709@imgtec.com> Date: Wed, 18 Nov 2015 13:14:28 +0000 MIME-Version: 1.0 In-Reply-To: <1447780434-27700-1-git-send-email-james.hogan@imgtec.com> Content-Type: text/plain; charset="windows-1252" Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v2] target-mips: Fix exceptions while UX=0 List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: James Hogan Cc: qemu-devel@nongnu.org, Aurelien Jarno On 17/11/15 17:13, James Hogan wrote: > Commit 01f728857941 ("target-mips: Status.UX/SX/KX enable 32-bit address > wrapping") added a new hflag MIPS_HFLAG_AWRAP, which indicates that > 64-bit addressing is disallowed in the current mode, so hflag users > don't need to worry about the complexities of working that out, for > example checking both MIPS_HFLAG_KSU and MIPS_HFLAG_UX. > > However when exceptions are taken outside of exception level, > mips_cpu_do_interrupt() manipulates the env->hflags directly rather than > using compute_hflags() to update them, and this code wasn't updated > accordingly. As a result, when UX is cleared, MIPS_HFLAG_AWRAP is set, > but it doesn't get cleared on entry back into kernel mode due to an > exception. Kernel mode then cannot access the 64-bit segments resulting > in a nested exception loop. The same applies to errors and debug > exceptions. > > Fix by updating mips_cpu_do_interrupt() to clear the MIPS_HFLAG_WRAP > flag when necessary, according to compute_hflags(). > > Fixes: 01f728857941 ("target-mips: Status.UX/SX/KX enable 32-bit...") > Signed-off-by: James Hogan > Cc: Leon Alrae > Cc: Aurelien Jarno > --- > Changes in v2: > - Add cases for debug exceptions and errors (Leon). > --- > target-mips/helper.c | 12 ++++++++++++ > 1 file changed, 12 insertions(+) Applied to target-mips queue, thanks. Leon