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


Groups > linux.kernel > #1356198

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

From David Matlack <dmatlack@google.com>
Newsgroups linux.kernel
Subject Re: [PATCH 1/1] KVM: don't allow irq_fpu_usable when the VCPU's XCR0 is loaded
Date 2016-03-11 22:40 +0100
Message-ID <rbCWR-3YT-1@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>
Organization linux.* mail to news gateway

Show all headers | View raw


On Fri, Mar 11, 2016 at 1:14 PM, Andy Lutomirski <luto@amacapital.net> wrote:
>
> On Fri, Mar 11, 2016 at 12:47 PM, David Matlack <dmatlack@google.com> wrote:
> > From: Eric Northup <digitaleric@google.com>
> >
> > Add a percpu boolean, tracking whether a KVM vCPU is running on the
> > host CPU.  KVM will set and clear it as it loads/unloads guest XCR0.
> > (Note that the rest of the guest FPU load/restore is safe, because
> > kvm_load_guest_fpu and kvm_put_guest_fpu call __kernel_fpu_begin()
> > and __kernel_fpu_end(), respectively.)  irq_fpu_usable() will then
> > also check for this percpu boolean.
>
> 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.

>
> --Andy

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