Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'x86-urgent-2026-01-18' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip

Pull misc x86 fixes from Ingo Molnar:

- Fix resctrl initialization on Hygon CPUs

- Fix resctrl memory bandwidth counters on Hygon CPUs

- Fix x86 self-tests build bug

* tag 'x86-urgent-2026-01-18' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
selftests/x86: Add selftests include path for kselftest.h after centralization
x86/resctrl: Fix memory bandwidth counter width for Hygon
x86/resctrl: Add missing resctrl initialization for Hygon

+21 -4
+17 -4
arch/x86/kernel/cpu/resctrl/core.c
··· 825 825 826 826 if (boot_cpu_data.x86_vendor == X86_VENDOR_INTEL) 827 827 return __get_mem_config_intel(&hw_res->r_resctrl); 828 - else if (boot_cpu_data.x86_vendor == X86_VENDOR_AMD) 828 + else if (boot_cpu_data.x86_vendor == X86_VENDOR_AMD || 829 + boot_cpu_data.x86_vendor == X86_VENDOR_HYGON) 829 830 return __rdt_get_mem_config_amd(&hw_res->r_resctrl); 830 831 831 832 return false; ··· 988 987 { 989 988 if (boot_cpu_data.x86_vendor == X86_VENDOR_INTEL) 990 989 rdt_init_res_defs_intel(); 991 - else if (boot_cpu_data.x86_vendor == X86_VENDOR_AMD) 990 + else if (boot_cpu_data.x86_vendor == X86_VENDOR_AMD || 991 + boot_cpu_data.x86_vendor == X86_VENDOR_HYGON) 992 992 rdt_init_res_defs_amd(); 993 993 } 994 994 ··· 1021 1019 c->x86_cache_occ_scale = ebx; 1022 1020 c->x86_cache_mbm_width_offset = eax & 0xff; 1023 1021 1024 - if (c->x86_vendor == X86_VENDOR_AMD && !c->x86_cache_mbm_width_offset) 1025 - c->x86_cache_mbm_width_offset = MBM_CNTR_WIDTH_OFFSET_AMD; 1022 + if (!c->x86_cache_mbm_width_offset) { 1023 + switch (c->x86_vendor) { 1024 + case X86_VENDOR_AMD: 1025 + c->x86_cache_mbm_width_offset = MBM_CNTR_WIDTH_OFFSET_AMD; 1026 + break; 1027 + case X86_VENDOR_HYGON: 1028 + c->x86_cache_mbm_width_offset = MBM_CNTR_WIDTH_OFFSET_HYGON; 1029 + break; 1030 + default: 1031 + /* Leave c->x86_cache_mbm_width_offset as 0 */ 1032 + break; 1033 + } 1034 + } 1026 1035 } 1027 1036 } 1028 1037
+3
arch/x86/kernel/cpu/resctrl/internal.h
··· 14 14 15 15 #define MBM_CNTR_WIDTH_OFFSET_AMD 20 16 16 17 + /* Hygon MBM counter width as an offset from MBM_CNTR_WIDTH_BASE */ 18 + #define MBM_CNTR_WIDTH_OFFSET_HYGON 8 19 + 17 20 #define RMID_VAL_ERROR BIT_ULL(63) 18 21 19 22 #define RMID_VAL_UNAVAIL BIT_ULL(62)
+1
tools/testing/selftests/x86/Makefile
··· 36 36 BINARIES_64 := $(patsubst %,$(OUTPUT)/%,$(BINARIES_64)) 37 37 38 38 CFLAGS := -O2 -g -std=gnu99 -pthread -Wall $(KHDR_INCLUDES) 39 + CFLAGS += -I $(top_srcdir)/tools/testing/selftests/ 39 40 40 41 # call32_from_64 in thunks.S uses absolute addresses. 41 42 ifeq ($(CAN_BUILD_WITH_NOPIE),1)