aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/kvm/vmx.c
diff options
context:
space:
mode:
authorEddie Dong <eddie.dong@intel.com>2007-07-18 05:15:21 -0400
committerAvi Kivity <avi@qumranet.com>2007-10-13 04:18:25 -0400
commitb6958ce44a11a9e9425d2b67a653b1ca2a27796f (patch)
tree503478ef27254df9b6ea21d2a6a279a7dfe2ef04 /drivers/kvm/vmx.c
parent1fd4f2a5ed8f80cf6e23d2bdf78554f6a1ac7997 (diff)
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 <ghaskins@novell.com> Signed-off-by: Yaozu (Eddie) Dong <eddie.dong@intel.com> Signed-off-by: Avi Kivity <avi@qumranet.com>
Diffstat (limited to 'drivers/kvm/vmx.c')
-rw-r--r--drivers/kvm/vmx.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/kvm/vmx.c b/drivers/kvm/vmx.c
index c4cc17cc00f7..7ec8cf84e6ea 100644
--- a/drivers/kvm/vmx.c
+++ b/drivers/kvm/vmx.c
@@ -1961,8 +1961,12 @@ static void post_kvm_run_save(struct kvm_vcpu *vcpu,
1961 kvm_run->if_flag = (vmcs_readl(GUEST_RFLAGS) & X86_EFLAGS_IF) != 0; 1961 kvm_run->if_flag = (vmcs_readl(GUEST_RFLAGS) & X86_EFLAGS_IF) != 0;
1962 kvm_run->cr8 = get_cr8(vcpu); 1962 kvm_run->cr8 = get_cr8(vcpu);
1963 kvm_run->apic_base = kvm_get_apic_base(vcpu); 1963 kvm_run->apic_base = kvm_get_apic_base(vcpu);
1964 kvm_run->ready_for_interrupt_injection = (vcpu->interrupt_window_open && 1964 if (irqchip_in_kernel(vcpu->kvm))
1965 vcpu->irq_summary == 0); 1965 kvm_run->ready_for_interrupt_injection = 1;
1966 else
1967 kvm_run->ready_for_interrupt_injection =
1968 (vcpu->interrupt_window_open &&
1969 vcpu->irq_summary == 0);
1966} 1970}
1967 1971
1968static int handle_interrupt_window(struct kvm_vcpu *vcpu, 1972static int handle_interrupt_window(struct kvm_vcpu *vcpu,