• Dor Laor's avatar
    [PATCH] KVM: Improve interrupt response · c1150d8c
    Dor Laor authored
    The current interrupt injection mechanism might delay an interrupt under
    the following circumstances:
    
     - if injection fails because the guest is not interruptible (rflags.IF clear,
       or after a 'mov ss' or 'sti' instruction).  Userspace can check rflags,
       but the other cases or not testable under the current API.
     - if injection fails because of a fault during delivery.  This probably
       never happens under normal guests.
     - if injection fails due to a physical interrupt causing a vmexit so that
       it can be handled by the host.
    
    In all cases the guest proceeds without processing the interrupt, reducing
    the interactive feel and interrupt throughput of the guest.
    
    This patch fixes the situation by allowing userspace to request an exit
    when the 'interrupt window' opens, so that it can re-inject the interrupt
    at the right time.  Guest interactivity is very visibly improved.
    Signed-off-by: default avatarDor Laor <dor.laor@qumranet.com>
    Signed-off-by: default avatarAvi Kivity <avi@qumranet.com>
    Acked-by: default avatarIngo Molnar <mingo@elte.hu>
    Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
    Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
    c1150d8c
svm.c 41.7 KB