sparc64: Add a new hypercall CPU_POKE
authorVijay Kumar <vijay.ac.kumar@oracle.com>
Fri, 21 Jul 2017 16:23:56 +0000 (10:23 -0600)
committerDavid S. Miller <davem@davemloft.net>
Thu, 10 Aug 2017 05:15:10 +0000 (22:15 -0700)
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>
Reviewed-by: Anthony Yznaga <anthony.yznaga@oracle.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
arch/sparc/include/asm/hypervisor.h
arch/sparc/kernel/hvcalls.S

index 73cb8978df58c9f25e2f06101a84bf1101dc7cf3..3dc9215d0357e0732ac31a906e4fa4d3a63b1470 100644 (file)
@@ -298,6 +298,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 4116ee5c77913221593421836eaae0803115a028..e57007ff7f8f946432add5cc97f1ad028b534a1d 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