From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S966541AbcCPMBV (ORCPT ); Wed, 16 Mar 2016 08:01:21 -0400 Received: from mx1.redhat.com ([209.132.183.28]:52698 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S964964AbcCPMBR (ORCPT ); Wed, 16 Mar 2016 08:01:17 -0400 Subject: Re: [PATCH 1/1] KVM: don't allow irq_fpu_usable when the VCPU's XCR0 is loaded To: Xiao Guangrong , Andy Lutomirski References: <1457729240-3846-1-git-send-email-dmatlack@google.com> <1457729240-3846-2-git-send-email-dmatlack@google.com> <56E6BA06.7000907@redhat.com> <56E86366.10403@redhat.com> <56E8D919.7080002@linux.intel.com> Cc: David Matlack , "linux-kernel@vger.kernel.org" , X86 ML , kvm list , Ingo Molnar , Andrew Lutomirski , "H. Peter Anvin" , Eric Northup From: Paolo Bonzini Message-ID: <56E94B08.9030705@redhat.com> Date: Wed, 16 Mar 2016 13:01:12 +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: <56E8D919.7080002@linux.intel.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Wed, 16 Mar 2016 12:01:17 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 16/03/2016 04:55, Xiao Guangrong wrote: >>>>> >>>>> Probably not. AFAICT KVM does not rely on it being loaded outside that >>>>> region. xsetbv isn't insanely expensive, is it? Maybe to minimize the >>>>> time spent with interrupts disabled it was put outside. >>>>> >>>>> I do like that your solution would be contained to KVM. >>>> >>>> I agree with Andy. We do want a fix for recent kernels because of the >>>> !eager_fpu case that Guangrong mentioned. > > Relying on interrupt is not easy as XCR0 can not be automatically > saved/loaded by VMCS... Once interrupt happens, it will use guest's XCR0 anyway. Right, that's why an xsetbv while interrupts are disabled is appealing. Paolo