|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [PATCH v2 5/4] x86/hvm: Drop hvm_{get,set}_guest_bndcfgs() and use {get,set}_regs() instead
On 17.01.2022 20:25, Andrew Cooper wrote:
> hvm_{get,set}_guest_bndcfgs() are thin wrappers around accessing MSR_BNDCFGS.
>
> MPX was implemented on Skylake uarch CPUs and dropped in subsequent CPUs, and
> is disabled by default in Xen VMs.
>
> It would be nice to move all the logic into vmx_msr_{read,write}_intercept(),
> but the common HVM migration code uses guest_{rd,wr}msr(). Therefore, use
> {get,set}_regs() to reduce the quantity of "common" HVM code.
>
> In lieu of having hvm_set_guest_bndcfgs() split out, use some #ifdef
> CONFIG_HVM in guest_wrmsr(). In vmx_{get,set}_regs(), split the switch
> statements into two depending on whether the require remote VMCS acquisition
> or not.
>
> Signed-off-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
Reviewed-by: Jan Beulich <jbeulich@xxxxxxxx>
One remark:
> @@ -323,10 +324,9 @@ int guest_rdmsr(struct vcpu *v, uint32_t msr, uint64_t
> *val)
> break;
>
> case MSR_IA32_BNDCFGS:
> - if ( !cp->feat.mpx || !is_hvm_domain(d) ||
> - !hvm_get_guest_bndcfgs(v, val) )
> + if ( !cp->feat.mpx ) /* Implies Intel HVM only */
Wouldn't it make sense to accompany this comment by ...
> goto gp_fault;
> - break;
ASSERT(is_hvm_domain(d));
(and then the same on the "set" path)?
Jan
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |