make do_sched_op_compat() x86-specific
authorJan Beulich <jbeulich@suse.com>
Tue, 9 Jun 2015 13:56:03 +0000 (15:56 +0200)
committerJan Beulich <jbeulich@suse.com>
Tue, 9 Jun 2015 13:56:03 +0000 (15:56 +0200)
Being a pre-3.1 compatibility hypercall handler only, it's not needed
on ARM or any future architectures Xen may get ported to.

Also the function shouldn't really be used internally - its use should
be limited to its purpose (and hence there's also no need for a
prototype).

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@cirix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
xen/arch/x86/compat.c
xen/arch/x86/hvm/hvm.c
xen/arch/x86/hvm/svm/svm.c
xen/arch/x86/hvm/viridian.c
xen/arch/x86/hvm/vmx/vmx.c
xen/common/schedule.c
xen/include/xen/hypercall.h

index 2d05867ebac8f5f3c849f84dfd8d8d0d794a774b..2d4be2e89953ffc7307d1539e6618f9bfaf9fc1b 100644 (file)
@@ -5,9 +5,10 @@
  * hypercall after doing necessary argument munging.
  */
 
-#include <xen/config.h>
 #include <xen/guest_access.h>
 #include <xen/hypercall.h>
+#include <xen/trace.h>
+#include <public/sched.h>
 
 #ifndef COMPAT
 typedef long ret_t;
@@ -26,6 +27,28 @@ ret_t do_physdev_op_compat(XEN_GUEST_HANDLE(physdev_op_t) uop)
 
 #ifndef COMPAT
 
+/* Legacy hypercall (as of 0x00030101). */
+long do_sched_op_compat(int cmd, unsigned long arg)
+{
+    switch ( cmd )
+    {
+    case SCHEDOP_yield:
+    case SCHEDOP_block:
+        return do_sched_op(cmd, guest_handle_from_ptr(NULL, void));
+
+    case SCHEDOP_shutdown:
+        TRACE_3D(TRC_SCHED_SHUTDOWN,
+                 current->domain->domain_id, current->vcpu_id, arg);
+        domain_shutdown(current->domain, (u8)arg);
+        break;
+
+    default:
+        return -ENOSYS;
+    }
+
+    return 0;
+}
+
 /* Legacy hypercall (as of 0x00030202). */
 long do_event_channel_op_compat(XEN_GUEST_HANDLE_PARAM(evtchn_op_t) uop)
 {
index f354cb7a76b8695fa34ec999b8f174c5b6a8e599..1c3e75a5f5821485d68a126079f47f5a55639ae2 100644 (file)
@@ -2705,7 +2705,7 @@ void hvm_hlt(unsigned long rflags)
     if ( unlikely(!(rflags & X86_EFLAGS_IF)) )
         return hvm_vcpu_down(curr);
 
-    do_sched_op_compat(SCHEDOP_block, 0);
+    do_sched_op(SCHEDOP_block, guest_handle_from_ptr(NULL, void));
 
     HVMTRACE_1D(HLT, /* pending = */ vcpu_runnable(curr));
 }
index 6734fb6fd032f437bf3406362eefb5453f0ce9cc..a02f983f62addcb02a040737bb00d5aa0be73b66 100644 (file)
@@ -36,7 +36,7 @@
 #include <asm/cpufeature.h>
 #include <asm/processor.h>
 #include <asm/amd.h>
-#include <asm/types.h>
+#include <asm/guest_access.h>
 #include <asm/debugreg.h>
 #include <asm/msr.h>
 #include <asm/i387.h>
@@ -1988,7 +1988,7 @@ static void svm_vmexit_do_pause(struct cpu_user_regs *regs)
      * Do something useful, like reschedule the guest
      */
     perfc_incr(pauseloop_exits);
-    do_sched_op_compat(SCHEDOP_yield, 0);
+    do_sched_op(SCHEDOP_yield, guest_handle_from_ptr(NULL, void));
 }
 
 static void
index 1e5a5702614ee755fbfbfcf6458ce95c07460868..2f22783625c957a08ac67beb346cd853a268dfbd 100644 (file)
@@ -9,6 +9,7 @@
 #include <xen/perfc.h>
 #include <xen/hypercall.h>
 #include <xen/domain_page.h>
+#include <asm/guest_access.h>
 #include <asm/paging.h>
 #include <asm/p2m.h>
 #include <asm/apic.h>
@@ -561,7 +562,7 @@ int viridian_hypercall(struct cpu_user_regs *regs)
     {
     case HvNotifyLongSpinWait:
         perfc_incr(mshv_call_long_wait);
-        do_sched_op_compat(SCHEDOP_yield, 0);
+        do_sched_op(SCHEDOP_yield, guest_handle_from_ptr(NULL, void));
         status = HV_STATUS_SUCCESS;
         break;
     default:
index af257db4da8c36a22f85b876ce1a2b5066b95472..0837627e81047de69ac64a074a3651ae3a5dcafe 100644 (file)
@@ -32,7 +32,7 @@
 #include <asm/regs.h>
 #include <asm/cpufeature.h>
 #include <asm/processor.h>
-#include <asm/types.h>
+#include <asm/guest_access.h>
 #include <asm/debugreg.h>
 #include <asm/msr.h>
 #include <asm/paging.h>
@@ -3198,7 +3198,7 @@ void vmx_vmexit_handler(struct cpu_user_regs *regs)
 
     case EXIT_REASON_PAUSE_INSTRUCTION:
         perfc_incr(pauseloop_exits);
-        do_sched_op_compat(SCHEDOP_yield, 0);
+        do_sched_op(SCHEDOP_yield, guest_handle_from_ptr(NULL, void));
         break;
 
     case EXIT_REASON_XSETBV:
index f5a2e55a59de143b300a6a7bd5eeeb317a260b97..6b02f9815a4657131617349941953a9d3ae8500e 100644 (file)
@@ -882,39 +882,6 @@ void watchdog_domain_destroy(struct domain *d)
         kill_timer(&d->watchdog_timer[i]);
 }
 
-long do_sched_op_compat(int cmd, unsigned long arg)
-{
-    long ret = 0;
-
-    switch ( cmd )
-    {
-    case SCHEDOP_yield:
-    {
-        ret = vcpu_yield();
-        break;
-    }
-
-    case SCHEDOP_block:
-    {
-        vcpu_block_enable_events();
-        break;
-    }
-
-    case SCHEDOP_shutdown:
-    {
-        TRACE_3D(TRC_SCHED_SHUTDOWN,
-                 current->domain->domain_id, current->vcpu_id, arg);
-        domain_shutdown(current->domain, (u8)arg);
-        break;
-    }
-
-    default:
-        ret = -ENOSYS;
-    }
-
-    return ret;
-}
-
 typedef long ret_t;
 
 #endif /* !COMPAT */
index eda8a36c46b591396f04cfd3ccd320b3cbfdf9e5..79fe11428779ca5ac98c16e9ffc94e6eb0683d03 100644 (file)
@@ -21,11 +21,6 @@ extern long
 do_ni_hypercall(
     void);
 
-extern long
-do_sched_op_compat(
-    int cmd,
-    unsigned long arg);
-
 extern long
 do_sched_op(
     int cmd,