From 232471e90faf6df4c3b782fec9c8ab9724f31803 Mon Sep 17 00:00:00 2001 From: Indan Zupancic Date: Thu, 21 May 2026 23:37:45 +0100 Subject: [PATCH] Fix MCS / ARM VCPU interrupt interaction, try 3 Restore the schedule queue check of commit c64867e from PR #352, which was accidentally undone when adding a similar check for the release queue in PR #1486. Resolves issue #1645. Signed-off-by: Indan Zupancic --- src/arch/arm/object/vcpu.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/arch/arm/object/vcpu.c b/src/arch/arm/object/vcpu.c index 673a254b7..0fe140173 100644 --- a/src/arch/arm/object/vcpu.c +++ b/src/arch/arm/object/vcpu.c @@ -111,7 +111,8 @@ void VPPIEvent(irq_t irq) * budget check that happens early in the handleInterruptEntry. * * If the current thread does *not* have budget, as indicated by its - * presence in the release queue, this interrupt is ignored for now. + * presence in either the scheduling or release queue, this interrupt + * is ignored for now. * As it is a level-triggered interrupt it shall be re-raised * (and not lost). * @@ -119,7 +120,8 @@ void VPPIEvent(irq_t irq) * our timeslice having ended, and we have a timeout fault handler for * this thread, we do not want to overwrite that with our VCPU fault. */ - if (!isSchedulable(NODE_STATE(ksCurThread))) { + if (thread_state_get_tcbQueued(NODE_STATE(ksCurThread)->tcbState) || + !isSchedulable(NODE_STATE(ksCurThread))) { return; } #endif @@ -146,7 +148,8 @@ void VGICMaintenance(void) #ifdef CONFIG_KERNEL_MCS /* See VPPIEvent for details on this check. */ - if (!isSchedulable(NODE_STATE(ksCurThread))) { + if (thread_state_get_tcbQueued(NODE_STATE(ksCurThread)->tcbState) || + !isSchedulable(NODE_STATE(ksCurThread))) { return; } #endif