Re: [patch V4 07/65] x86/fpu: Move inlines where they belong
From: Bae, Chang Seok
Date: Wed Jun 23 2021 - 14:43:20 EST
On Jun 23, 2021, at 05:01, Thomas Gleixner <tglx@xxxxxxxxxxxxx> wrote:
>
> They are only used in fpstate_init() and there is no point to have them in
> a header just to make reading the code harder.
<snip>
> -static inline void fpstate_init_xstate(struct xregs_state *xsave)
> -{
> - /*
> - * XRSTORS requires these bits set in xcomp_bv, or it will
> - * trigger #GP:
> - */
> - xsave->header.xcomp_bv = XCOMP_BV_COMPACTED_FORMAT | xfeatures_mask_all;
> -}
static void __init setup_init_fpu_buf(void)
{
...
if (boot_cpu_has(X86_FEATURE_XSAVES))
init_fpstate.xsave.header.xcomp_bv = XCOMP_BV_COMPACTED_FORMAT |
xfeatures_mask_all;
But this line [1] can be exactly replaced with the inline function above. At
least, I don’t see consistency on the mainline.
[1] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/arch/x86/kernel/fpu/xstate.c#n460
Thanks,
Chang