]> Pileus Git - ~andy/linux/commitdiff
KVM: PPC: book3s: fix build error caused by gfn_to_hva_memslot()
authorGavin Shan <shangw@linux.vnet.ibm.com>
Fri, 24 Aug 2012 08:50:28 +0000 (16:50 +0800)
committerMarcelo Tosatti <mtosatti@redhat.com>
Mon, 27 Aug 2012 19:44:20 +0000 (16:44 -0300)
The build error was caused by that builtin functions are calling
the functions implemented in modules. This error was introduced by
commit 4d8b81abc4 ("KVM: introduce readonly memslot").

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.

Acked-by: Paul Mackerras <paulus@samba.org>
Signed-off-by: Gavin Shan <shangw@linux.vnet.ibm.com>
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
arch/powerpc/kvm/book3s_hv_rm_mmu.c
include/linux/kvm_host.h
virt/kvm/kvm_main.c

index 56ac1a5d99129fea24213e7a8965f63a8678d9f0..fb0e821622d4fc97465288cd57f6c12978bdc381 100644 (file)
@@ -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;
index 5972c9845ddb8ce51a208462ed4da8c9921ee8d6..9c0b3c3ae0a5bda874b006154d19f1e74a6bec74 100644 (file)
@@ -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;
index 3416f8a31f63c978f59c2a5ac22d70baea12f860..6425906d7cecbfc8652ceb989b645d5b7b8a71dc 100644 (file)
@@ -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)
 {