From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 7B07C1EE006; Mon, 21 Oct 2024 10:50:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729507855; cv=none; b=ZfxGRq308POZmMfGHKdgu5rec6DqQwMa6td94S/7nuFUTLFbWa1YeY2Ci/MCTCWLppDrC3MmGBZTZW8SSopWwsAHxzTsS89wyQObcRaA+Ts5z7aLgYn2he79BpjpHbYa+lzLA0qSFh6Py9FbIeRxgtfMhISyy8q9nuFJ21fomIg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729507855; c=relaxed/simple; bh=Y0YWiH0NpV65D+rFBAqIoLOdXEXa6PaQL6hq0+Gv63c=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=VtcWjN7XoQIOMAg0mpH8/Wok9Q5e9v3mezDb/xWbuMvdOBbb3CfHGHZl757Pg+lxoUp+7EUCoRcihOKuhPZgIxOO5+8QVbwj3UcuXwleILZOYU0Xk/1GeriABhqpt5+bH3sMDwPlpqhFaDOPzFGiKTlM6UHJgL7Gl4kUgfIL2N8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=IBWbnanH; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="IBWbnanH" Received: by smtp.kernel.org (Postfix) with ESMTPSA id BBAA8C4CEC3; Mon, 21 Oct 2024 10:50:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1729507855; bh=Y0YWiH0NpV65D+rFBAqIoLOdXEXa6PaQL6hq0+Gv63c=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=IBWbnanH1rbg0sSzjp17Gp0uIcBBNWqf96WmSTacHrmyvNTJ/f0Q/5FuYnOSnsmuk LNcA9w44gXiFRJ06k4QH+DIUq23sug2aRJdRhCSFTviK8m0lCCwiM43DBoIjahzBPw vwyx2SMUUvGQctbLB49nAFziq3UFgEfd18R6YDEw= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Nathan Chancellor , "Borislav Petkov (AMD)" , Reinette Chatre , stable@kernel.org Subject: [PATCH 5.10 42/52] x86/resctrl: Annotate get_mem_config() functions as __init Date: Mon, 21 Oct 2024 12:26:03 +0200 Message-ID: <20241021102243.272322170@linuxfoundation.org> X-Mailer: git-send-email 2.47.0 In-Reply-To: <20241021102241.624153108@linuxfoundation.org> References: <20241021102241.624153108@linuxfoundation.org> User-Agent: quilt/0.67 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 5.10-stable review patch. If anyone has any objections, please let me know. ------------------ From: Nathan Chancellor commit d5fd042bf4cfb557981d65628e1779a492cd8cfa upstream. After a recent LLVM change [1] that deduces __cold on functions that only call cold code (such as __init functions), there is a section mismatch warning from __get_mem_config_intel(), which got moved to .text.unlikely. as a result of that optimization: WARNING: modpost: vmlinux: section mismatch in reference: \ __get_mem_config_intel+0x77 (section: .text.unlikely.) -> thread_throttle_mode_init (section: .init.text) Mark __get_mem_config_intel() as __init as well since it is only called from __init code, which clears up the warning. While __rdt_get_mem_config_amd() does not exhibit a warning because it does not call any __init code, it is a similar function that is only called from __init code like __get_mem_config_intel(), so mark it __init as well to keep the code symmetrical. CONFIG_SECTION_MISMATCH_WARN_ONLY=n would turn this into a fatal error. Fixes: 05b93417ce5b ("x86/intel_rdt/mba: Add primary support for Memory Bandwidth Allocation (MBA)") Fixes: 4d05bf71f157 ("x86/resctrl: Introduce AMD QOS feature") Signed-off-by: Nathan Chancellor Signed-off-by: Borislav Petkov (AMD) Reviewed-by: Reinette Chatre Cc: Link: https://github.com/llvm/llvm-project/commit/6b11573b8c5e3d36beee099dbe7347c2a007bf53 [1] Link: https://lore.kernel.org/r/20240917-x86-restctrl-get_mem_config_intel-init-v3-1-10d521256284@kernel.org Signed-off-by: Greg Kroah-Hartman --- arch/x86/kernel/cpu/resctrl/core.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) --- a/arch/x86/kernel/cpu/resctrl/core.c +++ b/arch/x86/kernel/cpu/resctrl/core.c @@ -251,7 +251,7 @@ static inline bool rdt_get_mb_table(stru return false; } -static bool __get_mem_config_intel(struct rdt_resource *r) +static __init bool __get_mem_config_intel(struct rdt_resource *r) { union cpuid_0x10_3_eax eax; union cpuid_0x10_x_edx edx; @@ -285,7 +285,7 @@ static bool __get_mem_config_intel(struc return true; } -static bool __rdt_get_mem_config_amd(struct rdt_resource *r) +static __init bool __rdt_get_mem_config_amd(struct rdt_resource *r) { union cpuid_0x10_3_eax eax; union cpuid_0x10_x_edx edx;