From patchwork Tue Dec 19 13:33:38 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: 180943 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:24d3:b0:fb:cd0c:d3e with SMTP id r19csp1938719dyi; Tue, 19 Dec 2023 05:33:59 -0800 (PST) X-Google-Smtp-Source: AGHT+IEUoKag2MOXAFPeaQTePgZImCPiyUMifBFwZOXziVjBdiv6ZFpDM3cRA1fY0m80X4deYnGj X-Received: by 2002:a17:903:41c9:b0:1d3:7a3b:d391 with SMTP id u9-20020a17090341c900b001d37a3bd391mr9774014ple.9.1702992839668; Tue, 19 Dec 2023 05:33:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702992839; cv=none; d=google.com; s=arc-20160816; b=033V4zhN481DH0HF8UHeLWF/oVCT4hYQkfommDxQDLXTlwXTUg9VjydFp1nnCt8clj Dxpd92WGPtMIj7G4RsNh7xoEZjwY5EV6nheo8DFZt/gFsbeDESADCWbrMurp6tWR9Ljz wFeDjbSVf+kDyHFYF07mqdvDQGJ4aJm2PYCX6NwYttZbXGDxV5gesVbxiy0fdwsBX8jo LYeme5Re5cm3ajAorLor0hQvelAGtK6s4NlxnX2U4T30ySJexu3LiHYy2GSlAibvZ9Pv rIv0ZQki6veXy5db0oFenM3KRnQiGUYv5jbRqJo+LQ6DvNdSx4Fz+DZnIMgcygw7TkVl EIbw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:precedence:robot-unsubscribe:robot-id :message-id:mime-version:list-unsubscribe:list-subscribe:list-id :precedence:references:in-reply-to:cc:subject:to:reply-to:sender :from:dkim-signature:dkim-signature:date; bh=wZu7+f4jqN8y26ObwbxjE93jUOV36LfTZnAHKob9k4E=; fh=AZhCD2S5chFgkdItrI9KwCizjrKL5oiXQGsiN+LO5oE=; b=ri1sHje7sG+CFa91N4sZcZd+9+PRNTrhUMowL+pmgvKnwMxz1I+DcU2nf81Rgp4B/7 CnsuK8zSeS7zWBzwHlPpATF1lrpj/pvTQVvdTnOodS3xOmEk0QpJ954qfiAvuXGCvcw8 +RAxILzntzevAi/5anaOKV3crhxIUl5vM/D50I1RAcznHiDDHa/Lk+5uCsij4u4JXx8O ddUupXlxTbNl29mzaKaVdRCquB1oO5UnVuBdqj702F1ErBuJVA1K4TA5pwCoq4mxvT38 jhms2mkUeNt35rLJRVUpdP82s9+yUSV9wbx6YSU6IXJbPziAaamVoig6sDvpuDV9sHGO RRPw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b="imOW/Kw1"; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; spf=pass (google.com: domain of linux-kernel+bounces-5263-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-5263-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id b12-20020a170902650c00b001cfe02fa89esi19505481plk.117.2023.12.19.05.33.59 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Dec 2023 05:33:59 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-5263-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b="imOW/Kw1"; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; spf=pass (google.com: domain of linux-kernel+bounces-5263-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-5263-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 6F2AE2849E3 for ; Tue, 19 Dec 2023 13:33:59 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id BBC8519BCB; Tue, 19 Dec 2023 13:33:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="imOW/Kw1"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="Yh1ORP8r" X-Original-To: linux-kernel@vger.kernel.org Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 866621945A; Tue, 19 Dec 2023 13:33:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linutronix.de Date: Tue, 19 Dec 2023 13:33:38 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1702992819; 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=wZu7+f4jqN8y26ObwbxjE93jUOV36LfTZnAHKob9k4E=; b=imOW/Kw1Cwl4ft0SmPPotxwsLhzNtOJYRjZA6zXjpcqzXHoys1seC77an5JxyBoR2yXahc bVGh6jcLXJI3JmwloAyAHp6eqqt9TST6km1Ow4MrXNI2EIP9Bz4HcRqZUdOCjz790hHCtC 6hjdulJNDmjUZloDSgp01skI6GuuFfj0ErzDa8q5B6rJx1PysLfJ76NhumvYuf/X8p4UHR Aj6G6qC+B6s8Ts6E4ekadE3Emg6CAeG64s4/wY0+TdTQ3YTMIFCPuErHsQtW7C3I63Doru 9YYmTzPkvlQB0a/H+GkM7fRmN3S3YTnXJH6/M5QznVDEcI9BLUBD92Cn2iOAzg== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1702992819; 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=wZu7+f4jqN8y26ObwbxjE93jUOV36LfTZnAHKob9k4E=; b=Yh1ORP8rnd+BcBQzUcb0Rf5akvwDcI9uEr6uHBLzPWCSrKbDtQ8Z5B0Ka3vD7M9OSBKbfl UbilJhA2v4m5yJDg== From: "tip-bot2 for Arnd Bergmann" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: x86/percpu] x86/alternatives: Move apply_relocation() out of init section Cc: Arnd Bergmann , Ingo Molnar , Uros Bizjak , x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <20231204072856.1033621-1-arnd@kernel.org> References: <20231204072856.1033621-1-arnd@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-ID: <170299281805.398.14125432177983046398.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails Precedence: bulk X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1785717419670158148 X-GMAIL-MSGID: 1785717419670158148 The following commit has been merged into the x86/percpu branch of tip: Commit-ID: 86ed430cf5296ca97a66f1f37e30b7dfe47cd36f Gitweb: https://git.kernel.org/tip/86ed430cf5296ca97a66f1f37e30b7dfe47cd36f Author: Arnd Bergmann AuthorDate: Mon, 04 Dec 2023 08:28:41 +01:00 Committer: Ingo Molnar CommitterDate: Tue, 19 Dec 2023 14:21:49 +01:00 x86/alternatives: Move apply_relocation() out of init section This function is now called from a few places that are no __init_or_module, resulting a link time warning: WARNING: modpost: vmlinux: section mismatch in reference: patch_dest+0x8a (section: .text) -> apply_relocation (section: .init.text) Remove the annotation here. [ mingo: Also sync up add_nop() with these changes. ] Fixes: 17bce3b2ae2d ("x86/callthunks: Handle %rip-relative relocations in call thunk template") Signed-off-by: Arnd Bergmann Signed-off-by: Ingo Molnar Cc: Uros Bizjak Link: https://lore.kernel.org/r/20231204072856.1033621-1-arnd@kernel.org --- arch/x86/kernel/alternative.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/arch/x86/kernel/alternative.c b/arch/x86/kernel/alternative.c index 5052371..1781e02 100644 --- a/arch/x86/kernel/alternative.c +++ b/arch/x86/kernel/alternative.c @@ -44,7 +44,7 @@ EXPORT_SYMBOL_GPL(alternatives_patched); #define DA_ENDBR 0x08 #define DA_SMP 0x10 -static unsigned int __initdata_or_module debug_alternative; +static unsigned int debug_alternative; static int __init debug_alt(char *str) { @@ -132,7 +132,7 @@ const unsigned char * const x86_nops[ASM_NOP_MAX+1] = * each single-byte NOPs). If @len to fill out is > ASM_NOP_MAX, pad with INT3 and * *jump* over instead of executing long and daft NOPs. */ -static void __init_or_module add_nop(u8 *instr, unsigned int len) +static void add_nop(u8 *instr, unsigned int len) { u8 *target = instr + len; @@ -206,7 +206,7 @@ static int skip_nops(u8 *instr, int offset, int len) * Optimize a sequence of NOPs, possibly preceded by an unconditional jump * to the end of the NOP sequence into a single NOP. */ -static bool __init_or_module +static bool __optimize_nops(u8 *instr, size_t len, struct insn *insn, int *next, int *prev, int *target) { int i = *next - insn->length; @@ -325,7 +325,7 @@ bool need_reloc(unsigned long offset, u8 *src, size_t src_len) return (target < src || target > src + src_len); } -void __init_or_module apply_relocation(u8 *buf, size_t len, u8 *dest, u8 *src, size_t src_len) +void apply_relocation(u8 *buf, size_t len, u8 *dest, u8 *src, size_t src_len) { int prev, target = 0;