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, 10 insertions, 0 deletions
diff --git a/drivers/kvm/kvm.h b/drivers/kvm/kvm.h
index 199e1e9bae25..3ec4e26b9bd7 100644
--- a/drivers/kvm/kvm.h
+++ b/drivers/kvm/kvm.h
@@ -544,6 +544,8 @@ void kvm_mmu_pte_write(struct kvm_vcpu *vcpu, gpa_t gpa,
544 const u8 *old, const u8 *new, int bytes); 544 const u8 *old, const u8 *new, int bytes);
545int kvm_mmu_unprotect_page_virt(struct kvm_vcpu *vcpu, gva_t gva); 545int kvm_mmu_unprotect_page_virt(struct kvm_vcpu *vcpu, gva_t gva);
546void kvm_mmu_free_some_pages(struct kvm_vcpu *vcpu); 546void kvm_mmu_free_some_pages(struct kvm_vcpu *vcpu);
547int kvm_mmu_load(struct kvm_vcpu *vcpu);
548void kvm_mmu_unload(struct kvm_vcpu *vcpu);
547 549
548int kvm_hypercall(struct kvm_vcpu *vcpu, struct kvm_run *run); 550int kvm_hypercall(struct kvm_vcpu *vcpu, struct kvm_run *run);
549 551
@@ -555,6 +557,14 @@ static inline int kvm_mmu_page_fault(struct kvm_vcpu *vcpu, gva_t gva,
555 return vcpu->mmu.page_fault(vcpu, gva, error_code); 557 return vcpu->mmu.page_fault(vcpu, gva, error_code);
556} 558}
557 559
560static inline int kvm_mmu_reload(struct kvm_vcpu *vcpu)
561{
562 if (likely(vcpu->mmu.root_hpa != INVALID_PAGE))
563 return 0;
564
565 return kvm_mmu_load(vcpu);
566}
567
558static inline int is_long_mode(struct kvm_vcpu *vcpu) 568static inline int is_long_mode(struct kvm_vcpu *vcpu)
559{ 569{
560#ifdef CONFIG_X86_64 570#ifdef CONFIG_X86_64