x86/vmce: Dispatch vmce_{rd,wr}msr() from guest_{rd,wr}msr()
authorAndrew Cooper <andrew.cooper3@citrix.com>
Tue, 21 Jul 2020 17:25:15 +0000 (18:25 +0100)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Thu, 23 Jul 2020 14:42:48 +0000 (15:42 +0100)
commit8a7bf75eb5bba4046c1aa278330a371545a6ecbd
tree0c70c0caac7bdca96c711274365dfa0e68c53c68
parentffe4f0fe17b5288e0c19955cd1ba589e6db1b0fe
x86/vmce: Dispatch vmce_{rd,wr}msr() from guest_{rd,wr}msr()

... rather than from the default clauses of the PV and HVM MSR handlers.

This means that we no longer take the vmce lock for any unknown MSR, and
accesses to architectural MCE banks outside of the subset implemented for the
guest no longer fall further through the unknown MSR path.

The bank limit of 32 isn't stated anywhere I can locate, but is a consequence
of the MSR layout described in SDM Volume 4.

With the vmce calls removed, the hvm alternative_call()'s expression can be
simplified substantially.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
xen/arch/x86/hvm/hvm.c
xen/arch/x86/msr.c
xen/arch/x86/pv/emul-priv-op.c