aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/kvm/kvm.h
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/kvm/kvm.h')
-rw-r--r--drivers/kvm/kvm.h10
1 files changed, 9 insertions, 1 deletions
diff --git a/drivers/kvm/kvm.h b/drivers/kvm/kvm.h
index 930e04ce1af6..c2db4218d6cc 100644
--- a/drivers/kvm/kvm.h
+++ b/drivers/kvm/kvm.h
@@ -278,7 +278,6 @@ struct kvm_arch_ops {
278 struct kvm_segment *var, int seg); 278 struct kvm_segment *var, int seg);
279 void (*set_segment)(struct kvm_vcpu *vcpu, 279 void (*set_segment)(struct kvm_vcpu *vcpu,
280 struct kvm_segment *var, int seg); 280 struct kvm_segment *var, int seg);
281 int (*is_long_mode)(struct kvm_vcpu *vcpu);
282 void (*get_cs_db_l_bits)(struct kvm_vcpu *vcpu, int *db, int *l); 281 void (*get_cs_db_l_bits)(struct kvm_vcpu *vcpu, int *db, int *l);
283 void (*set_cr0)(struct kvm_vcpu *vcpu, unsigned long cr0); 282 void (*set_cr0)(struct kvm_vcpu *vcpu, unsigned long cr0);
284 void (*set_cr0_no_modeswitch)(struct kvm_vcpu *vcpu, 283 void (*set_cr0_no_modeswitch)(struct kvm_vcpu *vcpu,
@@ -403,6 +402,15 @@ static inline struct page *_gfn_to_page(struct kvm *kvm, gfn_t gfn)
403 return (slot) ? slot->phys_mem[gfn - slot->base_gfn] : NULL; 402 return (slot) ? slot->phys_mem[gfn - slot->base_gfn] : NULL;
404} 403}
405 404
405static inline int is_long_mode(struct kvm_vcpu *vcpu)
406{
407#ifdef CONFIG_X86_64
408 return vcpu->shadow_efer & EFER_LME;
409#else
410 return 0;
411#endif
412}
413
406static inline int is_pae(struct kvm_vcpu *vcpu) 414static inline int is_pae(struct kvm_vcpu *vcpu)
407{ 415{
408 return vcpu->cr4 & CR4_PAE_MASK; 416 return vcpu->cr4 & CR4_PAE_MASK;