diff options
author | Russell King <rmk+kernel@arm.linux.org.uk> | 2013-02-04 09:51:49 -0500 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2013-02-04 09:51:49 -0500 |
commit | 2fb20e2e35cd1455d022ab7a553d7f1663ffbdeb (patch) | |
tree | 4b3bb0f76c15264fe7d4cced91127f3d96ff31f5 /arch/x86/kernel | |
parent | 9cb543124a2d31af42ce61a4c30765ecc8e5f1fa (diff) | |
parent | 5b91ab0abc957145c3ff6be03eb9a3901797019f (diff) |
Merge branch 'for-rmk/broadcast' of git://git.kernel.org/pub/scm/linux/kernel/git/will/linux into devel-stable
Diffstat (limited to 'arch/x86/kernel')
-rw-r--r-- | arch/x86/kernel/cpu/perf_event.c | 6 | ||||
-rw-r--r-- | arch/x86/kernel/entry_32.S | 1 | ||||
-rw-r--r-- | arch/x86/kernel/entry_64.S | 7 | ||||
-rw-r--r-- | arch/x86/kernel/head_32.S | 9 | ||||
-rw-r--r-- | arch/x86/kernel/msr.c | 3 | ||||
-rw-r--r-- | arch/x86/kernel/pci-dma.c | 2 | ||||
-rw-r--r-- | arch/x86/kernel/reboot.c | 2 | ||||
-rw-r--r-- | arch/x86/kernel/setup.c | 28 | ||||
-rw-r--r-- | arch/x86/kernel/step.c | 9 |
9 files changed, 34 insertions, 33 deletions
diff --git a/arch/x86/kernel/cpu/perf_event.c b/arch/x86/kernel/cpu/perf_event.c index 4428fd178bce..6774c17a5576 100644 --- a/arch/x86/kernel/cpu/perf_event.c +++ b/arch/x86/kernel/cpu/perf_event.c | |||
@@ -340,9 +340,6 @@ int x86_setup_perfctr(struct perf_event *event) | |||
340 | /* BTS is currently only allowed for user-mode. */ | 340 | /* BTS is currently only allowed for user-mode. */ |
341 | if (!attr->exclude_kernel) | 341 | if (!attr->exclude_kernel) |
342 | return -EOPNOTSUPP; | 342 | return -EOPNOTSUPP; |
343 | |||
344 | if (!attr->exclude_guest) | ||
345 | return -EOPNOTSUPP; | ||
346 | } | 343 | } |
347 | 344 | ||
348 | hwc->config |= config; | 345 | hwc->config |= config; |
@@ -385,9 +382,6 @@ int x86_pmu_hw_config(struct perf_event *event) | |||
385 | if (event->attr.precise_ip) { | 382 | if (event->attr.precise_ip) { |
386 | int precise = 0; | 383 | int precise = 0; |
387 | 384 | ||
388 | if (!event->attr.exclude_guest) | ||
389 | return -EOPNOTSUPP; | ||
390 | |||
391 | /* Support for constant skid */ | 385 | /* Support for constant skid */ |
392 | if (x86_pmu.pebs_active && !x86_pmu.pebs_broken) { | 386 | if (x86_pmu.pebs_active && !x86_pmu.pebs_broken) { |
393 | precise++; | 387 | precise++; |
diff --git a/arch/x86/kernel/entry_32.S b/arch/x86/kernel/entry_32.S index ff84d5469d77..6ed91d9980e2 100644 --- a/arch/x86/kernel/entry_32.S +++ b/arch/x86/kernel/entry_32.S | |||
@@ -1065,7 +1065,6 @@ ENTRY(xen_failsafe_callback) | |||
1065 | lea 16(%esp),%esp | 1065 | lea 16(%esp),%esp |
1066 | CFI_ADJUST_CFA_OFFSET -16 | 1066 | CFI_ADJUST_CFA_OFFSET -16 |
1067 | jz 5f | 1067 | jz 5f |
1068 | addl $16,%esp | ||
1069 | jmp iret_exc | 1068 | jmp iret_exc |
1070 | 5: pushl_cfi $-1 /* orig_ax = -1 => not a system call */ | 1069 | 5: pushl_cfi $-1 /* orig_ax = -1 => not a system call */ |
1071 | SAVE_ALL | 1070 | SAVE_ALL |
diff --git a/arch/x86/kernel/entry_64.S b/arch/x86/kernel/entry_64.S index 07a7a04529bc..cb3c591339aa 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: | |||
1863 | nmi_swapgs: | 1864 | nmi_swapgs: |
1864 | SWAPGS_UNSAFE_STACK | 1865 | SWAPGS_UNSAFE_STACK |
1865 | nmi_restore: | 1866 | nmi_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 8e7f6556028f..c8932c79e78b 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 | ||
302 | default_entry: | 302 | default_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 */ |
371 | 1: | 376 | 1: |
diff --git a/arch/x86/kernel/msr.c b/arch/x86/kernel/msr.c index a7c5661f8496..4929502c1372 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 0f5dec5c80e0..872079a67e4d 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 = { | |||
56 | EXPORT_SYMBOL(x86_dma_fallback_dev); | 56 | EXPORT_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 | ||
61 | int dma_set_mask(struct device *dev, u64 mask) | 61 | int 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 4e8ba39eaf0f..76fa1e9a2b39 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 00f6c1472b85..8b24289cc10c 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 | } |
diff --git a/arch/x86/kernel/step.c b/arch/x86/kernel/step.c index cd3b2438a980..9b4d51d0c0d0 100644 --- a/arch/x86/kernel/step.c +++ b/arch/x86/kernel/step.c | |||
@@ -165,10 +165,11 @@ void set_task_blockstep(struct task_struct *task, bool on) | |||
165 | * Ensure irq/preemption can't change debugctl in between. | 165 | * Ensure irq/preemption can't change debugctl in between. |
166 | * Note also that both TIF_BLOCKSTEP and debugctl should | 166 | * Note also that both TIF_BLOCKSTEP and debugctl should |
167 | * be changed atomically wrt preemption. | 167 | * be changed atomically wrt preemption. |
168 | * FIXME: this means that set/clear TIF_BLOCKSTEP is simply | 168 | * |
169 | * wrong if task != current, SIGKILL can wakeup the stopped | 169 | * NOTE: this means that set/clear TIF_BLOCKSTEP is only safe if |
170 | * tracee and set/clear can play with the running task, this | 170 | * task is current or it can't be running, otherwise we can race |
171 | * can confuse the next __switch_to_xtra(). | 171 | * with __switch_to_xtra(). We rely on ptrace_freeze_traced() but |
172 | * PTRACE_KILL is not safe. | ||
172 | */ | 173 | */ |
173 | local_irq_disable(); | 174 | local_irq_disable(); |
174 | debugctl = get_debugctlmsr(); | 175 | debugctl = get_debugctlmsr(); |