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 Ingo Molnar:
"Misc fixes: two KASAN fixes, two EFI boot fixes, two boot-delay
optimization fixes, and a fix for a IRQ handling hang observed on
virtual platforms"

* 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
x86/mm, kasan: Silence KASAN warnings in get_wchan()
compiler, atomics, kasan: Provide READ_ONCE_NOCHECK()
x86, kasan: Fix build failure on KASAN=y && KMEMCHECK=y kernels
x86/smpboot: Fix CPU #1 boot timeout
x86/smpboot: Fix cpu_init_udelay=10000 corner case boot parameter misbehavior
x86/ioapic: Disable interrupts when re-routing legacy IRQs
x86/setup: Extend low identity map to cover whole kernel range
x86/efi: Fix multiple GOP device support

+100 -25
+6 -2
arch/x86/boot/compressed/eboot.c
··· 667 667 bool conout_found = false; 668 668 void *dummy = NULL; 669 669 u32 h = handles[i]; 670 + u32 current_fb_base; 670 671 671 672 status = efi_call_early(handle_protocol, h, 672 673 proto, (void **)&gop32); ··· 679 678 if (status == EFI_SUCCESS) 680 679 conout_found = true; 681 680 682 - status = __gop_query32(gop32, &info, &size, &fb_base); 681 + status = __gop_query32(gop32, &info, &size, &current_fb_base); 683 682 if (status == EFI_SUCCESS && (!first_gop || conout_found)) { 684 683 /* 685 684 * Systems that use the UEFI Console Splitter may ··· 693 692 pixel_format = info->pixel_format; 694 693 pixel_info = info->pixel_information; 695 694 pixels_per_scan_line = info->pixels_per_scan_line; 695 + fb_base = current_fb_base; 696 696 697 697 /* 698 698 * Once we've found a GOP supporting ConOut, ··· 772 770 bool conout_found = false; 773 771 void *dummy = NULL; 774 772 u64 h = handles[i]; 773 + u32 current_fb_base; 775 774 776 775 status = efi_call_early(handle_protocol, h, 777 776 proto, (void **)&gop64); ··· 784 781 if (status == EFI_SUCCESS) 785 782 conout_found = true; 786 783 787 - status = __gop_query64(gop64, &info, &size, &fb_base); 784 + status = __gop_query64(gop64, &info, &size, &current_fb_base); 788 785 if (status == EFI_SUCCESS && (!first_gop || conout_found)) { 789 786 /* 790 787 * Systems that use the UEFI Console Splitter may ··· 798 795 pixel_format = info->pixel_format; 799 796 pixel_info = info->pixel_information; 800 797 pixels_per_scan_line = info->pixels_per_scan_line; 798 + fb_base = current_fb_base; 801 799 802 800 /* 803 801 * Once we've found a GOP supporting ConOut,
+2 -3
arch/x86/include/asm/string_64.h
··· 27 27 function. */ 28 28 29 29 #define __HAVE_ARCH_MEMCPY 1 30 + extern void *memcpy(void *to, const void *from, size_t len); 30 31 extern void *__memcpy(void *to, const void *from, size_t len); 31 32 32 33 #ifndef CONFIG_KMEMCHECK 33 - #if (__GNUC__ == 4 && __GNUC_MINOR__ >= 3) || __GNUC__ > 4 34 - extern void *memcpy(void *to, const void *from, size_t len); 35 - #else 34 + #if (__GNUC__ == 4 && __GNUC_MINOR__ < 3) || __GNUC__ < 4 36 35 #define memcpy(dst, src, len) \ 37 36 ({ \ 38 37 size_t __len = (len); \
+4
arch/x86/kernel/apic/io_apic.c
··· 2907 2907 struct irq_data *irq_data; 2908 2908 struct mp_chip_data *data; 2909 2909 struct irq_alloc_info *info = arg; 2910 + unsigned long flags; 2910 2911 2911 2912 if (!info || nr_irqs > 1) 2912 2913 return -EINVAL; ··· 2940 2939 2941 2940 cfg = irqd_cfg(irq_data); 2942 2941 add_pin_to_irq_node(data, ioapic_alloc_attr_node(info), ioapic, pin); 2942 + 2943 + local_irq_save(flags); 2943 2944 if (info->ioapic_entry) 2944 2945 mp_setup_entry(cfg, data, info->ioapic_entry); 2945 2946 mp_register_handler(virq, data->trigger); 2946 2947 if (virq < nr_legacy_irqs()) 2947 2948 legacy_pic->mask(virq); 2949 + local_irq_restore(flags); 2948 2950 2949 2951 apic_printk(APIC_VERBOSE, KERN_DEBUG 2950 2952 "IOAPIC[%d]: Set routing entry (%d-%d -> 0x%x -> IRQ %d Mode:%i Active:%i Dest:%d)\n",
+3 -3
arch/x86/kernel/process.c
··· 550 550 if (sp < bottom || sp > top) 551 551 return 0; 552 552 553 - fp = READ_ONCE(*(unsigned long *)sp); 553 + fp = READ_ONCE_NOCHECK(*(unsigned long *)sp); 554 554 do { 555 555 if (fp < bottom || fp > top) 556 556 return 0; 557 - ip = READ_ONCE(*(unsigned long *)(fp + sizeof(unsigned long))); 557 + ip = READ_ONCE_NOCHECK(*(unsigned long *)(fp + sizeof(unsigned long))); 558 558 if (!in_sched_functions(ip)) 559 559 return ip; 560 - fp = READ_ONCE(*(unsigned long *)fp); 560 + fp = READ_ONCE_NOCHECK(*(unsigned long *)fp); 561 561 } while (count++ < 16 && p->state != TASK_RUNNING); 562 562 return 0; 563 563 }
+8
arch/x86/kernel/setup.c
··· 1173 1173 clone_pgd_range(initial_page_table + KERNEL_PGD_BOUNDARY, 1174 1174 swapper_pg_dir + KERNEL_PGD_BOUNDARY, 1175 1175 KERNEL_PGD_PTRS); 1176 + 1177 + /* 1178 + * sync back low identity map too. It is used for example 1179 + * in the 32-bit EFI stub. 1180 + */ 1181 + clone_pgd_range(initial_page_table, 1182 + swapper_pg_dir + KERNEL_PGD_BOUNDARY, 1183 + KERNEL_PGD_PTRS); 1176 1184 #endif 1177 1185 1178 1186 tboot_probe();
+11 -4
arch/x86/kernel/smpboot.c
··· 509 509 */ 510 510 #define UDELAY_10MS_DEFAULT 10000 511 511 512 - static unsigned int init_udelay = UDELAY_10MS_DEFAULT; 512 + static unsigned int init_udelay = INT_MAX; 513 513 514 514 static int __init cpu_init_udelay(char *str) 515 515 { ··· 522 522 static void __init smp_quirk_init_udelay(void) 523 523 { 524 524 /* if cmdline changed it from default, leave it alone */ 525 - if (init_udelay != UDELAY_10MS_DEFAULT) 525 + if (init_udelay != INT_MAX) 526 526 return; 527 527 528 528 /* if modern processor, use no delay */ 529 529 if (((boot_cpu_data.x86_vendor == X86_VENDOR_INTEL) && (boot_cpu_data.x86 == 6)) || 530 530 ((boot_cpu_data.x86_vendor == X86_VENDOR_AMD) && (boot_cpu_data.x86 >= 0xF))) 531 531 init_udelay = 0; 532 + 533 + /* else, use legacy delay */ 534 + init_udelay = UDELAY_10MS_DEFAULT; 532 535 } 533 536 534 537 /* ··· 660 657 /* 661 658 * Give the other CPU some time to accept the IPI. 662 659 */ 663 - if (init_udelay) 660 + if (init_udelay == 0) 661 + udelay(10); 662 + else 664 663 udelay(300); 665 664 666 665 pr_debug("Startup point 1\n"); ··· 673 668 /* 674 669 * Give the other CPU some time to accept the IPI. 675 670 */ 676 - if (init_udelay) 671 + if (init_udelay == 0) 672 + udelay(10); 673 + else 677 674 udelay(200); 678 675 679 676 if (maxlvt > 3) /* Due to the Pentium erratum 3AP. */
+13
include/linux/compiler-gcc.h
··· 237 237 #define KASAN_ABI_VERSION 3 238 238 #endif 239 239 240 + #if GCC_VERSION >= 40902 241 + /* 242 + * Tell the compiler that address safety instrumentation (KASAN) 243 + * should not be applied to that function. 244 + * Conflicts with inlining: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67368 245 + */ 246 + #define __no_sanitize_address __attribute__((no_sanitize_address)) 247 + #endif 248 + 240 249 #endif /* gcc version >= 40000 specific checks */ 241 250 242 251 #if !defined(__noclone) 243 252 #define __noclone /* not needed */ 253 + #endif 254 + 255 + #if !defined(__no_sanitize_address) 256 + #define __no_sanitize_address 244 257 #endif 245 258 246 259 /*
+53 -13
include/linux/compiler.h
··· 198 198 199 199 #include <uapi/linux/types.h> 200 200 201 - static __always_inline void __read_once_size(const volatile void *p, void *res, int size) 201 + #define __READ_ONCE_SIZE \ 202 + ({ \ 203 + switch (size) { \ 204 + case 1: *(__u8 *)res = *(volatile __u8 *)p; break; \ 205 + case 2: *(__u16 *)res = *(volatile __u16 *)p; break; \ 206 + case 4: *(__u32 *)res = *(volatile __u32 *)p; break; \ 207 + case 8: *(__u64 *)res = *(volatile __u64 *)p; break; \ 208 + default: \ 209 + barrier(); \ 210 + __builtin_memcpy((void *)res, (const void *)p, size); \ 211 + barrier(); \ 212 + } \ 213 + }) 214 + 215 + static __always_inline 216 + void __read_once_size(const volatile void *p, void *res, int size) 202 217 { 203 - switch (size) { 204 - case 1: *(__u8 *)res = *(volatile __u8 *)p; break; 205 - case 2: *(__u16 *)res = *(volatile __u16 *)p; break; 206 - case 4: *(__u32 *)res = *(volatile __u32 *)p; break; 207 - case 8: *(__u64 *)res = *(volatile __u64 *)p; break; 208 - default: 209 - barrier(); 210 - __builtin_memcpy((void *)res, (const void *)p, size); 211 - barrier(); 212 - } 218 + __READ_ONCE_SIZE; 213 219 } 220 + 221 + #ifdef CONFIG_KASAN 222 + /* 223 + * This function is not 'inline' because __no_sanitize_address confilcts 224 + * with inlining. Attempt to inline it may cause a build failure. 225 + * https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67368 226 + * '__maybe_unused' allows us to avoid defined-but-not-used warnings. 227 + */ 228 + static __no_sanitize_address __maybe_unused 229 + void __read_once_size_nocheck(const volatile void *p, void *res, int size) 230 + { 231 + __READ_ONCE_SIZE; 232 + } 233 + #else 234 + static __always_inline 235 + void __read_once_size_nocheck(const volatile void *p, void *res, int size) 236 + { 237 + __READ_ONCE_SIZE; 238 + } 239 + #endif 214 240 215 241 static __always_inline void __write_once_size(volatile void *p, void *res, int size) 216 242 { ··· 274 248 * required ordering. 275 249 */ 276 250 277 - #define READ_ONCE(x) \ 278 - ({ union { typeof(x) __val; char __c[1]; } __u; __read_once_size(&(x), __u.__c, sizeof(x)); __u.__val; }) 251 + #define __READ_ONCE(x, check) \ 252 + ({ \ 253 + union { typeof(x) __val; char __c[1]; } __u; \ 254 + if (check) \ 255 + __read_once_size(&(x), __u.__c, sizeof(x)); \ 256 + else \ 257 + __read_once_size_nocheck(&(x), __u.__c, sizeof(x)); \ 258 + __u.__val; \ 259 + }) 260 + #define READ_ONCE(x) __READ_ONCE(x, 1) 261 + 262 + /* 263 + * Use READ_ONCE_NOCHECK() instead of READ_ONCE() if you need 264 + * to hide memory access from KASAN. 265 + */ 266 + #define READ_ONCE_NOCHECK(x) __READ_ONCE(x, 0) 279 267 280 268 #define WRITE_ONCE(x, val) \ 281 269 ({ \