Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp1918059rwd; Tue, 13 Jun 2023 16:48:22 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5+im8zrUvmC5j1wXRO6GLG79Uxtdn4y+t5Q6vGKytqxtDnAQ95GPkrYrfFEcDRHt+Vkxfp X-Received: by 2002:a05:6402:44d:b0:4be:b39b:ea8f with SMTP id p13-20020a056402044d00b004beb39bea8fmr7837617edw.2.1686700102348; Tue, 13 Jun 2023 16:48:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686700102; cv=none; d=google.com; s=arc-20160816; b=0S+dfSlzflPyg6jiP3v/AdnqLRjKoMJzKykfQNi/LzyqDN/U1yWhk16sEUZZPUtile aLifuvh4IHMD2XijxlV9/OiOg4eT3oJNjRcJTPPh/mg7a11H6xF/apaDAZfXmcbTVEtq gZpCzC5IswVGRZsSEw7Kr7tkHOOH+XqrMA0mSpq9sMLy4ykKts1MSjgpxQJ8cEVv+P0H IU+gUwTMgv0vdpuqpscJ3qkkco87GQfy/VItzllgrzFtuAVRTjbBYTOV8cA8fANVJV/w RYlC1jxqwM9PXhFxkFBrImZZ51gY+8ATr5ycqGEidJxRHECqRlXPKZJWlX/xGKhQtQ5X 3+lA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:date:mime-version:references:subject:cc:to:from :dkim-signature:dkim-signature:message-id; bh=3CR6tgLD7rhzvqZr45BM9V80YjsrczzKijoUucNo/+c=; b=M/KgdHV9TsxnxaXQO2KZSiX+BEyHq4hojChs4gEtxf86G11IPIMeygjXF4jflx5E2h cfROm+VR9kkd7yD2XvL2F+A5hyXmiAk+DVndXtmYtc8fic0iL4kMP81BNh9/hegYdNLA +x/okdsomXzQCVq1phlrp5ylB3gBXhXgDSh3UNn7sUeCMk4gLY14zgA++GCpG2jGfHDQ z/ebyVK4fr3VVHHN9BRYq2jUcUiE97hurj4gJiUvv21vLbn4ZzEU6R4ZpgNjJND3WyhI xSLOWYuRVr+/LT6wVtHTzd7lPvPjatb7Fq/tu59UTOT7XGxZ4FyrV2tUB9SRWdE68Aa0 jkkg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=EYe7iiF4; dkim=neutral (no key) header.i=@linutronix.de header.b=LPsNrGxE; 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 e23-20020a056402105700b005186d4fd448si2012573edu.575.2023.06.13.16.47.57; Tue, 13 Jun 2023 16:48:22 -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=EYe7iiF4; dkim=neutral (no key) header.i=@linutronix.de header.b=LPsNrGxE; 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 S241844AbjFMXlP (ORCPT + 99 others); Tue, 13 Jun 2023 19:41:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34300 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241188AbjFMXkF (ORCPT ); Tue, 13 Jun 2023 19:40:05 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B7B5C2117; Tue, 13 Jun 2023 16:39:44 -0700 (PDT) Message-ID: <20230613224545.727330699@linutronix.de> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1686699583; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: references:references; bh=3CR6tgLD7rhzvqZr45BM9V80YjsrczzKijoUucNo/+c=; b=EYe7iiF4scXvDMgiUbwXL/T+lduiRzS+SJhlEvazCoZJUCrGp1Hz5rf4m3IdPtjj8cDzzT oqHy2cl14gT+kMatDcbzWhLVe1PSnOyYVUFJPfQrT6U/YkVka5VPoxtUN9BEUfAS5YOkGU Bmv0b6/gTsXmP5xxTF5Gjn2rfGlKqFgbbrVhcewOMPGxUpVD3LhL5DRzVP+rlCGXe22osw IMvwikGyopJ7RkqTUMst4sZXg8rS7/bZ8HQ2sJMUFdCNsVjh6otKPg6G3uoZhB2yEl8rf6 RUSzPq6J2UzRKMuVBo3SW8O1838X+cq4La+hJ0Uc9YVzwnEQGwLfR1FJb+8z2g== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1686699583; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: references:references; bh=3CR6tgLD7rhzvqZr45BM9V80YjsrczzKijoUucNo/+c=; b=LPsNrGxEP8Km+tZv8qRIJtaALFJmiJBfXpv6Uvz8QfFEr/ZN23NzxBgtjM8dYII5szXKtk mtfRZq8oVXIvAnCg== From: Thomas Gleixner To: LKML Cc: x86@kernel.org, Linus Torvalds , Nikolay Borisov , "Ahmed S. Darwish" , Arnd Bergmann , Russell King , linux-arm-kernel@lists.infradead.org, linux-ia64@vger.kernel.org, Huacai Chen , WANG Xuerui , loongarch@lists.linux.dev, Geert Uytterhoeven , linux-m68k@lists.linux-m68k.org, Thomas Bogendoerfer , linux-mips@vger.kernel.org, Yoshinori Sato , Rich Felker , John Paul Adrian Glaubitz , linux-sh@vger.kernel.org, "David S. Miller" , sparclinux@vger.kernel.org, Richard Weinberger , Anton Ivanov , Johannes Berg , linux-um@lists.infradead.org, Richard Henderson , "James E.J. Bottomley" , Michael Ellerman , Chris Zankel , Tom Lendacky Subject: [patch 14/17] x86/init: Initialize signal frame size late References: <20230613223827.532680283@linutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Date: Wed, 14 Jun 2023 01:39:42 +0200 (CEST) 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 No point in doing this during really early boot. Move it to an early initcall so that it is set up before possible user mode helpers are started during device initialization. Signed-off-by: Thomas Gleixner --- arch/x86/include/asm/sigframe.h | 2 -- arch/x86/kernel/cpu/common.c | 3 --- arch/x86/kernel/signal.c | 4 +++- 3 files changed, 3 insertions(+), 6 deletions(-) --- a/arch/x86/include/asm/sigframe.h +++ b/arch/x86/include/asm/sigframe.h @@ -85,6 +85,4 @@ struct rt_sigframe_x32 { #endif /* CONFIG_X86_64 */ -void __init init_sigframe_size(void); - #endif /* _ASM_X86_SIGFRAME_H */ --- a/arch/x86/kernel/cpu/common.c +++ b/arch/x86/kernel/cpu/common.c @@ -64,7 +64,6 @@ #include #include #include -#include #include #include @@ -1607,8 +1606,6 @@ static void __init early_identify_cpu(st fpu__init_system(c); - init_sigframe_size(); - #ifdef CONFIG_X86_32 /* * Regardless of whether PCID is enumerated, the SDM says --- a/arch/x86/kernel/signal.c +++ b/arch/x86/kernel/signal.c @@ -182,7 +182,7 @@ get_sigframe(struct ksignal *ksig, struc static unsigned long __ro_after_init max_frame_size; static unsigned int __ro_after_init fpu_default_state_size; -void __init init_sigframe_size(void) +static int __init init_sigframe_size(void) { fpu_default_state_size = fpu__get_fpstate_size(); @@ -194,7 +194,9 @@ void __init init_sigframe_size(void) max_frame_size = round_up(max_frame_size, FRAME_ALIGNMENT); pr_info("max sigframe size: %lu\n", max_frame_size); + return 0; } +early_initcall(init_sigframe_size); unsigned long get_sigframe_size(void) {