aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/kvm/svm.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/svm.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/svm.c')
-rw-r--r--drivers/kvm/svm.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/drivers/kvm/svm.c b/drivers/kvm/svm.c
index d576451827e7..a347b61644cd 100644
--- a/drivers/kvm/svm.c
+++ b/drivers/kvm/svm.c
@@ -1398,9 +1398,12 @@ static void do_interrupt_requests(struct vcpu_svm *svm,
1398static void post_kvm_run_save(struct vcpu_svm *svm, 1398static void post_kvm_run_save(struct vcpu_svm *svm,
1399 struct kvm_run *kvm_run) 1399 struct kvm_run *kvm_run)
1400{ 1400{
1401 kvm_run->ready_for_interrupt_injection 1401 if (irqchip_in_kernel(svm->vcpu.kvm))
1402 = (svm->vcpu.interrupt_window_open && 1402 kvm_run->ready_for_interrupt_injection = 1;
1403 svm->vcpu.irq_summary == 0); 1403 else
1404 kvm_run->ready_for_interrupt_injection =
1405 (svm->vcpu.interrupt_window_open &&
1406 svm->vcpu.irq_summary == 0);
1404 kvm_run->if_flag = (svm->vmcb->save.rflags & X86_EFLAGS_IF) != 0; 1407 kvm_run->if_flag = (svm->vmcb->save.rflags & X86_EFLAGS_IF) != 0;
1405 kvm_run->cr8 = get_cr8(&svm->vcpu); 1408 kvm_run->cr8 = get_cr8(&svm->vcpu);
1406 kvm_run->apic_base = kvm_get_apic_base(&svm->vcpu); 1409 kvm_run->apic_base = kvm_get_apic_base(&svm->vcpu);