kvm/powerpc: rename kvm_hypercall() to epapr_hypercall()
authorBharat Bhushan <r65777@freescale.com>
Tue, 8 Oct 2013 04:02:19 +0000 (09:32 +0530)
committerAlexander Graf <agraf@suse.de>
Thu, 9 Jan 2014 09:14:56 +0000 (10:14 +0100)
kvm_hypercall() have nothing KVM specific, so renamed to epapr_hypercall().
Also this in moved to arch/powerpc/include/asm/epapr_hcalls.h

Signed-off-by: Bharat Bhushan <bharat.bhushan@freescale.com>
Signed-off-by: Alexander Graf <agraf@suse.de>
arch/powerpc/include/asm/epapr_hcalls.h
arch/powerpc/include/asm/kvm_para.h
arch/powerpc/kernel/kvm.c

index 86b0ac79990ca4ebda1ade6d67524d588bb148e9..eec87f9494bc427ef7fe5da39b7e4b386da8ac4b 100644 (file)
@@ -460,5 +460,51 @@ static inline unsigned int ev_idle(void)
 
        return r3;
 }
+
+#ifdef CONFIG_EPAPR_PARAVIRT
+static inline unsigned long epapr_hypercall(unsigned long *in,
+                           unsigned long *out,
+                           unsigned long nr)
+{
+       unsigned long register r0 asm("r0");
+       unsigned long register r3 asm("r3") = in[0];
+       unsigned long register r4 asm("r4") = in[1];
+       unsigned long register r5 asm("r5") = in[2];
+       unsigned long register r6 asm("r6") = in[3];
+       unsigned long register r7 asm("r7") = in[4];
+       unsigned long register r8 asm("r8") = in[5];
+       unsigned long register r9 asm("r9") = in[6];
+       unsigned long register r10 asm("r10") = in[7];
+       unsigned long register r11 asm("r11") = nr;
+       unsigned long register r12 asm("r12");
+
+       asm volatile("bl        epapr_hypercall_start"
+                    : "=r"(r0), "=r"(r3), "=r"(r4), "=r"(r5), "=r"(r6),
+                      "=r"(r7), "=r"(r8), "=r"(r9), "=r"(r10), "=r"(r11),
+                      "=r"(r12)
+                    : "r"(r3), "r"(r4), "r"(r5), "r"(r6), "r"(r7), "r"(r8),
+                      "r"(r9), "r"(r10), "r"(r11)
+                    : "memory", "cc", "xer", "ctr", "lr");
+
+       out[0] = r4;
+       out[1] = r5;
+       out[2] = r6;
+       out[3] = r7;
+       out[4] = r8;
+       out[5] = r9;
+       out[6] = r10;
+       out[7] = r11;
+
+       return r3;
+}
+#else
+static unsigned long epapr_hypercall(unsigned long *in,
+                                  unsigned long *out,
+                                  unsigned long nr)
+{
+       return EV_UNIMPLEMENTED;
+}
+#endif
+
 #endif /* !__ASSEMBLY__ */
 #endif /* _EPAPR_HCALLS_H */
index 2b119654b4c1a5fcd2ce568fd83ad3a64bccdd03..c18660ef26d8c1d110b14ef1a047bfa48f1d5067 100644 (file)
@@ -39,10 +39,6 @@ static inline int kvm_para_available(void)
        return 1;
 }
 
-extern unsigned long kvm_hypercall(unsigned long *in,
-                                  unsigned long *out,
-                                  unsigned long nr);
-
 #else
 
 static inline int kvm_para_available(void)
@@ -50,13 +46,6 @@ static inline int kvm_para_available(void)
        return 0;
 }
 
-static unsigned long kvm_hypercall(unsigned long *in,
-                                  unsigned long *out,
-                                  unsigned long nr)
-{
-       return EV_UNIMPLEMENTED;
-}
-
 #endif
 
 static inline long kvm_hypercall0_1(unsigned int nr, unsigned long *r2)
@@ -65,7 +54,7 @@ static inline long kvm_hypercall0_1(unsigned int nr, unsigned long *r2)
        unsigned long out[8];
        unsigned long r;
 
-       r = kvm_hypercall(in, out, KVM_HCALL_TOKEN(nr));
+       r = epapr_hypercall(in, out, KVM_HCALL_TOKEN(nr));
        *r2 = out[0];
 
        return r;
@@ -76,7 +65,7 @@ static inline long kvm_hypercall0(unsigned int nr)
        unsigned long in[8];
        unsigned long out[8];
 
