Received: by 2002:a25:23cc:0:0:0:0:0 with SMTP id j195csp777828ybj; Tue, 5 May 2020 07:25:27 -0700 (PDT) X-Google-Smtp-Source: APiQypI73MPANs/YQdIcLtvXhZr4klAVZLJHRoZQKocmT+JRLrg2Hd270YBa2X/IIecM8XxKms1V X-Received: by 2002:a17:907:2645:: with SMTP id ar5mr2991307ejc.75.1588688727412; Tue, 05 May 2020 07:25:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588688727; cv=none; d=google.com; s=arc-20160816; b=lz5Ras8AXX1cbSDqApnjohHT24cxMdyg+D7N0nsKN8HQZEhLvGmh/Gv1WJIE+HZsUq Lot7QcUMSBeucOqh1u31i20SyKjiDPHFzvJNOfy/VCNpL/Lq3xNANwu5DiF8nMEdPBDy i/k0ykmT7+1bfwN1Ump8850tWH8QKkhDq/Bkfz5uEsEE8MfubdgSk0zj6RqaL+nmIgPt WiJndWCC/sanetN7V6fVuyh/ojzKTw567SCQwZF67itHl5DojXulBcVqbRNBMWJIYju2 8vieztWZjP3ztXHhARHYYP+FPch2D7QaGw5AY3vr5coXWEwJbpg08wvpTzMhFcHXGL+6 c7Vw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:subject:cc:to:from:date:user-agent:message-id; bh=w0djALKur9GwXgCYJOric1BAfsyCllAGCLuQ0TeCR74=; b=NHt4NOFYT6g/JAWVb4T+P6OwXTQQBaH7oJzRtnPQ5dSZ4iWkFSDOonZN1CyPlUKNIe JieI8FzdMQCOM882en9E8krIOpX03gnCAHkhCk+MPtvqCkaiqo5itH19yklCWmTUN2m8 SlUshC1ILwca65w0Yptyr8Rfybdth6HMUHQG6gqqjgPzQUKJtGflGjgZ0OWwIJtW38q/ vbTNjv9qMydoLhPeMlsXX35QKZu1KW2wjV8HHn3P5bh+Fz5wx/MhBwvxEMj6qmayZ2iZ w0tNerDSvOMywOeFSZ4pG1CzuPwHBdkoS4Q9clM43b7CTmN6XvfTkrjPfvysLj9cojqs T5dA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id z10si1281278ede.211.2020.05.05.07.25.04; Tue, 05 May 2020 07:25:27 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729602AbgEEOOg (ORCPT + 99 others); Tue, 5 May 2020 10:14:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48706 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1729597AbgEEOOd (ORCPT ); Tue, 5 May 2020 10:14:33 -0400 Received: from Galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 636ADC061A10 for ; Tue, 5 May 2020 07:14:33 -0700 (PDT) Received: from p5de0bf0b.dip0.t-ipconnect.de ([93.224.191.11] helo=nanos.tec.linutronix.de) by Galois.linutronix.de with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1jVyKt-0000ws-SM; Tue, 05 May 2020 16:14:16 +0200 Received: from nanos.tec.linutronix.de (localhost [IPv6:::1]) by nanos.tec.linutronix.de (Postfix) with ESMTP id 483D0FFC8D; Tue, 5 May 2020 16:14:15 +0200 (CEST) Message-Id: <20200505134340.320164650@linutronix.de> User-Agent: quilt/0.65 Date: Tue, 05 May 2020 15:41:14 +0200 From: Thomas Gleixner To: LKML Cc: x86@kernel.org, "Paul E. McKenney" , Andy Lutomirski , Alexandre Chartre , Frederic Weisbecker , Paolo Bonzini , Sean Christopherson , Masami Hiramatsu , Petr Mladek , Steven Rostedt , Joel Fernandes , Boris Ostrovsky , Juergen Gross , Brian Gerst , Mathieu Desnoyers , Josh Poimboeuf , Will Deacon Subject: [patch V4 part 2 02/18] x86/entry/32: Move non entry code into .text section References: <20200505134112.272268764@linutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-transfer-encoding: 8-bit X-Linutronix-Spam-Score: -1.0 X-Linutronix-Spam-Level: - X-Linutronix-Spam-Status: No , -1.0 points, 5.0 required, ALL_TRUSTED=-1,SHORTCIRCUIT=-0.0001 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org All ASM code which is not part of the entry functionality can move out into the .text section. No reason to keep it in the non-instrumentable entry section. Signed-off-by: Thomas Gleixner --- arch/x86/entry/entry_32.S | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) --- a/arch/x86/entry/entry_32.S +++ b/arch/x86/entry/entry_32.S @@ -729,7 +729,8 @@ /* * %eax: prev task * %edx: next task - */ +*/ +.pushsection .text, "ax" SYM_CODE_START(__switch_to_asm) /* * Save callee-saved registers @@ -776,6 +777,7 @@ SYM_CODE_START(__switch_to_asm) jmp __switch_to SYM_CODE_END(__switch_to_asm) +.popsection /* * The unwinder expects the last frame on the stack to always be at the same @@ -784,6 +786,7 @@ SYM_CODE_END(__switch_to_asm) * asmlinkage function so its argument has to be pushed on the stack. This * wrapper creates a proper "end of stack" frame header before the call. */ +.pushsection .text, "ax" SYM_FUNC_START(schedule_tail_wrapper) FRAME_BEGIN @@ -794,6 +797,8 @@ SYM_FUNC_START(schedule_tail_wrapper) FRAME_END ret SYM_FUNC_END(schedule_tail_wrapper) +.popsection + /* * A newly forked process directly context switches into this address. * @@ -801,6 +806,7 @@ SYM_FUNC_END(schedule_tail_wrapper) * ebx: kernel thread func (NULL for user thread) * edi: kernel thread arg */ +.pushsection .text, "ax" SYM_CODE_START(ret_from_fork) call schedule_tail_wrapper @@ -825,6 +831,7 @@ SYM_CODE_START(ret_from_fork) movl $0, PT_EAX(%esp) jmp 2b SYM_CODE_END(ret_from_fork) +.popsection /* * Return to user mode is not as complex as all this looks, @@ -1693,6 +1700,7 @@ SYM_CODE_START(general_protection) jmp common_exception SYM_CODE_END(general_protection) +.pushsection .text, "ax" SYM_CODE_START(rewind_stack_do_exit) /* Prevent any naive code from trying to unwind to our caller. */ xorl %ebp, %ebp @@ -1703,3 +1711,4 @@ SYM_CODE_START(rewind_stack_do_exit) call do_exit 1: jmp 1b SYM_CODE_END(rewind_stack_do_exit) +.popsection