Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752300AbbETFVI (ORCPT ); Wed, 20 May 2015 01:21:08 -0400 Received: from mga09.intel.com ([134.134.136.24]:54667 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751097AbbETFVD convert rfc822-to-8bit (ORCPT ); Wed, 20 May 2015 01:21:03 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.13,463,1427785200"; d="scan'208";a="712877165" From: "Zhang, Yang Z" To: "Li, Liang Z" , "kvm@vger.kernel.org" , "linux-kernel@vger.kernel.org" CC: "gleb@kernel.or" , "pbonzini@redhat.com" , "tglx@linutronix.de" , "mingo@redhat.com" , "hpa@zytor.com" , "x86@kernel.org" Subject: RE: [PATCH] kvm/fpu: Enable eager restore kvm FPU for MPX Thread-Topic: [PATCH] kvm/fpu: Enable eager restore kvm FPU for MPX Thread-Index: AQHQkqcPFMLOnVkLEkGfXnwzK3ao452EU40A Date: Wed, 20 May 2015 05:20:57 +0000 Message-ID: References: <1432132539-6194-1-git-send-email-liang.z.li@intel.com> In-Reply-To: <1432132539-6194-1-git-send-email-liang.z.li@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 8BIT MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1628 Lines: 48 Li, Liang Z wrote on 2015-05-20: > The MPX feature requires eager KVM FPU restore support. We have > verified that MPX cannot work correctly with the current lazy KVM FPU > restore mechanism. Eager KVM FPU restore should be enabled if the MPX > feature is exposed to VM. > > Signed-off-by: Liang Li > --- > arch/x86/kvm/vmx.c | 2 ++ > arch/x86/kvm/x86.c | 3 ++- > 2 files changed, 4 insertions(+), 1 deletion(-) > diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c index > f7b6168..e2cccbe 100644 --- a/arch/x86/kvm/vmx.c +++ > b/arch/x86/kvm/vmx.c @@ -8445,6 +8445,8 @@ static struct kvm_vcpu > *vmx_create_vcpu(struct kvm *kvm, unsigned int id) > goto free_vmcs; > } > + if (vmx_mpx_supported()) Is it better to use guest_cpuid_has_mpx() instead of vmx_mpx_supported()? > + vmx_fpu_activate(&vmx->vcpu); > return &vmx->vcpu; > > free_vmcs: > diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c index > 5f38188..5993f5f 100644 --- a/arch/x86/kvm/x86.c +++ > b/arch/x86/kvm/x86.c @@ -7060,7 +7060,8 @@ void kvm_put_guest_fpu(struct > kvm_vcpu *vcpu) > fpu_save_init(&vcpu->arch.guest_fpu); > __kernel_fpu_end(); > ++vcpu->stat.fpu_reload; > - kvm_make_request(KVM_REQ_DEACTIVATE_FPU, vcpu); > + if (!kvm_x86_ops->mpx_supported()) > + kvm_make_request(KVM_REQ_DEACTIVATE_FPU, vcpu); > trace_kvm_fpu(0); > } Best regards, Yang -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/