From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Yang, Sheng" Subject: [RFC][PATCH 4/7] KVM: Export necessary function to modules() Date: Fri, 1 Feb 2008 16:24:10 +0800 Message-ID: <200802011624.11289.sheng.yang@intel.com> Mime-Version: 1.0 Content-Type: Multipart/Mixed; boundary="Boundary-00=_rctoHu0qFvItwCB" Cc: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org To: Avi Kivity Return-path: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: kvm-devel-bounces-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org Errors-To: kvm-devel-bounces-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org List-Id: kvm.vger.kernel.org --Boundary-00=_rctoHu0qFvItwCB Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline =46rom 1b7e6dcffe5845a05b7bfe42b52d680f17f34d5d Mon Sep 17 00:00:00 2001 =46rom: Sheng Yang 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 functi= on gfn_to_hva() is needed by VMX for supporting EPT swap. Signed-off-by: Sheng Yang =2D-- 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(-) diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c index 8f94a0b..31cdf09 100644 =2D-- a/arch/x86/kvm/x86.c +++ b/arch/x86/kvm/x86.c @@ -202,6 +202,7 @@ out: return ret; } +EXPORT_SYMBOL_GPL(load_pdptrs); static bool pdptrs_changed(struct kvm_vcpu *vcpu) { diff --git a/include/asm-x86/kvm_host.h b/include/asm-x86/kvm_host.h index c1d52af..b133317 100644 =2D-- a/include/asm-x86/kvm_host.h +++ b/include/asm-x86/kvm_host.h @@ -425,6 +425,7 @@ void kvm_mmu_slot_remove_write_access(struct kvm *kvm, = int=20 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=20 kvm_nr_mmu_pages); +int load_pdptrs(struct kvm_vcpu *vcpu, unsigned long cr3); enum emulation_result { EMULATE_DONE, /* no further processing */ diff --git a/include/linux/kvm_host.h b/include/linux/kvm_host.h index a84c912..8c55beb 100644 =2D-- a/include/linux/kvm_host.h +++ b/include/linux/kvm_host.h @@ -182,6 +182,7 @@ int kvm_clear_guest_page(struct kvm *kvm, gfn_t gfn, in= t=20 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); diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c index 8fc12dc..0e6d89d 100644 =2D-- a/virt/kvm/kvm_main.c +++ b/virt/kvm/kvm_main.c @@ -443,7 +443,7 @@ int kvm_is_visible_gfn(struct kvm *kvm, gfn_t gfn) } EXPORT_SYMBOL_GPL(kvm_is_visible_gfn); =2Dstatic 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= =20 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 =2D- debian.1.5.3.7.1-dirty --Boundary-00=_rctoHu0qFvItwCB Content-Type: text/x-diff; charset="utf-8"; name="0004-KVM-Export-necessary-function-to-modules.patch" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="0004-KVM-Export-necessary-function-to-modules.patch" =46rom 1b7e6dcffe5845a05b7bfe42b52d680f17f34d5d Mon Sep 17 00:00:00 2001 =46rom: Sheng Yang 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 functi= on gfn_to_hva() is needed by VMX for supporting EPT swap. Signed-off-by: Sheng Yang =2D-- 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(-) diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c index 8f94a0b..31cdf09 100644 =2D-- a/arch/x86/kvm/x86.c +++ b/arch/x86/kvm/x86.c @@ -202,6 +202,7 @@ out: =20 return ret; } +EXPORT_SYMBOL_GPL(load_pdptrs); =20 static bool pdptrs_changed(struct kvm_vcpu *vcpu) { diff --git a/include/asm-x86/kvm_host.h b/include/asm-x86/kvm_host.h index c1d52af..b133317 100644 =2D-- a/include/asm-x86/kvm_host.h +++ b/include/asm-x86/kvm_host.h @@ -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_pag= es); +int load_pdptrs(struct kvm_vcpu *vcpu, unsigned long cr3); =20 enum emulation_result { EMULATE_DONE, /* no further processing */ diff --git a/include/linux/kvm_host.h b/include/linux/kvm_host.h index a84c912..8c55beb 100644 =2D-- a/include/linux/kvm_host.h +++ b/include/linux/kvm_host.h @@ -182,6 +182,7 @@ int kvm_clear_guest_page(struct kvm *kvm, gfn_t gfn, in= t 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); =20 void kvm_vcpu_block(struct kvm_vcpu *vcpu); diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c index 8fc12dc..0e6d89d 100644 =2D-- a/virt/kvm/kvm_main.c +++ b/virt/kvm/kvm_main.c @@ -443,7 +443,7 @@ int kvm_is_visible_gfn(struct kvm *kvm, gfn_t gfn) } EXPORT_SYMBOL_GPL(kvm_is_visible_gfn); =20 =2Dstatic 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; =20 @@ -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); =20 /* * Requires current->mm->mmap_sem to be held =2D-=20 debian.1.5.3.7.1-dirty --Boundary-00=_rctoHu0qFvItwCB Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline ------------------------------------------------------------------------- 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/ --Boundary-00=_rctoHu0qFvItwCB Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ kvm-devel mailing list kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org https://lists.sourceforge.net/lists/listinfo/kvm-devel --Boundary-00=_rctoHu0qFvItwCB--