diff mbox

[v2] kvm/book3s: fix build error caused by gfn_to_hva_memslot()

Message ID 1345798228-30966-1-git-send-email-shangw@linux.vnet.ibm.com (mailing list archive)
State New, archived
Headers show

Commit Message

Gavin Shan Aug. 24, 2012, 8:50 a.m. UTC
The build error was caused by that builtin functions are calling
the functions implemented in modules. That was introduced by the
following commit.

commit 4d8b81abc47b83a1939e59df2fdb0e98dfe0eedd

The patch fixes the build error by moving function __gfn_to_hva_memslot()
from kvm_main.c to kvm_host.h and making that "inline" so that the
builtin function (kvmppc_h_enter) can use that.

Signed-off-by: Gavin Shan <shangw@linux.vnet.ibm.com>
---

--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Comments

Paul Mackerras Aug. 24, 2012, 9:03 a.m. UTC | #1
On Fri, Aug 24, 2012 at 04:50:28PM +0800, Gavin Shan wrote:
> The build error was caused by that builtin functions are calling
> the functions implemented in modules. That was introduced by the
> following commit.
> 
> commit 4d8b81abc47b83a1939e59df2fdb0e98dfe0eedd
> 
> The patch fixes the build error by moving function __gfn_to_hva_memslot()
> from kvm_main.c to kvm_host.h and making that "inline" so that the
> builtin function (kvmppc_h_enter) can use that.
> 
> Signed-off-by: Gavin Shan <shangw@linux.vnet.ibm.com>

Acked-by: Paul Mackerras <paulus@samba.org>

By the way, when you give a commit ID it's a good idea to give the
headline of the commit as well, something like this:

This error was introduced by commit 4d8b81abc4 ("KVM: introduce
readonly memslot").

Paul.
--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Marcelo Tosatti Aug. 27, 2012, 7:52 p.m. UTC | #2
On Fri, Aug 24, 2012 at 07:03:14PM +1000, Paul Mackerras wrote:
> On Fri, Aug 24, 2012 at 04:50:28PM +0800, Gavin Shan wrote:
> > The build error was caused by that builtin functions are calling
> > the functions implemented in modules. That was introduced by the
> > following commit.
> > 
> > commit 4d8b81abc47b83a1939e59df2fdb0e98dfe0eedd
> > 
> > The patch fixes the build error by moving function __gfn_to_hva_memslot()
> > from kvm_main.c to kvm_host.h and making that "inline" so that the
> > builtin function (kvmppc_h_enter) can use that.
> > 
> > Signed-off-by: Gavin Shan <shangw@linux.vnet.ibm.com>
> 
> Acked-by: Paul Mackerras <paulus@samba.org>
> 
> By the way, when you give a commit ID it's a good idea to give the
> headline of the commit as well, something like this:
> 
> This error was introduced by commit 4d8b81abc4 ("KVM: introduce
> readonly memslot").
> 
> Paul.

Applied, thanks (with suggested changelog modification).
--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/arch/powerpc/kvm/book3s_hv_rm_mmu.c b/arch/powerpc/kvm/book3s_hv_rm_mmu.c
index 56ac1a5..fb0e821 100644
--- a/arch/powerpc/kvm/book3s_hv_rm_mmu.c
+++ b/arch/powerpc/kvm/book3s_hv_rm_mmu.c
@@ -197,7 +197,7 @@  long kvmppc_h_enter(struct kvm_vcpu *vcpu, unsigned long flags,
 		pa &= PAGE_MASK;
 	} else {
 		/* Translate to host virtual address */
-		hva = gfn_to_hva_memslot(memslot, gfn);
+		hva = __gfn_to_hva_memslot(memslot, gfn);
 
 		/* Look up the Linux PTE for the backing page */
 		pte_size = psize;
diff --git a/include/linux/kvm_host.h b/include/linux/kvm_host.h
index 5972c98..9c0b3c3 100644
--- a/include/linux/kvm_host.h
+++ b/include/linux/kvm_host.h
@@ -773,6 +773,12 @@  __gfn_to_memslot(struct kvm_memslots *slots, gfn_t gfn)
 	return search_memslots(slots, gfn);
 }
 
+static inline unsigned long
+__gfn_to_hva_memslot(struct kvm_memory_slot *slot, gfn_t gfn)
+{
+	return slot->userspace_addr + (gfn - slot->base_gfn) * PAGE_SIZE;
+}
+
 static inline int memslot_id(struct kvm *kvm, gfn_t gfn)
 {
 	return gfn_to_memslot(kvm, gfn)->id;
diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c
index 3416f8a..6425906 100644
--- a/virt/kvm/kvm_main.c
+++ b/virt/kvm/kvm_main.c
@@ -984,12 +984,6 @@  static bool memslot_is_readonly(struct kvm_memory_slot *slot)
 	return slot->flags & KVM_MEM_READONLY;
 }
 
-static unsigned long __gfn_to_hva_memslot(struct kvm_memory_slot *slot,
-					  gfn_t gfn)
-{
-	return slot->userspace_addr + (gfn - slot->base_gfn) * PAGE_SIZE;
-}
-
 static unsigned long __gfn_to_hva_many(struct kvm_memory_slot *slot, gfn_t gfn,
 				       gfn_t *nr_pages, bool write)
 {