diff options
Diffstat (limited to 'drivers/kvm/svm.c')
-rw-r--r-- | drivers/kvm/svm.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/drivers/kvm/svm.c b/drivers/kvm/svm.c index a347b61644cd..c8cd242f36ff 100644 --- a/drivers/kvm/svm.c +++ b/drivers/kvm/svm.c | |||
@@ -843,6 +843,16 @@ static int svm_guest_debug(struct kvm_vcpu *vcpu, struct kvm_debug_guest *dbg) | |||
843 | return -EOPNOTSUPP; | 843 | return -EOPNOTSUPP; |
844 | } | 844 | } |
845 | 845 | ||
846 | static int svm_get_irq(struct kvm_vcpu *vcpu) | ||
847 | { | ||
848 | struct vcpu_svm *svm = to_svm(vcpu); | ||
849 | u32 exit_int_info = svm->vmcb->control.exit_int_info; | ||
850 | |||
851 | if (is_external_interrupt(exit_int_info)) | ||
852 | return exit_int_info & SVM_EVTINJ_VEC_MASK; | ||
853 | return -1; | ||
854 | } | ||
855 | |||
846 | static void load_host_msrs(struct kvm_vcpu *vcpu) | 856 | static void load_host_msrs(struct kvm_vcpu *vcpu) |
847 | { | 857 | { |
848 | #ifdef CONFIG_X86_64 | 858 | #ifdef CONFIG_X86_64 |
@@ -1310,6 +1320,13 @@ static inline void svm_inject_irq(struct vcpu_svm *svm, int irq) | |||
1310 | ((/*control->int_vector >> 4*/ 0xf) << V_INTR_PRIO_SHIFT); | 1320 | ((/*control->int_vector >> 4*/ 0xf) << V_INTR_PRIO_SHIFT); |
1311 | } | 1321 | } |
1312 | 1322 | ||
1323 | static void svm_set_irq(struct kvm_vcpu *vcpu, int irq) | ||
1324 | { | ||
1325 | struct vcpu_svm *svm = to_svm(vcpu); | ||
1326 | |||
1327 | svm_inject_irq(svm, irq); | ||
1328 | } | ||
1329 | |||
1313 | static void svm_intr_assist(struct vcpu_svm *svm) | 1330 | static void svm_intr_assist(struct vcpu_svm *svm) |
1314 | { | 1331 | { |
1315 | struct vmcb *vmcb = svm->vmcb; | 1332 | struct vmcb *vmcb = svm->vmcb; |
@@ -1783,6 +1800,8 @@ static struct kvm_arch_ops svm_arch_ops = { | |||
1783 | .run = svm_vcpu_run, | 1800 | .run = svm_vcpu_run, |
1784 | .skip_emulated_instruction = skip_emulated_instruction, | 1801 | .skip_emulated_instruction = skip_emulated_instruction, |
1785 | .patch_hypercall = svm_patch_hypercall, | 1802 | .patch_hypercall = svm_patch_hypercall, |
1803 | .get_irq = svm_get_irq, | ||
1804 | .set_irq = svm_set_irq, | ||
1786 | }; | 1805 | }; |
1787 | 1806 | ||
1788 | static int __init svm_init(void) | 1807 | static int __init svm_init(void) |