Received: by 2002:a05:7412:b10a:b0:f3:1519:9f41 with SMTP id az10csp2540361rdb; Sun, 3 Dec 2023 23:29:16 -0800 (PST) X-Google-Smtp-Source: AGHT+IGZEAy1RGaYTv5fJJkiKXTefy3cGNCjd/u6nXw2mLGF7/K0dZv96u5OEk21CR+ALoUTuVjY X-Received: by 2002:a05:6870:499a:b0:1fb:75b:99c6 with SMTP id ho26-20020a056870499a00b001fb075b99c6mr6343143oab.117.1701674956728; Sun, 03 Dec 2023 23:29:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701674956; cv=none; d=google.com; s=arc-20160816; b=pLgvCu7Jvh9JkFC8B4Y4Dw4iqc4+pYsZY2rESQsDAf4zMliWvZErqv6irxcSo1fQBE C9TDDYAvhUAdMsDisNF7/HrASEvjc3UF3Rj8tVI0yV7qoHLu/FB09Yih0HjgAZx6lKdp riNRQAwBHpcC9jcgsGuftvB9N7CNKj6ZAjwZmxvdtXnDGNo2MnnvgVOW5eV9Nn6XOEJX IUicnSErd/Am+bmvSDCWfAtbgXQ460spmQ4jYfKxJY+IdLQdmMxoR/UMz3gKNORfeNBI UIbBGTJLlTJtQl2WSe8gXFzw5eyjs5vzCBfy47+wJklo79iwYNnPP2lo2inR08gJuHYY rHJA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=dcxB8kVqIn5DhYKrJl89NuDnBKQgRvnxcEGSL3eMx2w=; fh=IGokRMYB3ea45hiLzZhVAKxyziVqbfASGL37DtRgQmM=; b=q8kabYktdCuPWISX8WJzNFIlRwgiNS66j8EPbvm/kCHI+pLeWJtuy9/nqKh7lxJDXo LZlwPFB0a8obYIq2pV4+J1U46Ad5w/4MtC4WxPKbNGba/vgFTxEwUAF8qhV2jM6fzN24 Nqprrmxg56h3HV7berG6tiZeic7eVCH9+Quc9zOzcoTOORDLKpqGaDF/EXc5/eZxvr9k 3ICL9IEN2z9RHqXDq9rlF9KuHWV9TohOpL9RewGQXiWNPSr6LBD+e1ZIwocNbjXIOyWa MvUk7Gn4OJBZk3Hq33bViobnF54rNpAGBwIMWOddOHT3vqBqR+GN6RSOWKC+kLlrBljU QiEA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Cw53yCj0; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from fry.vger.email (fry.vger.email. [23.128.96.38]) by mx.google.com with ESMTPS id k20-20020a63d114000000b005c1c5d338a9si7515465pgg.658.2023.12.03.23.29.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 03 Dec 2023 23:29:16 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) client-ip=23.128.96.38; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Cw53yCj0; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by fry.vger.email (Postfix) with ESMTP id C2F27807C743; Sun, 3 Dec 2023 23:29:13 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232618AbjLDH3A (ORCPT + 99 others); Mon, 4 Dec 2023 02:29:00 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37150 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229769AbjLDH26 (ORCPT ); Mon, 4 Dec 2023 02:28:58 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 60186D7 for ; Sun, 3 Dec 2023 23:29:05 -0800 (PST) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 22559C433C8; Mon, 4 Dec 2023 07:29:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1701674944; bh=ag47fZQN67ZIIBjPxPbl0fUu/BkVyp7AgqE71oADyVA=; h=From:To:Cc:Subject:Date:From; b=Cw53yCj0nyzlnWnbte5Lwrqcep7sQ1vNA/H/kA1jFpbkHZOKhfjn8Qj8RC6vXV0hj dhqJl1orOc2HwTgI7jTsQakj6rb7vDmEu4+ro5uD5rMIejGmoTDV6sF/uel4qK/lVn Cg4WhA2u9chkMf7njxL5GsVYB3w1ItBWrgL5tDs+Mh/kX7M2GKPcUTwWvPYnS0PcNm BNYaaMPEjV9iIOaUB67vzKsLwaYORmmG85864Qlh8mRFefPnLJ/G8GanlBWFg7B4Rb pilAA3MJ1N1eyVclZay+OkSO5b2rlXwVLOJjA2mpyDQ6l+PrzzYtkHiBx7Ba3NqgLH +FYvPa5pAjgIQ== From: Arnd Bergmann To: Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org, Uros Bizjak Cc: Arnd Bergmann , "H. Peter Anvin" , Peter Zijlstra , Kees Cook , Sami Tolvanen , Josh Poimboeuf , linux-kernel@vger.kernel.org Subject: [PATCH] x86/alternative: move apply_relocation() out of init section Date: Mon, 4 Dec 2023 08:28:41 +0100 Message-Id: <20231204072856.1033621-1-arnd@kernel.org> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on fry.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (fry.vger.email [0.0.0.0]); Sun, 03 Dec 2023 23:29:13 -0800 (PST) From: Arnd Bergmann 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. Fixes: 17bce3b2ae2d ("x86/callthunks: Handle %rip-relative relocations in call thunk template") Signed-off-by: Arnd Bergmann --- Not entire sure about this one, it does address the warning, but it might be possible to find and change all the callers instead if they fit the __init_or_module pattern. --- arch/x86/kernel/alternative.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/arch/x86/kernel/alternative.c b/arch/x86/kernel/alternative.c index d973bcf7db78..4a25642ab714 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) { @@ -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; -- 2.39.2