mirror of
https://github.com/yuzu-emu/unicorn.git
synced 2025-03-28 15:46:52 +00: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. Backports commit 60fba59a2f9a092a44b688df5d058cdd6dd9c276 from qemu
This commit is contained in:
parent
ca0ac5dca9
commit
746d377221
|
@ -7880,6 +7880,14 @@ static void v7m_exception_taken(ARMCPU *cpu, uint32_t lr, bool dotailchain,
|
|||
// Unicorn: commented out
|
||||
//armv7m_nvic_get_pending_irq_info(env->nvic, &exc, &targets_secure);
|
||||
|
||||
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_M_SECURITY) &&
|
||||
(lr & R_V7M_EXCRET_S_MASK)) {
|
||||
|
|
Loading…
Reference in a new issue