virt, sched: Add generic vCPU pinning support
[cascardo/linux.git] / arch / x86 / kernel / cpu / hypervisor.c
index 73d391a..35691a6 100644 (file)
@@ -21,7 +21,8 @@
  *
  */
 
-#include <linux/module.h>
+#include <linux/init.h>
+#include <linux/export.h>
 #include <asm/processor.h>
 #include <asm/hypervisor.h>
 
@@ -85,3 +86,14 @@ bool __init hypervisor_x2apic_available(void)
               x86_hyper->x2apic_available &&
               x86_hyper->x2apic_available();
 }
+
+void hypervisor_pin_vcpu(int cpu)
+{
+       if (!x86_hyper)
+               return;
+
+       if (x86_hyper->pin_vcpu)
+               x86_hyper->pin_vcpu(cpu);
+       else
+               WARN_ONCE(1, "vcpu pinning requested but not supported!\n");
+}