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 A2B3A2FD7C8; Tue, 26 Aug 2025 11:30:25 +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=1756207825; cv=none; b=ipGwb19wZSBMHPTb2PsX6aDJ+4Cj4+Hn7UUV/uCVuHVJV1Gvp8Dz7vCYS6r/22yYjmJ2XrT1B2Tqfi1mtxu+sx6MeZw2rKJAszpFVXtQIWUq02B0v4DjEI1ByLkWyOI+v20xttc0rr3ZA5GYpgavMqIYKTSX1zXBrXMgwLaqWqs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1756207825; c=relaxed/simple; bh=9yJi8XkPlIjGzpXZRE5Tn+wCR9xuZunLGtxG03EKwvw=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=sLzL3BIIpTm1TXBTHeqnZ+AyGyw4gZr+/MmHbc1aaqVflSf4u6/wdnzVzbT1CuTIAPG2K2v7lYSSuvxIaS75lHZ9809NbaJ0Fa5e73sCpTQ/lxnhe8QDI/bBb24mrDiWIhmIY2tcVciSAmI/aEXnk8G8qYcrZ3rz7dRTAq56A70= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=ka6pSuu5; 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="ka6pSuu5" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 30D4BC4CEF1; Tue, 26 Aug 2025 11:30:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1756207825; bh=9yJi8XkPlIjGzpXZRE5Tn+wCR9xuZunLGtxG03EKwvw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ka6pSuu5xM3KDXZyjxkCc0PSVY2iZNAmPhYxkHss2CHpor1Ijwq/t7pJXwYUjS9rQ M4tJ5xjyw08bDYmyF4frWod+3qyO/mz7WAoXNnfqKh5mrOW55JUVjBuwbtFRD0Wpla ++KbOcDahgPVKAAdfFS25DFIKfAKCNO8G9LC2MLk= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Tianxiang Peng , "Borislav Petkov (AMD)" , Hui Li , stable@kernel.org Subject: [PATCH 6.16 332/457] x86/cpu/hygon: Add missing resctrl_cpu_detect() in bsp_init helper Date: Tue, 26 Aug 2025 13:10:16 +0200 Message-ID: <20250826110945.544378985@linuxfoundation.org> X-Mailer: git-send-email 2.50.1 In-Reply-To: <20250826110937.289866482@linuxfoundation.org> References: <20250826110937.289866482@linuxfoundation.org> User-Agent: quilt/0.68 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.16-stable review patch. If anyone has any objections, please let me know. ------------------ From: Tianxiang Peng commit d8df126349dad855cdfedd6bbf315bad2e901c2f upstream. Since 923f3a2b48bd ("x86/resctrl: Query LLC monitoring properties once during boot") resctrl_cpu_detect() has been moved from common CPU initialization code to the vendor-specific BSP init helper, while Hygon didn't put that call in their code. This triggers a division by zero fault during early booting stage on our machines with X86_FEATURE_CQM* supported, where get_rdt_mon_resources() tries to calculate mon_l3_config with uninitialized boot_cpu_data.x86_cache_occ_scale. Add the missing resctrl_cpu_detect() in the Hygon BSP init helper. [ bp: Massage commit message. ] Fixes: 923f3a2b48bd ("x86/resctrl: Query LLC monitoring properties once during boot") Signed-off-by: Tianxiang Peng Signed-off-by: Borislav Petkov (AMD) Reviewed-by: Hui Li Cc: Link: https://lore.kernel.org/20250623093153.3016937-1-txpeng@tencent.com Signed-off-by: Greg Kroah-Hartman --- arch/x86/kernel/cpu/hygon.c | 3 +++ 1 file changed, 3 insertions(+) --- a/arch/x86/kernel/cpu/hygon.c +++ b/arch/x86/kernel/cpu/hygon.c @@ -16,6 +16,7 @@ #include #include #include +#include #include "cpu.h" @@ -117,6 +118,8 @@ static void bsp_init_hygon(struct cpuinf x86_amd_ls_cfg_ssbd_mask = 1ULL << 10; } } + + resctrl_cpu_detect(c); } static void early_init_hygon(struct cpuinfo_x86 *c)