lkml.org 
[lkml]   [2019]   [Dec]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v8 6/7] KVM: X86: Load guest fpu state when accessing MSRs managed by XSAVES
On Tue, Dec 10, 2019 at 01:27:48PM -0800, Sean Christopherson wrote:
> On Fri, Nov 01, 2019 at 04:52:21PM +0800, Yang Weijiang wrote:
> > From: Sean Christopherson <sean.j.christopherson@intel.com>
> >

> > - for (i = 0; i < msrs->nmsrs; ++i)
> > + for (i = 0; i < msrs->nmsrs; ++i) {
> > + if (!fpu_loaded && cet_xss &&
> > + is_xsaves_msr(entries[i].index)) {
> > + kvm_load_guest_fpu(vcpu);
>
> This needs to also check for a non-NULL @vcpu. KVM_GET_MSR can be called
> on the VM to invoke do_get_msr_feature().
>
Yeah, I need to add the check, thanks!

> > + fpu_loaded = true;
> > + }
> > if (do_msr(vcpu, entries[i].index, &entries[i].data))
> > break;
> > + }
> > + if (fpu_loaded)
> > + kvm_put_guest_fpu(vcpu);
> >
> > return i;
> > }
> > --
> > 2.17.2
> >

\
 
 \ /
  Last update: 2019-12-11 03:03    [W:0.054 / U:5.384 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site