From 2ceeb1df6fa1770fcb69291bbf50a92c5e7f1f95 Mon Sep 17 00:00:00 2001 From: Kent McLeod Date: Tue, 15 Oct 2019 19:02:02 +1100 Subject: [PATCH] VGICMaintenance: Update spurious check Ignore any VGIC maintenance interrupts that arrive if a VCPU isn't currently running. --- src/arch/arm/object/vcpu.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/arch/arm/object/vcpu.c b/src/arch/arm/object/vcpu.c index 81ba5350b..84d76f6c7 100644 --- a/src/arch/arm/object/vcpu.c +++ b/src/arch/arm/object/vcpu.c @@ -140,12 +140,14 @@ void VGICMaintenance(void) uint32_t eisr0, eisr1; uint32_t flags; - /* The current thread must be runnable at this point as we can only get - * a VGIC maintenance whilst we are actively running a thread with an - * associated VCPU. For the moment for the proof we leave a redundant - * check in here that this is indeed not happening */ - if (!isRunnable(NODE_STATE(ksCurThread))) { - printf("Received VGIC maintenance on non-runnable thread!\n"); + /* We shouldn't get a VGICMaintenance interrupt while a VCPU isn't active, + * but if one becomes pending before the VGIC is disabled we might get one + * when returning to userlevel after disabling the current VCPU. In this + * case we simply return and rely on the interrupt being raised again when + * the VCPU is reenabled. + */ + if (!ARCH_NODE_STATE(armHSVCPUActive)) { + printf("Received VGIC maintenance without active VCPU!\n"); return; }