Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1357229

Re: [PATCH 1/1] KVM: don't allow irq_fpu_usable when the VCPU's XCR0 is loaded

Path csiph.com!news.mixmin.net!aioe.org!gothmog.csi.it!bofh.it!news.nic.it!robomod
From Paolo Bonzini <pbonzini@redhat.com>
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 <rcAzD-4e2-9@gated-at.bofh.it> (permalink)
References <rbCat-3jh-1@gated-at.bofh.it> <rbCau-3jh-3@gated-at.bofh.it> <rbCDw-3NU-23@gated-at.bofh.it> <rbCWR-3YT-1@gated-at.bofh.it>
X-Original-To David Matlack <dmatlack@google.com>, Andy Lutomirski <luto@amacapital.net>
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 <linux-kernel.vger.kernel.org>
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" <linux-kernel@vger.kernel.org>, X86 ML <x86@kernel.org>, kvm list <kvm@vger.kernel.org>, Ingo Molnar <mingo@redhat.com>, Andrew Lutomirski <luto@kernel.org>, "H. Peter Anvin" <hpa@zytor.com>, Eric Northup <digitaleric@google.com>
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> <CALCETrVc-GaqWC+MZm08YOUCMumzQ-TJK4h296LMtpQPdPS=0Q@mail.gmail.com> <CALzav=dRU9svdrF-CBKc_zfgz9ziAhJ8bkyPeMZV9T9jxOMdRg@mail.gmail.com>
X-Original-Sender linux-kernel-owner@vger.kernel.org
Xref csiph.com linux.kernel:1357229

Show key headers only | View raw



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.

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 0/1] KVM: x86: using the fpu in interrupt context with a guest's xcr0 David Matlack <dmatlack@google.com> - 2016-03-11 21:50 +0100
  [PATCH 1/1] KVM: don't allow irq_fpu_usable when the VCPU's XCR0 is loaded David Matlack <dmatlack@google.com> - 2016-03-11 21:50 +0100
    Re: [PATCH 1/1] KVM: don't allow irq_fpu_usable when the VCPU's XCR0  is loaded Andy Lutomirski <luto@amacapital.net> - 2016-03-11 22:20 +0100
      Re: [PATCH 1/1] KVM: don't allow irq_fpu_usable when the VCPU's XCR0  is loaded David Matlack <dmatlack@google.com> - 2016-03-11 22:40 +0100
        Re: [PATCH 1/1] KVM: don't allow irq_fpu_usable when the VCPU's XCR0  is loaded Paolo Bonzini <pbonzini@redhat.com> - 2016-03-14 14:20 +0100
          Re: [PATCH 1/1] KVM: don't allow irq_fpu_usable when the VCPU's XCR0  is loaded Andy Lutomirski <luto@amacapital.net> - 2016-03-15 19:30 +0100
            Re: [PATCH 1/1] KVM: don't allow irq_fpu_usable when the VCPU's XCR0  is loaded Paolo Bonzini <pbonzini@redhat.com> - 2016-03-15 20:40 +0100
              Re: [PATCH 1/1] KVM: don't allow irq_fpu_usable when the VCPU's XCR0  is loaded Xiao Guangrong <guangrong.xiao@linux.intel.com> - 2016-03-16 05:00 +0100
                Re: [PATCH 1/1] KVM: don't allow irq_fpu_usable when the VCPU's XCR0  is loaded Paolo Bonzini <pbonzini@redhat.com> - 2016-03-16 13:10 +0100
  Re: [PATCH 0/1] KVM: x86: using the fpu in interrupt context with a  guest's xcr0 Xiao Guangrong <guangrong.xiao@linux.intel.com> - 2016-03-14 08:50 +0100
    Re: [PATCH 0/1] KVM: x86: using the fpu in interrupt context with a  guest's xcr0 David Matlack <dmatlack@google.com> - 2016-03-15 20:10 +0100
      Re: [PATCH 0/1] KVM: x86: using the fpu in interrupt context with a  guest's xcr0 Xiao Guangrong <guangrong.xiao@linux.intel.com> - 2016-03-16 04:50 +0100
        Re: [PATCH 0/1] KVM: x86: using the fpu in interrupt context with a  guest's xcr0 Andy Lutomirski <luto@amacapital.net> - 2016-03-16 04:50 +0100
          Re: [PATCH 0/1] KVM: x86: using the fpu in interrupt context with a  guest's xcr0 David Matlack <dmatlack@google.com> - 2016-03-16 18:20 +0100
        Re: [PATCH 0/1] KVM: x86: using the fpu in interrupt context with a  guest's xcr0 David Matlack <dmatlack@google.com> - 2016-03-16 18:10 +0100

csiph-web