x86/msr: Don't inject #GP when trying to read FEATURE_CONTROL
authorRoger Pau Monne <roger.pau@citrix.com>
Tue, 29 Dec 2020 16:58:01 +0000 (17:58 +0100)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Tue, 26 Jan 2021 12:56:28 +0000 (12:56 +0000)
commitca88a43e660c75796656a544e54a648c60d26ef0
tree394f0105812f3ee13bce5293b3c3c755a62231dc
parentca6fcf4321b31df0b50720fa817e727b16e34f76
x86/msr: Don't inject #GP when trying to read FEATURE_CONTROL

Windows 10 will triple fault if #GP is injected when attempting to
read the FEATURE_CONTROL MSR on Intel or compatible hardware. Fix this
by injecting a #GP only when the vendor doesn't support the MSR, even
if there are no features to expose.

Fixes: 39ab598c50a2 ('x86/pv: allow reading FEATURE_CONTROL MSR')
Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
[Extended comment]
Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
xen/arch/x86/msr.c