x86/msr: Fix fallout from mostly c/s 832c180
authorAndrew Cooper <andrew.cooper3@citrix.com>
Tue, 9 Apr 2019 15:18:46 +0000 (16:18 +0100)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Mon, 15 Apr 2019 16:51:30 +0000 (17:51 +0100)
commitbe3d5b30331d87e177744dbe23138b9ebcdc86f1
tree626ff7ccfa15fc19cad87ec68a14ebc1094b3a54
parent1aec95350ac8261cba516371710d4d837c26f6a0
x86/msr: Fix fallout from mostly c/s 832c180

 * Fix the shim build by providing a !CONFIG_HVM declaration for
   hvm_get_guest_bndcfgs(), and removing the introduced
   ASSERT(is_hvm_domain(d))'s.  They are needed for DCE to keep the build
   working.  Furthermore, in this way, the risk of runtime type confusion is
   removed.
 * Revert the de-const'ing of the vcpu pointer in vmx_get_guest_bndcfgs().
   vmx_vmcs_enter() really does mutate the vcpu, and may cause it to undergo a
   full de/reschedule, which is contrary to the programmers expectation of
   hvm_get_guest_bndcfgs().  guest_rdmsr() was always going to need to lose
   its const parameter, and this was the correct time for it to happen.
 * The MSRs in vcpu_msrs are in numeric order.  Re-position XSS to match.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Paul Durrant <paul.durrant@citrix.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
xen/arch/x86/hvm/vmx/vmx.c
xen/arch/x86/msr.c
xen/arch/x86/pv/emul-priv-op.c
xen/include/asm-x86/hvm/hvm.h
xen/include/asm-x86/msr.h