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_for_v5.19_rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip

Pull x86 fixes from Borislav Petkov:

- Prepare for and clear .brk early in order to address XenPV guests
failures where the hypervisor verifies page tables and uninitialized
data in that range leads to bogus failures in those checks

- Add any potential setup_data entries supplied at boot to the identity
pagetable mappings to prevent kexec kernel boot failures. Usually,
this is not a problem for the normal kernel as those mappings are
part of the initially mapped 2M pages but if kexec gets to allocate
the second kernel somewhere else, those setup_data entries need to be
mapped there too.

- Fix objtool not to discard text references from the __tracepoints
section so that ENDBR validation still works

- Correct the setup_data types limit as it is user-visible, before 5.19
releases

* tag 'x86_urgent_for_v5.19_rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
x86/boot: Fix the setup data types max limit
x86/ibt, objtool: Don't discard text references from tracepoint section
x86/compressed/64: Add identity mappings for setup_data entries
x86: Fix .brk attribute in linker script
x86: Clear .brk area at early boot
x86/xen: Use clear_bss() for Xen PV guests

+29 -16
+13
arch/x86/boot/compressed/ident_map_64.c
··· 110 110 void initialize_identity_maps(void *rmode) 111 111 { 112 112 unsigned long cmdline; 113 + struct setup_data *sd; 113 114 114 115 /* Exclude the encryption mask from __PHYSICAL_MASK */ 115 116 physical_mask &= ~sme_me_mask; ··· 163 162 kernel_add_identity_map((unsigned long)boot_params, (unsigned long)(boot_params + 1)); 164 163 cmdline = get_cmd_line_ptr(); 165 164 kernel_add_identity_map(cmdline, cmdline + COMMAND_LINE_SIZE); 165 + 166 + /* 167 + * Also map the setup_data entries passed via boot_params in case they 168 + * need to be accessed by uncompressed kernel via the identity mapping. 169 + */ 170 + sd = (struct setup_data *)boot_params->hdr.setup_data; 171 + while (sd) { 172 + unsigned long sd_addr = (unsigned long)sd; 173 + 174 + kernel_add_identity_map(sd_addr, sd_addr + sizeof(*sd) + sd->len); 175 + sd = (struct setup_data *)sd->next; 176 + } 166 177 167 178 sev_prep_identity_maps(top_level_pgt); 168 179
+3
arch/x86/include/asm/setup.h
··· 120 120 static char __brk_##name[size] 121 121 122 122 extern void probe_roms(void); 123 + 124 + void clear_bss(void); 125 + 123 126 #ifdef __i386__ 124 127 125 128 asmlinkage void __init i386_start_kernel(void);
+1 -1
arch/x86/include/uapi/asm/bootparam.h
··· 15 15 #define SETUP_INDIRECT (1<<31) 16 16 17 17 /* SETUP_INDIRECT | max(SETUP_*) */ 18 - #define SETUP_TYPE_MAX (SETUP_INDIRECT | SETUP_JAILHOUSE) 18 + #define SETUP_TYPE_MAX (SETUP_INDIRECT | SETUP_CC_BLOB) 19 19 20 20 /* ram_size flags */ 21 21 #define RAMDISK_IMAGE_START_MASK 0x07FF
+3 -1
arch/x86/kernel/head64.c
··· 426 426 427 427 /* Don't add a printk in there. printk relies on the PDA which is not initialized 428 428 yet. */ 429 - static void __init clear_bss(void) 429 + void __init clear_bss(void) 430 430 { 431 431 memset(__bss_start, 0, 432 432 (unsigned long) __bss_stop - (unsigned long) __bss_start); 433 + memset(__brk_base, 0, 434 + (unsigned long) __brk_limit - (unsigned long) __brk_base); 433 435 } 434 436 435 437 static unsigned long get_cmd_line_ptr(void)
+1 -1
arch/x86/kernel/vmlinux.lds.S
··· 385 385 __end_of_kernel_reserve = .; 386 386 387 387 . = ALIGN(PAGE_SIZE); 388 - .brk (NOLOAD) : AT(ADDR(.brk) - LOAD_OFFSET) { 388 + .brk : AT(ADDR(.brk) - LOAD_OFFSET) { 389 389 __brk_base = .; 390 390 . += 64 * 1024; /* 64k alignment slop space */ 391 391 *(.bss..brk) /* areas brk users have reserved */
+6 -2
arch/x86/xen/enlighten_pv.c
··· 1183 1183 extern void early_xen_iret_patch(void); 1184 1184 1185 1185 /* First C function to be called on Xen boot */ 1186 - asmlinkage __visible void __init xen_start_kernel(void) 1186 + asmlinkage __visible void __init xen_start_kernel(struct start_info *si) 1187 1187 { 1188 1188 struct physdev_set_iopl set_iopl; 1189 1189 unsigned long initrd_start = 0; 1190 1190 int rc; 1191 1191 1192 - if (!xen_start_info) 1192 + if (!si) 1193 1193 return; 1194 + 1195 + clear_bss(); 1196 + 1197 + xen_start_info = si; 1194 1198 1195 1199 __text_gen_insn(&early_xen_iret_patch, 1196 1200 JMP32_INSN_OPCODE, &early_xen_iret_patch, &xen_iret,
+1 -9
arch/x86/xen/xen-head.S
··· 48 48 ANNOTATE_NOENDBR 49 49 cld 50 50 51 - /* Clear .bss */ 52 - xor %eax,%eax 53 - mov $__bss_start, %rdi 54 - mov $__bss_stop, %rcx 55 - sub %rdi, %rcx 56 - shr $3, %rcx 57 - rep stosq 58 - 59 - mov %rsi, xen_start_info 60 51 mov initial_stack(%rip), %rsp 61 52 62 53 /* Set up %gs. ··· 62 71 cdq 63 72 wrmsr 64 73 74 + mov %rsi, %rdi 65 75 call xen_start_kernel 66 76 SYM_CODE_END(startup_xen) 67 77 __FINIT
+1 -2
tools/objtool/check.c
··· 3826 3826 !strcmp(sec->name, "__bug_table") || 3827 3827 !strcmp(sec->name, "__ex_table") || 3828 3828 !strcmp(sec->name, "__jump_table") || 3829 - !strcmp(sec->name, "__mcount_loc") || 3830 - !strcmp(sec->name, "__tracepoints")) 3829 + !strcmp(sec->name, "__mcount_loc")) 3831 3830 continue; 3832 3831 3833 3832 list_for_each_entry(reloc, &sec->reloc->reloc_list, list)