KVM: Export necessary function to modules()
RFC PATCH 4/7 KVM: Export necessary function to modules()
From 1b7e6dcffe5845a05b7bfe42b52d680f17f34d5d Mon Sep 17 00:00:00 2001
From: Sheng Yang <[email protected]>
Date: Fri, 1 Feb 2008 06:41:35 +0800
Subject: [PATCH] KVM: Export necessary function to modules()
The function load_pdptrs() is needed by VMX for EPT in PAE mode. The function gfn_to_hva() is needed by VMX for supporting EPT swap.
--- arch/x86/kvm/x86.c | 1 + include/asm-x86/kvm_host.h | 1 + include/linux/kvm_host.h | 1 + virt/kvm/kvm_main.c | 3 ++- 4 files changed, 5 insertions(+), 1 deletions(-)
arch/x86/kvm/x86.c +1 -0
@@ -202,6 +202,7 @@ out:return ret; } +EXPORT_SYMBOL_GPL (load_pdptrs);static bool pdptrs_changed (struct kvm_vcpu *vcpu) {
include/asm-x86/kvm_host.h +0 -0
@@ -425,6 +425,7 @@ void kvm_mmu_slot_remove_write_access(struct kvm *kvm, int
slot);
void kvm_mmu_zap_all(struct kvm *kvm);
unsigned int kvm_mmu_calculate_mmu_pages(struct kvm *kvm); void kvm_mmu_change_mmu_pages(struct kvm *kvm, unsigned intkvm_nr_mmu_pages);
+int load_pdptrs(struct kvm_vcpu *vcpu, unsigned long cr3);
enum emulation_result {
EMULATE_DONE, /* no further processing */
include/linux/kvm_host.h +0 -0
@@ -182,6 +182,7 @@ int kvm_clear_guest_page(struct kvm *kvm, gfn_t gfn, int
offset, int len);
int kvm_clear_guest(struct kvm *kvm, gpa_t gpa, unsigned long len); struct kvm_memory_slot *gfn_to_memslot(struct kvm *kvm, gfn_t gfn); int kvm_is_visible_gfn(struct kvm *kvm, gfn_t gfn);
+unsigned long gfn_to_hva(struct kvm *kvm, gfn_t gfn);
void mark_page_dirty(struct kvm *kvm, gfn_t gfn);
void kvm_vcpu_block(struct kvm_vcpu *vcpu);
virt/kvm/kvm_main.c +1 -1
@@ -443,7 +443,7 @@ int kvm_is_visible_gfn(struct kvm *kvm, gfn_t gfn) }EXPORT_SYMBOL_GPL (kvm_is_visible_gfn); -static unsigned long gfn_to_hva (struct kvm *kvm,gfn_t gfn) +unsigned long gfn_to_hva (struct kvm *kvm,gfn_t gfn) {struct kvm_memory_slot *slot;
@@ -453,6 +453,7 @@ static unsigned long gfn_to_hva(struct kvm *kvm, gfn_t
gfn)
return bad_hva();
return (slot->userspace_addr + (gfn - slot->base_gfn) * PAGE_SIZE);
}
+EXPORT_SYMBOL_GPL(gfn_to_hva);
/*
* Requires current->mm->mmap_sem to be held
--
debian.1.5.3.7.1-dirty
From 1b7e6dcffe5845a05b7bfe42b52d680f17f34d5d Mon Sep 17 00:00:00 2001
From: Sheng Yang <[email protected]>
Date: Fri, 1 Feb 2008 06:41:35 +0800
Subject: [PATCH] KVM: Export necessary function to modules()
The function load_pdptrs() is needed by VMX for EPT in PAE mode. The function gfn_to_hva() is needed by VMX for supporting EPT swap.
--- arch/x86/kvm/x86.c | 1 + include/asm-x86/kvm_host.h | 1 + include/linux/kvm_host.h | 1 + virt/kvm/kvm_main.c | 3 ++- 4 files changed, 5 insertions(+), 1 deletions(-)
arch/x86/kvm/x86.c +1 -0
@@ -202,6 +202,7 @@ out:return ret; } +EXPORT_SYMBOL_GPL (load_pdptrs);static bool pdptrs_changed (struct kvm_vcpu *vcpu) {
include/asm-x86/kvm_host.h +1 -0
@@ -425,6 +425,7 @@ void kvm_mmu_slot_remove_write_access(struct kvm *kvm, int slot);void kvm_mmu_zap_all (struct kvm *kvm);unsigned int kvm_mmu_calculate_mmu_pages (struct kvm *kvm);void kvm_mmu_change_mmu_pages (struct kvm *kvm,unsigned int kvm_nr_mmu_pages); +int load_pdptrs (struct kvm_vcpu *vcpu,unsigned long cr3);enum emulation_result {EMULATE_DONE ,/* no further processing */
include/linux/kvm_host.h +1 -0
@@ -182,6 +182,7 @@ int kvm_clear_guest_page(struct kvm *kvm, gfn_t gfn, int offset, int len);int kvm_clear_guest (struct kvm *kvm,gpa_t gpa,unsigned long len);struct kvm_memory_slot *gfn_to_memslot (struct kvm *kvm,gfn_t gfn);int kvm_is_visible_gfn (struct kvm *kvm,gfn_t gfn); +unsigned long gfn_to_hva (struct kvm *kvm,gfn_t gfn);void mark_page_dirty (struct kvm *kvm,gfn_t gfn);void kvm_vcpu_block (struct kvm_vcpu *vcpu);
virt/kvm/kvm_main.c +2 -1
@@ -443,7 +443,7 @@ int kvm_is_visible_gfn(struct kvm *kvm, gfn_t gfn) }EXPORT_SYMBOL_GPL (kvm_is_visible_gfn); -static unsigned long gfn_to_hva (struct kvm *kvm,gfn_t gfn) +unsigned long gfn_to_hva (struct kvm *kvm,gfn_t gfn) {struct kvm_memory_slot *slot;
@@ -453,6 +453,7 @@ static unsigned long gfn_to_hva(struct kvm *kvm, gfn_t gfn)return bad_hva ();return (slot->userspace_addr + (gfn - slot->base_gfn) *PAGE_SIZE ); } +EXPORT_SYMBOL_GPL (gfn_to_hva);/* * Requires current->mm->mmap_sem to be held
Signature · 1 line
debian.1.5.3.7.1-dirty
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
kvm-devel mailing list [email protected]
https://lists.sourceforge.net/lists/listinfo/kvm-devel