qemu-commits
[Top][All Lists]
Advanced

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

[Qemu-commits] [qemu/qemu] 02ac2f: target/arm: Avoid bogus NSACR traps o


From: Peter Maydell
Subject: [Qemu-commits] [qemu/qemu] 02ac2f: target/arm: Avoid bogus NSACR traps on M-profile w...
Date: Fri, 02 Aug 2019 09:38:12 -0700

  Branch: refs/heads/master
  Home:   https://github.com/qemu/qemu
  Commit: 02ac2f7f613b47f6a5b397b20ab0e6b2e7fb89fa
      
https://github.com/qemu/qemu/commit/02ac2f7f613b47f6a5b397b20ab0e6b2e7fb89fa
  Author: Peter Maydell <address@hidden>
  Date:   2019-08-02 (Fri, 02 Aug 2019)

  Changed paths:
    M target/arm/cpu.c

  Log Message:
  -----------
  target/arm: Avoid bogus NSACR traps on M-profile without Security Extension

In Arm v8.0 M-profile CPUs without the Security Extension and also in
v7M CPUs, there is no NSACR register. However, the code we have to handle
the FPU does not always check whether the ARM_FEATURE_M_SECURITY bit
is set before testing whether env->v7m.nsacr permits access to the
FPU. This means that for a CPU with an FPU but without the Security
Extension we would always take a bogus fault when trying to stack
the FPU registers on an exception entry.

We could fix this by adding extra feature bit checks for all uses,
but it is simpler to just make the internal value of nsacr 0xcff
("all non-secure accesses allowed"), since this is not guest
visible when the Security Extension is not present. This allows
us to continue to follow the Arm ARM pseudocode which takes a
similar approach. (In particular, in the v8.1 Arm ARM the register
is documented as reading as 0xcff in this configuration.)

Fixes: https://bugs.launchpad.net/qemu/+bug/1838475
Signed-off-by: Peter Maydell <address@hidden>
Reviewed-by: Damien Hedde <address@hidden>
Message-id: address@hidden





reply via email to

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