x86: Fix the logical destination mode test
There are following issues with the ioapic logical destination mode test: - A race condition that is triggered when the interrupt handler ioapic_isr_86() is called at the same time by multiple vCPUs. Due to this the g_isr_86 is not correctly incremented. To prevent this a spinlock is added around ‘g_isr_86++’. - On older QEMU versions initial x2APIC ID is not set, that is why the local APIC IDs of each vCPUs are not configured. Hence the logical destination mode test fails/hangs. Adding ‘+x2apic’ to the qemu -cpu params ensures that the local APICs are configured every time, irrespective of the QEMU version. - With ‘-machine kernel_irqchip=split’ included in the ioapic test test_ioapic_self_reconfigure() always fails and somehow leads to a state where after submitting IOAPIC fixed delivery - logical destination mode request we never receive an interrupt back. For now, the physical and logical destination mode tests are moved above test_ioapic_self_reconfigure(). Fixes: b2a1ee7e ("kvm-unit-test: x86: ioapic: Test physical and logical destination mode") Signed-off-by:Nitesh Narayan Lal <nitesh@redhat.com> Signed-off-by:
Paolo Bonzini <pbonzini@redhat.com>
Loading
Please register or sign in to comment