x86/amd: protect set_cpuidmask() against #GP faults
authorAndrew Cooper <andrew.cooper3@citrix.com>
Thu, 5 Jun 2014 15:57:07 +0000 (17:57 +0200)
committerJan Beulich <jbeulich@suse.com>
Thu, 5 Jun 2014 15:57:07 +0000 (17:57 +0200)
commit07884c98671a734f20f2ac8302032657d262f3c9
tree67fbc7707a9a41388218965d69444a8c95ec807a
parent39ede234d1fd683430ffb1784d6d35b096f16457
x86/amd: protect set_cpuidmask() against #GP faults

Virtual environments such as Xen HVM containers and VirtualBox do not
necessarily provide support for feature masking MSRs.

As their presence is detected by model numbers alone, and their use predicated
on command line parameters, use the safe() variants of {wr,rd}msr() to avoid
dying with an early #GP fault.

In fact, use the password variants in all cases because:
    a) they are safe to use even if not strictly required
    b) have a more useful function prototype for this purposes

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
xen/arch/x86/cpu/amd.c