mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-11 03:24:58 -06:00
target/arm: Clean excReturn bits when tail chaining
The TailChain() pseudocode specifies that a tail chaining exception should sanitize the excReturn all-ones bits and (if there is no FPU) the excReturn FType bits; we weren't doing this. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Message-id: 20190416125744.27770-14-peter.maydell@linaro.org
This commit is contained in:
parent
3cd6726f0b
commit
60fba59a2f
1 changed files with 8 additions and 0 deletions
|
@ -8076,6 +8076,14 @@ static void v7m_exception_taken(ARMCPU *cpu, uint32_t lr, bool dotailchain,
|
||||||
qemu_log_mask(CPU_LOG_INT, "...taking pending %s exception %d\n",
|
qemu_log_mask(CPU_LOG_INT, "...taking pending %s exception %d\n",
|
||||||
targets_secure ? "secure" : "nonsecure", exc);
|
targets_secure ? "secure" : "nonsecure", exc);
|
||||||
|
|
||||||
|
if (dotailchain) {
|
||||||
|
/* Sanitize LR FType and PREFIX bits */
|
||||||
|
if (!arm_feature(env, ARM_FEATURE_VFP)) {
|
||||||
|
lr |= R_V7M_EXCRET_FTYPE_MASK;
|
||||||
|
}
|
||||||
|
lr = deposit32(lr, 24, 8, 0xff);
|
||||||
|
}
|
||||||
|
|
||||||
if (arm_feature(env, ARM_FEATURE_V8)) {
|
if (arm_feature(env, ARM_FEATURE_V8)) {
|
||||||
if (arm_feature(env, ARM_FEATURE_M_SECURITY) &&
|
if (arm_feature(env, ARM_FEATURE_M_SECURITY) &&
|
||||||
(lr & R_V7M_EXCRET_S_MASK)) {
|
(lr & R_V7M_EXCRET_S_MASK)) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue