aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds2013-01-31 00:08:43 -0600
committerLinus Torvalds2013-01-31 00:08:43 -0600
commitbdb0ae6a767ef2622eb282e06fc225e855341653 (patch)
tree34441e77a137fa349c48472bce2e12efceb18b21 /arch/x86/kernel
parent0fe94b9e56da7ebffad4422415bdc2854934a389 (diff)
parente0094244e41c4d0c7ad69920681972fc45d8ce34 (diff)
downloadkernel-common-bdb0ae6a767ef2622eb282e06fc225e855341653.tar.gz
kernel-common-bdb0ae6a767ef2622eb282e06fc225e855341653.tar.xz
kernel-common-bdb0ae6a767ef2622eb282e06fc225e855341653.zip
Merge branch 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull x86 fixes from Peter Anvin: "This is a collection of miscellaneous fixes, the most important one is the fix for the Samsung laptop bricking issue (auto-blacklisting the samsung-laptop driver); the efi_enabled() changes you see below are prerequisites for that fix. The other issues fixed are booting on OLPC XO-1.5, an UV fix, NMI debugging, and requiring CAP_SYS_RAWIO for MSR references, just as with I/O port references." * 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: samsung-laptop: Disable on EFI hardware efi: Make 'efi_enabled' a function to query EFI facilities smp: Fix SMP function call empty cpu mask race x86/msr: Add capabilities check x86/dma-debug: Bump PREALLOC_DMA_DEBUG_ENTRIES x86/olpc: Fix olpc-xo1-sci.c build errors arch/x86/platform/uv: Fix incorrect tlb flush all issue x86-64: Fix unwind annotations in recent NMI changes x86-32: Start out cr0 clean, disable paging before modifying cr3/4
Diffstat (limited to 'arch/x86/kernel')
-rw-r--r--arch/x86/kernel/entry_64.S7
-rw-r--r--arch/x86/kernel/head_32.S9
-rw-r--r--arch/x86/kernel/msr.c3
-rw-r--r--arch/x86/kernel/pci-dma.c2
-rw-r--r--arch/x86/kernel/reboot.c2
-rw-r--r--arch/x86/kernel/setup.c28
6 files changed, 29 insertions, 22 deletions
diff --git a/arch/x86/kernel/entry_64.S b/arch/x86/kernel/entry_64.S
index 07a7a04529b..cb3c591339a 100644
--- a/arch/x86/kernel/entry_64.S
+++ b/arch/x86/kernel/entry_64.S
@@ -1781,6 +1781,7 @@ first_nmi:
1781 * Leave room for the "copied" frame 1781 * Leave room for the "copied" frame
1782 */ 1782 */
1783 subq $(5*8), %rsp 1783 subq $(5*8), %rsp
1784 CFI_ADJUST_CFA_OFFSET 5*8
1784 1785
1785 /* Copy the stack frame to the Saved frame */ 1786 /* Copy the stack frame to the Saved frame */
1786 .rept 5 1787 .rept 5
@@ -1863,10 +1864,8 @@ end_repeat_nmi:
1863nmi_swapgs: 1864nmi_swapgs:
1864 SWAPGS_UNSAFE_STACK 1865 SWAPGS_UNSAFE_STACK
1865nmi_restore: 1866nmi_restore:
1866 RESTORE_ALL 8 1867 /* Pop the extra iret frame at once */
1867 1868 RESTORE_ALL 6*8
1868 /* Pop the extra iret frame */
1869 addq $(5*8), %rsp
1870 1869
1871 /* Clear the NMI executing stack variable */ 1870 /* Clear the NMI executing stack variable */
1872 movq $0, 5*8(%rsp) 1871 movq $0, 5*8(%rsp)
diff --git a/arch/x86/kernel/head_32.S b/arch/x86/kernel/head_32.S
index 8e7f6556028..c8932c79e78 100644
--- a/arch/x86/kernel/head_32.S
+++ b/arch/x86/kernel/head_32.S
@@ -300,6 +300,12 @@ ENTRY(startup_32_smp)
300 leal -__PAGE_OFFSET(%ecx),%esp 300 leal -__PAGE_OFFSET(%ecx),%esp
301 301
302default_entry: 302default_entry:
303#define CR0_STATE (X86_CR0_PE | X86_CR0_MP | X86_CR0_ET | \
304 X86_CR0_NE | X86_CR0_WP | X86_CR0_AM | \
305 X86_CR0_PG)
306 movl $(CR0_STATE & ~X86_CR0_PG),%eax
307 movl %eax,%cr0
308
303/* 309/*
304 * New page tables may be in 4Mbyte page mode and may 310 * New page tables may be in 4Mbyte page mode and may
305 * be using the global pages. 311 * be using the global pages.
@@ -364,8 +370,7 @@ default_entry:
364 */ 370 */
365 movl $pa(initial_page_table), %eax 371 movl $pa(initial_page_table), %eax
366 movl %eax,%cr3 /* set the page table pointer.. */ 372 movl %eax,%cr3 /* set the page table pointer.. */
367 movl %cr0,%eax 373 movl $CR0_STATE,%eax
368 orl $X86_CR0_PG,%eax
369 movl %eax,%cr0 /* ..and set paging (PG) bit */ 374 movl %eax,%cr0 /* ..and set paging (PG) bit */
370 ljmp $__BOOT_CS,$1f /* Clear prefetch and normalize %eip */ 375 ljmp $__BOOT_CS,$1f /* Clear prefetch and normalize %eip */
3711: 3761:
diff --git a/arch/x86/kernel/msr.c b/arch/x86/kernel/msr.c
index a7c5661f849..4929502c137 100644
--- a/arch/x86/kernel/msr.c
+++ b/arch/x86/kernel/msr.c
@@ -174,6 +174,9 @@ static int msr_open(struct inode *inode, struct file *file)
174 unsigned int cpu; 174 unsigned int cpu;
175 struct cpuinfo_x86 *c; 175 struct cpuinfo_x86 *c;
176 176
177 if (!capable(CAP_SYS_RAWIO))
178 return -EPERM;
179
177 cpu = iminor(file->f_path.dentry->d_inode); 180 cpu = iminor(file->f_path.dentry->d_inode);
178 if (cpu >= nr_cpu_ids || !cpu_online(cpu)) 181 if (cpu >= nr_cpu_ids || !cpu_online(cpu))
179 return -ENXIO; /* No such CPU */ 182 return -ENXIO; /* No such CPU */
diff --git a/arch/x86/kernel/pci-dma.c b/arch/x86/kernel/pci-dma.c
index 0f5dec5c80e..872079a67e4 100644
--- a/arch/x86/kernel/pci-dma.c
+++ b/arch/x86/kernel/pci-dma.c
@@ -56,7 +56,7 @@ struct device x86_dma_fallback_dev = {
56EXPORT_SYMBOL(x86_dma_fallback_dev); 56EXPORT_SYMBOL(x86_dma_fallback_dev);
57 57
58/* Number of entries preallocated for DMA-API debugging */ 58/* Number of entries preallocated for DMA-API debugging */
59#define PREALLOC_DMA_DEBUG_ENTRIES 32768 59#define PREALLOC_DMA_DEBUG_ENTRIES 65536
60 60
61int dma_set_mask(struct device *dev, u64 mask) 61int dma_set_mask(struct device *dev, u64 mask)
62{ 62{
diff --git a/arch/x86/kernel/reboot.c b/arch/x86/kernel/reboot.c
index 4e8ba39eaf0..76fa1e9a2b3 100644
--- a/arch/x86/kernel/reboot.c
+++ b/arch/x86/kernel/reboot.c
@@ -584,7 +584,7 @@ static void native_machine_emergency_restart(void)
584 break; 584 break;
585 585
586 case BOOT_EFI: 586 case BOOT_EFI:
587 if (efi_enabled) 587 if (efi_enabled(EFI_RUNTIME_SERVICES))
588 efi.reset_system(reboot_mode ? 588 efi.reset_system(reboot_mode ?
589 EFI_RESET_WARM : 589 EFI_RESET_WARM :
590 EFI_RESET_COLD, 590 EFI_RESET_COLD,
diff --git a/arch/x86/kernel/setup.c b/arch/x86/kernel/setup.c
index 00f6c1472b8..8b24289cc10 100644
--- a/arch/x86/kernel/setup.c
+++ b/arch/x86/kernel/setup.c
@@ -807,15 +807,15 @@ void __init setup_arch(char **cmdline_p)
807#ifdef CONFIG_EFI 807#ifdef CONFIG_EFI
808 if (!strncmp((char *)&boot_params.efi_info.efi_loader_signature, 808 if (!strncmp((char *)&boot_params.efi_info.efi_loader_signature,
809 "EL32", 4)) { 809 "EL32", 4)) {
810 efi_enabled = 1; 810 set_bit(EFI_BOOT, &x86_efi_facility);
811 efi_64bit = false;
812 } else if (!strncmp((char *)&boot_params.efi_info.efi_loader_signature, 811 } else if (!strncmp((char *)&boot_params.efi_info.efi_loader_signature,
813 "EL64", 4)) { 812 "EL64", 4)) {
814 efi_enabled = 1; 813 set_bit(EFI_BOOT, &x86_efi_facility);
815 efi_64bit = true; 814 set_bit(EFI_64BIT, &x86_efi_facility);
816 } 815 }
817 if (efi_enabled && efi_memblock_x86_reserve_range()) 816
818 efi_enabled = 0; 817 if (efi_enabled(EFI_BOOT))
818 efi_memblock_x86_reserve_range();
819#endif 819#endif
820 820
821 x86_init.oem.arch_setup(); 821 x86_init.oem.arch_setup();
@@ -888,7 +888,7 @@ void __init setup_arch(char **cmdline_p)
888 888
889 finish_e820_parsing(); 889 finish_e820_parsing();
890 890
891 if (efi_enabled) 891 if (efi_enabled(EFI_BOOT))
892 efi_init(); 892 efi_init();
893 893
894 dmi_scan_machine(); 894 dmi_scan_machine();
@@ -971,7 +971,7 @@ void __init setup_arch(char **cmdline_p)
971 * The EFI specification says that boot service code won't be called 971 * The EFI specification says that boot service code won't be called
972 * after ExitBootServices(). This is, in fact, a lie. 972 * after ExitBootServices(). This is, in fact, a lie.
973 */ 973 */
974 if (efi_enabled) 974 if (efi_enabled(EFI_MEMMAP))
975 efi_reserve_boot_services(); 975 efi_reserve_boot_services();
976 976
977 /* preallocate 4k for mptable mpc */ 977 /* preallocate 4k for mptable mpc */
@@ -1114,7 +1114,7 @@ void __init setup_arch(char **cmdline_p)
1114 1114
1115#ifdef CONFIG_VT 1115#ifdef CONFIG_VT
1116#if defined(CONFIG_VGA_CONSOLE) 1116#if defined(CONFIG_VGA_CONSOLE)
1117 if (!efi_enabled || (efi_mem_type(0xa0000) != EFI_CONVENTIONAL_MEMORY)) 1117 if (!efi_enabled(EFI_BOOT) || (efi_mem_type(0xa0000) != EFI_CONVENTIONAL_MEMORY))
1118 conswitchp = &vga_con; 1118 conswitchp = &vga_con;
1119#elif defined(CONFIG_DUMMY_CONSOLE) 1119#elif defined(CONFIG_DUMMY_CONSOLE)
1120 conswitchp = &dummy_con; 1120 conswitchp = &dummy_con;
@@ -1131,14 +1131,14 @@ void __init setup_arch(char **cmdline_p)
1131 register_refined_jiffies(CLOCK_TICK_RATE); 1131 register_refined_jiffies(CLOCK_TICK_RATE);
1132 1132
1133#ifdef CONFIG_EFI 1133#ifdef CONFIG_EFI
1134 /* Once setup is done above, disable efi_enabled on mismatched 1134 /* Once setup is done above, unmap the EFI memory map on
1135 * firmware/kernel archtectures since there is no support for 1135 * mismatched firmware/kernel archtectures since there is no
1136 * runtime services. 1136 * support for runtime services.
1137 */ 1137 */
1138 if (efi_enabled && IS_ENABLED(CONFIG_X86_64) != efi_64bit) { 1138 if (efi_enabled(EFI_BOOT) &&
1139 IS_ENABLED(CONFIG_X86_64) != efi_enabled(EFI_64BIT)) {
1139 pr_info("efi: Setup done, disabling due to 32/64-bit mismatch\n"); 1140 pr_info("efi: Setup done, disabling due to 32/64-bit mismatch\n");
1140 efi_unmap_memmap(); 1141 efi_unmap_memmap();
1141 efi_enabled = 0;
1142 } 1142 }
1143#endif 1143#endif
1144} 1144}