sched: add hypercall option to override and restore vcpu affinity
authorJuergen Gross <jgross@suse.com>
Wed, 9 Mar 2016 15:49:59 +0000 (16:49 +0100)
committerJan Beulich <jbeulich@suse.com>
Wed, 9 Mar 2016 15:49:59 +0000 (16:49 +0100)
commit8fa0fca9f3fdaac1aead9cf61d678a0d8cce02e2
treeea29f8989c3cfccc3977664d4ca5646c155eb2ec
parentd62ead2eb23491de50cf65f548d66c2e433de455
sched: add hypercall option to override and restore vcpu affinity

Some hardware (e.g. Dell studio 1555 laptops) require SMIs to be
called on physical cpu 0 only. Linux drivers like dcdbas or i8k try
to achieve this by pinning the running thread to cpu 0, but in Dom0
this is not enough: the vcpu must be pinned to physical cpu 0 via
Xen, too.

Add a stable hypercall option SCHEDOP_pin_override to the sched_op
hypercall to achieve this. It is taking a physical cpu number as
parameter. If pinning is possible (the calling domain has the
privilege to make the call and the cpu is available in the domain's
cpupool) the calling vcpu is pinned to the specified cpu. The old
cpu affinity is saved. To undo the override pinning a negative cpu
value is specified. This will restore the original cpu affinity of
the vcpu.

Signed-off-by: Juergen Gross <jgross@suse.com>
Acked-by: Dario Faggioli <dario.faggioli@citrix.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
xen/common/compat/schedule.c
xen/common/schedule.c
xen/include/public/sched.h
xen/include/xen/sched.h
xen/include/xlat.lst