aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kvm
diff options
context:
space:
mode:
authorGleb Natapov <gleb@redhat.com>2009-04-21 10:45:11 -0400
committerAvi Kivity <avi@redhat.com>2009-06-10 04:48:49 -0400
commit14d0bc1f7c8226d5088e7182c3b53e0c7e91d1af (patch)
tree021a440648ed2117a33a4c8c1bcc91dcb22311cf /arch/x86/kvm
parent16d7a191170f0ca48c2c3277017b3e6d275e0711 (diff)
KVM: Get rid of get_irq() callback
It just returns pending IRQ vector from the queue for VMX/SVM. Get IRQ directly from the queue before migration and put it back after. Signed-off-by: Gleb Natapov <gleb@redhat.com> Signed-off-by: Avi Kivity <avi@redhat.com>
Diffstat (limited to 'arch/x86/kvm')
-rw-r--r--arch/x86/kvm/svm.c8
-rw-r--r--arch/x86/kvm/vmx.c8
-rw-r--r--arch/x86/kvm/x86.c12
3 files changed, 5 insertions, 23 deletions
diff --git a/arch/x86/kvm/svm.c b/arch/x86/kvm/svm.c
index 18072888efc5..d96a6d3edec7 100644
--- a/arch/x86/kvm/svm.c
+++ b/arch/x86/kvm/svm.c
@@ -966,13 +966,6 @@ static int svm_guest_debug(struct kvm_vcpu *vcpu, struct kvm_guest_debug *dbg)
966 return 0; 966 return 0;
967} 967}
968 968
969static int svm_get_irq(struct kvm_vcpu *vcpu)
970{
971 if (!vcpu->arch.interrupt.pending)
972 return -1;
973 return vcpu->arch.interrupt.nr;
974}
975
976static void load_host_msrs(struct kvm_vcpu *vcpu) 969static void load_host_msrs(struct kvm_vcpu *vcpu)
977{ 970{
978#ifdef CONFIG_X86_64 971#ifdef CONFIG_X86_64
@@ -2647,7 +2640,6 @@ static struct kvm_x86_ops svm_x86_ops = {
2647 .handle_exit = handle_exit, 2640 .handle_exit = handle_exit,
2648 .skip_emulated_instruction = skip_emulated_instruction, 2641 .skip_emulated_instruction = skip_emulated_instruction,
2649 .patch_hypercall = svm_patch_hypercall, 2642 .patch_hypercall = svm_patch_hypercall,
2650 .get_irq = svm_get_irq,
2651 .set_irq = svm_set_irq, 2643 .set_irq = svm_set_irq,
2652 .set_nmi = svm_inject_nmi, 2644 .set_nmi = svm_inject_nmi,
2653 .queue_exception = svm_queue_exception, 2645 .queue_exception = svm_queue_exception,
diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c
index bad2413fbd51..25be53aa5eef 100644
--- a/arch/x86/kvm/vmx.c
+++ b/arch/x86/kvm/vmx.c
@@ -1045,13 +1045,6 @@ static int set_guest_debug(struct kvm_vcpu *vcpu, struct kvm_guest_debug *dbg)
1045 return 0; 1045 return 0;
1046} 1046}
1047 1047
1048static int vmx_get_irq(struct kvm_vcpu *vcpu)
1049{
1050 if (!vcpu->arch.interrupt.pending)
1051 return -1;
1052 return vcpu->arch.interrupt.nr;
1053}
1054
1055static __init int cpu_has_kvm_support(void) 1048static __init int cpu_has_kvm_support(void)
1056{ 1049{
1057 return cpu_has_vmx(); 1050 return cpu_has_vmx();
@@ -3634,7 +3627,6 @@ static struct kvm_x86_ops vmx_x86_ops = {
3634 .handle_exit = vmx_handle_exit, 3627 .handle_exit = vmx_handle_exit,
3635 .skip_emulated_instruction = skip_emulated_instruction, 3628 .skip_emulated_instruction = skip_emulated_instruction,
3636 .patch_hypercall = vmx_patch_hypercall, 3629 .patch_hypercall = vmx_patch_hypercall,
3637 .get_irq = vmx_get_irq,
3638 .set_irq = vmx_inject_irq, 3630 .set_irq = vmx_inject_irq,
3639 .set_nmi = vmx_inject_nmi, 3631 .set_nmi = vmx_inject_nmi,
3640 .queue_exception = vmx_queue_exception, 3632 .queue_exception = vmx_queue_exception,
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
index 63917216a051..0f3e04b74a66 100644
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
@@ -3536,7 +3536,6 @@ int kvm_arch_vcpu_ioctl_get_sregs(struct kvm_vcpu *vcpu,
3536 struct kvm_sregs *sregs) 3536 struct kvm_sregs *sregs)
3537{ 3537{
3538 struct descriptor_table dt; 3538 struct descriptor_table dt;
3539 int pending_vec;
3540 3539
3541 vcpu_load(vcpu); 3540 vcpu_load(vcpu);
3542 3541
@@ -3573,9 +3572,9 @@ int kvm_arch_vcpu_ioctl_get_sregs(struct kvm_vcpu *vcpu,
3573 memcpy(sregs->interrupt_bitmap, vcpu->arch.irq_pending, 3572 memcpy(sregs->interrupt_bitmap, vcpu->arch.irq_pending,
3574 sizeof sregs->interrupt_bitmap); 3573 sizeof sregs->interrupt_bitmap);
3575 3574
3576 pending_vec = kvm_x86_ops->get_irq(vcpu); 3575 if (vcpu->arch.interrupt.pending)
3577 if (pending_vec >= 0) 3576 set_bit(vcpu->arch.interrupt.nr,
3578 set_bit(pending_vec, (unsigned long *)sregs->interrupt_bitmap); 3577 (unsigned long *)sregs->interrupt_bitmap);
3579 3578
3580 vcpu_put(vcpu); 3579 vcpu_put(vcpu);
3581 3580
@@ -4097,9 +4096,8 @@ int kvm_arch_vcpu_ioctl_set_sregs(struct kvm_vcpu *vcpu,
4097 max_bits); 4096 max_bits);
4098 /* Only pending external irq is handled here */ 4097 /* Only pending external irq is handled here */
4099 if (pending_vec < max_bits) { 4098 if (pending_vec < max_bits) {
4100 kvm_x86_ops->set_irq(vcpu, pending_vec); 4099 kvm_queue_interrupt(vcpu, pending_vec);
4101 pr_debug("Set back pending irq %d\n", 4100 pr_debug("Set back pending irq %d\n", pending_vec);
4102 pending_vec);
4103 } 4101 }
4104 kvm_pic_clear_isr_ack(vcpu->kvm); 4102 kvm_pic_clear_isr_ack(vcpu->kvm);
4105 } 4103 }