diff options
| author | Peter Maydell <peter.maydell@linaro.org> | 2017-09-07 13:54:54 +0100 |
|---|---|---|
| committer | Peter Maydell <peter.maydell@linaro.org> | 2017-09-07 13:54:54 +0100 |
| commit | 9d40cd8a68cfc7606f4548cc9e812bab15c6dc28 (patch) | |
| tree | 5ea2b0c184445a132503a6ae8b8710be0e709fac /target/arm/helper.c | |
| parent | ecf5e8eae8b0b5fa41f00b53d67747b42fd1b8b9 (diff) | |
| download | focaccia-qemu-9d40cd8a68cfc7606f4548cc9e812bab15c6dc28.tar.gz focaccia-qemu-9d40cd8a68cfc7606f4548cc9e812bab15c6dc28.zip | |
target/arm: Make CCR register banked for v8M
Make the CCR register banked if v8M security extensions are enabled. This is slightly more complicated than the other "add banking" patches because there is one bit in the register which is not banked. We keep the live data in the NS copy of the register, and adjust it on register reads and writes. (Since we don't currently implement the behaviour that the bit controls, there is nowhere else that needs to care.) This patch includes the enforcement of the bits which are newly RES1 in ARMv8M. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Message-id: 1503414539-28762-17-git-send-email-peter.maydell@linaro.org
Diffstat (limited to 'target/arm/helper.c')
| -rw-r--r-- | target/arm/helper.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/target/arm/helper.c b/target/arm/helper.c index cc68688d88..2fe1662af7 100644 --- a/target/arm/helper.c +++ b/target/arm/helper.c @@ -6113,7 +6113,8 @@ static void v7m_push_stack(ARMCPU *cpu) uint32_t xpsr = xpsr_read(env); /* Align stack pointer if the guest wants that */ - if ((env->regs[13] & 4) && (env->v7m.ccr & R_V7M_CCR_STKALIGN_MASK)) { + if ((env->regs[13] & 4) && + (env->v7m.ccr[env->v7m.secure] & R_V7M_CCR_STKALIGN_MASK)) { env->regs[13] -= 4; xpsr |= XPSR_SPREALIGN; } @@ -6211,7 +6212,7 @@ static void do_v7m_exception_exit(ARMCPU *cpu) /* fall through */ case 9: /* Return to Thread using Main stack */ if (!rettobase && - !(env->v7m.ccr & R_V7M_CCR_NONBASETHRDENA_MASK)) { + !(env->v7m.ccr[env->v7m.secure] & R_V7M_CCR_NONBASETHRDENA_MASK)) { ufault = true; } break; |