diff options
author | Peter Maydell <peter.maydell@linaro.org> | 2018-02-15 18:29:37 +0000 |
---|---|---|
committer | Peter Maydell <peter.maydell@linaro.org> | 2018-02-15 18:29:49 +0000 |
commit | 6eb3a64e2a96f5ced1f7896042b01f002bf0a91f (patch) | |
tree | c54762aa63312781c938aab17c8bce8db6e363e7 | |
parent | 24ac0fb129f9ce9dd96901b2377fc6271dc55b2b (diff) | |
download | qemu-6eb3a64e2a96f5ced1f7896042b01f002bf0a91f.zip qemu-6eb3a64e2a96f5ced1f7896042b01f002bf0a91f.tar.gz qemu-6eb3a64e2a96f5ced1f7896042b01f002bf0a91f.tar.bz2 |
target/arm: Implement writing to CONTROL_NS for v8M
In commit 50f11062d4c896 we added support for MSR/MRS access
to the NS banked special registers, but we forgot to implement
the support for writing to CONTROL_NS. Correct the omission.
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20180209165810.6668-8-peter.maydell@linaro.org
-rw-r--r-- | target/arm/helper.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/target/arm/helper.c b/target/arm/helper.c index 550dc3d..1ae1199 100644 --- a/target/arm/helper.c +++ b/target/arm/helper.c @@ -10507,6 +10507,16 @@ void HELPER(v7m_msr)(CPUARMState *env, uint32_t maskreg, uint32_t val) } env->v7m.faultmask[M_REG_NS] = val & 1; return; + case 0x94: /* CONTROL_NS */ + if (!env->v7m.secure) { + return; + } + write_v7m_control_spsel_for_secstate(env, + val & R_V7M_CONTROL_SPSEL_MASK, + M_REG_NS); + env->v7m.control[M_REG_NS] &= ~R_V7M_CONTROL_NPRIV_MASK; + env->v7m.control[M_REG_NS] |= val & R_V7M_CONTROL_NPRIV_MASK; + return; case 0x98: /* SP_NS */ { /* This gives the non-secure SP selected based on whether we're |