[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <87wnk3awwf.ffs@tglx>
Date: Fri, 17 Dec 2021 19:50:24 +0100
From: Thomas Gleixner <tglx@...utronix.de>
To: Jing Liu <jing2.liu@...el.com>, x86@...nel.org,
kvm@...r.kernel.org, linux-kernel@...r.kernel.org,
mingo@...hat.com, bp@...en8.de, dave.hansen@...ux.intel.com,
pbonzini@...hat.com
Cc: seanjc@...gle.com, jun.nakajima@...el.com, kevin.tian@...el.com,
jing2.liu@...ux.intel.com, jing2.liu@...el.com,
guang.zeng@...el.com, wei.w.wang@...el.com, yang.zhong@...el.com
Subject: Re: [PATCH v2 08/23] x86/fpu: Provide
fpu_update_guest_perm_features() for guest
eviewed-by: Thomas Gleixner <tglx@...utronix.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@...utronix.de>
Powered by blists - more mailing lists