aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/kvm/x86.h
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/kvm/x86.h')
-rw-r--r--drivers/kvm/x86.h25
1 files changed, 14 insertions, 11 deletions
diff --git a/drivers/kvm/x86.h b/drivers/kvm/x86.h
index 0fc7020aa1a5..0e01ac75268c 100644
--- a/drivers/kvm/x86.h
+++ b/drivers/kvm/x86.h
@@ -92,8 +92,7 @@ enum {
92 92
93#include "x86_emulate.h" 93#include "x86_emulate.h"
94 94
95struct kvm_vcpu { 95struct kvm_vcpu_arch {
96 KVM_VCPU_COMM;
97 u64 host_tsc; 96 u64 host_tsc;
98 int interrupt_window_open; 97 int interrupt_window_open;
99 unsigned long irq_summary; /* bit vector: 1 per word in irq_pending */ 98 unsigned long irq_summary; /* bit vector: 1 per word in irq_pending */
@@ -130,7 +129,6 @@ struct kvm_vcpu {
130 int last_pt_write_count; 129 int last_pt_write_count;
131 u64 *last_pte_updated; 130 u64 *last_pte_updated;
132 131
133
134 struct i387_fxsave_struct host_fx_image; 132 struct i387_fxsave_struct host_fx_image;
135 struct i387_fxsave_struct guest_fx_image; 133 struct i387_fxsave_struct guest_fx_image;
136 134
@@ -159,12 +157,17 @@ struct kvm_vcpu {
159 157
160 int cpuid_nent; 158 int cpuid_nent;
161 struct kvm_cpuid_entry2 cpuid_entries[KVM_MAX_CPUID_ENTRIES]; 159 struct kvm_cpuid_entry2 cpuid_entries[KVM_MAX_CPUID_ENTRIES];
162
163 /* emulate context */ 160 /* emulate context */
164 161
165 struct x86_emulate_ctxt emulate_ctxt; 162 struct x86_emulate_ctxt emulate_ctxt;
166}; 163};
167 164
165struct kvm_vcpu {
166 KVM_VCPU_COMM;
167
168 struct kvm_vcpu_arch arch;
169};
170
168struct descriptor_table { 171struct descriptor_table {
169 u16 limit; 172 u16 limit;
170 unsigned long base; 173 unsigned long base;
@@ -339,7 +342,7 @@ static inline void kvm_mmu_free_some_pages(struct kvm_vcpu *vcpu)
339 342
340static inline int kvm_mmu_reload(struct kvm_vcpu *vcpu) 343static inline int kvm_mmu_reload(struct kvm_vcpu *vcpu)
341{ 344{
342 if (likely(vcpu->mmu.root_hpa != INVALID_PAGE)) 345 if (likely(vcpu->arch.mmu.root_hpa != INVALID_PAGE))
343 return 0; 346 return 0;
344 347
345 return kvm_mmu_load(vcpu); 348 return kvm_mmu_load(vcpu);
@@ -348,7 +351,7 @@ static inline int kvm_mmu_reload(struct kvm_vcpu *vcpu)
348static inline int is_long_mode(struct kvm_vcpu *vcpu) 351static inline int is_long_mode(struct kvm_vcpu *vcpu)
349{ 352{
350#ifdef CONFIG_X86_64 353#ifdef CONFIG_X86_64
351 return vcpu->shadow_efer & EFER_LME; 354 return vcpu->arch.shadow_efer & EFER_LME;
352#else 355#else
353 return 0; 356 return 0;
354#endif 357#endif
@@ -356,17 +359,17 @@ static inline int is_long_mode(struct kvm_vcpu *vcpu)
356 359
357static inline int is_pae(struct kvm_vcpu *vcpu) 360static inline int is_pae(struct kvm_vcpu *vcpu)
358{ 361{
359 return vcpu->cr4 & X86_CR4_PAE; 362 return vcpu->arch.cr4 & X86_CR4_PAE;
360} 363}
361 364
362static inline int is_pse(struct kvm_vcpu *vcpu) 365static inline int is_pse(struct kvm_vcpu *vcpu)
363{ 366{
364 return vcpu->cr4 & X86_CR4_PSE; 367 return vcpu->arch.cr4 & X86_CR4_PSE;
365} 368}
366 369
367static inline int is_paging(struct kvm_vcpu *vcpu) 370static inline int is_paging(struct kvm_vcpu *vcpu)
368{ 371{
369 return vcpu->cr0 & X86_CR0_PG; 372 return vcpu->arch.cr0 & X86_CR0_PG;
370} 373}
371 374
372int load_pdptrs(struct kvm_vcpu *vcpu, unsigned long cr3); 375int load_pdptrs(struct kvm_vcpu *vcpu, unsigned long cr3);
@@ -489,8 +492,8 @@ static inline void kvm_inject_gp(struct kvm_vcpu *vcpu, u32 error_code)
489 492
490static inline int kvm_arch_vcpu_runnable(struct kvm_vcpu *vcpu) 493static inline int kvm_arch_vcpu_runnable(struct kvm_vcpu *vcpu)
491{ 494{
492 return vcpu->mp_state == VCPU_MP_STATE_RUNNABLE 495 return vcpu->arch.mp_state == VCPU_MP_STATE_RUNNABLE
493 || vcpu->mp_state == VCPU_MP_STATE_SIPI_RECEIVED; 496 || vcpu->arch.mp_state == VCPU_MP_STATE_SIPI_RECEIVED;
494} 497}
495 498
496#endif 499#endif