From mboxrd@z Thu Jan 1 00:00:00 1970 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id D1026E9A776 for ; Tue, 24 Mar 2026 11:47:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=JO6LAiZlruzJO/CSOR2NzyhH2Te1q/x/reIBxqIBsNU=; b=CQmY4u2oXdBBcH LQUzdr/bK7LNjLHTQcvTE7xsgmhTvxyp7l065meBFrsk5DAm+ktCUw4AV8YjyFVKSeLpJ+s0yxYrU Dk6FNU2ApVZK1aBzwk3hJUNSEStJmqf0+qIfFLF35zni/vVmKwxoeU4EqxXHdc1LKGqc3dM46VnvN Tzz+Xbm+E7yDkAb26XN7+ZNw1VVnsoP4I0V5uKcuBHw96+Kh3fpVVU5k9PGswWlMSVlv0tdZ+bHlr zIZ7MUqcEDnoiqSwhlCSyd4iESsXknc9+XE//cXR/nCKH4QBQUfcm703m27qtI1o2m144OGUDW5nO kxeFEOeFe7MzC0+SdUVA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98.2 #2 (Red Hat Linux)) id 1w50Ef-00000001IqA-3Y5n; Tue, 24 Mar 2026 11:47:49 +0000 Received: from out30-111.freemail.mail.aliyun.com ([115.124.30.111]) by bombadil.infradead.org with esmtps (Exim 4.98.2 #2 (Red Hat Linux)) id 1w50Ed-00000001IJd-0BFG for linux-riscv@lists.infradead.org; Tue, 24 Mar 2026 11:47:48 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.alibaba.com; s=default; t=1774352741; h=From:To:Subject:Date:Message-Id:MIME-Version; bh=eGoUX5+U64mMyKbsYD4ZIBWAtxP/BeYqHD20VtSl4vc=; b=TLeffPEX1hMfUlHGGNXJQ0orUMvWCoGAz5t4rI3U9z9yUAC60TrsCz8aI/bpHxaaPeex1ZtwO5AMvjDSmHg2/xCnwfAWNBiC42gJ5SmfCf0Vz4Torp/dxzmqtSW+ibTlpWxQT199/iZfGdwd5YajxnAMmWhu+uVH7YeWtwQx6xI= X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R781e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=maildocker-contentspam033037033178;MF=fangyu.yu@linux.alibaba.com;NM=1;PH=DS;RN=17;SR=0;TI=SMTPD_---0X.eWVFc_1774352735; Received: from localhost.localdomain(mailfrom:fangyu.yu@linux.alibaba.com fp:SMTPD_---0X.eWVFc_1774352735 cluster:ay36) by smtp.aliyun-inc.com; Tue, 24 Mar 2026 19:45:35 +0800 From: fangyu.yu@linux.alibaba.com To: pjw@kernel.org, palmer@dabbelt.com, aou@eecs.berkeley.edu, alex@ghiti.fr, songshuaishuai@tinylab.org, bjorn@rivosinc.com, ardb@kernel.org, arnd@arndb.de, bhelgaas@google.com, richard.lyu@suse.com, tzimmermann@suse.de, nathan@kernel.org Cc: guoren@kernel.org, kvm-riscv@lists.infradead.org, linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, Fangyu Yu Subject: [PATCH 2/4] riscv: kexec: Place norelocate trampoline into .kexec.tramp.text Date: Tue, 24 Mar 2026 19:45:25 +0800 Message-Id: <20260324114527.91494-3-fangyu.yu@linux.alibaba.com> X-Mailer: git-send-email 2.39.3 (Apple Git-146) In-Reply-To: <20260324114527.91494-1-fangyu.yu@linux.alibaba.com> References: <20260324114527.91494-1-fangyu.yu@linux.alibaba.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20260324_044747_299207_BAB29FA4 X-CRM114-Status: UNSURE ( 6.13 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org From: Fangyu Yu Move riscv_kexec_norelocate out of the generic .text section and into a dedicated executable trampoline section, .kexec.tramp.text. Signed-off-by: Fangyu Yu --- arch/riscv/include/asm/kexec.h | 9 +++++++++ arch/riscv/kernel/kexec_relocate.S | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/arch/riscv/include/asm/kexec.h b/arch/riscv/include/asm/kexec.h index b9ee8346cc8c..315dce0d9ca6 100644 --- a/arch/riscv/include/asm/kexec.h +++ b/arch/riscv/include/asm/kexec.h @@ -75,4 +75,13 @@ int load_extra_segments(struct kimage *image, unsigned long kernel_start, unsigned long cmdline_len); #endif +#ifndef __ASSEMBLY__ +#ifdef CONFIG_MMU +#define __kexec_tramp_text __section(".kexec.tramp.text") +#else +#define __kexec_tramp_text +#endif +#endif +extern char __kexec_tramp_text_start[]; + #endif diff --git a/arch/riscv/kernel/kexec_relocate.S b/arch/riscv/kernel/kexec_relocate.S index de0a4b35d01e..af6b99f5b0fd 100644 --- a/arch/riscv/kernel/kexec_relocate.S +++ b/arch/riscv/kernel/kexec_relocate.S @@ -147,7 +147,7 @@ riscv_kexec_relocate_end: /* Used for jumping to crashkernel */ -.section ".text" +.section ".kexec.tramp.text", "ax" SYM_CODE_START(riscv_kexec_norelocate) /* * s0: (const) Phys address to jump to -- 2.50.1 _______________________________________________ linux-riscv mailing list linux-riscv@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-riscv