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 C37AF3A1CD; Mon, 21 Oct 2024 10:38:58 +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=1729507138; cv=none; b=KgQKOaZd5vdBybLUthtyvH8h+24QQvMYq88EnHm8GzqO1cgMzPyHNgMfQV8QglHM4WD5P7iKLohbyIIiPU6ZOC38o7l6xMfDxVV62NPTxL2DOcLTldBt9yz00C+p2ngxUb5QPUlyj2EWuP2OZWAkqn6J1zBDZy8f+21izldwwaU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729507138; c=relaxed/simple; bh=XmrUGlfA4fGZSBmuB97noQy6HMAWMsCkjOQYBy0YNwE=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=cHkHZtmeEqO887WD6cXKJ7wOzUKl4n4zhAwOelMtZGvUExdehFj2VSLWXuHRWxaNVuql06otlvxWJRurMJ2vca6GibJZpE0xlgqjt6OtglU1Fj9rrq0g5xUpOgM+gqqKy/WiXxBp46xHx06ppaZvaLHbv0aM46vuwTG8vxNZA4Y= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=Ml1Z3YZq; 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="Ml1Z3YZq" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 447BEC4CEC3; Mon, 21 Oct 2024 10:38:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1729507138; bh=XmrUGlfA4fGZSBmuB97noQy6HMAWMsCkjOQYBy0YNwE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Ml1Z3YZq7xS6LNcx0EfrHkLJTnxvT31e48DT/L4Epz+qQs0RSJP8sb4agF9xjhBOQ AZtR3C535uS3JsIcaE7YI3iOTJksD6gXaADnYLKjkarYEuN3hVkM98KcTeGWOajoiz qgofj4w8l5CMwrGWS2vc4ORVwzKvqgqM2JIJJ4g8= 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 6.6 103/124] x86/resctrl: Annotate get_mem_config() functions as __init Date: Mon, 21 Oct 2024 12:25:07 +0200 Message-ID: <20241021102300.703853657@linuxfoundation.org> X-Mailer: git-send-email 2.47.0 In-Reply-To: <20241021102256.706334758@linuxfoundation.org> References: <20241021102256.706334758@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 6.6-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 @@ -193,7 +193,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) { struct rdt_hw_resource *hw_res = resctrl_to_arch_res(r); union cpuid_0x10_3_eax eax; @@ -227,7 +227,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) { struct rdt_hw_resource *hw_res = resctrl_to_arch_res(r); u32 eax, ebx, ecx, edx, subleaf;