Re: [PATCH 1/2] KVM: x86: disable MPX if host did not enable MPX XSAVE features

2016-05-10 Thread Paolo Bonzini
On 13/04/2016 11:47, Yang Zhang wrote: > On 2016/3/24 21:07, Paolo Bonzini wrote: >> >> >> On 24/03/2016 14:06, Yang Zhang wrote: >>> >>> I mean why not keep the old way that only activate the eager_fpu while >>> guest sees the MPX bit in CPUID, like: >>> >>> vcpu->arch.eager_fpu = use_eager_fpu(

Re: [PATCH 1/2] KVM: x86: disable MPX if host did not enable MPX XSAVE features

2016-04-13 Thread Yang Zhang
On 2016/3/24 21:07, Paolo Bonzini wrote: On 24/03/2016 14:06, Yang Zhang wrote: I mean why not keep the old way that only activate the eager_fpu while guest sees the MPX bit in CPUID, like: vcpu->arch.eager_fpu = use_eager_fpu() && guest_cpuid_has_mpx(vcpu); If the host uses eager FPU you

Re: [PATCH 1/2] KVM: x86: disable MPX if host did not enable MPX XSAVE features

2016-03-24 Thread Paolo Bonzini
On 24/03/2016 14:06, Yang Zhang wrote: > > I mean why not keep the old way that only activate the eager_fpu while > guest sees the MPX bit in CPUID, like: > > vcpu->arch.eager_fpu = use_eager_fpu() && guest_cpuid_has_mpx(vcpu); If the host uses eager FPU you can assume that it's faster than la

Re: [PATCH 1/2] KVM: x86: disable MPX if host did not enable MPX XSAVE features

2016-03-24 Thread Yang Zhang
On 2016/3/11 20:09, Paolo Bonzini wrote: Sorry for the late reply. On 11/03/2016 03:37, Yang Zhang wrote: @@ -97,7 +104,7 @@ int kvm_update_cpuid(struct kvm_vcpu *vcpu) if (best && (best->eax & (F(XSAVES) | F(XSAVEC best->ebx = xstate_required_size(vcpu->arch.xcr0

Re: [PATCH 1/2] KVM: x86: disable MPX if host did not enable MPX XSAVE features

2016-03-11 Thread Paolo Bonzini
On 11/03/2016 03:37, Yang Zhang wrote: >> @@ -97,7 +104,7 @@ int kvm_update_cpuid(struct kvm_vcpu *vcpu) >> if (best && (best->eax & (F(XSAVES) | F(XSAVEC >> best->ebx = xstate_required_size(vcpu->arch.xcr0, true); >> >> -vcpu->arch.eager_fpu = use_eager_fpu() || gues

[PATCH 1/2] KVM: x86: disable MPX if host did not enable MPX XSAVE features

2016-03-08 Thread Paolo Bonzini
When eager FPU is disabled, KVM will still see the MPX bit in CPUID and presumably the MPX vmentry and vmexit controls. However, it will not be able to expose the MPX XSAVE features to the guest, because the guest's accessible XSAVE features are always a subset of host_xcr0. In this case, we shou