Skip to content
Commit dcf27dc5 authored by Nitesh Narayan Lal's avatar Nitesh Narayan Lal Committed by Paolo Bonzini
Browse files

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: default avatarNitesh Narayan Lal <nitesh@redhat.com>
Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
parent ef5d77a0
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment