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 branch 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip

Pull x86 fixes from Thomas Gleixner:
"A pile of x86 updates:

- Prevent exceeding he valid physical address space in the /dev/mem
limit checks.

- Move all header content inside the header guard to prevent compile
failures.

- Fix the bogus __percpu annotation in this_cpu_has() which makes
sparse very noisy.

- Disable switch jump tables completely when retpolines are enabled.

- Prevent leaking the trampoline address"

* 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
x86/realmode: Make set_real_mode_mem() static inline
x86/cpufeature: Fix __percpu annotation in this_cpu_has()
x86/mm: Don't exceed the valid physical address space
x86/retpolines: Disable switch jump tables when retpolines are enabled
x86/realmode: Don't leak the trampoline kernel address
x86/boot: Fix incorrect ifdeffery scope
x86/resctrl: Remove unused variable

+19 -22
+6 -2
arch/x86/Makefile
··· 219 219 # Additionally, avoid generating expensive indirect jumps which 220 220 # are subject to retpolines for small number of switch cases. 221 221 # clang turns off jump table generation by default when under 222 - # retpoline builds, however, gcc does not for x86. 223 - KBUILD_CFLAGS += $(call cc-option,--param=case-values-threshold=20) 222 + # retpoline builds, however, gcc does not for x86. This has 223 + # only been fixed starting from gcc stable version 8.4.0 and 224 + # onwards, but not for older ones. See gcc bug #86952. 225 + ifndef CONFIG_CC_IS_CLANG 226 + KBUILD_CFLAGS += $(call cc-option,-fno-jump-tables) 227 + endif 224 228 endif 225 229 226 230 archscripts: scripts_basic
+2 -2
arch/x86/boot/compressed/misc.h
··· 120 120 121 121 void set_sev_encryption_mask(void); 122 122 123 - #endif 124 - 125 123 /* acpi.c */ 126 124 #ifdef CONFIG_ACPI 127 125 acpi_physical_address get_rsdp_addr(void); ··· 133 135 #else 134 136 static inline int count_immovable_mem_regions(void) { return 0; } 135 137 #endif 138 + 139 + #endif /* BOOT_COMPRESSED_MISC_H */
+3 -2
arch/x86/include/asm/cpufeature.h
··· 112 112 test_cpu_cap(c, bit)) 113 113 114 114 #define this_cpu_has(bit) \ 115 - (__builtin_constant_p(bit) && REQUIRED_MASK_BIT_SET(bit) ? 1 : \ 116 - x86_this_cpu_test_bit(bit, (unsigned long *)&cpu_info.x86_capability)) 115 + (__builtin_constant_p(bit) && REQUIRED_MASK_BIT_SET(bit) ? 1 : \ 116 + x86_this_cpu_test_bit(bit, \ 117 + (unsigned long __percpu *)&cpu_info.x86_capability)) 117 118 118 119 /* 119 120 * This macro is for detection of features which need kernel
+5 -1
arch/x86/include/asm/realmode.h
··· 77 77 return ALIGN(real_mode_blob_end - real_mode_blob, PAGE_SIZE); 78 78 } 79 79 80 - void set_real_mode_mem(phys_addr_t mem, size_t size); 80 + static inline void set_real_mode_mem(phys_addr_t mem) 81 + { 82 + real_mode_header = (struct real_mode_header *) __va(mem); 83 + } 84 + 81 85 void reserve_real_mode(void); 82 86 83 87 #endif /* __ASSEMBLY__ */
-3
arch/x86/kernel/cpu/resctrl/monitor.c
··· 501 501 void cqm_setup_limbo_handler(struct rdt_domain *dom, unsigned long delay_ms) 502 502 { 503 503 unsigned long delay = msecs_to_jiffies(delay_ms); 504 - struct rdt_resource *r; 505 504 int cpu; 506 - 507 - r = &rdt_resources_all[RDT_RESOURCE_L3]; 508 505 509 506 cpu = cpumask_any(&dom->cpu_mask); 510 507 dom->cqm_work_cpu = cpu;
+1 -1
arch/x86/mm/mmap.c
··· 230 230 /* Can we access it for direct reading/writing? Must be RAM: */ 231 231 int valid_phys_addr_range(phys_addr_t addr, size_t count) 232 232 { 233 - return addr + count <= __pa(high_memory); 233 + return addr + count - 1 <= __pa(high_memory - 1); 234 234 } 235 235 236 236 /* Can we access it through mmap? Must be a valid physical address: */
+1 -1
arch/x86/platform/efi/quirks.c
··· 449 449 */ 450 450 rm_size = real_mode_size_needed(); 451 451 if (rm_size && (start + rm_size) < (1<<20) && size >= rm_size) { 452 - set_real_mode_mem(start, rm_size); 452 + set_real_mode_mem(start); 453 453 start += rm_size; 454 454 size -= rm_size; 455 455 }
+1 -10
arch/x86/realmode/init.c
··· 15 15 /* Hold the pgd entry used on booting additional CPUs */ 16 16 pgd_t trampoline_pgd_entry; 17 17 18 - void __init set_real_mode_mem(phys_addr_t mem, size_t size) 19 - { 20 - void *base = __va(mem); 21 - 22 - real_mode_header = (struct real_mode_header *) base; 23 - printk(KERN_DEBUG "Base memory trampoline at [%p] %llx size %zu\n", 24 - base, (unsigned long long)mem, size); 25 - } 26 - 27 18 void __init reserve_real_mode(void) 28 19 { 29 20 phys_addr_t mem; ··· 33 42 } 34 43 35 44 memblock_reserve(mem, size); 36 - set_real_mode_mem(mem, size); 45 + set_real_mode_mem(mem); 37 46 } 38 47 39 48 static void __init setup_real_mode(void)