All of lore.kernel.org
 help / color / mirror / Atom feed
* Re: [PATCH] target/arm: Fix handling of cortex-m FTYPE flag in EXCRET
       [not found] <20191121014353.2604-1-jean-hugues.deschenes@ossiaco.com>
@ 2019-11-21 13:22 ` Peter Maydell
  0 siblings, 0 replies; only message in thread
From: Peter Maydell @ 2019-11-21 13:22 UTC (permalink / raw)
  To: Jean-Hugues Deschênes; +Cc: qemu-arm, richard.henderson, qemu-devel

On Thu, 21 Nov 2019 at 01:44, Jean-Hugues Deschênes
<Jean-Hugues.Deschenes@ossiaco.com> wrote:
>
> According to the PushStack() pseudocode in the armv7m RM,
> bit 4 of the LR should be set to NOT(CONTROL.PFCA) when
> an FPU is present. Current implementation is doing it for
> armv8, but not for armv7. This patch makes the existing
> logic applicable to both code paths.
>
> Signed-off-by: Jean-Hugues Deschenes <jean-hugues.deschenes@ossiaco.com>
> ---
>  target/arm/m_helper.c | 7 +++----
>  1 file changed, 3 insertions(+), 4 deletions(-)
>
> diff --git a/target/arm/m_helper.c b/target/arm/m_helper.c
> index f2512e448e..595c49fe2a 100644
> --- a/target/arm/m_helper.c
> +++ b/target/arm/m_helper.c
> @@ -2173,19 +2173,18 @@ void arm_v7m_cpu_do_interrupt(CPUState *cs)
>          if (env->v7m.secure) {
>              lr |= R_V7M_EXCRET_S_MASK;
>          }
> -        if (!(env->v7m.control[M_REG_S] & R_V7M_CONTROL_FPCA_MASK)) {
> -            lr |= R_V7M_EXCRET_FTYPE_MASK;
> -        }
>      } else {
>          lr = R_V7M_EXCRET_RES1_MASK |
>              R_V7M_EXCRET_S_MASK |
>              R_V7M_EXCRET_DCRS_MASK |
> -            R_V7M_EXCRET_FTYPE_MASK |
>              R_V7M_EXCRET_ES_MASK;
>          if (env->v7m.control[M_REG_NS] & R_V7M_CONTROL_SPSEL_MASK) {
>              lr |= R_V7M_EXCRET_SPSEL_MASK;
>          }
>      }
> +    if (!(env->v7m.control[M_REG_S] & R_V7M_CONTROL_FPCA_MASK)) {
> +        lr |= R_V7M_EXCRET_FTYPE_MASK;
> +    }
>      if (!arm_v7m_is_handler_mode(env)) {
>          lr |= R_V7M_EXCRET_MODE_MASK;
>      }
> --
> 2.17.1

Thanks, applied to my target-arm.next branch for 4.2.

-- PMM


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2019-11-21 13:24 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <20191121014353.2604-1-jean-hugues.deschenes@ossiaco.com>
2019-11-21 13:22 ` [PATCH] target/arm: Fix handling of cortex-m FTYPE flag in EXCRET Peter Maydell

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.