Re: [PATCH v9 1/5] x86/xsave: Move xsave initialization to after parsing early parameters

From: Ingo Molnar
Date: Thu Oct 12 2017 - 03:18:49 EST



* Andi Kleen <andi@xxxxxxxxxxxxxx> wrote:

> From: Andi Kleen <ak@xxxxxxxxxxxxxxx>
>
> Move the XSAVE initialization code to be after parsing early parameters.
> I don't see any reason why the FPU code needs to be initialized that
> early, nothing else in the initialization phase uses XSAVE.
> This is useful to be able to handle command line parameters in the
> XSAVE initialization code.

But that's not what the patch does:

> ---
> arch/x86/kernel/cpu/common.c | 2 --
> arch/x86/kernel/setup.c | 3 +++
> 2 files changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/arch/x86/kernel/cpu/common.c b/arch/x86/kernel/cpu/common.c
> index c9176bae7fd8..fd47692e5ce9 100644
> --- a/arch/x86/kernel/cpu/common.c
> +++ b/arch/x86/kernel/cpu/common.c
> @@ -903,8 +903,6 @@ static void __init early_identify_cpu(struct cpuinfo_x86 *c)
> }
>
> setup_force_cpu_cap(X86_FEATURE_ALWAYS);
> - fpu__init_system(c);

This moves the early _FPU_ initialization code, which is more than just xstate
related...

Also, this is fundamentally a CPU initialization sequence, and this change
detaches it from the early CPU initialization code. If you want to parse early
parameters you can add it to fpu__init_parse_early_param() which is there for that
exact reason.

Also, please fix the titles of your patches as well, you routinely get the
prefixes wrong, 'git log' should give you an idea about what the current title
pattern is for FPU code modifications.

Thanks,

Ingo