aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/include
diff options
context:
space:
mode:
authorYang Zhang <yang.z.zhang@Intel.com>2013-01-24 21:18:51 -0500
committerGleb Natapov <gleb@redhat.com>2013-01-29 03:48:19 -0500
commitc7c9c56ca26f7b9458711b2d78b60b60e0d38ba7 (patch)
treefeab61b2f3a5587dd502a9d2bf4b27a8b2ebe507 /arch/x86/include
parent8d14695f9542e9e0195d6e41ddaa52c32322adf5 (diff)
x86, apicv: add virtual interrupt delivery support
Virtual interrupt delivery avoids KVM to inject vAPIC interrupts manually, which is fully taken care of by the hardware. This needs some special awareness into existing interrupr injection path: - for pending interrupt, instead of direct injection, we may need update architecture specific indicators before resuming to guest. - A pending interrupt, which is masked by ISR, should be also considered in above update action, since hardware will decide when to inject it at right time. Current has_interrupt and get_interrupt only returns a valid vector from injection p.o.v. Reviewed-by: Marcelo Tosatti <mtosatti@redhat.com> Signed-off-by: Kevin Tian <kevin.tian@intel.com> Signed-off-by: Yang Zhang <yang.z.zhang@Intel.com> Signed-off-by: Gleb Natapov <gleb@redhat.com>
Diffstat (limited to 'arch/x86/include')
-rw-r--r--arch/x86/include/asm/kvm_host.h5
-rw-r--r--arch/x86/include/asm/vmx.h11
2 files changed, 16 insertions, 0 deletions
diff --git a/arch/x86/include/asm/kvm_host.h b/arch/x86/include/asm/kvm_host.h
index d42c2839be98..635a74d22409 100644
--- a/arch/x86/include/asm/kvm_host.h
+++ b/arch/x86/include/asm/kvm_host.h
@@ -699,6 +699,10 @@ struct kvm_x86_ops {
699 void (*enable_nmi_window)(struct kvm_vcpu *vcpu); 699 void (*enable_nmi_window)(struct kvm_vcpu *vcpu);
700 void (*enable_irq_window)(struct kvm_vcpu *vcpu); 700 void (*enable_irq_window)(struct kvm_vcpu *vcpu);
701 void (*update_cr8_intercept)(struct kvm_vcpu *vcpu, int tpr, int irr); 701 void (*update_cr8_intercept)(struct kvm_vcpu *vcpu, int tpr, int irr);
702 int (*vm_has_apicv)(struct kvm *kvm);
703 void (*hwapic_irr_update)(struct kvm_vcpu *vcpu, int max_irr);
704 void (*hwapic_isr_update)(struct kvm *kvm, int isr);
705 void (*load_eoi_exitmap)(struct kvm_vcpu *vcpu, u64 *eoi_exit_bitmap);
702 void (*set_virtual_x2apic_mode)(struct kvm_vcpu *vcpu, bool set); 706 void (*set_virtual_x2apic_mode)(struct kvm_vcpu *vcpu, bool set);
703 int (*set_tss_addr)(struct kvm *kvm, unsigned int addr); 707 int (*set_tss_addr)(struct kvm *kvm, unsigned int addr);
704 int (*get_tdp_level)(void); 708 int (*get_tdp_level)(void);
@@ -994,6 +998,7 @@ int kvm_age_hva(struct kvm *kvm, unsigned long hva);
994int kvm_test_age_hva(struct kvm *kvm, unsigned long hva); 998int kvm_test_age_hva(struct kvm *kvm, unsigned long hva);
995void kvm_set_spte_hva(struct kvm *kvm, unsigned long hva, pte_t pte); 999void kvm_set_spte_hva(struct kvm *kvm, unsigned long hva, pte_t pte);
996int cpuid_maxphyaddr(struct kvm_vcpu *vcpu); 1000int cpuid_maxphyaddr(struct kvm_vcpu *vcpu);
1001int kvm_cpu_has_injectable_intr(struct kvm_vcpu *v);
997int kvm_cpu_has_interrupt(struct kvm_vcpu *vcpu); 1002int kvm_cpu_has_interrupt(struct kvm_vcpu *vcpu);
998int kvm_arch_interrupt_allowed(struct kvm_vcpu *vcpu); 1003int kvm_arch_interrupt_allowed(struct kvm_vcpu *vcpu);
999int kvm_cpu_get_interrupt(struct kvm_vcpu *v); 1004int kvm_cpu_get_interrupt(struct kvm_vcpu *v);
diff --git a/arch/x86/include/asm/vmx.h b/arch/x86/include/asm/vmx.h
index 0a54df0b36fc..694586ca6456 100644
--- a/arch/x86/include/asm/vmx.h
+++ b/arch/x86/include/asm/vmx.h
@@ -62,6 +62,7 @@
62#define EXIT_REASON_MCE_DURING_VMENTRY 41 62#define EXIT_REASON_MCE_DURING_VMENTRY 41
63#define EXIT_REASON_TPR_BELOW_THRESHOLD 43 63#define EXIT_REASON_TPR_BELOW_THRESHOLD 43
64#define EXIT_REASON_APIC_ACCESS 44 64#define EXIT_REASON_APIC_ACCESS 44
65#define EXIT_REASON_EOI_INDUCED 45
65#define EXIT_REASON_EPT_VIOLATION 48 66#define EXIT_REASON_EPT_VIOLATION 48
66#define EXIT_REASON_EPT_MISCONFIG 49 67#define EXIT_REASON_EPT_MISCONFIG 49
67#define EXIT_REASON_WBINVD 54 68#define EXIT_REASON_WBINVD 54
@@ -144,6 +145,7 @@
144#define SECONDARY_EXEC_WBINVD_EXITING 0x00000040 145#define SECONDARY_EXEC_WBINVD_EXITING 0x00000040
145#define SECONDARY_EXEC_UNRESTRICTED_GUEST 0x00000080 146#define SECONDARY_EXEC_UNRESTRICTED_GUEST 0x00000080
146#define SECONDARY_EXEC_APIC_REGISTER_VIRT 0x00000100 147#define SECONDARY_EXEC_APIC_REGISTER_VIRT 0x00000100
148#define SECONDARY_EXEC_VIRTUAL_INTR_DELIVERY 0x00000200
147#define SECONDARY_EXEC_PAUSE_LOOP_EXITING 0x00000400 149#define SECONDARY_EXEC_PAUSE_LOOP_EXITING 0x00000400
148#define SECONDARY_EXEC_ENABLE_INVPCID 0x00001000 150#define SECONDARY_EXEC_ENABLE_INVPCID 0x00001000
149 151
@@ -181,6 +183,7 @@ enum vmcs_field {
181 GUEST_GS_SELECTOR = 0x0000080a, 183 GUEST_GS_SELECTOR = 0x0000080a,
182 GUEST_LDTR_SELECTOR = 0x0000080c, 184 GUEST_LDTR_SELECTOR = 0x0000080c,
183 GUEST_TR_SELECTOR = 0x0000080e, 185 GUEST_TR_SELECTOR = 0x0000080e,
186 GUEST_INTR_STATUS = 0x00000810,
184 HOST_ES_SELECTOR = 0x00000c00, 187 HOST_ES_SELECTOR = 0x00000c00,
185 HOST_CS_SELECTOR = 0x00000c02, 188 HOST_CS_SELECTOR = 0x00000c02,
186 HOST_SS_SELECTOR = 0x00000c04, 189 HOST_SS_SELECTOR = 0x00000c04,
@@ -208,6 +211,14 @@ enum vmcs_field {
208 APIC_ACCESS_ADDR_HIGH = 0x00002015, 211 APIC_ACCESS_ADDR_HIGH = 0x00002015,
209 EPT_POINTER = 0x0000201a, 212 EPT_POINTER = 0x0000201a,
210 EPT_POINTER_HIGH = 0x0000201b, 213 EPT_POINTER_HIGH = 0x0000201b,
214 EOI_EXIT_BITMAP0 = 0x0000201c,
215 EOI_EXIT_BITMAP0_HIGH = 0x0000201d,
216 EOI_EXIT_BITMAP1 = 0x0000201e,
217 EOI_EXIT_BITMAP1_HIGH = 0x0000201f,
218 EOI_EXIT_BITMAP2 = 0x00002020,
219 EOI_EXIT_BITMAP2_HIGH = 0x00002021,
220 EOI_EXIT_BITMAP3 = 0x00002022,
221 EOI_EXIT_BITMAP3_HIGH = 0x00002023,
211 GUEST_PHYSICAL_ADDRESS = 0x00002400, 222 GUEST_PHYSICAL_ADDRESS = 0x00002400,
212 GUEST_PHYSICAL_ADDRESS_HIGH = 0x00002401, 223 GUEST_PHYSICAL_ADDRESS_HIGH = 0x00002401,
213 VMCS_LINK_POINTER = 0x00002800, 224 VMCS_LINK_POINTER = 0x00002800,