lkml.org 
[lkml]   [2021]   [Dec]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    From
    SubjectRe: [PATCH v2 08/23] x86/fpu: Provide fpu_update_guest_perm_features() for guest
    Date
    eviewed-by: Thomas Gleixner <tglx@linutronix.de>
    On Fri, Dec 17 2021 at 07:29, Jing Liu wrote:
    > +/*
    > + * fpu_update_guest_perm_features - Enable xfeatures according to guest perm
    > + * @guest_fpu: Pointer to the guest FPU container
    > + *
    > + * Enable all dynamic xfeatures according to guest perm. Invoked if the
    > + * caller wants to conservatively expand fpstate buffer instead of waiting
    > + * until XCR0 or XFD MSR is written.
    > + *
    > + * Return: 0 on success, error code otherwise
    > + */
    > +int fpu_update_guest_perm_features(struct fpu_guest *guest_fpu)
    > +{
    > + u64 expand;
    > +
    > + lockdep_assert_preemption_enabled();
    > +
    > + if (!IS_ENABLED(CONFIG_X86_64))
    > + return 0;
    > +
    > + expand = guest_fpu->perm & ~guest_fpu->xfeatures;
    > + if (!expand)
    > + return 0;
    > +
    > + return __xfd_enable_feature(expand, guest_fpu);
    > +}
    > +EXPORT_SYMBOL_GPL(fpu_update_guest_perm_features);

    Reviewed-by: Thomas Gleixner <tglx@linutronix.de>

    \
     
     \ /
      Last update: 2021-12-17 19:51    [W:4.203 / U:0.012 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site