]> xenbits.xensource.com Git - xen.git/commit
x86/HVM: don't give the wrong impression of WRMSR succeeding
authorJan Beulich <jbeulich@suse.com>
Tue, 27 Feb 2018 14:12:23 +0000 (15:12 +0100)
committerJan Beulich <jbeulich@suse.com>
Tue, 27 Feb 2018 14:12:23 +0000 (15:12 +0100)
commit1f1d183d49008794b087cf043fc77f724a45af98
tree377ae54c8cf5f68855df181104a955883733bae1
parent40681735502648fdc45973382a440aa38f4ec800
x86/HVM: don't give the wrong impression of WRMSR succeeding

... for non-existent MSRs: wrmsr_hypervisor_regs()'s comment clearly
says that the function returns 0 for unrecognized MSRs, so
{svm,vmx}_msr_write_intercept() should not convert this into success. We
don't want to unconditionally fail the access though, as we can't be
certain the list of handled MSRs is complete enough for the guest types
we care about, so instead mirror what we do on the read paths and probe
the MSR to decide whether to raise #GP.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Kevin Tian <kevin.tian@intel.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
xen/arch/x86/hvm/svm/svm.c
xen/arch/x86/hvm/vmx/vmx.c