• Avi Kivity's avatar
    KVM: Fix race between APIC TMR and IRR · a5d36f82
    Avi Kivity authored
    When we queue an interrupt to the local apic, we set the IRR before the TMR.
    The vcpu can pick up the IRR and inject the interrupt before setting the TMR,
    and perhaps even EOI it, causing incorrect behaviour.
    
    The race is really insignificant since it can only occur on the first
    interrupt (usually following interrupts will not change TMR), but it's better
    closed than open.
    
    Fixed by reordering setting the TMR vs IRR.
    
    Cc: stable@kernel.org
    Signed-off-by: default avatarAvi Kivity <avi@redhat.com>
    Signed-off-by: default avatarMarcelo Tosatti <mtosatti@redhat.com>
    a5d36f82
lapic.c 29.5 KB