-       return kvm_hypercall(in, out, KVM_HCALL_TOKEN(nr));
+       return epapr_hypercall(in, out, KVM_HCALL_TOKEN(nr));
 }
 
 static inline long kvm_hypercall1(unsigned int nr, unsigned long p1)
@@ -85,7 +74,7 @@ static inline long kvm_hypercall1(unsigned int nr, unsigned long p1)
        unsigned long out[8];
 
        in[0] = p1;
-       return kvm_hypercall(in, out, KVM_HCALL_TOKEN(nr));
+       return epapr_hypercall(in, out, KVM_HCALL_TOKEN(nr));
 }
 
 static inline long kvm_hypercall2(unsigned int nr, unsigned long p1,
@@ -96,7 +85,7 @@ static inline long kvm_hypercall2(unsigned int nr, unsigned long p1,
 
        in[0] = p1;
        in[1] = p2;
-       return kvm_hypercall(in, out, KVM_HCALL_TOKEN(nr));
+       return epapr_hypercall(in, out, KVM_HCALL_TOKEN(nr));
 }
 
 static inline long kvm_hypercall3(unsigned int nr, unsigned long p1,
@@ -108,7 +97,7 @@ static inline long kvm_hypercall3(unsigned int nr, unsigned long p1,
        in[0] = p1;
        in[1] = p2;
        in[2] = p3;
-       return kvm_hypercall(in, out, KVM_HCALL_TOKEN(nr));
+       return epapr_hypercall(in, out, KVM_HCALL_TOKEN(nr));
 }
 
 static inline long kvm_hypercall4(unsigned int nr, unsigned long p1,
@@ -122,7 +111,7 @@ static inline long kvm_hypercall4(unsigned int nr, unsigned long p1,
        in[1] = p2;
        in[2] = p3;
        in[3] = p4;
-       return kvm_hypercall(in, out, KVM_HCALL_TOKEN(nr));
+       return epapr_hypercall(in, out, KVM_HCALL_TOKEN(nr));
 }
 
 
index db28032e320e3e5332b6e60d77d1b56d29cea7d9..6a0175297b0d8e92495ce97e7274ecba72fcb790 100644 (file)
@@ -413,13 +413,13 @@ static void kvm_map_magic_page(void *data)
 {
        u32 *features = data;
 
-       ulong in[8];
+       ulong in[8] = {0};
        ulong out[8];
 
        in[0] = KVM_MAGIC_PAGE;
        in[1] = KVM_MAGIC_PAGE;
 
-       kvm_hypercall(in, out, KVM_HCALL_TOKEN(KVM_HC_PPC_MAP_MAGIC_PAGE));
+       epapr_hypercall(in, out, KVM_HCALL_TOKEN(KVM_HC_PPC_MAP_MAGIC_PAGE));
 
        *features = out[0];
 }
@@ -711,43 +711,6 @@ static void kvm_use_magic_page(void)
                         kvm_patching_worked ? "worked" : "failed");
 }
 
-unsigned long kvm_hypercall(unsigned long *in,
-                           unsigned long *out,
-                           unsigned long nr)
-{
-       unsigned long register r0 asm("r0");
-       unsigned long register r3 asm("r3") = in[0];
-       unsigned long register r4 asm("r4") = in[1];
-       unsigned long register r5 asm("r5") = in[2];
-       unsigned long register r6 asm("r6") = in[3];
-       unsigned long register r7 asm("r7") = in[4];
-       unsigned long register r8 asm("r8") = in[5];
-       unsigned long register r9 asm("r9") = in[6];
-       unsigned long register r10 asm("r10") = in[7];
-       unsigned long register r11 asm("r11") = nr;
-       unsigned long register r12 asm("r12");
-
-       asm volatile("bl        epapr_hypercall_start"
-                    : "=r"(r0), "=r"(r3), "=r"(r4), "=r"(r5), "=r"(r6),
-                      "=r"(r7), "=r"(r8), "=r"(r9), "=r"(r10), "=r"(r11),
-                      "=r"(r12)
-                    : "r"(r3), "r"(r4), "r"(r5), "r"(r6), "r"(r7), "r"(r8),
-                      "r"(r9), "r"(r10), "r"(r11)
-                    : "memory", "cc", "xer", "ctr", "lr");
-
-       out[0] = r4;
-       out[1] = r5;
-       out[2] = r6;
-       out[3] = r7;
-       out[4] = r8;
-       out[5] = r9;
-       out[6] = r10;
-       out[7] = r11;
-
-       return r3;
-}
-EXPORT_SYMBOL_GPL(kvm_hypercall);
-
 static __init void kvm_free_tmp(void)
 {
        free_reserved_area(&kvm_tmp[kvm_tmp_index],