From nobody Tue Apr 7 12:44:02 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 06FABC4332F for ; Mon, 17 Oct 2022 13:47:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230012AbiJQNrm (ORCPT ); Mon, 17 Oct 2022 09:47:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42170 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229956AbiJQNrg (ORCPT ); Mon, 17 Oct 2022 09:47:36 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 433AC58DD7; Mon, 17 Oct 2022 06:47:35 -0700 (PDT) Date: Mon, 17 Oct 2022 13:47:32 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1666014453; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=RYRgwFQgQpDYP5WecjoI1bYhBCL6RdxmeiLAElFhWwY=; b=u7WleTcURbWvLQy7LWzgcd8+NqDyStSfsOUENOo9jiBro87pyyfm9obL092LSBswvrZzUW ecpArw43LdKd542EooWeLRfj9aY6QP2d81yUifrtbJ4Spfz2P4AelTV7LNw0iGqyhrT7ie JIYVvoAHqiKzWoQLYa4Mi03nD4bn95wrXlfV+v591IKKeBVoaRdYpvPi/08zeXiD3Ms+Dq MDe5KOWNcmdgXQWmjJFhwA7FNjO7YqvuJ7p5wtIcCxbu0LtPdS2FoyhK/aTy7AHYMbms2P v/dwmxQAiCpPo5bjQZTh86omZAVYHbyvFz/SrLuZK9SNW/XwEKC90pxBZ3fYiA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1666014453; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=RYRgwFQgQpDYP5WecjoI1bYhBCL6RdxmeiLAElFhWwY=; b=syq4pA0mfazDEMp5le6CZeJxDOcIP5nKqScoiImN5ec//N+Cxtkyg4cBG7sSdcKRV+t0hO XNMvQ7RVODzcIuCg== From: "tip-bot2 for Chang S. Bae" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: x86/urgent] x86/fpu: Configure init_fpstate attributes orderly Cc: "Chang S. Bae" , Thomas Gleixner , neelnatu@google.com, x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <20220824191223.1248-2-chang.seok.bae@intel.com> References: <20220824191223.1248-2-chang.seok.bae@intel.com> MIME-Version: 1.0 Message-ID: <166601445264.401.13144053597878691608.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The following commit has been merged into the x86/urgent branch of tip: Commit-ID: c32d7cab57e3a77af8ecc17cde7a5761a26483b8 Gitweb: https://git.kernel.org/tip/c32d7cab57e3a77af8ecc17cde7a5761a= 26483b8 Author: Chang S. Bae AuthorDate: Wed, 24 Aug 2022 12:12:21 -07:00 Committer: Thomas Gleixner CommitterDate: Mon, 17 Oct 2022 15:44:25 +02:00 x86/fpu: Configure init_fpstate attributes orderly The init_fpstate setup code is spread out and out of order. The init image is recorded before its scoped features and the buffer size are determined. Determine the scope of init_fpstate components and its size before recording the init state. Also move the relevant code together. Signed-off-by: Chang S. Bae Signed-off-by: Thomas Gleixner Acked-by: neelnatu@google.com Link: https://lore.kernel.org/r/20220824191223.1248-2-chang.seok.bae@intel.= com --- arch/x86/kernel/fpu/init.c | 8 -------- arch/x86/kernel/fpu/xstate.c | 6 +++++- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/arch/x86/kernel/fpu/init.c b/arch/x86/kernel/fpu/init.c index 621f4b6..8946f89 100644 --- a/arch/x86/kernel/fpu/init.c +++ b/arch/x86/kernel/fpu/init.c @@ -210,13 +210,6 @@ static void __init fpu__init_system_xstate_size_legacy= (void) fpstate_reset(¤t->thread.fpu); } =20 -static void __init fpu__init_init_fpstate(void) -{ - /* Bring init_fpstate size and features up to date */ - init_fpstate.size =3D fpu_kernel_cfg.max_size; - init_fpstate.xfeatures =3D fpu_kernel_cfg.max_features; -} - /* * Called on the boot CPU once per system bootup, to set up the initial * FPU state that is later cloned into all processes: @@ -236,5 +229,4 @@ void __init fpu__init_system(struct cpuinfo_x86 *c) fpu__init_system_xstate_size_legacy(); fpu__init_system_xstate(fpu_kernel_cfg.max_size); fpu__init_task_struct_size(); - fpu__init_init_fpstate(); } diff --git a/arch/x86/kernel/fpu/xstate.c b/arch/x86/kernel/fpu/xstate.c index c834015..f0ce106 100644 --- a/arch/x86/kernel/fpu/xstate.c +++ b/arch/x86/kernel/fpu/xstate.c @@ -360,7 +360,7 @@ static void __init setup_init_fpu_buf(void) =20 print_xstate_features(); =20 - xstate_init_xcomp_bv(&init_fpstate.regs.xsave, fpu_kernel_cfg.max_feature= s); + xstate_init_xcomp_bv(&init_fpstate.regs.xsave, init_fpstate.xfeatures); =20 /* * Init all the features state with header.xfeatures being 0x0 @@ -875,6 +875,10 @@ void __init fpu__init_system_xstate(unsigned int legac= y_size) update_regset_xstate_info(fpu_user_cfg.max_size, fpu_user_cfg.max_features); =20 + /* Bring init_fpstate size and features up to date */ + init_fpstate.size =3D fpu_kernel_cfg.max_size; + init_fpstate.xfeatures =3D fpu_kernel_cfg.max_features; + setup_init_fpu_buf(); =20 /*