aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/kvm/kvm.h
diff options
context:
space:
mode:
authorAnthony Liguori <aliguori@us.ibm.com>2007-09-17 15:57:50 -0400
committerAvi Kivity <avi@qumranet.com>2008-01-30 10:52:46 -0500
commit7aa81cc04781b5b99a0647ec04533599d78cd219 (patch)
tree6ac8854faf3db2bc499e2c105fdfdab95df52170 /drivers/kvm/kvm.h
parentaca7f96600b170e470b3056aba0ed8d7df8d330d (diff)
KVM: Refactor hypercall infrastructure (v3)
This patch refactors the current hypercall infrastructure to better support live migration and SMP. It eliminates the hypercall page by trapping the UD exception that would occur if you used the wrong hypercall instruction for the underlying architecture and replacing it with the right one lazily. A fall-out of this patch is that the unhandled hypercalls no longer trap to userspace. There is very little reason though to use a hypercall to communicate with userspace as PIO or MMIO can be used. There is no code in tree that uses userspace hypercalls. [avi: fix #ud injection on vmx] Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> Signed-off-by: Avi Kivity <avi@qumranet.com>
Diffstat (limited to 'drivers/kvm/kvm.h')
-rw-r--r--drivers/kvm/kvm.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/kvm/kvm.h b/drivers/kvm/kvm.h
index 3b0bc4bda5f2..da9c3aa1c08c 100644
--- a/drivers/kvm/kvm.h
+++ b/drivers/kvm/kvm.h
@@ -46,6 +46,7 @@
46#define KVM_MAX_CPUID_ENTRIES 40 46#define KVM_MAX_CPUID_ENTRIES 40
47 47
48#define DE_VECTOR 0 48#define DE_VECTOR 0
49#define UD_VECTOR 6
49#define NM_VECTOR 7 50#define NM_VECTOR 7
50#define DF_VECTOR 8 51#define DF_VECTOR 8
51#define TS_VECTOR 10 52#define TS_VECTOR 10
@@ -317,9 +318,6 @@ struct kvm_vcpu {
317 unsigned long cr0; 318 unsigned long cr0;
318 unsigned long cr2; 319 unsigned long cr2;
319 unsigned long cr3; 320 unsigned long cr3;
320 gpa_t para_state_gpa;
321 struct page *para_state_page;
322 gpa_t hypercall_gpa;
323 unsigned long cr4; 321 unsigned long cr4;
324 unsigned long cr8; 322 unsigned long cr8;
325 u64 pdptrs[4]; /* pae */ 323 u64 pdptrs[4]; /* pae */
@@ -622,7 +620,9 @@ void __kvm_mmu_free_some_pages(struct kvm_vcpu *vcpu);
622int kvm_mmu_load(struct kvm_vcpu *vcpu); 620int kvm_mmu_load(struct kvm_vcpu *vcpu);
623void kvm_mmu_unload(struct kvm_vcpu *vcpu); 621void kvm_mmu_unload(struct kvm_vcpu *vcpu);
624 622
625int kvm_hypercall(struct kvm_vcpu *vcpu, struct kvm_run *run); 623int kvm_emulate_hypercall(struct kvm_vcpu *vcpu);
624
625int kvm_fix_hypercall(struct kvm_vcpu *vcpu);
626 626
627static inline void kvm_guest_enter(void) 627static inline void kvm_guest_enter(void)
628{ 628{