aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/kvm/kvm.h
diff options
context:
space:
mode:
authorDor Laor <dor.laor@qumranet.com>2007-01-05 19:36:24 -0500
committerLinus Torvalds <torvalds@woody.osdl.org>2007-01-06 02:55:22 -0500
commitc1150d8cf9e9d2b356fab52d79f2366985e5511b (patch)
treedbd50c3e064c22dcab7ce4acc7236370c6750923 /drivers/kvm/kvm.h
parente097f35ce58eb8d687f3a300247cf1a978fcea39 (diff)
[PATCH] KVM: Improve interrupt response
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: Dor Laor <dor.laor@qumranet.com> Signed-off-by: Avi Kivity <avi@qumranet.com> Acked-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/kvm/kvm.h')
-rw-r--r--drivers/kvm/kvm.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/kvm/kvm.h b/drivers/kvm/kvm.h
index 100df6f38d92..32023d1ac24b 100644
--- a/drivers/kvm/kvm.h
+++ b/drivers/kvm/kvm.h
@@ -173,6 +173,7 @@ struct kvm_vcpu {
173 struct mutex mutex; 173 struct mutex mutex;
174 int cpu; 174 int cpu;
175 int launched; 175 int launched;
176 int interrupt_window_open;
176 unsigned long irq_summary; /* bit vector: 1 per word in irq_pending */ 177 unsigned long irq_summary; /* bit vector: 1 per word in irq_pending */
177#define NR_IRQ_WORDS KVM_IRQ_BITMAP_SIZE(unsigned long) 178#define NR_IRQ_WORDS KVM_IRQ_BITMAP_SIZE(unsigned long)
178 unsigned long irq_pending[NR_IRQ_WORDS]; 179 unsigned long irq_pending[NR_IRQ_WORDS];
@@ -247,6 +248,9 @@ struct kvm_stat {
247 u32 io_exits; 248 u32 io_exits;
248 u32 mmio_exits; 249 u32 mmio_exits;
249 u32 signal_exits; 250 u32 signal_exits;
251 u32 irq_window_exits;
252 u32 halt_exits;
253 u32 request_irq_exits;
250 u32 irq_exits; 254 u32 irq_exits;
251}; 255};
252 256