From patchwork Fri Jun 16 09:24:43 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: tip-bot2 for Thomas Gleixner X-Patchwork-Id: 108988 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp1202257vqr; Fri, 16 Jun 2023 02:40:54 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5HqA0sFfOMIS0QgTuBShY+W5qCsTsiw6z+bJjDulBE++VPU5dw4p9KdIKuwAoB76XTKuqM X-Received: by 2002:a17:90a:598b:b0:25e:21fd:d0ee with SMTP id l11-20020a17090a598b00b0025e21fdd0eemr1155737pji.4.1686908454190; Fri, 16 Jun 2023 02:40:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686908454; cv=none; d=google.com; s=arc-20160816; b=Pj+VYQyUwRCL4kFFJHiSDX02U4Rtr5gcrsUz6NhN6eVP6yC9Guk6Lo44YKsM4TjMxL 5+OfyGxX4ZbyihzQwYIo5opRn1MFXHTDIf7jd3GfAQWH1nKmSP+i6N3fQ5RDrETXmYTN +4LrqOYQQNGqFIQ1EhNsW+VQDoLDJmyFT3eeQlexMRKKHlL/5QBzwLwkBRwZVsnU6CKN E29JjQugNm1R8ZkGe5CRXdICASBiB9VWWsmr7cnWZ/CcuF48Je6PGUt537KoC2jq63/5 lphABDsRQ2LhpZFDAQr2yePyMhvqlqQ7mecQhJy3HeYZbz6Xo7mRwFAHpxz3R23gnf+h EuhA== 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=n8JjCGMZg2aquHdshBmUxYgzLMNz9foabYDHjHRLCmw=; b=izDqo0AOIn2qDxVvvFZxx7C8FK1hjEOF+OTcEzueMwKZElA3wI7Bp/EAYGPx4HczEo WpJBKubiEgGkqnZmC6HtboF0THhqkEpMDBaFwXgWWjWj/2Spn6TZcZ/jXMagOBkd1NmJ 50pwgRuOGk+hM39/ZFIKeFu3aX6XxATLKKp0N5j8HFn2S7lQ9B8KdPdATv7N9vEZJ2X1 0NBiNH2IRYLZ0xkd2xp5PVe5/dXt9NDIuyf9cXR6IprN1HpqjDe2If/0IwU8Nr3ZFoAi 06d2B9uB//zxlbfUxTcuLvXbAXk5Fb6Ln5/jGI/jsq/3a7vSdvJxHrHOilrtArQ9W/4p OgoA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=IWR7Mc5o; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b="Yn2P/wpO"; 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: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id gz14-20020a17090b0ece00b0025667be94f0si1196224pjb.77.2023.06.16.02.40.39; Fri, 16 Jun 2023 02:40:54 -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=IWR7Mc5o; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b="Yn2P/wpO"; 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 S1344217AbjFPJZW (ORCPT + 99 others); Fri, 16 Jun 2023 05:25:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41318 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344017AbjFPJYu (ORCPT ); Fri, 16 Jun 2023 05:24:50 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2A48B2117; Fri, 16 Jun 2023 02:24:45 -0700 (PDT) Date: Fri, 16 Jun 2023 09:24:43 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1686907483; 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=n8JjCGMZg2aquHdshBmUxYgzLMNz9foabYDHjHRLCmw=; b=IWR7Mc5o118rmqaS3z1ueZAQl5gq34xv3g/Ux8i5BQSijVLAzU28Il0eeGAnGepLQrrQS0 QX0imLGSoFt1bRnmFkmWae4Xli42yJhIxO645g1IQ9n8Q7s/PzeWQMJWc3IlXBApmWpSjy JueLuMz+C5taWHsu4e9Eg7V6cwfBIvK823vZYlQ+SyF/pUIY3r0OqPolukn1msXOks1cWL 66jT2VkHcc2kJY0/DMYC5AZpcvinBPc25QJFDJ3w9I3aA7I5vCVeF2pgsLjXe7L9++XpTm yhnbksN/Syyb3s9WNI7CsCUKmiJLXS92lqeKEauWlKOrZZL0+gjHvDQtMDYugg== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1686907483; 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=n8JjCGMZg2aquHdshBmUxYgzLMNz9foabYDHjHRLCmw=; b=Yn2P/wpO8JAk2MIdUbUdR/CYq4Jle/S8mcqM0mEc5Zej1hTEvrDtSoAbeH2Fjj1RfR4MDT PX0OM1KX5ynYtrBA== 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/init: Initialize signal frame size late Cc: Thomas Gleixner , x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <20230613224545.727330699@linutronix.de> References: <20230613224545.727330699@linutronix.de> MIME-Version: 1.0 Message-ID: <168690748312.404.1213636159310165530.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1768633244683251101?= X-GMAIL-MSGID: =?utf-8?q?1768851718957121715?= The following commit has been merged into the x86/boot branch of tip: Commit-ID: 54d9a91a3d6713d1332e93be13b4eaf0fa54349d Gitweb: https://git.kernel.org/tip/54d9a91a3d6713d1332e93be13b4eaf0fa54349d Author: Thomas Gleixner AuthorDate: Wed, 14 Jun 2023 01:39:42 +02:00 Committer: Thomas Gleixner CommitterDate: Fri, 16 Jun 2023 10:16:00 +02:00 x86/init: Initialize signal frame size late 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 Link: https://lore.kernel.org/r/20230613224545.727330699@linutronix.de --- 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(-) diff --git a/arch/x86/include/asm/sigframe.h b/arch/x86/include/asm/sigframe.h index 5b1ed65..84eab27 100644 --- 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 */ diff --git a/arch/x86/kernel/cpu/common.c b/arch/x86/kernel/cpu/common.c index 5ee8b31..b8a4db1 100644 --- 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(struct cpuinfo_x86 *c) fpu__init_system(c); - init_sigframe_size(); - #ifdef CONFIG_X86_32 /* * Regardless of whether PCID is enumerated, the SDM says diff --git a/arch/x86/kernel/signal.c b/arch/x86/kernel/signal.c index 004cb30..cfeec3e 100644 --- a/arch/x86/kernel/signal.c +++ b/arch/x86/kernel/signal.c @@ -182,7 +182,7 @@ get_sigframe(struct ksignal *ksig, struct pt_regs *regs, size_t frame_size, 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) {