]> xenbits.xensource.com Git - xen.git/commit
tools/libxc: Fix restoration of PV MSRs after migrate
authorAndrew Cooper <andrew.cooper3@citrix.com>
Thu, 16 Nov 2017 21:10:00 +0000 (21:10 +0000)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Tue, 21 Nov 2017 11:19:02 +0000 (11:19 +0000)
commitf1a0a8c3fe2fb37c77ec1fe43618feef412427b5
tree77c6a461af51a86a5d6f1068bdc11e7005fb949c
parenteb0660c6950e08e44fdfeca3e29320382e2a1554
tools/libxc: Fix restoration of PV MSRs after migrate

There are two bugs in process_vcpu_msrs() which clearly demonstrate that I
didn't test this bit of Migration v2 very well when writing it...

vcpu->msrsz is always expected to be a multiple of xen_domctl_vcpu_msr_t
records in a spec-compliant stream, so the modulo yields 0 for the msr_count,
rather than the actual number sent in the stream.

Passing 0 for the msr_count causes the hypercall to exit early, and hides the
fact that the guest handle is inserted into the wrong field in the domctl
union.

The reason that these bugs have gone unnoticed for so long is that the only
MSRs passed like this for PV guests are the AMD DBGEXT MSRs, which only exist
in fairly modern hardware, and whose use doesn't appear to be implemented in
any contemporary PV guests.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Wei Liu <wei.liu2@citrix.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
Release-acked-by: Julien Grall <julien.grall@linaro.org>
tools/libxc/xc_sr_restore_x86_pv.c