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-cleanups-2024-09-17' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip

Pull x86 cleanups from Thomas Gleixner:
"A set of cleanups across x86:

- Use memremap() for the EISA probe instead of ioremap(). EISA is
strictly memory and not MMIO

- Cleanups and enhancement all over the place"

* tag 'x86-cleanups-2024-09-17' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
x86/EISA: Dereference memory directly instead of using readl()
x86/extable: Remove unused declaration fixup_bug()
x86/boot/64: Strip percpu address space when setting up GDT descriptors
x86/cpu: Clarify the error message when BIOS does not support SGX
x86/kexec: Add comments around swap_pages() assembly to improve readability
x86/kexec: Fix a comment of swap_pages() assembly
x86/sgx: Fix a W=1 build warning in function comment
x86/EISA: Use memremap() to probe for the EISA BIOS signature
x86/mtrr: Remove obsolete declaration for mtrr_bp_restore()
x86/cpu_entry_area: Annotate percpu_setup_exception_stacks() as __init

+16 -14
-1
arch/x86/include/asm/extable.h
··· 37 37 38 38 extern int fixup_exception(struct pt_regs *regs, int trapnr, 39 39 unsigned long error_code, unsigned long fault_addr); 40 - extern int fixup_bug(struct pt_regs *regs, int trapnr); 41 40 extern int ex_get_fixup_type(unsigned long ip); 42 41 extern void early_fixup_exception(struct pt_regs *regs, int trapnr); 43 42
-2
arch/x86/include/asm/mtrr.h
··· 69 69 unsigned int type, bool increment); 70 70 extern int mtrr_del(int reg, unsigned long base, unsigned long size); 71 71 extern int mtrr_del_page(int reg, unsigned long base, unsigned long size); 72 - extern void mtrr_bp_restore(void); 73 72 extern int mtrr_trim_uncached_memory(unsigned long end_pfn); 74 73 extern int amd_special_default_mtrr(void); 75 74 void mtrr_disable(void); ··· 116 117 return 0; 117 118 } 118 119 #define mtrr_bp_init() do {} while (0) 119 - #define mtrr_bp_restore() do {} while (0) 120 120 #define mtrr_disable() do {} while (0) 121 121 #define mtrr_enable() do {} while (0) 122 122 #define mtrr_generic_set_state() do {} while (0)
+1 -1
arch/x86/kernel/cpu/feat_ctl.c
··· 188 188 update_sgx: 189 189 if (!(msr & FEAT_CTL_SGX_ENABLED)) { 190 190 if (enable_sgx_kvm || enable_sgx_driver) 191 - pr_err_once("SGX disabled by BIOS.\n"); 191 + pr_err_once("SGX disabled or unsupported by BIOS.\n"); 192 192 clear_cpu_cap(c, X86_FEATURE_SGX); 193 193 return; 194 194 }
+1 -1
arch/x86/kernel/cpu/sgx/main.c
··· 733 733 return 0; 734 734 } 735 735 736 - /** 736 + /* 737 737 * A section metric is concatenated in a way that @low bits 12-31 define the 738 738 * bits 12-31 of the metric and @high bits 0-19 define the bits 32-51 of the 739 739 * metric.
+4 -4
arch/x86/kernel/eisa.c
··· 11 11 12 12 static __init int eisa_bus_probe(void) 13 13 { 14 - void __iomem *p; 14 + u32 *p; 15 15 16 16 if ((xen_pv_domain() && !xen_initial_domain()) || cc_platform_has(CC_ATTR_GUEST_SEV_SNP)) 17 17 return 0; 18 18 19 - p = ioremap(0x0FFFD9, 4); 20 - if (p && readl(p) == 'E' + ('I' << 8) + ('S' << 16) + ('A' << 24)) 19 + p = memremap(0x0FFFD9, 4, MEMREMAP_WB); 20 + if (p && *p == 'E' + ('I' << 8) + ('S' << 16) + ('A' << 24)) 21 21 EISA_bus = 1; 22 - iounmap(p); 22 + memunmap(p); 23 23 return 0; 24 24 } 25 25 subsys_initcall(eisa_bus_probe);
+2 -1
arch/x86/kernel/head64.c
··· 559 559 */ 560 560 void __head startup_64_setup_gdt_idt(void) 561 561 { 562 + struct desc_struct *gdt = (void *)(__force unsigned long)init_per_cpu_var(gdt_page.gdt); 562 563 void *handler = NULL; 563 564 564 565 struct desc_ptr startup_gdt_descr = { 565 - .address = (unsigned long)&RIP_REL_REF(init_per_cpu_var(gdt_page.gdt)), 566 + .address = (unsigned long)&RIP_REL_REF(*gdt), 566 567 .size = GDT_SIZE - 1, 567 568 }; 568 569
+7 -3
arch/x86/kernel/relocate_kernel_64.S
··· 170 170 wbinvd 171 171 .Lsme_off: 172 172 173 + /* Save the preserve_context to %r11 as swap_pages clobbers %rcx. */ 173 174 movq %rcx, %r11 174 175 call swap_pages 175 176 ··· 259 258 /* Do the copies */ 260 259 SYM_CODE_START_LOCAL_NOALIGN(swap_pages) 261 260 UNWIND_HINT_END_OF_STACK 262 - movq %rdi, %rcx /* Put the page_list in %rcx */ 261 + movq %rdi, %rcx /* Put the indirection_page in %rcx */ 263 262 xorl %edi, %edi 264 263 xorl %esi, %esi 265 264 jmp 1f ··· 290 289 movq %rcx, %rsi /* For ever source page do a copy */ 291 290 andq $0xfffffffffffff000, %rsi 292 291 293 - movq %rdi, %rdx 294 - movq %rsi, %rax 292 + movq %rdi, %rdx /* Save destination page to %rdx */ 293 + movq %rsi, %rax /* Save source page to %rax */ 295 294 295 + /* copy source page to swap page */ 296 296 movq %r10, %rdi 297 297 movl $512, %ecx 298 298 rep ; movsq 299 299 300 + /* copy destination page to source page */ 300 301 movq %rax, %rdi 301 302 movq %rdx, %rsi 302 303 movl $512, %ecx 303 304 rep ; movsq 304 305 306 + /* copy swap page to destination page */ 305 307 movq %rdx, %rdi 306 308 movq %r10, %rsi 307 309 movl $512, %ecx
+1 -1
arch/x86/mm/cpu_entry_area.c
··· 164 164 } 165 165 } 166 166 #else 167 - static inline void percpu_setup_exception_stacks(unsigned int cpu) 167 + static void __init percpu_setup_exception_stacks(unsigned int cpu) 168 168 { 169 169 struct cpu_entry_area *cea = get_cpu_entry_area(cpu); 170 170