From b6958ce44a11a9e9425d2b67a653b1ca2a27796f Mon Sep 17 00:00:00 2001 From: Eddie Dong Date: Wed, 18 Jul 2007 12:15:21 +0300 Subject: KVM: Emulate hlt in the kernel By sleeping in the kernel when hlt is executed, we simplify the in-kernel guest interrupt path considerably. Signed-off-by: Gregory Haskins Signed-off-by: Yaozu (Eddie) Dong Signed-off-by: Avi Kivity --- drivers/kvm/svm.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'drivers/kvm/svm.c') diff --git a/drivers/kvm/svm.c b/drivers/kvm/svm.c index d576451827e..a347b61644c 100644 --- a/drivers/kvm/svm.c +++ b/drivers/kvm/svm.c @@ -1398,9 +1398,12 @@ static void do_interrupt_requests(struct vcpu_svm *svm, static void post_kvm_run_save(struct vcpu_svm *svm, struct kvm_run *kvm_run) { - kvm_run->ready_for_interrupt_injection - = (svm->vcpu.interrupt_window_open && - svm->vcpu.irq_summary == 0); + if (irqchip_in_kernel(svm->vcpu.kvm)) + kvm_run->ready_for_interrupt_injection = 1; + else + kvm_run->ready_for_interrupt_injection = + (svm->vcpu.interrupt_window_open && + svm->vcpu.irq_summary == 0); kvm_run->if_flag = (svm->vmcb->save.rflags & X86_EFLAGS_IF) != 0; kvm_run->cr8 = get_cr8(&svm->vcpu); kvm_run->apic_base = kvm_get_apic_base(&svm->vcpu); -- cgit v1.2.3