From: Leon Alrae <leon.alrae@imgtec.com>
To: James Hogan <james.hogan@imgtec.com>
Cc: qemu-devel@nongnu.org, Aurelien Jarno <aurelien@aurel32.net>
Subject: Re: [Qemu-devel] [PATCH v2] target-mips: Fix exceptions while UX=0
Date: Wed, 18 Nov 2015 13:14:28 +0000 [thread overview]
Message-ID: <564C79B4.9030709@imgtec.com> (raw)
In-Reply-To: <1447780434-27700-1-git-send-email-james.hogan@imgtec.com>
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 <james.hogan@imgtec.com>
> Cc: Leon Alrae <leon.alrae@imgtec.com>
> Cc: Aurelien Jarno <aurelien@aurel32.net>
> ---
> 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
prev parent reply other threads:[~2015-11-18 13:14 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-11-17 17:13 [Qemu-devel] [PATCH v2] target-mips: Fix exceptions while UX=0 James Hogan
2015-11-18 13:14 ` Leon Alrae [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=564C79B4.9030709@imgtec.com \
--to=leon.alrae@imgtec.com \
--cc=aurelien@aurel32.net \
--cc=james.hogan@imgtec.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.