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-2023-10-15' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip

Pull x86 fixes from Ingo Molnar:
"Fix a false-positive KASAN warning, fix an AMD erratum on Zen4 CPUs,
and fix kernel-doc build warnings"

* tag 'x86-urgent-2023-10-15' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
x86/alternatives: Disable KASAN in apply_alternatives()
x86/cpu: Fix AMD erratum #1485 on Zen4-based CPUs
x86/resctrl: Fix kernel-doc warnings

+33 -7
+7 -2
arch/x86/include/asm/msr-index.h
··· 637 637 /* AMD Last Branch Record MSRs */ 638 638 #define MSR_AMD64_LBR_SELECT 0xc000010e 639 639 640 - /* Fam 17h MSRs */ 641 - #define MSR_F17H_IRPERF 0xc00000e9 640 + /* Zen4 */ 641 + #define MSR_ZEN4_BP_CFG 0xc001102e 642 + #define MSR_ZEN4_BP_CFG_SHARED_BTB_FIX_BIT 5 642 643 644 + /* Zen 2 */ 643 645 #define MSR_ZEN2_SPECTRAL_CHICKEN 0xc00110e3 644 646 #define MSR_ZEN2_SPECTRAL_CHICKEN_BIT BIT_ULL(1) 647 + 648 + /* Fam 17h MSRs */ 649 + #define MSR_F17H_IRPERF 0xc00000e9 645 650 646 651 /* Fam 16h MSRs */ 647 652 #define MSR_F16H_L2I_PERF_CTL 0xc0010230
+13
arch/x86/kernel/alternative.c
··· 403 403 u8 insn_buff[MAX_PATCH_LEN]; 404 404 405 405 DPRINTK(ALT, "alt table %px, -> %px", start, end); 406 + 407 + /* 408 + * In the case CONFIG_X86_5LEVEL=y, KASAN_SHADOW_START is defined using 409 + * cpu_feature_enabled(X86_FEATURE_LA57) and is therefore patched here. 410 + * During the process, KASAN becomes confused seeing partial LA57 411 + * conversion and triggers a false-positive out-of-bound report. 412 + * 413 + * Disable KASAN until the patching is complete. 414 + */ 415 + kasan_disable_current(); 416 + 406 417 /* 407 418 * The scan order should be from start to end. A later scanned 408 419 * alternative code can overwrite previously scanned alternative code. ··· 463 452 464 453 text_poke_early(instr, insn_buff, insn_buff_sz); 465 454 } 455 + 456 + kasan_enable_current(); 466 457 } 467 458 468 459 static inline bool is_jcc32(struct insn *insn)
+8
arch/x86/kernel/cpu/amd.c
··· 80 80 AMD_LEGACY_ERRATUM(AMD_MODEL_RANGE(0x17, 0x00, 0x0, 0x2f, 0xf), 81 81 AMD_MODEL_RANGE(0x17, 0x50, 0x0, 0x5f, 0xf)); 82 82 83 + static const int amd_erratum_1485[] = 84 + AMD_LEGACY_ERRATUM(AMD_MODEL_RANGE(0x19, 0x10, 0x0, 0x1f, 0xf), 85 + AMD_MODEL_RANGE(0x19, 0x60, 0x0, 0xaf, 0xf)); 86 + 83 87 static bool cpu_has_amd_erratum(struct cpuinfo_x86 *cpu, const int *erratum) 84 88 { 85 89 int osvw_id = *erratum++; ··· 1153 1149 pr_notice_once("AMD Zen1 DIV0 bug detected. Disable SMT for full protection.\n"); 1154 1150 setup_force_cpu_bug(X86_BUG_DIV0); 1155 1151 } 1152 + 1153 + if (!cpu_has(c, X86_FEATURE_HYPERVISOR) && 1154 + cpu_has_amd_erratum(c, amd_erratum_1485)) 1155 + msr_set_bit(MSR_ZEN4_BP_CFG, MSR_ZEN4_BP_CFG_SHARED_BTB_FIX_BIT); 1156 1156 } 1157 1157 1158 1158 #ifdef CONFIG_X86_32
+5 -5
arch/x86/kernel/cpu/resctrl/monitor.c
··· 30 30 struct list_head list; 31 31 }; 32 32 33 - /** 34 - * @rmid_free_lru A least recently used list of free RMIDs 33 + /* 34 + * @rmid_free_lru - A least recently used list of free RMIDs 35 35 * These RMIDs are guaranteed to have an occupancy less than the 36 36 * threshold occupancy 37 37 */ 38 38 static LIST_HEAD(rmid_free_lru); 39 39 40 - /** 41 - * @rmid_limbo_count count of currently unused but (potentially) 40 + /* 41 + * @rmid_limbo_count - count of currently unused but (potentially) 42 42 * dirty RMIDs. 43 43 * This counts RMIDs that no one is currently using but that 44 44 * may have a occupancy value > resctrl_rmid_realloc_threshold. User can ··· 46 46 */ 47 47 static unsigned int rmid_limbo_count; 48 48 49 - /** 49 + /* 50 50 * @rmid_entry - The entry in the limbo and free lists. 51 51 */ 52 52 static struct rmid_entry *rmid_ptrs;