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 Thoma Gleixner:
"Another round of fixes for x86:

- Move the initialization of the microcode driver to late_initcall to
make sure everything that init function needs is available.

- Make sure that lockdep knows about interrupts being off in the
entry code before calling into c-code.

- Undo the cpu hotplug init delay regression.

- Use the proper conditionals in the mpx instruction decoder.

- Fixup restart_syscall for x32 tasks.

- Fix the hugepage regression on PAE kernels which was introduced
with the latest PAT changes"

* 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
x86/signal: Fix restart_syscall number for x32 tasks
x86/mpx: Fix instruction decoder condition
x86/mm: Fix regression with huge pages on PAE
x86 smpboot: Re-enable init_udelay=0 by default on modern CPUs
x86/entry/64: Fix irqflag tracing wrt context tracking
x86/microcode: Initialize the driver late when facilities are up

+55 -37
-1
arch/x86/boot/boot.h
··· 23 23 #include <stdarg.h> 24 24 #include <linux/types.h> 25 25 #include <linux/edd.h> 26 - #include <asm/boot.h> 27 26 #include <asm/setup.h> 28 27 #include "bitops.h" 29 28 #include "ctype.h"
+2
arch/x86/boot/video-mode.c
··· 19 19 #include "video.h" 20 20 #include "vesa.h" 21 21 22 + #include <uapi/asm/boot.h> 23 + 22 24 /* 23 25 * Common variables 24 26 */
+2
arch/x86/boot/video.c
··· 13 13 * Select video mode 14 14 */ 15 15 16 + #include <uapi/asm/boot.h> 17 + 16 18 #include "boot.h" 17 19 #include "video.h" 18 20 #include "vesa.h"
+18 -1
arch/x86/entry/entry_64.S
··· 509 509 * tracking that we're in kernel mode. 510 510 */ 511 511 SWAPGS 512 + 513 + /* 514 + * We need to tell lockdep that IRQs are off. We can't do this until 515 + * we fix gsbase, and we should do it before enter_from_user_mode 516 + * (which can take locks). Since TRACE_IRQS_OFF idempotent, 517 + * the simplest way to handle it is to just call it twice if 518 + * we enter from user mode. There's no reason to optimize this since 519 + * TRACE_IRQS_OFF is a no-op if lockdep is off. 520 + */ 521 + TRACE_IRQS_OFF 522 + 512 523 #ifdef CONFIG_CONTEXT_TRACKING 513 524 call enter_from_user_mode 514 525 #endif ··· 1060 1049 SWAPGS 1061 1050 1062 1051 .Lerror_entry_from_usermode_after_swapgs: 1052 + /* 1053 + * We need to tell lockdep that IRQs are off. We can't do this until 1054 + * we fix gsbase, and we should do it before enter_from_user_mode 1055 + * (which can take locks). 1056 + */ 1057 + TRACE_IRQS_OFF 1063 1058 #ifdef CONFIG_CONTEXT_TRACKING 1064 1059 call enter_from_user_mode 1065 1060 #endif 1061 + ret 1066 1062 1067 1063 .Lerror_entry_done: 1068 - 1069 1064 TRACE_IRQS_OFF 1070 1065 ret 1071 1066
+10 -8
arch/x86/include/asm/page_types.h
··· 9 9 #define PAGE_SIZE (_AC(1,UL) << PAGE_SHIFT) 10 10 #define PAGE_MASK (~(PAGE_SIZE-1)) 11 11 12 - #define __PHYSICAL_MASK ((phys_addr_t)((1ULL << __PHYSICAL_MASK_SHIFT) - 1)) 13 - #define __VIRTUAL_MASK ((1UL << __VIRTUAL_MASK_SHIFT) - 1) 14 - 15 - /* Cast PAGE_MASK to a signed type so that it is sign-extended if 16 - virtual addresses are 32-bits but physical addresses are larger 17 - (ie, 32-bit PAE). */ 18 - #define PHYSICAL_PAGE_MASK (((signed long)PAGE_MASK) & __PHYSICAL_MASK) 19 - 20 12 #define PMD_PAGE_SIZE (_AC(1, UL) << PMD_SHIFT) 21 13 #define PMD_PAGE_MASK (~(PMD_PAGE_SIZE-1)) 22 14 23 15 #define PUD_PAGE_SIZE (_AC(1, UL) << PUD_SHIFT) 24 16 #define PUD_PAGE_MASK (~(PUD_PAGE_SIZE-1)) 17 + 18 + #define __PHYSICAL_MASK ((phys_addr_t)((1ULL << __PHYSICAL_MASK_SHIFT) - 1)) 19 + #define __VIRTUAL_MASK ((1UL << __VIRTUAL_MASK_SHIFT) - 1) 20 + 21 + /* Cast *PAGE_MASK to a signed type so that it is sign-extended if 22 + virtual addresses are 32-bits but physical addresses are larger 23 + (ie, 32-bit PAE). */ 24 + #define PHYSICAL_PAGE_MASK (((signed long)PAGE_MASK) & __PHYSICAL_MASK) 25 + #define PHYSICAL_PMD_PAGE_MASK (((signed long)PMD_PAGE_MASK) & __PHYSICAL_MASK) 26 + #define PHYSICAL_PUD_PAGE_MASK (((signed long)PUD_PAGE_MASK) & __PHYSICAL_MASK) 25 27 26 28 #define HPAGE_SHIFT PMD_SHIFT 27 29 #define HPAGE_SIZE (_AC(1,UL) << HPAGE_SHIFT)
+4 -10
arch/x86/include/asm/pgtable_types.h
··· 279 279 static inline pudval_t pud_pfn_mask(pud_t pud) 280 280 { 281 281 if (native_pud_val(pud) & _PAGE_PSE) 282 - return PUD_PAGE_MASK & PHYSICAL_PAGE_MASK; 282 + return PHYSICAL_PUD_PAGE_MASK; 283 283 else 284 284 return PTE_PFN_MASK; 285 285 } 286 286 287 287 static inline pudval_t pud_flags_mask(pud_t pud) 288 288 { 289 - if (native_pud_val(pud) & _PAGE_PSE) 290 - return ~(PUD_PAGE_MASK & (pudval_t)PHYSICAL_PAGE_MASK); 291 - else 292 - return ~PTE_PFN_MASK; 289 + return ~pud_pfn_mask(pud); 293 290 } 294 291 295 292 static inline pudval_t pud_flags(pud_t pud) ··· 297 300 static inline pmdval_t pmd_pfn_mask(pmd_t pmd) 298 301 { 299 302 if (native_pmd_val(pmd) & _PAGE_PSE) 300 - return PMD_PAGE_MASK & PHYSICAL_PAGE_MASK; 303 + return PHYSICAL_PMD_PAGE_MASK; 301 304 else 302 305 return PTE_PFN_MASK; 303 306 } 304 307 305 308 static inline pmdval_t pmd_flags_mask(pmd_t pmd) 306 309 { 307 - if (native_pmd_val(pmd) & _PAGE_PSE) 308 - return ~(PMD_PAGE_MASK & (pmdval_t)PHYSICAL_PAGE_MASK); 309 - else 310 - return ~PTE_PFN_MASK; 310 + return ~pmd_pfn_mask(pmd); 311 311 } 312 312 313 313 static inline pmdval_t pmd_flags(pmd_t pmd)
-1
arch/x86/include/asm/x86_init.h
··· 1 1 #ifndef _ASM_X86_PLATFORM_H 2 2 #define _ASM_X86_PLATFORM_H 3 3 4 - #include <asm/pgtable_types.h> 5 4 #include <asm/bootparam.h> 6 5 7 6 struct mpc_bus;
+1
arch/x86/kernel/cpu/microcode/core.c
··· 698 698 return error; 699 699 700 700 } 701 + late_initcall(microcode_init);
-2
arch/x86/kernel/setup.c
··· 1250 1250 if (efi_enabled(EFI_BOOT)) 1251 1251 efi_apply_memmap_quirks(); 1252 1252 #endif 1253 - 1254 - microcode_init(); 1255 1253 } 1256 1254 1257 1255 #ifdef CONFIG_X86_32
+10 -7
arch/x86/kernel/signal.c
··· 690 690 signal_setup_done(failed, ksig, stepping); 691 691 } 692 692 693 - #ifdef CONFIG_X86_32 694 - #define NR_restart_syscall __NR_restart_syscall 695 - #else /* !CONFIG_X86_32 */ 696 - #define NR_restart_syscall \ 697 - test_thread_flag(TIF_IA32) ? __NR_ia32_restart_syscall : __NR_restart_syscall 698 - #endif /* CONFIG_X86_32 */ 693 + static inline unsigned long get_nr_restart_syscall(const struct pt_regs *regs) 694 + { 695 + #if defined(CONFIG_X86_32) || !defined(CONFIG_X86_64) 696 + return __NR_restart_syscall; 697 + #else /* !CONFIG_X86_32 && CONFIG_X86_64 */ 698 + return test_thread_flag(TIF_IA32) ? __NR_ia32_restart_syscall : 699 + __NR_restart_syscall | (regs->orig_ax & __X32_SYSCALL_BIT); 700 + #endif /* CONFIG_X86_32 || !CONFIG_X86_64 */ 701 + } 699 702 700 703 /* 701 704 * Note that 'init' is a special process: it doesn't get signals it doesn't ··· 727 724 break; 728 725 729 726 case -ERESTART_RESTARTBLOCK: 730 - regs->ax = NR_restart_syscall; 727 + regs->ax = get_nr_restart_syscall(regs); 731 728 regs->ip -= 2; 732 729 break; 733 730 }
+5 -4
arch/x86/kernel/smpboot.c
··· 509 509 */ 510 510 #define UDELAY_10MS_DEFAULT 10000 511 511 512 - static unsigned int init_udelay = INT_MAX; 512 + static unsigned int init_udelay = UINT_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 != INT_MAX) 525 + if (init_udelay != UINT_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 - ((boot_cpu_data.x86_vendor == X86_VENDOR_AMD) && (boot_cpu_data.x86 >= 0xF))) 530 + ((boot_cpu_data.x86_vendor == X86_VENDOR_AMD) && (boot_cpu_data.x86 >= 0xF))) { 531 531 init_udelay = 0; 532 - 532 + return; 533 + } 533 534 /* else, use legacy delay */ 534 535 init_udelay = UDELAY_10MS_DEFAULT; 535 536 }
+3 -3
arch/x86/mm/mpx.c
··· 101 101 switch (type) { 102 102 case REG_TYPE_RM: 103 103 regno = X86_MODRM_RM(insn->modrm.value); 104 - if (X86_REX_B(insn->rex_prefix.value) == 1) 104 + if (X86_REX_B(insn->rex_prefix.value)) 105 105 regno += 8; 106 106 break; 107 107 108 108 case REG_TYPE_INDEX: 109 109 regno = X86_SIB_INDEX(insn->sib.value); 110 - if (X86_REX_X(insn->rex_prefix.value) == 1) 110 + if (X86_REX_X(insn->rex_prefix.value)) 111 111 regno += 8; 112 112 break; 113 113 114 114 case REG_TYPE_BASE: 115 115 regno = X86_SIB_BASE(insn->sib.value); 116 - if (X86_REX_B(insn->rex_prefix.value) == 1) 116 + if (X86_REX_B(insn->rex_prefix.value)) 117 117 regno += 8; 118 118 break; 119 119