Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757549AbcCXNIK (ORCPT ); Thu, 24 Mar 2016 09:08:10 -0400 Received: from mx1.redhat.com ([209.132.183.28]:57008 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750972AbcCXNIA (ORCPT ); Thu, 24 Mar 2016 09:08:00 -0400 Subject: Re: [PATCH 1/2] KVM: x86: disable MPX if host did not enable MPX XSAVE features To: Yang Zhang References: <1457437481-65784-1-git-send-email-pbonzini@redhat.com> <1457437481-65784-2-git-send-email-pbonzini@redhat.com> <56E2B58B.8020605@redhat.com> <56F3E653.6040901@gmail.com> Cc: linux-kernel@vger.kernel.org, kvm@vger.kernel.org, Xiao Guangrong From: Paolo Bonzini Message-ID: <56F3E6AB.5070902@redhat.com> Date: Thu, 24 Mar 2016 14:07:55 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.6.0 MIME-Version: 1.0 In-Reply-To: <56F3E653.6040901@gmail.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 430 Lines: 15 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 lazy FPU. Paolo > Besides, vmx_fpu_activate is called when do vcpu_reset. So it seems no > need to call fpu_activate() here again.