target/arm: Pass security space rather than flag for AT instructions
commite1ee56ec2383fcc6c1bab613e783a0c190fc0ea7
authorJean-Philippe Brucker <jean-philippe@linaro.org>
Tue, 22 Aug 2023 16:31:12 +0000 (22 17:31 +0100)
committerPeter Maydell <peter.maydell@linaro.org>
Tue, 22 Aug 2023 16:31:12 +0000 (22 17:31 +0100)
tree2d4fc33f6d8bd4db979e7ab7d58cce2dacb99781
parentf1269a98aaf8e2884cb067d09bce0d3056ede289
target/arm: Pass security space rather than flag for AT instructions

At the moment we only handle Secure and Nonsecure security spaces for
the AT instructions. Add support for Realm and Root.

For AArch64, arm_security_space() gives the desired space. ARM DDI0487J
says (R_NYXTL):

  If EL3 is implemented, then when an address translation instruction
  that applies to an Exception level lower than EL3 is executed, the
  Effective value of SCR_EL3.{NSE, NS} determines the target Security
  state that the instruction applies to.

For AArch32, some instructions can access NonSecure space from Secure,
so we still need to pass the state explicitly to do_ats_write().

Signed-off-by: Jean-Philippe Brucker <jean-philippe@linaro.org>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Message-id: 20230809123706.1842548-5-jean-philippe@linaro.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
target/arm/helper.c
target/arm/internals.h
target/arm/ptw.c