linux-yocto/arch
Xiaochen Shen 43d8f1f001 x86/resctrl: Fix memory bandwidth counter width for Hygon
commit 7517e899e1b87b4c22a92c7e40d8733c48e4ec3c upstream.

The memory bandwidth calculation relies on reading the hardware counter
and measuring the delta between samples. To ensure accurate measurement,
the software reads the counter frequently enough to prevent it from
rolling over twice between reads.

The default Memory Bandwidth Monitoring (MBM) counter width is 24 bits.
Hygon CPUs provide a 32-bit width counter, but they do not support the
MBM capability CPUID leaf (0xF.[ECX=1]:EAX) to report the width offset
(from 24 bits).

Consequently, the kernel falls back to the 24-bit default counter width,
which causes incorrect overflow handling on Hygon CPUs.

Fix this by explicitly setting the counter width offset to 8 bits (resulting
in a 32-bit total counter width) for Hygon CPUs.

Fixes: d8df126349 ("x86/cpu/hygon: Add missing resctrl_cpu_detect() in bsp_init helper")
Signed-off-by: Xiaochen Shen <shenxiaochen@open-hieco.net>
Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de>
Reviewed-by: Tony Luck <tony.luck@intel.com>
Reviewed-by: Reinette Chatre <reinette.chatre@intel.com>
Cc: stable@vger.kernel.org
Link: https://patch.msgid.link/20251209062650.1536952-3-shenxiaochen@open-hieco.net
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2026-01-23 11:21:29 +01:00
..
alpha alpha: don't reference obsolete termio struct for TC* constants 2026-01-17 16:35:16 +01:00
arc Ext4 bug fixes for 6.18-rc2, including 2025-10-15 07:51:57 -07:00
arm ARM: dts: imx6q-ba16: fix RTC interrupt level 2026-01-17 16:35:20 +01:00
arm64 arm64: dts: mba8mx: Fix Ethernet PHY IRQ support 2026-01-17 16:35:21 +01:00
csky csky: fix csky_cmpxchg_fixup not working 2026-01-17 16:35:16 +01:00
hexagon Remove long-stale ext3 defconfig option 2025-10-15 07:57:28 -07:00
loongarch LoongArch: BPF: Enhance the bpf_arch_text_poke() function 2026-01-08 10:17:21 +01:00
m68k Ext4 bug fixes for 6.18-rc2, including 2025-10-15 07:51:57 -07:00
microblaze Ext4 bug fixes for 6.18-rc2, including 2025-10-15 07:51:57 -07:00
mips mips: fix HIGHMEM initialization 2026-01-23 11:21:20 +01:00
nios2
openrisc Ext4 bug fixes for 6.18-rc2, including 2025-10-15 07:51:57 -07:00
parisc parisc: entry: set W bit for !compat tasks in syscall_restore_rfi() 2026-01-08 10:17:01 +01:00
powerpc powerpc/pseries/cmm: call balloon_devinfo_init() also without CONFIG_BALLOON_COMPACTION 2026-01-08 10:17:02 +01:00
riscv riscv: pgtable: Cleanup useless VA_USER_XXX definitions 2026-01-17 16:35:25 +01:00
s390 KVM: s390: Fix gmap_helper_zap_one_page() again 2026-01-08 10:16:41 +01:00
sh Remove long-stale ext3 defconfig option 2025-10-15 07:57:28 -07:00
sparc sparc/PCI: Correct 64-bit non-pref -> pref BAR resources 2026-01-17 16:35:29 +01:00
um um: init cpu_tasks[] earlier 2026-01-02 12:56:59 +01:00
x86 x86/resctrl: Fix memory bandwidth counter width for Hygon 2026-01-23 11:21:29 +01:00
xtensa Ext4 bug fixes for 6.18-rc2, including 2025-10-15 07:51:57 -07:00
.gitignore
Kconfig compiler_types: Introduce __nocfi_generic 2025-10-29 20:04:55 -07:00