From: "Edgar E. Iglesias" <edgar.iglesias@xilinx.com>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: Laurent Desnogues <laurent.desnogues@gmail.com>,
qemu-arm@nongnu.org, qemu-devel@nongnu.org, patches@linaro.org
Subject: Re: [Qemu-devel] [PATCH 2/2] target-arm: Don't try to set ESR IL bit in arm_cpu_do_interrupt_aarch64()
Date: Tue, 17 May 2016 14:51:27 +0200 [thread overview]
Message-ID: <20160517125126.GV3731@toto> (raw)
In-Reply-To: <1463487258-27468-3-git-send-email-peter.maydell@linaro.org>
On Tue, May 17, 2016 at 01:14:18PM +0100, Peter Maydell wrote:
> Remove some incorrect code from arm_cpu_do_interrupt_aarch64()
> which attempts to set the IL bit in the syndrome register based
> on the value of env->thumb. This is wrong in several ways:
> * IL doesn't indicate Thumb-vs-ARM, it indicates instruction
> length (which may be 16 or 32 for Thumb and is always 32 for ARM)
> * not every syndrome format uses IL like this -- for some IL is
> always set, and for some it is always clear
> * the code is changing esr_el[new_el] even for interrupt entry,
> which is not supposed to modify ESR_ELx at all
>
> Delete the code, and instead rely on the syndrome value in
> env->exception.syndrome having already been set up with the
> correct value of IL.
Reviewed-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com>
Tested-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com>
>
> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
> ---
> target-arm/helper.c | 3 ---
> 1 file changed, 3 deletions(-)
>
> diff --git a/target-arm/helper.c b/target-arm/helper.c
> index d652c01..df65e68 100644
> --- a/target-arm/helper.c
> +++ b/target-arm/helper.c
> @@ -6349,9 +6349,6 @@ static void arm_cpu_do_interrupt_aarch64(CPUState *cs)
> env->elr_el[new_el] = env->pc;
> } else {
> env->banked_spsr[aarch64_banked_spsr_index(new_el)] = cpsr_read(env);
> - if (!env->thumb) {
> - env->cp15.esr_el[new_el] |= 1 << 25;
> - }
> env->elr_el[new_el] = env->regs[15];
>
> aarch64_sync_32_to_64(env);
> --
> 1.9.1
>
WARNING: multiple messages have this Message-ID (diff)
From: "Edgar E. Iglesias" <edgar.iglesias@xilinx.com>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: qemu-arm@nongnu.org, qemu-devel@nongnu.org, patches@linaro.org,
Laurent Desnogues <laurent.desnogues@gmail.com>
Subject: Re: [Qemu-devel] [PATCH 2/2] target-arm: Don't try to set ESR IL bit in arm_cpu_do_interrupt_aarch64()
Date: Tue, 17 May 2016 14:51:27 +0200 [thread overview]
Message-ID: <20160517125126.GV3731@toto> (raw)
In-Reply-To: <1463487258-27468-3-git-send-email-peter.maydell@linaro.org>
On Tue, May 17, 2016 at 01:14:18PM +0100, Peter Maydell wrote:
> Remove some incorrect code from arm_cpu_do_interrupt_aarch64()
> which attempts to set the IL bit in the syndrome register based
> on the value of env->thumb. This is wrong in several ways:
> * IL doesn't indicate Thumb-vs-ARM, it indicates instruction
> length (which may be 16 or 32 for Thumb and is always 32 for ARM)
> * not every syndrome format uses IL like this -- for some IL is
> always set, and for some it is always clear
> * the code is changing esr_el[new_el] even for interrupt entry,
> which is not supposed to modify ESR_ELx at all
>
> Delete the code, and instead rely on the syndrome value in
> env->exception.syndrome having already been set up with the
> correct value of IL.
Reviewed-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com>
Tested-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com>
>
> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
> ---
> target-arm/helper.c | 3 ---
> 1 file changed, 3 deletions(-)
>
> diff --git a/target-arm/helper.c b/target-arm/helper.c
> index d652c01..df65e68 100644
> --- a/target-arm/helper.c
> +++ b/target-arm/helper.c
> @@ -6349,9 +6349,6 @@ static void arm_cpu_do_interrupt_aarch64(CPUState *cs)
> env->elr_el[new_el] = env->pc;
> } else {
> env->banked_spsr[aarch64_banked_spsr_index(new_el)] = cpsr_read(env);
> - if (!env->thumb) {
> - env->cp15.esr_el[new_el] |= 1 << 25;
> - }
> env->elr_el[new_el] = env->regs[15];
>
> aarch64_sync_32_to_64(env);
> --
> 1.9.1
>
next prev parent reply other threads:[~2016-05-17 12:52 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-05-17 12:14 [Qemu-arm] [PATCH 0/2] target-arm: ESR IL bit fixes Peter Maydell
2016-05-17 12:14 ` [Qemu-devel] " Peter Maydell
2016-05-17 12:14 ` [Qemu-arm] [PATCH 1/2] target-arm: Set IL bit in syndromes for insn abort, watchpoint, swstep Peter Maydell
2016-05-17 12:14 ` [Qemu-devel] " Peter Maydell
2016-05-17 12:50 ` Edgar E. Iglesias
2016-05-17 12:50 ` Edgar E. Iglesias
2016-05-17 13:06 ` [Qemu-arm] " Peter Maydell
2016-05-17 13:06 ` [Qemu-devel] " Peter Maydell
2016-05-17 13:12 ` Edgar E. Iglesias
2016-05-17 13:12 ` Edgar E. Iglesias
2016-05-17 12:14 ` [Qemu-arm] [PATCH 2/2] target-arm: Don't try to set ESR IL bit in arm_cpu_do_interrupt_aarch64() Peter Maydell
2016-05-17 12:14 ` [Qemu-devel] " Peter Maydell
2016-05-17 12:51 ` Edgar E. Iglesias [this message]
2016-05-17 12:51 ` Edgar E. Iglesias
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=20160517125126.GV3731@toto \
--to=edgar.iglesias@xilinx.com \
--cc=laurent.desnogues@gmail.com \
--cc=patches@linaro.org \
--cc=peter.maydell@linaro.org \
--cc=qemu-arm@nongnu.org \
--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.