From 2c70a1e115de6527025f2bc42549a15284194b66 Mon Sep 17 00:00:00 2001 From: Wei Liu Date: Fri, 28 Dec 2018 13:08:16 +0800 Subject: [PATCH] hv: fix sos kernel hang when migrate irq to different cpu With kernel 4.19, it's possible that same irq vector assigned to different devices on different cpu. So when we update the tmr, we should update the value for cpu which is irq target. Tracked-On: #2212 Signed-off-by: Alek Du --- hypervisor/dm/vioapic.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/hypervisor/dm/vioapic.c b/hypervisor/dm/vioapic.c index 242eea0cf..fbd7e5add 100644 --- a/hypervisor/dm/vioapic.c +++ b/hypervisor/dm/vioapic.c @@ -195,7 +195,17 @@ vioapic_update_tmr(struct acrn_vcpu *vcpu) spinlock_obtain(&(vioapic->mtx)); pincount = vioapic_pincount(vcpu->vm); for (pin = 0U; pin < pincount; pin++) { + uint64_t mask; + uint32_t dest; + bool phys; + rte = vioapic->rtbl[pin]; + dest = rte.full >> IOAPIC_RTE_DEST_SHIFT; + phys = ((rte.full & IOAPIC_RTE_DESTLOG) == 0UL); + + calcvdest(vcpu->vm, &mask, dest, phys); + if ((mask & (1 << vcpu->vcpu_id)) == 0) + continue; level = ((rte.full & IOAPIC_RTE_TRGRLVL) != 0UL);