Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp2334746rwd; Fri, 16 Jun 2023 02:30:45 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7gglBgZVGM4YAhx4aAq/nz6pzs4yU0vZGmieCv8v3NEgHNyCPmJhC7r/mNXvVZ6EalqHo9 X-Received: by 2002:a05:6a20:144e:b0:100:3964:6cb with SMTP id a14-20020a056a20144e00b00100396406cbmr2137070pzi.40.1686907845386; Fri, 16 Jun 2023 02:30:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686907845; cv=none; d=google.com; s=arc-20160816; b=yTqTj9ULG0mkWy0AWGwY7IAxEQNwgVH0SsHiDYZ7i+6pP0+VWzjqMBoeZkN7l82//0 3hT4vD8O4rEPjPth+JSZty4hxg2/xxH3TR/vo23PGZVHbdTOTavX2pahvXitepDIwCqg 71TxHj+DtSGpgtCK4EodBfh4085B4W/ZdybSb9txx/2tSrKh3ry5r7JKXA1S9Fh/KI9O mCaNfHZOe1ju679Ex53aJoSGF0jHos8EviqoJw2kagg080cUa8s0/0SGdpToaF6VgVNS rIluciSxibIgz437m+PfP2MHQ3QaddBauaGKRHVeG70MXAdv8QDWiDr0VCOfPdY4xOad 2esg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:robot-unsubscribe :robot-id:message-id:mime-version:references:in-reply-to:cc:subject :to:reply-to:sender:from:dkim-signature:dkim-signature:date; bh=MjTC0bn1c6tuURZzGvFsI612RvzdiyDdTjdWG5MDlzU=; b=gFOBVy4wAhNBxSIPP9IWiXgDZRpjfSD4W/cnGWnigYMFTOzbUc4iyMzQ5Z7ZXIGET5 Uo2Grl9wnfNDPLVUUtsmhR7iscAbx4y/w7oTxN6EQU81HbN5vdFXVEVy1rfcOsp/zMdD /OZtUHG1Y4oFS9yijuafW9C48x0CPvofwZ5rWqHlCCoD3Nd7lWCBbyfKmCHUcWbileU1 KSNeJAys8c3RUF8+Ox2NxopshYadipfKNJY4Md2onyP0ZvVJbMEQ0ytRSlc3Hh5UJMO+ A0kdItFtvg4tIGjWDa44OazKvR0L1q73gl7Pu4hhN8Gdbss0+2KxndjTEztic38a3c/6 nLYg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=wF2SmJWu; dkim=neutral (no key) header.i=@linutronix.de; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id k62-20020a638441000000b0054fdb953dc5si4809594pgd.703.2023.06.16.02.30.31; Fri, 16 Jun 2023 02:30:45 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=wF2SmJWu; dkim=neutral (no key) header.i=@linutronix.de; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1343868AbjFPJZH (ORCPT + 99 others); Fri, 16 Jun 2023 05:25:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41296 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1343991AbjFPJYt (ORCPT ); Fri, 16 Jun 2023 05:24:49 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C3E28271E; Fri, 16 Jun 2023 02:24:43 -0700 (PDT) Date: Fri, 16 Jun 2023 09:24:41 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1686907481; 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=MjTC0bn1c6tuURZzGvFsI612RvzdiyDdTjdWG5MDlzU=; b=wF2SmJWuNppxnWPNrs81++B5IdpKH61pDoL/tR9JOHqjEJ11/n1l9kOUl+fMgrnqxDlmIC O3kJfSi99UVFzWr/CHTxCxSKkvv/pYrCIIkobhmmkKL1NBgcYMvQ/8UjIcZWAeUpjfHPa0 5Un7u52oetO6mciwq2mQ3LCx5HuFcDl3PZYaixL9gGGPF8Bs/StdWXZbQTZm8Kf7J4duXr vXY98MKyEbxZZFdN4Tchya+kHmW18OJhG12M5Y3JfRgQDFrSBTdSgZw0vdfhf/3fxH3UvV zOFEUtuvKYT4+6mxhqowa+7YMnuES9zZY0KqJkBcvpjTO5tdK4rKvAmd6Qsghg== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1686907481; 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=MjTC0bn1c6tuURZzGvFsI612RvzdiyDdTjdWG5MDlzU=; b=ezM+NdLbqduyvN1oe2vodJ+TxHZ91y5g1UqcEsjacSf7udrLhxZwVLGp7VrOW6RVoKN4uD NN6UEWF2qkSMRuCw== From: "tip-bot2 for Thomas Gleixner" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: x86/boot] x86/fpu: Move FPU initialization into arch_cpu_finalize_init() Cc: Thomas Gleixner , x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <20230613224545.902376621@linutronix.de> References: <20230613224545.902376621@linutronix.de> MIME-Version: 1.0 Message-ID: <168690748113.404.13314023725457189436.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: 7bit X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The following commit has been merged into the x86/boot branch of tip: Commit-ID: b81fac906a8f9e682e513ddd95697ec7a20878d4 Gitweb: https://git.kernel.org/tip/b81fac906a8f9e682e513ddd95697ec7a20878d4 Author: Thomas Gleixner AuthorDate: Wed, 14 Jun 2023 01:39:46 +02:00 Committer: Thomas Gleixner CommitterDate: Fri, 16 Jun 2023 10:16:01 +02:00 x86/fpu: Move FPU initialization into arch_cpu_finalize_init() Initializing the FPU during the early boot process is a pointless exercise. Early boot is convoluted and fragile enough. Nothing requires that the FPU is set up early. It has to be initialized before fork_init() because the task_struct size depends on the FPU register buffer size. Move the initialization to arch_cpu_finalize_init() which is the perfect place to do so. No functional change. This allows to remove quite some of the custom early command line parsing, but that's subject to the next installment. Signed-off-by: Thomas Gleixner Link: https://lore.kernel.org/r/20230613224545.902376621@linutronix.de --- arch/x86/kernel/cpu/common.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/arch/x86/kernel/cpu/common.c b/arch/x86/kernel/cpu/common.c index 2807e5b..46ebdd6 100644 --- a/arch/x86/kernel/cpu/common.c +++ b/arch/x86/kernel/cpu/common.c @@ -1604,8 +1604,6 @@ static void __init early_identify_cpu(struct cpuinfo_x86 *c) sld_setup(c); - fpu__init_system(); - #ifdef CONFIG_X86_32 /* * Regardless of whether PCID is enumerated, the SDM says @@ -2287,8 +2285,6 @@ void cpu_init(void) doublefault_init_cpu_tss(); - fpu__init_cpu(); - if (is_uv_system()) uv_cpu_init(); @@ -2304,6 +2300,7 @@ void cpu_init_secondary(void) */ cpu_init_exception_handling(); cpu_init(); + fpu__init_cpu(); } #endif @@ -2396,6 +2393,13 @@ void __init arch_cpu_finalize_init(void) '0' + (boot_cpu_data.x86 > 6 ? 6 : boot_cpu_data.x86); } + /* + * Must be before alternatives because it might set or clear + * feature bits. + */ + fpu__init_system(); + fpu__init_cpu(); + alternative_instructions(); if (IS_ENABLED(CONFIG_X86_64)) {