Merge git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6
[wrt350n-kernel.git] / arch / x86 / kvm / mmu.h
blob1fce19ec7a2380c61c79ef0f50e71e4c39d2af66
1 #ifndef __KVM_X86_MMU_H
2 #define __KVM_X86_MMU_H
4 #include <linux/kvm_host.h>
6 static inline void kvm_mmu_free_some_pages(struct kvm_vcpu *vcpu)
8 if (unlikely(vcpu->kvm->arch.n_free_mmu_pages < KVM_MIN_FREE_MMU_PAGES))
9 __kvm_mmu_free_some_pages(vcpu);
12 static inline int kvm_mmu_reload(struct kvm_vcpu *vcpu)
14 if (likely(vcpu->arch.mmu.root_hpa != INVALID_PAGE))
15 return 0;
17 return kvm_mmu_load(vcpu);
20 static inline int is_long_mode(struct kvm_vcpu *vcpu)
22 #ifdef CONFIG_X86_64
23 return vcpu->arch.shadow_efer & EFER_LME;
24 #else
25 return 0;
26 #endif
29 static inline int is_pae(struct kvm_vcpu *vcpu)
31 return vcpu->arch.cr4 & X86_CR4_PAE;
34 static inline int is_pse(struct kvm_vcpu *vcpu)
36 return vcpu->arch.cr4 & X86_CR4_PSE;
39 static inline int is_paging(struct kvm_vcpu *vcpu)
41 return vcpu->arch.cr0 & X86_CR0_PG;
44 #endif