diff options
author | Paul Durrant <paul.durrant@citrix.com> | 2019-03-14 14:56:00 +0100 |
---|---|---|
committer | Jan Beulich <jbeulich@suse.com> | 2019-04-09 15:06:40 +0200 |
commit | 832c1803ca71fdb1526384d43c24b158a25f4639 (patch) | |
tree | 8f665d2053cea803f1b0e566dfd208ce635501be /xen/arch/x86/msr.c | |
parent | 5ba1c5d0641cf63086b3058e547fcd28c3c4a011 (diff) |
x86: stop handling MSR_IA32_BNDCFGS 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.
NOTE: Because vmx_get/set_guest_bndcfgs() call vmx_vmcs_enter(), the
struct vcpu pointer passed in, and hence the vcpu pointer passed to
guest_rdmsr() cannot be const.
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.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/xen/arch/x86/msr.c b/xen/arch/x86/msr.c index d1a646160a..48f3a94f5b 100644 --- a/xen/arch/x86/msr.c +++ b/xen/arch/x86/msr.c @@ -181,6 +181,16 @@ int guest_rdmsr(const struct vcpu *v, uint32_t msr, uint64_t *val) ret = guest_rdmsr_x2apic(v, msr, val); break; + case MSR_IA32_BNDCFGS: + if ( !cp->feat.mpx ) + goto gp_fault; + + ASSERT(is_hvm_domain(d)); + if (!hvm_get_guest_bndcfgs(v, val) ) + goto gp_fault; + + break; + case 0x40000000 ... 0x400001ff: if ( is_viridian_domain(d) ) { @@ -357,6 +367,16 @@ int guest_wrmsr(struct vcpu *v, uint32_t msr, uint64_t val) ret = guest_wrmsr_x2apic(v, msr, val); break; + case MSR_IA32_BNDCFGS: + if ( !cp->feat.mpx ) + goto gp_fault; + + ASSERT(is_hvm_domain(d)); + if ( !hvm_set_guest_bndcfgs(v, val) ) + goto gp_fault; + + break; + case 0x40000000 ... 0x400001ff: if ( is_viridian_domain(d) ) { |