Re: [PATCH v2 21/66] KVM: x86: Use supported_xcr0 to detect MPX support

From: Paolo Bonzini
Date: Tue Mar 03 2020 - 09:34:15 EST


On 03/03/20 00:56, Sean Christopherson wrote:
>
> bool kvm_mpx_supported(void)
> {
> - return ((host_xcr0 & (XFEATURE_MASK_BNDREGS | XFEATURE_MASK_BNDCSR))
> - && kvm_x86_ops->mpx_supported());
> + return supported_xcr0 & (XFEATURE_MASK_BNDREGS | XFEATURE_MASK_BNDCSR);
> }

Better check that both bits are set.

Paolo