Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1364144
| Path | csiph.com!news.mixmin.net!aioe.org!bofh.it!news.nic.it!robomod |
|---|---|
| From | Yang Zhang <yang.zhang.wz@gmail.com> |
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH 1/2] KVM: x86: disable MPX if host did not enable MPX XSAVE features |
| Date | Thu, 24 Mar 2016 14:10:02 +0100 |
| Message-ID | <rgdbr-34K-3@gated-at.bofh.it> (permalink) |
| References | <raojg-hv-9@gated-at.bofh.it> <raojg-hv-7@gated-at.bofh.it> <rbucW-69h-13@gated-at.bofh.it> <rbucW-69h-11@gated-at.bofh.it> |
| X-Original-To | Paolo Bonzini <pbonzini@redhat.com> |
| Dkim-Signature | v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=subject:to:references:cc:from:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding; bh=nSgknPc/t18iXhS0CifKnWHM5TqA3Ko10UOZyXMk9PU=; b=CkHD0/+9T6h3Rnk7lLSLrZV/MnZdM1PLqZb+oJqxAyeGwDE2I4xKznK0mn0/cwXWcl cbn8D7lZGU1+wG69aXzsVAMQZLV0s1dfw4Q6maipRJJPLND0szVmPavYpFABwgAVP+0l WfGdozodMoKfhXgczbQbySzGXYCzGvUjoV7YQp6+8Y+3ehmgcavAO9y53LQ+Lz9NoQdd Sh57JnG8pKi8Y2TK4ikKT3MWx8gXe++zk+MoDjZ8f/uyF+uki4AnqLdtZFETziCgUlHq VRYavcV6QmSn01rZ7wfLjUAKzWsQOvGY/SO3lNbaebh2mkEq1RPSpe5t5l0tEsNFaqy6 3/3Q== |
| X-Google-Dkim-Signature | v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:to:references:cc:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=nSgknPc/t18iXhS0CifKnWHM5TqA3Ko10UOZyXMk9PU=; b=HqWWFQOozZZ4TC1DTGul9brCZ7FVFIB/+brKPmXr5Lly5qzU83fz+QFkUPh2qxi2aH JoEHQOz1K1M/zycCuDdf3M6F6PJyuihcdntHRw4ivZk2Fl2CvESXQ7D2tIUWX8+AStCW tb/dEWxNSHPWqXJLNSz4SHgkYOJO/NT90tB1650aeMnqkPZMrEXamtx9KOXHO5HNWSpt wrzQBaL3WddojtGvnvFZ4Dl0w9X72UobJS9yYz/gfLwuqs+vRMeNV5BsuXFGGggBb2i2 h/9ShMKOV88mcFilNR1ReFBEEODBeDx+MOI36OewuaQ/5tJJRGeVBd8V85EAUJt5/VPf BcUw== |
| X-Gm-Message-State | AD7BkJLY4529A/sATPbn/ZFK4Gk119nJR8ZqFah3wkmZAbyOHAHWaYpZzB459yC0wBeTCQ== |
| X-Received | by 10.98.10.156 with SMTP id 28mr12595346pfk.130.1458824791231; Thu, 24 Mar 2016 06:06:31 -0700 (PDT) |
| User-Agent | Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.6.0 |
| MIME-Version | 1.0 |
| Content-Type | text/plain; charset=utf-8; format=flowed |
| Content-Transfer-Encoding | 7bit |
| Sender | robomod@news.nic.it |
| List-ID | <linux-kernel.vger.kernel.org> |
| X-Mailing-List | linux-kernel@vger.kernel.org |
| Approved | robomod@news.nic.it |
| Lines | 36 |
| Organization | linux.* mail to news gateway |
| X-Original-Cc | linux-kernel@vger.kernel.org, kvm@vger.kernel.org, Xiao Guangrong <guangrong.xiao@linux.intel.com> |
| X-Original-Date | Thu, 24 Mar 2016 21:06:27 +0800 |
| X-Original-Message-ID | <56F3E653.6040901@gmail.com> |
| X-Original-References | <1457437481-65784-1-git-send-email-pbonzini@redhat.com> <1457437481-65784-2-git-send-email-pbonzini@redhat.com> <CA+3C=r-NVn__gPVdYRSypzjfejRBgB4VVY5OpckS2QGjXnUu2Q@mail.gmail.com> <56E2B58B.8020605@redhat.com> |
| X-Original-Sender | linux-kernel-owner@vger.kernel.org |
| Xref | csiph.com linux.kernel:1364144 |
Show key headers only | View raw
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, 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. 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); Besides, vmx_fpu_activate is called when do vcpu_reset. So it seems no need to call fpu_activate() here again. -- best regards yang
Back to linux.kernel | Previous | Next | Find similar | Unroll thread
Re: [PATCH 1/2] KVM: x86: disable MPX if host did not enable MPX XSAVE features Yang Zhang <yang.zhang.wz@gmail.com> - 2016-03-24 14:10 +0100
csiph-web