Path: csiph.com!news.mixmin.net!aioe.org!gothmog.csi.it!bofh.it!news.nic.it!robomod From: Paolo Bonzini Newsgroups: linux.kernel Subject: Re: [PATCH 1/1] KVM: don't allow irq_fpu_usable when the VCPU's XCR0 is loaded Date: Mon, 14 Mar 2016 14:20:01 +0100 Message-ID: References: X-Original-To: David Matlack , Andy Lutomirski Dkim-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:subject:to:references:cc:from:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding; bh=i4/EugJ5Gd44IkqrAhrOsLKJDtzqoj+jJHMz65mnqxc=; b=L5jwwP7PI2ZJkxt+RHhaWnIAB/3PO5TANBOWmwZzsko6jQXS2rJzc5MFEm1a3hBVT+ V4rpAYCxNZ1YCzrfQCuoFoNB9eypv/zpRGDgFRI/uAMqbHgBfEeEoG7tnL/AyPCFUD5+ YiyS6ndIldouE0kGgB4V4ub4OrRAh70w4PL+ZfZBX61tmgM0LI5DXF3b073qip8Q6w9/ ZcheQLQKDguOFH5y2pqlT02etbx/SCOsg/AgT4lcXXzlt4kJlw6chjeL8KOQSqJTgpBr 3ZS85QRfyFRhkf4ujyvNw0Ep5mxT4Skl+KDDStQnumAxRXr6c0MRyfuvwnz5E/ovse4W RTKQ== X-Google-Dkim-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:subject:to:references:cc:from:message-id :date:user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=i4/EugJ5Gd44IkqrAhrOsLKJDtzqoj+jJHMz65mnqxc=; b=UmSK6TiKD2L2ZJmk/hMgl+WwHCuf3uPoO00AInTscg/woMIrGqKabXzgtRM21el8w3 6D9RoSQsFy9S4UKBJKQLEpOAChPDPmY2sPYQoX5sciQqhXscMs/M6AM9er5JUf2tQ9aA +g/E7sA0Dubi4xYj2ahC+F80B4xqmNBC0cItcSHJyioBTT20pqHsYmswdE+r6Psgv1k3 vtzNKr6fahhL7Gbpk2D1hjyzUhSxx1yR88I5iCyUFffEXwF6NVBypHLt4JnZf67eppxw jNvnKINBhrcVsxlfaxDb9kJhwAKPBKKQ9q1h+8VvZEQ6O94DhsSzwy1KswU5Fp+BCKBj vl2w== X-Gm-Message-State: AD7BkJKRelhsal9W7Rw3VIU0hT4vS9jhzs0oEmxLZsUTkCYKHwCmFeWu4gGH4RnJCHcHFA== X-Received: by 10.28.45.209 with SMTP id t200mr17821041wmt.71.1457961490670; Mon, 14 Mar 2016 06:18:10 -0700 (PDT) User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.6.0 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Sender: robomod@news.nic.it List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Approved: robomod@news.nic.it Lines: 23 Organization: linux.* mail to news gateway X-Original-Cc: "linux-kernel@vger.kernel.org" , X86 ML , kvm list , Ingo Molnar , Andrew Lutomirski , "H. Peter Anvin" , Eric Northup X-Original-Date: Mon, 14 Mar 2016 14:17:58 +0100 X-Original-Message-ID: <56E6BA06.7000907@redhat.com> X-Original-References: <1457729240-3846-1-git-send-email-dmatlack@google.com> <1457729240-3846-2-git-send-email-dmatlack@google.com> X-Original-Sender: linux-kernel-owner@vger.kernel.org Xref: csiph.com linux.kernel:1357229 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. Paolo ps: while Andy is planning to kill lazy FPU, I want to benchmark it with KVM... Remember that with a single pre-xsave host in your cluster, your virt management might happily default your VMs to a Westmere or Nehalem CPU model. GCC might be a pretty good testbench for this (e.g. a kernel compile with very high make -j), because outside of the lexer (which plays SIMD games) it never uses the FPU.