All of lore.kernel.org
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: Yang Zhang <yang.zhang.wz@gmail.com>
Cc: linux-kernel@vger.kernel.org, kvm@vger.kernel.org,
	Xiao Guangrong <guangrong.xiao@linux.intel.com>
Subject: Re: [PATCH 1/2] KVM: x86: disable MPX if host did not enable MPX XSAVE features
Date: Fri, 11 Mar 2016 13:09:47 +0100	[thread overview]
Message-ID: <56E2B58B.8020605@redhat.com> (raw)
In-Reply-To: <CA+3C=r-NVn__gPVdYRSypzjfejRBgB4VVY5OpckS2QGjXnUu2Q@mail.gmail.com>



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() || guest_cpuid_has_mpx(vcpu);
>> +	vcpu->arch.eager_fpu = use_eager_fpu();
> 
> Hi Paolo,
> 
> As i mentioned on another thread, force KVM to use eager fpu
> unconditionally may introduce the performance regression. Though the
> cost for eager fpu is very small especially in modern CPU, it still
> cannot be ignored on old platform.

This patch doesn't change anything in that respect.  It doesn't enable
eager FPU in any case where it wasn't already enabled before the patch.

All this patch does is hide MPX completely to the guests (just like it's
hidden on the host) if the host is using lazy FPU.

> And we have observed some performance
> decrease on those platforms according the result from some experiments
> which did several years ago.

Indeed after the merge window I plan to benchmark KVM on old systems
(pre-XSAVE) to see if there is a negative benefit from eager FPU.

Thanks,

Paolo

  parent reply	other threads:[~2016-03-11 12:09 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-08 11:44 [PATCH 0/2] KVM: x86: disable MPX if host did not enable MPX XSAVE features Paolo Bonzini
2016-03-08 11:44 ` [PATCH 1/2] " Paolo Bonzini
     [not found]   ` <CA+3C=r-NVn__gPVdYRSypzjfejRBgB4VVY5OpckS2QGjXnUu2Q@mail.gmail.com>
2016-03-11 12:09     ` Paolo Bonzini [this message]
2016-03-24 13:06       ` Yang Zhang
2016-03-24 13:07         ` Paolo Bonzini
2016-04-13  9:47           ` Yang Zhang
2016-05-10 12:38             ` Paolo Bonzini
2016-03-08 11:44 ` [PATCH 2/2] KVM: x86: remove eager_fpu field of struct kvm_vcpu_arch Paolo Bonzini
2016-03-10 12:28 ` [PATCH 0/2] KVM: x86: disable MPX if host did not enable MPX XSAVE features Xiao Guangrong
2016-03-10 12:30   ` Paolo Bonzini
2016-03-10 17:35     ` Ingo Molnar
2016-03-10 17:38       ` Paolo Bonzini

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=56E2B58B.8020605@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=guangrong.xiao@linux.intel.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=yang.zhang.wz@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.