diff options
author | Eddie Dong <eddie.dong@intel.com> | 2007-08-06 09:29:07 -0400 |
---|---|---|
committer | Avi Kivity <avi@qumranet.com> | 2007-10-13 04:18:26 -0400 |
commit | 2a8067f17b8442ecce0b14e134823020ff33b4fa (patch) | |
tree | e7f65775b3ced0c42de2df8118a84e7ddb9fff7d /drivers/kvm/vmx.c | |
parent | 96ad2cc6132479aa0aea485d0838a13fda765bd5 (diff) |
KVM: pending irq save/restore
Add in kernel irqchip save/restore support for pending vectors.
[avi: fix compile warning on i386]
[avi: remove printk]
Signed-off-by: Yaozu (Eddie) Dong <eddie.dong@intel.com>
Signed-off-by: Qing He <qing.he@intel.com>
Signed-off-by: Avi Kivity <avi@qumranet.com>
Diffstat (limited to 'drivers/kvm/vmx.c')
-rw-r--r-- | drivers/kvm/vmx.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/drivers/kvm/vmx.c b/drivers/kvm/vmx.c index 7ec8cf84e6ea..6c371ea21046 100644 --- a/drivers/kvm/vmx.c +++ b/drivers/kvm/vmx.c | |||
@@ -790,6 +790,20 @@ static int set_guest_debug(struct kvm_vcpu *vcpu, struct kvm_debug_guest *dbg) | |||
790 | return 0; | 790 | return 0; |
791 | } | 791 | } |
792 | 792 | ||
793 | static int vmx_get_irq(struct kvm_vcpu *vcpu) | ||
794 | { | ||
795 | u32 idtv_info_field; | ||
796 | |||
797 | idtv_info_field = vmcs_read32(IDT_VECTORING_INFO_FIELD); | ||
798 | if (idtv_info_field & INTR_INFO_VALID_MASK) { | ||
799 | if (is_external_interrupt(idtv_info_field)) | ||
800 | return idtv_info_field & VECTORING_INFO_VECTOR_MASK; | ||
801 | else | ||
802 | printk("pending exception: not handled yet\n"); | ||
803 | } | ||
804 | return -1; | ||
805 | } | ||
806 | |||
793 | static __init int cpu_has_kvm_support(void) | 807 | static __init int cpu_has_kvm_support(void) |
794 | { | 808 | { |
795 | unsigned long ecx = cpuid_ecx(1); | 809 | unsigned long ecx = cpuid_ecx(1); |
@@ -2500,6 +2514,8 @@ static struct kvm_arch_ops vmx_arch_ops = { | |||
2500 | .run = vmx_vcpu_run, | 2514 | .run = vmx_vcpu_run, |
2501 | .skip_emulated_instruction = skip_emulated_instruction, | 2515 | .skip_emulated_instruction = skip_emulated_instruction, |
2502 | .patch_hypercall = vmx_patch_hypercall, | 2516 | .patch_hypercall = vmx_patch_hypercall, |
2517 | .get_irq = vmx_get_irq, | ||
2518 | .set_irq = vmx_inject_irq, | ||
2503 | }; | 2519 | }; |
2504 | 2520 | ||
2505 | static int __init vmx_init(void) | 2521 | static int __init vmx_init(void) |