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

Pull x86 fixes from Borislav Petkov:

- Fix build error on RHEL where -Werror=maybe-uninitialized is set.

- Restore the firmware's IDT when calling EFI boot services and before
ExitBootServices() has been called. This fixes a boot failure on what
appears to be a tablet with 32-bit UEFI running a 64-bit kernel.

* tag 'x86_urgent_for_v5.14' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
x86/resctrl: Fix a maybe-uninitialized build warning treated as error
x86/efi: Restore Firmware IDT before calling ExitBootServices()

+30 -9
+21 -9
arch/x86/boot/compressed/efi_thunk_64.S
··· 5 5 * Early support for invoking 32-bit EFI services from a 64-bit kernel. 6 6 * 7 7 * Because this thunking occurs before ExitBootServices() we have to 8 - * restore the firmware's 32-bit GDT before we make EFI service calls, 9 - * since the firmware's 32-bit IDT is still currently installed and it 10 - * needs to be able to service interrupts. 8 + * restore the firmware's 32-bit GDT and IDT before we make EFI service 9 + * calls. 11 10 * 12 11 * On the plus side, we don't have to worry about mangling 64-bit 13 12 * addresses into 32-bits because we're executing with an identity ··· 38 39 /* 39 40 * Convert x86-64 ABI params to i386 ABI 40 41 */ 41 - subq $32, %rsp 42 + subq $64, %rsp 42 43 movl %esi, 0x0(%rsp) 43 44 movl %edx, 0x4(%rsp) 44 45 movl %ecx, 0x8(%rsp) ··· 48 49 leaq 0x14(%rsp), %rbx 49 50 sgdt (%rbx) 50 51 52 + addq $16, %rbx 53 + sidt (%rbx) 54 + 51 55 /* 52 - * Switch to gdt with 32-bit segments. This is the firmware GDT 53 - * that was installed when the kernel started executing. This 54 - * pointer was saved at the EFI stub entry point in head_64.S. 56 + * Switch to IDT and GDT with 32-bit segments. This is the firmware GDT 57 + * and IDT that was installed when the kernel started executing. The 58 + * pointers were saved at the EFI stub entry point in head_64.S. 55 59 * 56 60 * Pass the saved DS selector to the 32-bit code, and use far return to 57 61 * restore the saved CS selector. 58 62 */ 63 + leaq efi32_boot_idt(%rip), %rax 64 + lidt (%rax) 59 65 leaq efi32_boot_gdt(%rip), %rax 60 66 lgdt (%rax) 61 67 ··· 71 67 pushq %rax 72 68 lretq 73 69 74 - 1: addq $32, %rsp 70 + 1: addq $64, %rsp 75 71 movq %rdi, %rax 76 72 77 73 pop %rbx ··· 132 128 133 129 /* 134 130 * Some firmware will return with interrupts enabled. Be sure to 135 - * disable them before we switch GDTs. 131 + * disable them before we switch GDTs and IDTs. 136 132 */ 137 133 cli 134 + 135 + lidtl (%ebx) 136 + subl $16, %ebx 138 137 139 138 lgdtl (%ebx) 140 139 ··· 172 165 .word 0 173 166 .quad 0 174 167 SYM_DATA_END(efi32_boot_gdt) 168 + 169 + SYM_DATA_START(efi32_boot_idt) 170 + .word 0 171 + .quad 0 172 + SYM_DATA_END(efi32_boot_idt) 175 173 176 174 SYM_DATA_START(efi32_boot_cs) 177 175 .word 0
+3
arch/x86/boot/compressed/head_64.S
··· 319 319 movw %cs, rva(efi32_boot_cs)(%ebp) 320 320 movw %ds, rva(efi32_boot_ds)(%ebp) 321 321 322 + /* Store firmware IDT descriptor */ 323 + sidtl rva(efi32_boot_idt)(%ebp) 324 + 322 325 /* Disable paging */ 323 326 movl %cr0, %eax 324 327 btrl $X86_CR0_PG_BIT, %eax
+6
arch/x86/kernel/cpu/resctrl/monitor.c
··· 304 304 case QOS_L3_MBM_LOCAL_EVENT_ID: 305 305 m = &rr->d->mbm_local[rmid]; 306 306 break; 307 + default: 308 + /* 309 + * Code would never reach here because an invalid 310 + * event id would fail the __rmid_read. 311 + */ 312 + return RMID_VAL_ERROR; 307 313 } 308 314 309 315 if (rr->first) {