From mboxrd@z Thu Jan 1 00:00:00 1970 From: Xiao Guangrong Subject: Re: [PATCH 1/1] KVM: don't allow irq_fpu_usable when the VCPU's XCR0 is loaded Date: Wed, 16 Mar 2016 11:55:05 +0800 Message-ID: <56E8D919.7080002@linux.intel.com> 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> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Cc: David Matlack , "linux-kernel@vger.kernel.org" , X86 ML , kvm list , Ingo Molnar , Andrew Lutomirski , "H. Peter Anvin" , Eric Northup To: Paolo Bonzini , Andy Lutomirski Return-path: In-Reply-To: <56E86366.10403@redhat.com> Sender: linux-kernel-owner@vger.kernel.org List-Id: kvm.vger.kernel.org On 03/16/2016 03:32 AM, Paolo Bonzini wrote: > > > On 15/03/2016 19:27, Andy Lutomirski wrote: >> On Mon, Mar 14, 2016 at 6:17 AM, Paolo Bonzini wrote: >>> >>> >>> On 11/03/2016 22:33, David Matlack wrote: >>>>> Is this better than just always keeping the host's XCR0 loaded outside >>>>> if the KVM interrupts-disabled region? >>>> >>>> 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.