]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
sparc64: Add a new hypercall CPU_POKE
authorVijay Kumar <vijay.ac.kumar@oracle.com>
Fri, 5 May 2017 19:35:05 +0000 (15:35 -0400)
committerAllen Pais <allen.pais@oracle.com>
Tue, 18 Jul 2017 12:25:00 +0000 (17:55 +0530)
This adds a new hypercall CPU_POKE for quickly waking up an idle CPU.
CPU POKE should only be sent to valid  non-local CPUs.

Signed-off-by: Rob Gardner <rob.gardner@oracle.com>
Signed-off-by: Vijay Kumar <vijay.ac.kumar@oracle.com>
Orabug: 25575672
Signed-off-by: Allen Pais <allen.pais@oracle.com>
Reviewed-by: Anthony Yznaga <anthony.yznaga@oracle.com>
arch/sparc/include/asm/hypervisor.h
arch/sparc/kernel/hvcalls.S

index 9e23c56eebdedccadfd2d7bae2b745c77265e826..f53479e9995f8ca20e5e3e5c86861f00344071ed 100644 (file)
@@ -306,6 +306,24 @@ unsigned long sun4v_cpu_stop(unsigned long cpuid);
 unsigned long sun4v_cpu_yield(void);
 #endif
 
+/* cpu_poke()
+ * TRAP:       HV_FAST_TRAP
+ * FUNCTION:   HV_FAST_CPU_POKE
+ * RET0:       status
+ * ERRORS:     ENOCPU          cpuid refers to a CPU that does not exist
+ *             EINVAL          cpuid is current CPU
+ *
+ * Poke CPU cpuid. If the target CPU is currently suspended having
+ * invoked the cpu-yield service, that vCPU will be resumed.
+ * Poke interrupts may only be sent to valid, non-local CPUs.
+ * It is not legal to poke the current vCPU.
+ */
+#define HV_FAST_CPU_POKE                0x13
+
+#ifndef __ASSEMBLY__
+unsigned long sun4v_cpu_poke(unsigned long cpuid);
+#endif
+
 /* cpu_qconf()
  * TRAP:       HV_FAST_TRAP
  * FUNCTION:   HV_FAST_CPU_QCONF
index 8061686c69df4883436b1027343d7d6191eef895..027fdb7b98a3083409f54f66ba96f49500701128 100644 (file)
@@ -106,6 +106,17 @@ ENTRY(sun4v_cpu_yield)
         nop
 ENDPROC(sun4v_cpu_yield)
 
+       /* %o0: cpuid
+        *
+        * returns %o0: status
+        */
+ENTRY(sun4v_cpu_poke)
+       mov     HV_FAST_CPU_POKE, %o5
+       ta      HV_FAST_TRAP
+       retl
+        nop
+ENDPROC(sun4v_cpu_poke)
+
        /* %o0: type
         * %o1: queue paddr
         * %o2: num queue entries