x86/domctl: implement XEN_DOMCTL_{get,set}_vcpu_msrs
authorAndrew Cooper <andrew.cooper3@citrix.com>
Tue, 10 Jun 2014 14:57:16 +0000 (16:57 +0200)
committerJan Beulich <jbeulich@suse.com>
Tue, 10 Jun 2014 14:57:16 +0000 (16:57 +0200)
commit8c3c9eee0c1129b0c5789ded48ee85007fa74b02
treebf0cca27f9d560d2655525d80bfb525eed4dcd5a
parent38d4393462ad766fd10313f323a329be29a2f58e
x86/domctl: implement XEN_DOMCTL_{get,set}_vcpu_msrs

Despite my 'Reviewed-by' tag on c/s 65e3554908 "x86/PV: support data
breakpoint extension registers", I have re-evaluated my position as far as the
hypercall interface is concerned.

Previously, for the sake of not modifying the migration code in libxc,
XEN_DOMCTL_get_ext_vcpucontext would jump though hoops to return -ENOBUFS if
and only if MSRs were in use and no buffer was present.

This is fragile, and awkward from a toolstack point-of-view when actually
sending MSR content in the migration stream.  It also complicates fixing a
further race condition, between querying the number of MSRs for a vcpu, and
the vcpu touching a new one.

As this code is still only in unstable, take this opportunity to redesign the
interface.  This patch introduces the brand new XEN_DOMCTL_{get,set}_vcpu_msrs
subops.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
xen/arch/x86/domctl.c
xen/include/public/domctl.h