summaryrefslogtreecommitdiff
path: root/xen/arch/x86/msr.c
diff options
context:
space:
mode:
authorPaul Durrant <paul.durrant@citrix.com>2019-03-14 14:55:00 +0100
committerJan Beulich <jbeulich@suse.com>2019-04-09 15:08:49 +0200
commit4ec08bb826765e788acd0aaccf8c444df8de8019 (patch)
treeff10bba8c663a2bf3c6445b570a717e90b816a17 /xen/arch/x86/msr.c
parent943c474283a34e48e5088af2ad67d7a56320fbd7 (diff)
x86: stop handling MSR_IA32_XSS save/restore in implementation code
Saving and restoring the value of this MSR is currently handled by implementation-specific code despite it being architectural. This patch moves handling of accesses to this MSR from hvm.c into the msr.c, thus allowing the common MSR save/restore code to handle it. This patch also adds proper checks of CPUID policy in the new get/set code. NOTE: MSR_IA32_XSS is the last MSR to be saved and restored by implementation-specific code. This patch therefore removes the (VMX) definitions and of the init_msr(), save_msr() and load_msr() hvm_funcs, as they are no longer necessary. The declarations of and calls to those hvm_funcs will be cleaned up by a subsequent patch. Signed-off-by: Paul Durrant <paul.durrant@citrix.com> Reviewed-by: Jan Beulich <jbeulich@suse.com> Reviewed-by: Kevin Tian <kevin.tian@intel.com>
Diffstat (limited to 'xen/arch/x86/msr.c')
-rw-r--r--xen/arch/x86/msr.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/xen/arch/x86/msr.c b/xen/arch/x86/msr.c
index 48f3a94f5b..815d599588 100644
--- a/xen/arch/x86/msr.c
+++ b/xen/arch/x86/msr.c
@@ -191,6 +191,13 @@ int guest_rdmsr(const struct vcpu *v, uint32_t msr, uint64_t *val)
break;
+ case MSR_IA32_XSS:
+ if ( !cp->xstate.xsaves )
+ goto gp_fault;
+
+ *val = msrs->xss.raw;
+ break;
+
case 0x40000000 ... 0x400001ff:
if ( is_viridian_domain(d) )
{
@@ -377,6 +384,17 @@ int guest_wrmsr(struct vcpu *v, uint32_t msr, uint64_t val)
break;
+ case MSR_IA32_XSS:
+ if ( !cp->xstate.xsaves )
+ goto gp_fault;
+
+ /* No XSS features currently supported for guests */
+ if ( val != 0 )
+ goto gp_fault;
+
+ msrs->xss.raw = val;
+ break;
+
case 0x40000000 ... 0x400001ff:
if ( is_viridian_domain(d) )
{