qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH v2] target-mips: Fix exceptions while UX=0


From: Leon Alrae
Subject: Re: [Qemu-devel] [PATCH v2] target-mips: Fix exceptions while UX=0
Date: Wed, 18 Nov 2015 13:14:28 +0000
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0

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 <address@hidden>
> Cc: Leon Alrae <address@hidden>
> Cc: Aurelien Jarno <address@hidden>
> ---
> 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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]