diff options
Diffstat (limited to 'arch/x86/kernel')
44 files changed, 219 insertions, 122 deletions
diff --git a/arch/x86/kernel/Makefile b/arch/x86/kernel/Makefile index d7e5a58ee22f..e489ff9cb3e2 100644 --- a/arch/x86/kernel/Makefile +++ b/arch/x86/kernel/Makefile | |||
| @@ -6,11 +6,12 @@ extra-y := head_$(BITS).o head$(BITS).o head.o init_task.o vmlinu | |||
| 6 | 6 | ||
| 7 | CPPFLAGS_vmlinux.lds += -U$(UTS_MACHINE) | 7 | CPPFLAGS_vmlinux.lds += -U$(UTS_MACHINE) |
| 8 | 8 | ||
| 9 | ifdef CONFIG_FTRACE | 9 | ifdef CONFIG_FUNCTION_TRACER |
| 10 | # Do not profile debug and lowlevel utilities | 10 | # Do not profile debug and lowlevel utilities |
| 11 | CFLAGS_REMOVE_tsc.o = -pg | 11 | CFLAGS_REMOVE_tsc.o = -pg |
| 12 | CFLAGS_REMOVE_rtc.o = -pg | 12 | CFLAGS_REMOVE_rtc.o = -pg |
| 13 | CFLAGS_REMOVE_paravirt-spinlocks.o = -pg | 13 | CFLAGS_REMOVE_paravirt-spinlocks.o = -pg |
| 14 | CFLAGS_REMOVE_ftrace.o = -pg | ||
| 14 | endif | 15 | endif |
| 15 | 16 | ||
| 16 | # | 17 | # |
diff --git a/arch/x86/kernel/acpi/boot.c b/arch/x86/kernel/acpi/boot.c index 0d1c26a583c5..8c1f76abae9e 100644 --- a/arch/x86/kernel/acpi/boot.c +++ b/arch/x86/kernel/acpi/boot.c | |||
| @@ -153,12 +153,13 @@ char *__init __acpi_map_table(unsigned long phys, unsigned long size) | |||
| 153 | } | 153 | } |
| 154 | 154 | ||
| 155 | #ifdef CONFIG_PCI_MMCONFIG | 155 | #ifdef CONFIG_PCI_MMCONFIG |
| 156 | |||
| 157 | static int acpi_mcfg_64bit_base_addr __initdata = FALSE; | ||
| 158 | |||
| 156 | /* The physical address of the MMCONFIG aperture. Set from ACPI tables. */ | 159 | /* The physical address of the MMCONFIG aperture. Set from ACPI tables. */ |
| 157 | struct acpi_mcfg_allocation *pci_mmcfg_config; | 160 | struct acpi_mcfg_allocation *pci_mmcfg_config; |
| 158 | int pci_mmcfg_config_num; | 161 | int pci_mmcfg_config_num; |
| 159 | 162 | ||
| 160 | static int acpi_mcfg_64bit_base_addr __initdata = FALSE; | ||
| 161 | |||
| 162 | static int __init acpi_mcfg_oem_check(struct acpi_table_mcfg *mcfg) | 163 | static int __init acpi_mcfg_oem_check(struct acpi_table_mcfg *mcfg) |
| 163 | { | 164 | { |
| 164 | if (!strcmp(mcfg->header.oem_id, "SGI")) | 165 | if (!strcmp(mcfg->header.oem_id, "SGI")) |
| @@ -1136,7 +1137,7 @@ int mp_register_gsi(u32 gsi, int triggering, int polarity) | |||
| 1136 | return gsi; | 1137 | return gsi; |
| 1137 | } | 1138 | } |
| 1138 | if (test_bit(ioapic_pin, mp_ioapic_routing[ioapic].pin_programmed)) { | 1139 | if (test_bit(ioapic_pin, mp_ioapic_routing[ioapic].pin_programmed)) { |
| 1139 | pr_debug(KERN_DEBUG "Pin %d-%d already programmed\n", | 1140 | pr_debug("Pin %d-%d already programmed\n", |
| 1140 | mp_ioapic_routing[ioapic].apic_id, ioapic_pin); | 1141 | mp_ioapic_routing[ioapic].apic_id, ioapic_pin); |
| 1141 | #ifdef CONFIG_X86_32 | 1142 | #ifdef CONFIG_X86_32 |
| 1142 | return (gsi < IRQ_COMPRESSION_START ? gsi : gsi_to_irq[gsi]); | 1143 | return (gsi < IRQ_COMPRESSION_START ? gsi : gsi_to_irq[gsi]); |
| @@ -1598,6 +1599,11 @@ static struct dmi_system_id __initdata acpi_dmi_table[] = { | |||
| 1598 | DMI_MATCH(DMI_PRODUCT_NAME, "TravelMate 360"), | 1599 | DMI_MATCH(DMI_PRODUCT_NAME, "TravelMate 360"), |
| 1599 | }, | 1600 | }, |
| 1600 | }, | 1601 | }, |
| 1602 | {} | ||
| 1603 | }; | ||
| 1604 | |||
| 1605 | /* second table for DMI checks that should run after early-quirks */ | ||
| 1606 | static struct dmi_system_id __initdata acpi_dmi_table_late[] = { | ||
| 1601 | /* | 1607 | /* |
| 1602 | * HP laptops which use a DSDT reporting as HP/SB400/10000, | 1608 | * HP laptops which use a DSDT reporting as HP/SB400/10000, |
| 1603 | * which includes some code which overrides all temperature | 1609 | * which includes some code which overrides all temperature |
| @@ -1726,6 +1732,9 @@ int __init early_acpi_boot_init(void) | |||
| 1726 | 1732 | ||
| 1727 | int __init acpi_boot_init(void) | 1733 | int __init acpi_boot_init(void) |
| 1728 | { | 1734 | { |
| 1735 | /* those are executed after early-quirks are executed */ | ||
| 1736 | dmi_check_system(acpi_dmi_table_late); | ||
| 1737 | |||
| 1729 | /* | 1738 | /* |
| 1730 | * If acpi_disabled, bail out | 1739 | * If acpi_disabled, bail out |
| 1731 | * One exception: acpi=ht continues far enough to enumerate LAPICs | 1740 | * One exception: acpi=ht continues far enough to enumerate LAPICs |
diff --git a/arch/x86/kernel/acpi/sleep.c b/arch/x86/kernel/acpi/sleep.c index c44cd6dbfa14..806b4e9051b4 100644 --- a/arch/x86/kernel/acpi/sleep.c +++ b/arch/x86/kernel/acpi/sleep.c | |||
| @@ -22,7 +22,7 @@ unsigned long acpi_realmode_flags; | |||
| 22 | static unsigned long acpi_realmode; | 22 | static unsigned long acpi_realmode; |
| 23 | 23 | ||
| 24 | #if defined(CONFIG_SMP) && defined(CONFIG_64BIT) | 24 | #if defined(CONFIG_SMP) && defined(CONFIG_64BIT) |
| 25 | static char temp_stack[10240]; | 25 | static char temp_stack[4096]; |
| 26 | #endif | 26 | #endif |
| 27 | 27 | ||
| 28 | /** | 28 | /** |
| @@ -98,7 +98,7 @@ int acpi_save_state_mem(void) | |||
| 98 | #else /* CONFIG_64BIT */ | 98 | #else /* CONFIG_64BIT */ |
| 99 | header->trampoline_segment = setup_trampoline() >> 4; | 99 | header->trampoline_segment = setup_trampoline() >> 4; |
| 100 | #ifdef CONFIG_SMP | 100 | #ifdef CONFIG_SMP |
| 101 | stack_start.sp = temp_stack + 4096; | 101 | stack_start.sp = temp_stack + sizeof(temp_stack); |
| 102 | early_gdt_descr.address = | 102 | early_gdt_descr.address = |
| 103 | (unsigned long)get_cpu_gdt_table(smp_processor_id()); | 103 | (unsigned long)get_cpu_gdt_table(smp_processor_id()); |
| 104 | #endif | 104 | #endif |
diff --git a/arch/x86/kernel/amd_iommu.c b/arch/x86/kernel/amd_iommu.c index a8fd9ebdc8e2..331b318304eb 100644 --- a/arch/x86/kernel/amd_iommu.c +++ b/arch/x86/kernel/amd_iommu.c | |||
| @@ -50,7 +50,7 @@ static int dma_ops_unity_map(struct dma_ops_domain *dma_dom, | |||
| 50 | /* returns !0 if the IOMMU is caching non-present entries in its TLB */ | 50 | /* returns !0 if the IOMMU is caching non-present entries in its TLB */ |
| 51 | static int iommu_has_npcache(struct amd_iommu *iommu) | 51 | static int iommu_has_npcache(struct amd_iommu *iommu) |
| 52 | { | 52 | { |
| 53 | return iommu->cap & IOMMU_CAP_NPCACHE; | 53 | return iommu->cap & (1UL << IOMMU_CAP_NPCACHE); |
| 54 | } | 54 | } |
| 55 | 55 | ||
| 56 | /**************************************************************************** | 56 | /**************************************************************************** |
| @@ -536,6 +536,9 @@ static void dma_ops_free_addresses(struct dma_ops_domain *dom, | |||
| 536 | { | 536 | { |
| 537 | address >>= PAGE_SHIFT; | 537 | address >>= PAGE_SHIFT; |
| 538 | iommu_area_free(dom->bitmap, address, pages); | 538 | iommu_area_free(dom->bitmap, address, pages); |
| 539 | |||
| 540 | if (address + pages >= dom->next_bit) | ||
| 541 | dom->need_flush = true; | ||
| 539 | } | 542 | } |
| 540 | 543 | ||
| 541 | /**************************************************************************** | 544 | /**************************************************************************** |
| @@ -992,8 +995,10 @@ static void __unmap_single(struct amd_iommu *iommu, | |||
| 992 | 995 | ||
| 993 | dma_ops_free_addresses(dma_dom, dma_addr, pages); | 996 | dma_ops_free_addresses(dma_dom, dma_addr, pages); |
| 994 | 997 | ||
| 995 | if (amd_iommu_unmap_flush) | 998 | if (amd_iommu_unmap_flush || dma_dom->need_flush) { |
| 996 | iommu_flush_pages(iommu, dma_dom->domain.id, dma_addr, size); | 999 | iommu_flush_pages(iommu, dma_dom->domain.id, dma_addr, size); |
| 1000 | dma_dom->need_flush = false; | ||
| 1001 | } | ||
| 997 | } | 1002 | } |
| 998 | 1003 | ||
| 999 | /* | 1004 | /* |
diff --git a/arch/x86/kernel/amd_iommu_init.c b/arch/x86/kernel/amd_iommu_init.c index 4cd8083c58be..0cdcda35a05f 100644 --- a/arch/x86/kernel/amd_iommu_init.c +++ b/arch/x86/kernel/amd_iommu_init.c | |||
| @@ -212,7 +212,7 @@ static void __init iommu_set_exclusion_range(struct amd_iommu *iommu) | |||
| 212 | /* Programs the physical address of the device table into the IOMMU hardware */ | 212 | /* Programs the physical address of the device table into the IOMMU hardware */ |
| 213 | static void __init iommu_set_device_table(struct amd_iommu *iommu) | 213 | static void __init iommu_set_device_table(struct amd_iommu *iommu) |
| 214 | { | 214 | { |
| 215 | u32 entry; | 215 | u64 entry; |
| 216 | 216 | ||
| 217 | BUG_ON(iommu->mmio_base == NULL); | 217 | BUG_ON(iommu->mmio_base == NULL); |
| 218 | 218 | ||
diff --git a/arch/x86/kernel/asm-offsets_64.c b/arch/x86/kernel/asm-offsets_64.c index 505543a75a56..7fcf63d22f8b 100644 --- a/arch/x86/kernel/asm-offsets_64.c +++ b/arch/x86/kernel/asm-offsets_64.c | |||
| @@ -22,7 +22,7 @@ | |||
| 22 | 22 | ||
| 23 | #define __NO_STUBS 1 | 23 | #define __NO_STUBS 1 |
| 24 | #undef __SYSCALL | 24 | #undef __SYSCALL |
| 25 | #undef ASM_X86__UNISTD_64_H | 25 | #undef _ASM_X86_UNISTD_64_H |
| 26 | #define __SYSCALL(nr, sym) [nr] = 1, | 26 | #define __SYSCALL(nr, sym) [nr] = 1, |
| 27 | static char syscalls[] = { | 27 | static char syscalls[] = { |
| 28 | #include <asm/unistd.h> | 28 | #include <asm/unistd.h> |
diff --git a/arch/x86/kernel/cpu/Makefile b/arch/x86/kernel/cpu/Makefile index 7f0b45a5d788..82ec6075c057 100644 --- a/arch/x86/kernel/cpu/Makefile +++ b/arch/x86/kernel/cpu/Makefile | |||
| @@ -25,7 +25,7 @@ obj-$(CONFIG_X86_LOCAL_APIC) += perfctr-watchdog.o | |||
| 25 | quiet_cmd_mkcapflags = MKCAP $@ | 25 | quiet_cmd_mkcapflags = MKCAP $@ |
| 26 | cmd_mkcapflags = $(PERL) $(srctree)/$(src)/mkcapflags.pl $< $@ | 26 | cmd_mkcapflags = $(PERL) $(srctree)/$(src)/mkcapflags.pl $< $@ |
| 27 | 27 | ||
| 28 | cpufeature = $(src)/../../../../include/asm-x86/cpufeature.h | 28 | cpufeature = $(src)/../../include/asm/cpufeature.h |
| 29 | 29 | ||
| 30 | targets += capflags.c | 30 | targets += capflags.c |
| 31 | $(obj)/capflags.c: $(cpufeature) $(src)/mkcapflags.pl FORCE | 31 | $(obj)/capflags.c: $(cpufeature) $(src)/mkcapflags.pl FORCE |
diff --git a/arch/x86/kernel/cpu/addon_cpuid_features.c b/arch/x86/kernel/cpu/addon_cpuid_features.c index 0d9c993aa93e..ef8f831af823 100644 --- a/arch/x86/kernel/cpu/addon_cpuid_features.c +++ b/arch/x86/kernel/cpu/addon_cpuid_features.c | |||
| @@ -69,7 +69,7 @@ void __cpuinit init_scattered_cpuid_features(struct cpuinfo_x86 *c) | |||
| 69 | */ | 69 | */ |
| 70 | void __cpuinit detect_extended_topology(struct cpuinfo_x86 *c) | 70 | void __cpuinit detect_extended_topology(struct cpuinfo_x86 *c) |
| 71 | { | 71 | { |
| 72 | #ifdef CONFIG_SMP | 72 | #ifdef CONFIG_X86_SMP |
| 73 | unsigned int eax, ebx, ecx, edx, sub_index; | 73 | unsigned int eax, ebx, ecx, edx, sub_index; |
| 74 | unsigned int ht_mask_width, core_plus_mask_width; | 74 | unsigned int ht_mask_width, core_plus_mask_width; |
| 75 | unsigned int core_select_mask, core_level_siblings; | 75 | unsigned int core_select_mask, core_level_siblings; |
diff --git a/arch/x86/kernel/cpu/common.c b/arch/x86/kernel/cpu/common.c index 25581dcb280e..b9c9ea0217a9 100644 --- a/arch/x86/kernel/cpu/common.c +++ b/arch/x86/kernel/cpu/common.c | |||
| @@ -20,6 +20,7 @@ | |||
| 20 | #include <asm/pat.h> | 20 | #include <asm/pat.h> |
| 21 | #include <asm/asm.h> | 21 | #include <asm/asm.h> |
| 22 | #include <asm/numa.h> | 22 | #include <asm/numa.h> |
| 23 | #include <asm/smp.h> | ||
| 23 | #ifdef CONFIG_X86_LOCAL_APIC | 24 | #ifdef CONFIG_X86_LOCAL_APIC |
| 24 | #include <asm/mpspec.h> | 25 | #include <asm/mpspec.h> |
| 25 | #include <asm/apic.h> | 26 | #include <asm/apic.h> |
| @@ -549,6 +550,10 @@ static void __init early_identify_cpu(struct cpuinfo_x86 *c) | |||
| 549 | this_cpu->c_early_init(c); | 550 | this_cpu->c_early_init(c); |
| 550 | 551 | ||
| 551 | validate_pat_support(c); | 552 | validate_pat_support(c); |
| 553 | |||
| 554 | #ifdef CONFIG_SMP | ||
| 555 | c->cpu_index = boot_cpu_id; | ||
| 556 | #endif | ||
| 552 | } | 557 | } |
| 553 | 558 | ||
| 554 | void __init early_cpu_init(void) | 559 | void __init early_cpu_init(void) |
| @@ -1134,7 +1139,7 @@ void __cpuinit cpu_init(void) | |||
| 1134 | /* | 1139 | /* |
| 1135 | * Boot processor to setup the FP and extended state context info. | 1140 | * Boot processor to setup the FP and extended state context info. |
| 1136 | */ | 1141 | */ |
| 1137 | if (!smp_processor_id()) | 1142 | if (smp_processor_id() == boot_cpu_id) |
| 1138 | init_thread_xstate(); | 1143 | init_thread_xstate(); |
| 1139 | 1144 | ||
| 1140 | xsave_init(); | 1145 | xsave_init(); |
diff --git a/arch/x86/kernel/cpu/cpufreq/acpi-cpufreq.c b/arch/x86/kernel/cpu/cpufreq/acpi-cpufreq.c index c24c4a487b7c..8e48c5d4467d 100644 --- a/arch/x86/kernel/cpu/cpufreq/acpi-cpufreq.c +++ b/arch/x86/kernel/cpu/cpufreq/acpi-cpufreq.c | |||
| @@ -780,6 +780,9 @@ static int __init acpi_cpufreq_init(void) | |||
| 780 | { | 780 | { |
| 781 | int ret; | 781 | int ret; |
| 782 | 782 | ||
| 783 | if (acpi_disabled) | ||
| 784 | return 0; | ||
| 785 | |||
| 783 | dprintk("acpi_cpufreq_init\n"); | 786 | dprintk("acpi_cpufreq_init\n"); |
| 784 | 787 | ||
| 785 | ret = acpi_cpufreq_early_init(); | 788 | ret = acpi_cpufreq_early_init(); |
diff --git a/arch/x86/kernel/cpu/cpufreq/powernow-k8.c b/arch/x86/kernel/cpu/cpufreq/powernow-k8.c index 008d23ba491b..d3dcd58b87cd 100644 --- a/arch/x86/kernel/cpu/cpufreq/powernow-k8.c +++ b/arch/x86/kernel/cpu/cpufreq/powernow-k8.c | |||
| @@ -45,7 +45,6 @@ | |||
| 45 | #endif | 45 | #endif |
| 46 | 46 | ||
| 47 | #define PFX "powernow-k8: " | 47 | #define PFX "powernow-k8: " |
| 48 | #define BFX PFX "BIOS error: " | ||
| 49 | #define VERSION "version 2.20.00" | 48 | #define VERSION "version 2.20.00" |
| 50 | #include "powernow-k8.h" | 49 | #include "powernow-k8.h" |
| 51 | 50 | ||
| @@ -536,35 +535,40 @@ static int check_pst_table(struct powernow_k8_data *data, struct pst_s *pst, u8 | |||
| 536 | 535 | ||
| 537 | for (j = 0; j < data->numps; j++) { | 536 | for (j = 0; j < data->numps; j++) { |
| 538 | if (pst[j].vid > LEAST_VID) { | 537 | if (pst[j].vid > LEAST_VID) { |
| 539 | printk(KERN_ERR PFX "vid %d invalid : 0x%x\n", j, pst[j].vid); | 538 | printk(KERN_ERR FW_BUG PFX "vid %d invalid : 0x%x\n", |
| 539 | j, pst[j].vid); | ||
| 540 | return -EINVAL; | 540 | return -EINVAL; |
| 541 | } | 541 | } |
| 542 | if (pst[j].vid < data->rvo) { /* vid + rvo >= 0 */ | 542 | if (pst[j].vid < data->rvo) { /* vid + rvo >= 0 */ |
| 543 | printk(KERN_ERR BFX "0 vid exceeded with pstate %d\n", j); | 543 | printk(KERN_ERR FW_BUG PFX "0 vid exceeded with pstate" |
| 544 | " %d\n", j); | ||
| 544 | return -ENODEV; | 545 | return -ENODEV; |
| 545 | } | 546 | } |
| 546 | if (pst[j].vid < maxvid + data->rvo) { /* vid + rvo >= maxvid */ | 547 | if (pst[j].vid < maxvid + data->rvo) { /* vid + rvo >= maxvid */ |
| 547 | printk(KERN_ERR BFX "maxvid exceeded with pstate %d\n", j); | 548 | printk(KERN_ERR FW_BUG PFX "maxvid exceeded with pstate" |
| 549 | " %d\n", j); | ||
| 548 | return -ENODEV; | 550 | return -ENODEV; |
| 549 | } | 551 | } |
| 550 | if (pst[j].fid > MAX_FID) { | 552 | if (pst[j].fid > MAX_FID) { |
| 551 | printk(KERN_ERR BFX "maxfid exceeded with pstate %d\n", j); | 553 | printk(KERN_ERR FW_BUG PFX "maxfid exceeded with pstate" |
| 554 | " %d\n", j); | ||
| 552 | return -ENODEV; | 555 | return -ENODEV; |
| 553 | } | 556 | } |
| 554 | if (j && (pst[j].fid < HI_FID_TABLE_BOTTOM)) { | 557 | if (j && (pst[j].fid < HI_FID_TABLE_BOTTOM)) { |
| 555 | /* Only first fid is allowed to be in "low" range */ | 558 | /* Only first fid is allowed to be in "low" range */ |
| 556 | printk(KERN_ERR BFX "two low fids - %d : 0x%x\n", j, pst[j].fid); | 559 | printk(KERN_ERR FW_BUG PFX "two low fids - %d : " |
| 560 | "0x%x\n", j, pst[j].fid); | ||
| 557 | return -EINVAL; | 561 | return -EINVAL; |
| 558 | } | 562 | } |
| 559 | if (pst[j].fid < lastfid) | 563 | if (pst[j].fid < lastfid) |
| 560 | lastfid = pst[j].fid; | 564 | lastfid = pst[j].fid; |
| 561 | } | 565 | } |
| 562 | if (lastfid & 1) { | 566 | if (lastfid & 1) { |
| 563 | printk(KERN_ERR BFX "lastfid invalid\n"); | 567 | printk(KERN_ERR FW_BUG PFX "lastfid invalid\n"); |
| 564 | return -EINVAL; | 568 | return -EINVAL; |
| 565 | } | 569 | } |
| 566 | if (lastfid > LO_FID_TABLE_TOP) | 570 | if (lastfid > LO_FID_TABLE_TOP) |
| 567 | printk(KERN_INFO BFX "first fid not from lo freq table\n"); | 571 | printk(KERN_INFO FW_BUG PFX "first fid not from lo freq table\n"); |
| 568 | 572 | ||
| 569 | return 0; | 573 | return 0; |
| 570 | } | 574 | } |
| @@ -672,13 +676,13 @@ static int find_psb_table(struct powernow_k8_data *data) | |||
| 672 | 676 | ||
| 673 | dprintk("table vers: 0x%x\n", psb->tableversion); | 677 | dprintk("table vers: 0x%x\n", psb->tableversion); |
| 674 | if (psb->tableversion != PSB_VERSION_1_4) { | 678 | if (psb->tableversion != PSB_VERSION_1_4) { |
| 675 | printk(KERN_ERR BFX "PSB table is not v1.4\n"); | 679 | printk(KERN_ERR FW_BUG PFX "PSB table is not v1.4\n"); |
| 676 | return -ENODEV; | 680 | return -ENODEV; |
| 677 | } | 681 | } |
| 678 | 682 | ||
| 679 | dprintk("flags: 0x%x\n", psb->flags1); | 683 | dprintk("flags: 0x%x\n", psb->flags1); |
| 680 | if (psb->flags1) { | 684 | if (psb->flags1) { |
| 681 | printk(KERN_ERR BFX "unknown flags\n"); | 685 | printk(KERN_ERR FW_BUG PFX "unknown flags\n"); |
| 682 | return -ENODEV; | 686 | return -ENODEV; |
| 683 | } | 687 | } |
| 684 | 688 | ||
| @@ -705,7 +709,7 @@ static int find_psb_table(struct powernow_k8_data *data) | |||
| 705 | } | 709 | } |
| 706 | } | 710 | } |
| 707 | if (cpst != 1) { | 711 | if (cpst != 1) { |
| 708 | printk(KERN_ERR BFX "numpst must be 1\n"); | 712 | printk(KERN_ERR FW_BUG PFX "numpst must be 1\n"); |
| 709 | return -ENODEV; | 713 | return -ENODEV; |
| 710 | } | 714 | } |
| 711 | 715 | ||
| @@ -1130,17 +1134,19 @@ static int __cpuinit powernowk8_cpu_init(struct cpufreq_policy *pol) | |||
| 1130 | "ACPI Processor module before starting this " | 1134 | "ACPI Processor module before starting this " |
| 1131 | "driver.\n"); | 1135 | "driver.\n"); |
| 1132 | #else | 1136 | #else |
| 1133 | printk(KERN_ERR PFX "Your BIOS does not provide ACPI " | 1137 | printk(KERN_ERR FW_BUG PFX "Your BIOS does not provide" |
| 1134 | "_PSS objects in a way that Linux understands. " | 1138 | " ACPI _PSS objects in a way that Linux " |
| 1135 | "Please report this to the Linux ACPI maintainers" | 1139 | "understands. Please report this to the Linux " |
| 1136 | " and complain to your BIOS vendor.\n"); | 1140 | "ACPI maintainers and complain to your BIOS " |
| 1141 | "vendor.\n"); | ||
| 1137 | #endif | 1142 | #endif |
| 1138 | kfree(data); | 1143 | kfree(data); |
| 1139 | return -ENODEV; | 1144 | return -ENODEV; |
| 1140 | } | 1145 | } |
| 1141 | if (pol->cpu != 0) { | 1146 | if (pol->cpu != 0) { |
| 1142 | printk(KERN_ERR PFX "No ACPI _PSS objects for CPU other than " | 1147 | printk(KERN_ERR FW_BUG PFX "No ACPI _PSS objects for " |
| 1143 | "CPU0. Complain to your BIOS vendor.\n"); | 1148 | "CPU other than CPU0. Complain to your BIOS " |
| 1149 | "vendor.\n"); | ||
| 1144 | kfree(data); | 1150 | kfree(data); |
| 1145 | return -ENODEV; | 1151 | return -ENODEV; |
| 1146 | } | 1152 | } |
| @@ -1193,7 +1199,7 @@ static int __cpuinit powernowk8_cpu_init(struct cpufreq_policy *pol) | |||
| 1193 | 1199 | ||
| 1194 | /* min/max the cpu is capable of */ | 1200 | /* min/max the cpu is capable of */ |
| 1195 | if (cpufreq_frequency_table_cpuinfo(pol, data->powernow_table)) { | 1201 | if (cpufreq_frequency_table_cpuinfo(pol, data->powernow_table)) { |
| 1196 | printk(KERN_ERR PFX "invalid powernow_table\n"); | 1202 | printk(KERN_ERR FW_BUG PFX "invalid powernow_table\n"); |
| 1197 | powernow_k8_cpu_exit_acpi(data); | 1203 | powernow_k8_cpu_exit_acpi(data); |
| 1198 | kfree(data->powernow_table); | 1204 | kfree(data->powernow_table); |
| 1199 | kfree(data); | 1205 | kfree(data); |
diff --git a/arch/x86/kernel/cpu/proc.c b/arch/x86/kernel/cpu/proc.c index a26c480b9491..01b1244ef1c0 100644 --- a/arch/x86/kernel/cpu/proc.c +++ b/arch/x86/kernel/cpu/proc.c | |||
| @@ -160,14 +160,16 @@ static void *c_start(struct seq_file *m, loff_t *pos) | |||
| 160 | { | 160 | { |
| 161 | if (*pos == 0) /* just in case, cpu 0 is not the first */ | 161 | if (*pos == 0) /* just in case, cpu 0 is not the first */ |
| 162 | *pos = first_cpu(cpu_online_map); | 162 | *pos = first_cpu(cpu_online_map); |
| 163 | if ((*pos) < nr_cpu_ids && cpu_online(*pos)) | 163 | else |
| 164 | *pos = next_cpu_nr(*pos - 1, cpu_online_map); | ||
| 165 | if ((*pos) < nr_cpu_ids) | ||
| 164 | return &cpu_data(*pos); | 166 | return &cpu_data(*pos); |
| 165 | return NULL; | 167 | return NULL; |
| 166 | } | 168 | } |
| 167 | 169 | ||
| 168 | static void *c_next(struct seq_file *m, void *v, loff_t *pos) | 170 | static void *c_next(struct seq_file *m, void *v, loff_t *pos) |
| 169 | { | 171 | { |
| 170 | *pos = next_cpu(*pos, cpu_online_map); | 172 | (*pos)++; |
| 171 | return c_start(m, pos); | 173 | return c_start(m, pos); |
| 172 | } | 174 | } |
| 173 | 175 | ||
diff --git a/arch/x86/kernel/dumpstack_32.c b/arch/x86/kernel/dumpstack_32.c index 1a78180f08d3..b3614752197b 100644 --- a/arch/x86/kernel/dumpstack_32.c +++ b/arch/x86/kernel/dumpstack_32.c | |||
| @@ -405,7 +405,6 @@ die_nmi(char *str, struct pt_regs *regs, int do_panic) | |||
| 405 | panic("Non maskable interrupt"); | 405 | panic("Non maskable interrupt"); |
| 406 | console_silent(); | 406 | console_silent(); |
| 407 | spin_unlock(&nmi_print_lock); | 407 | spin_unlock(&nmi_print_lock); |
| 408 | bust_spinlocks(0); | ||
| 409 | 408 | ||
| 410 | /* | 409 | /* |
| 411 | * If we are in kernel we are probably nested up pretty bad | 410 | * If we are in kernel we are probably nested up pretty bad |
| @@ -416,6 +415,7 @@ die_nmi(char *str, struct pt_regs *regs, int do_panic) | |||
| 416 | crash_kexec(regs); | 415 | crash_kexec(regs); |
| 417 | } | 416 | } |
| 418 | 417 | ||
| 418 | bust_spinlocks(0); | ||
| 419 | do_exit(SIGSEGV); | 419 | do_exit(SIGSEGV); |
| 420 | } | 420 | } |
| 421 | 421 | ||
diff --git a/arch/x86/kernel/e820.c b/arch/x86/kernel/e820.c index ce97bf3bed12..7aafeb5263ef 100644 --- a/arch/x86/kernel/e820.c +++ b/arch/x86/kernel/e820.c | |||
| @@ -1290,15 +1290,17 @@ void __init e820_reserve_resources(void) | |||
| 1290 | res->start = e820.map[i].addr; | 1290 | res->start = e820.map[i].addr; |
| 1291 | res->end = end; | 1291 | res->end = end; |
| 1292 | 1292 | ||
| 1293 | res->flags = IORESOURCE_MEM | IORESOURCE_BUSY; | 1293 | res->flags = IORESOURCE_MEM; |
| 1294 | 1294 | ||
| 1295 | /* | 1295 | /* |
| 1296 | * don't register the region that could be conflicted with | 1296 | * don't register the region that could be conflicted with |
| 1297 | * pci device BAR resource and insert them later in | 1297 | * pci device BAR resource and insert them later in |
| 1298 | * pcibios_resource_survey() | 1298 | * pcibios_resource_survey() |
| 1299 | */ | 1299 | */ |
| 1300 | if (e820.map[i].type != E820_RESERVED || res->start < (1ULL<<20)) | 1300 | if (e820.map[i].type != E820_RESERVED || res->start < (1ULL<<20)) { |
| 1301 | res->flags |= IORESOURCE_BUSY; | ||
| 1301 | insert_resource(&iomem_resource, res); | 1302 | insert_resource(&iomem_resource, res); |
| 1303 | } | ||
| 1302 | res++; | 1304 | res++; |
| 1303 | } | 1305 | } |
| 1304 | 1306 | ||
| @@ -1318,7 +1320,7 @@ void __init e820_reserve_resources_late(void) | |||
| 1318 | res = e820_res; | 1320 | res = e820_res; |
| 1319 | for (i = 0; i < e820.nr_map; i++) { | 1321 | for (i = 0; i < e820.nr_map; i++) { |
| 1320 | if (!res->parent && res->end) | 1322 | if (!res->parent && res->end) |
| 1321 | reserve_region_with_split(&iomem_resource, res->start, res->end, res->name); | 1323 | insert_resource_expand_to_fit(&iomem_resource, res); |
| 1322 | res++; | 1324 | res++; |
| 1323 | } | 1325 | } |
| 1324 | } | 1326 | } |
diff --git a/arch/x86/kernel/early-quirks.c b/arch/x86/kernel/early-quirks.c index 733c4f8d42ea..3ce029ffaa55 100644 --- a/arch/x86/kernel/early-quirks.c +++ b/arch/x86/kernel/early-quirks.c | |||
| @@ -95,7 +95,8 @@ static void __init nvidia_bugs(int num, int slot, int func) | |||
| 95 | 95 | ||
| 96 | } | 96 | } |
| 97 | 97 | ||
| 98 | static u32 ati_ixp4x0_rev(int num, int slot, int func) | 98 | #if defined(CONFIG_ACPI) && defined(CONFIG_X86_IO_APIC) |
| 99 | static u32 __init ati_ixp4x0_rev(int num, int slot, int func) | ||
| 99 | { | 100 | { |
| 100 | u32 d; | 101 | u32 d; |
| 101 | u8 b; | 102 | u8 b; |
| @@ -115,7 +116,6 @@ static u32 ati_ixp4x0_rev(int num, int slot, int func) | |||
| 115 | 116 | ||
| 116 | static void __init ati_bugs(int num, int slot, int func) | 117 | static void __init ati_bugs(int num, int slot, int func) |
| 117 | { | 118 | { |
| 118 | #if defined(CONFIG_ACPI) && defined (CONFIG_X86_IO_APIC) | ||
| 119 | u32 d; | 119 | u32 d; |
| 120 | u8 b; | 120 | u8 b; |
| 121 | 121 | ||
| @@ -138,9 +138,56 @@ static void __init ati_bugs(int num, int slot, int func) | |||
| 138 | printk(KERN_INFO "If you got timer trouble " | 138 | printk(KERN_INFO "If you got timer trouble " |
| 139 | "try acpi_use_timer_override\n"); | 139 | "try acpi_use_timer_override\n"); |
| 140 | } | 140 | } |
| 141 | #endif | ||
| 142 | } | 141 | } |
| 143 | 142 | ||
| 143 | static u32 __init ati_sbx00_rev(int num, int slot, int func) | ||
| 144 | { | ||
| 145 | u32 old, d; | ||
| 146 | |||
| 147 | d = read_pci_config(num, slot, func, 0x70); | ||
| 148 | old = d; | ||
| 149 | d &= ~(1<<8); | ||
| 150 | write_pci_config(num, slot, func, 0x70, d); | ||
| 151 | d = read_pci_config(num, slot, func, 0x8); | ||
| 152 | d &= 0xff; | ||
| 153 | write_pci_config(num, slot, func, 0x70, old); | ||
| 154 | |||
| 155 | return d; | ||
| 156 | } | ||
| 157 | |||
| 158 | static void __init ati_bugs_contd(int num, int slot, int func) | ||
| 159 | { | ||
| 160 | u32 d, rev; | ||
| 161 | |||
| 162 | if (acpi_use_timer_override) | ||
| 163 | return; | ||
| 164 | |||
| 165 | rev = ati_sbx00_rev(num, slot, func); | ||
| 166 | if (rev > 0x13) | ||
| 167 | return; | ||
| 168 | |||
| 169 | /* check for IRQ0 interrupt swap */ | ||
| 170 | d = read_pci_config(num, slot, func, 0x64); | ||
| 171 | if (!(d & (1<<14))) | ||
| 172 | acpi_skip_timer_override = 1; | ||
| 173 | |||
| 174 | if (acpi_skip_timer_override) { | ||
| 175 | printk(KERN_INFO "SB600 revision 0x%x\n", rev); | ||
| 176 | printk(KERN_INFO "Ignoring ACPI timer override.\n"); | ||
| 177 | printk(KERN_INFO "If you got timer trouble " | ||
| 178 | "try acpi_use_timer_override\n"); | ||
| 179 | } | ||
| 180 | } | ||
| 181 | #else | ||
| 182 | static void __init ati_bugs(int num, int slot, int func) | ||
| 183 | { | ||
| 184 | } | ||
| 185 | |||
| 186 | static void __init ati_bugs_contd(int num, int slot, int func) | ||
| 187 | { | ||
| 188 | } | ||
| 189 | #endif | ||
| 190 | |||
| 144 | #ifdef CONFIG_DMAR | 191 | #ifdef CONFIG_DMAR |
| 145 | static void __init intel_g33_dmar(int num, int slot, int func) | 192 | static void __init intel_g33_dmar(int num, int slot, int func) |
| 146 | { | 193 | { |
| @@ -176,6 +223,8 @@ static struct chipset early_qrk[] __initdata = { | |||
| 176 | PCI_CLASS_BRIDGE_HOST, PCI_ANY_ID, 0, fix_hypertransport_config }, | 223 | PCI_CLASS_BRIDGE_HOST, PCI_ANY_ID, 0, fix_hypertransport_config }, |
| 177 | { PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_IXP400_SMBUS, | 224 | { PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_IXP400_SMBUS, |
| 178 | PCI_CLASS_SERIAL_SMBUS, PCI_ANY_ID, 0, ati_bugs }, | 225 | PCI_CLASS_SERIAL_SMBUS, PCI_ANY_ID, 0, ati_bugs }, |
| 226 | { PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_SBX00_SMBUS, | ||
| 227 | PCI_CLASS_SERIAL_SMBUS, PCI_ANY_ID, 0, ati_bugs_contd }, | ||
| 179 | #ifdef CONFIG_DMAR | 228 | #ifdef CONFIG_DMAR |
| 180 | { PCI_VENDOR_ID_INTEL, 0x29c0, | 229 | { PCI_VENDOR_ID_INTEL, 0x29c0, |
| 181 | PCI_CLASS_BRIDGE_HOST, PCI_ANY_ID, 0, intel_g33_dmar }, | 230 | PCI_CLASS_BRIDGE_HOST, PCI_ANY_ID, 0, intel_g33_dmar }, |
diff --git a/arch/x86/kernel/entry_32.S b/arch/x86/kernel/entry_32.S index c356423a6026..28b597ef9ca1 100644 --- a/arch/x86/kernel/entry_32.S +++ b/arch/x86/kernel/entry_32.S | |||
| @@ -1024,7 +1024,7 @@ ENTRY(machine_check) | |||
| 1024 | RING0_INT_FRAME | 1024 | RING0_INT_FRAME |
| 1025 | pushl $0 | 1025 | pushl $0 |
| 1026 | CFI_ADJUST_CFA_OFFSET 4 | 1026 | CFI_ADJUST_CFA_OFFSET 4 |
| 1027 | pushl $do_machine_check | 1027 | pushl machine_check_vector |
| 1028 | CFI_ADJUST_CFA_OFFSET 4 | 1028 | CFI_ADJUST_CFA_OFFSET 4 |
| 1029 | jmp error_code | 1029 | jmp error_code |
| 1030 | CFI_ENDPROC | 1030 | CFI_ENDPROC |
| @@ -1149,7 +1149,7 @@ ENDPROC(xen_failsafe_callback) | |||
| 1149 | 1149 | ||
| 1150 | #endif /* CONFIG_XEN */ | 1150 | #endif /* CONFIG_XEN */ |
| 1151 | 1151 | ||
| 1152 | #ifdef CONFIG_FTRACE | 1152 | #ifdef CONFIG_FUNCTION_TRACER |
| 1153 | #ifdef CONFIG_DYNAMIC_FTRACE | 1153 | #ifdef CONFIG_DYNAMIC_FTRACE |
| 1154 | 1154 | ||
| 1155 | ENTRY(mcount) | 1155 | ENTRY(mcount) |
| @@ -1204,7 +1204,7 @@ trace: | |||
| 1204 | jmp ftrace_stub | 1204 | jmp ftrace_stub |
| 1205 | END(mcount) | 1205 | END(mcount) |
| 1206 | #endif /* CONFIG_DYNAMIC_FTRACE */ | 1206 | #endif /* CONFIG_DYNAMIC_FTRACE */ |
| 1207 | #endif /* CONFIG_FTRACE */ | 1207 | #endif /* CONFIG_FUNCTION_TRACER */ |
| 1208 | 1208 | ||
| 1209 | .section .rodata,"a" | 1209 | .section .rodata,"a" |
| 1210 | #include "syscall_table_32.S" | 1210 | #include "syscall_table_32.S" |
diff --git a/arch/x86/kernel/entry_64.S b/arch/x86/kernel/entry_64.S index 09e7145484c5..b86f332c96a6 100644 --- a/arch/x86/kernel/entry_64.S +++ b/arch/x86/kernel/entry_64.S | |||
| @@ -61,7 +61,7 @@ | |||
| 61 | 61 | ||
| 62 | .code64 | 62 | .code64 |
| 63 | 63 | ||
| 64 | #ifdef CONFIG_FTRACE | 64 | #ifdef CONFIG_FUNCTION_TRACER |
| 65 | #ifdef CONFIG_DYNAMIC_FTRACE | 65 | #ifdef CONFIG_DYNAMIC_FTRACE |
| 66 | ENTRY(mcount) | 66 | ENTRY(mcount) |
| 67 | retq | 67 | retq |
| @@ -138,7 +138,7 @@ trace: | |||
| 138 | jmp ftrace_stub | 138 | jmp ftrace_stub |
| 139 | END(mcount) | 139 | END(mcount) |
| 140 | #endif /* CONFIG_DYNAMIC_FTRACE */ | 140 | #endif /* CONFIG_DYNAMIC_FTRACE */ |
| 141 | #endif /* CONFIG_FTRACE */ | 141 | #endif /* CONFIG_FUNCTION_TRACER */ |
| 142 | 142 | ||
| 143 | #ifndef CONFIG_PREEMPT | 143 | #ifndef CONFIG_PREEMPT |
| 144 | #define retint_kernel retint_restore_args | 144 | #define retint_kernel retint_restore_args |
diff --git a/arch/x86/kernel/ftrace.c b/arch/x86/kernel/ftrace.c index d073d981a730..50ea0ac8c9bf 100644 --- a/arch/x86/kernel/ftrace.c +++ b/arch/x86/kernel/ftrace.c | |||
| @@ -21,8 +21,7 @@ | |||
| 21 | #include <asm/nops.h> | 21 | #include <asm/nops.h> |
| 22 | 22 | ||
| 23 | 23 | ||
| 24 | /* Long is fine, even if it is only 4 bytes ;-) */ | 24 | static unsigned char ftrace_nop[MCOUNT_INSN_SIZE]; |
| 25 | static unsigned long *ftrace_nop; | ||
| 26 | 25 | ||
| 27 | union ftrace_code_union { | 26 | union ftrace_code_union { |
| 28 | char code[MCOUNT_INSN_SIZE]; | 27 | char code[MCOUNT_INSN_SIZE]; |
| @@ -33,17 +32,17 @@ union ftrace_code_union { | |||
| 33 | }; | 32 | }; |
| 34 | 33 | ||
| 35 | 34 | ||
| 36 | static int notrace ftrace_calc_offset(long ip, long addr) | 35 | static int ftrace_calc_offset(long ip, long addr) |
| 37 | { | 36 | { |
| 38 | return (int)(addr - ip); | 37 | return (int)(addr - ip); |
| 39 | } | 38 | } |
| 40 | 39 | ||
| 41 | notrace unsigned char *ftrace_nop_replace(void) | 40 | unsigned char *ftrace_nop_replace(void) |
| 42 | { | 41 | { |
| 43 | return (char *)ftrace_nop; | 42 | return ftrace_nop; |
| 44 | } | 43 | } |
| 45 | 44 | ||
| 46 | notrace unsigned char *ftrace_call_replace(unsigned long ip, unsigned long addr) | 45 | unsigned char *ftrace_call_replace(unsigned long ip, unsigned long addr) |
| 47 | { | 46 | { |
| 48 | static union ftrace_code_union calc; | 47 | static union ftrace_code_union calc; |
| 49 | 48 | ||
| @@ -57,7 +56,7 @@ notrace unsigned char *ftrace_call_replace(unsigned long ip, unsigned long addr) | |||
| 57 | return calc.code; | 56 | return calc.code; |
| 58 | } | 57 | } |
| 59 | 58 | ||
| 60 | notrace int | 59 | int |
| 61 | ftrace_modify_code(unsigned long ip, unsigned char *old_code, | 60 | ftrace_modify_code(unsigned long ip, unsigned char *old_code, |
| 62 | unsigned char *new_code) | 61 | unsigned char *new_code) |
| 63 | { | 62 | { |
| @@ -66,26 +65,31 @@ ftrace_modify_code(unsigned long ip, unsigned char *old_code, | |||
| 66 | /* | 65 | /* |
| 67 | * Note: Due to modules and __init, code can | 66 | * Note: Due to modules and __init, code can |
| 68 | * disappear and change, we need to protect against faulting | 67 | * disappear and change, we need to protect against faulting |
| 69 | * as well as code changing. | 68 | * as well as code changing. We do this by using the |
| 69 | * probe_kernel_* functions. | ||
| 70 | * | 70 | * |
| 71 | * No real locking needed, this code is run through | 71 | * No real locking needed, this code is run through |
| 72 | * kstop_machine, or before SMP starts. | 72 | * kstop_machine, or before SMP starts. |
| 73 | */ | 73 | */ |
| 74 | if (__copy_from_user_inatomic(replaced, (char __user *)ip, MCOUNT_INSN_SIZE)) | ||
| 75 | return 1; | ||
| 76 | 74 | ||
| 75 | /* read the text we want to modify */ | ||
| 76 | if (probe_kernel_read(replaced, (void *)ip, MCOUNT_INSN_SIZE)) | ||
| 77 | return -EFAULT; | ||
| 78 | |||
| 79 | /* Make sure it is what we expect it to be */ | ||
| 77 | if (memcmp(replaced, old_code, MCOUNT_INSN_SIZE) != 0) | 80 | if (memcmp(replaced, old_code, MCOUNT_INSN_SIZE) != 0) |
| 78 | return 2; | 81 | return -EINVAL; |
| 79 | 82 | ||
| 80 | WARN_ON_ONCE(__copy_to_user_inatomic((char __user *)ip, new_code, | 83 | /* replace the text with the new text */ |
| 81 | MCOUNT_INSN_SIZE)); | 84 | if (probe_kernel_write((void *)ip, new_code, MCOUNT_INSN_SIZE)) |
| 85 | return -EPERM; | ||
| 82 | 86 | ||
| 83 | sync_core(); | 87 | sync_core(); |
| 84 | 88 | ||
| 85 | return 0; | 89 | return 0; |
| 86 | } | 90 | } |
| 87 | 91 | ||
| 88 | notrace int ftrace_update_ftrace_func(ftrace_func_t func) | 92 | int ftrace_update_ftrace_func(ftrace_func_t func) |
| 89 | { | 93 | { |
| 90 | unsigned long ip = (unsigned long)(&ftrace_call); | 94 | unsigned long ip = (unsigned long)(&ftrace_call); |
| 91 | unsigned char old[MCOUNT_INSN_SIZE], *new; | 95 | unsigned char old[MCOUNT_INSN_SIZE], *new; |
| @@ -98,13 +102,6 @@ notrace int ftrace_update_ftrace_func(ftrace_func_t func) | |||
| 98 | return ret; | 102 | return ret; |
| 99 | } | 103 | } |
| 100 | 104 | ||
| 101 | notrace int ftrace_mcount_set(unsigned long *data) | ||
| 102 | { | ||
| 103 | /* mcount is initialized as a nop */ | ||
| 104 | *data = 0; | ||
| 105 | return 0; | ||
| 106 | } | ||
| 107 | |||
| 108 | int __init ftrace_dyn_arch_init(void *data) | 105 | int __init ftrace_dyn_arch_init(void *data) |
| 109 | { | 106 | { |
| 110 | extern const unsigned char ftrace_test_p6nop[]; | 107 | extern const unsigned char ftrace_test_p6nop[]; |
| @@ -127,9 +124,6 @@ int __init ftrace_dyn_arch_init(void *data) | |||
| 127 | * TODO: check the cpuid to determine the best nop. | 124 | * TODO: check the cpuid to determine the best nop. |
| 128 | */ | 125 | */ |
| 129 | asm volatile ( | 126 | asm volatile ( |
| 130 | "jmp ftrace_test_jmp\n" | ||
| 131 | /* This code needs to stay around */ | ||
| 132 | ".section .text, \"ax\"\n" | ||
| 133 | "ftrace_test_jmp:" | 127 | "ftrace_test_jmp:" |
| 134 | "jmp ftrace_test_p6nop\n" | 128 | "jmp ftrace_test_p6nop\n" |
| 135 | "nop\n" | 129 | "nop\n" |
| @@ -140,8 +134,6 @@ int __init ftrace_dyn_arch_init(void *data) | |||
| 140 | "jmp 1f\n" | 134 | "jmp 1f\n" |
| 141 | "ftrace_test_nop5:" | 135 | "ftrace_test_nop5:" |
| 142 | ".byte 0x66,0x66,0x66,0x66,0x90\n" | 136 | ".byte 0x66,0x66,0x66,0x66,0x90\n" |
| 143 | "jmp 1f\n" | ||
| 144 | ".previous\n" | ||
| 145 | "1:" | 137 | "1:" |
| 146 | ".section .fixup, \"ax\"\n" | 138 | ".section .fixup, \"ax\"\n" |
| 147 | "2: movl $1, %0\n" | 139 | "2: movl $1, %0\n" |
| @@ -156,15 +148,15 @@ int __init ftrace_dyn_arch_init(void *data) | |||
| 156 | switch (faulted) { | 148 | switch (faulted) { |
| 157 | case 0: | 149 | case 0: |
| 158 | pr_info("ftrace: converting mcount calls to 0f 1f 44 00 00\n"); | 150 | pr_info("ftrace: converting mcount calls to 0f 1f 44 00 00\n"); |
| 159 | ftrace_nop = (unsigned long *)ftrace_test_p6nop; | 151 | memcpy(ftrace_nop, ftrace_test_p6nop, MCOUNT_INSN_SIZE); |
| 160 | break; | 152 | break; |
| 161 | case 1: | 153 | case 1: |
| 162 | pr_info("ftrace: converting mcount calls to 66 66 66 66 90\n"); | 154 | pr_info("ftrace: converting mcount calls to 66 66 66 66 90\n"); |
| 163 | ftrace_nop = (unsigned long *)ftrace_test_nop5; | 155 | memcpy(ftrace_nop, ftrace_test_nop5, MCOUNT_INSN_SIZE); |
| 164 | break; | 156 | break; |
| 165 | case 2: | 157 | case 2: |
| 166 | pr_info("ftrace: converting mcount calls to jmp . + 5\n"); | 158 | pr_info("ftrace: converting mcount calls to jmp . + 5\n"); |
| 167 | ftrace_nop = (unsigned long *)ftrace_test_jmp; | 159 | memcpy(ftrace_nop, ftrace_test_jmp, MCOUNT_INSN_SIZE); |
| 168 | break; | 160 | break; |
| 169 | } | 161 | } |
| 170 | 162 | ||
diff --git a/arch/x86/kernel/genapic_flat_64.c b/arch/x86/kernel/genapic_flat_64.c index 2ec2de8d8c46..c0262791bda4 100644 --- a/arch/x86/kernel/genapic_flat_64.c +++ b/arch/x86/kernel/genapic_flat_64.c | |||
| @@ -25,7 +25,7 @@ | |||
| 25 | #include <acpi/acpi_bus.h> | 25 | #include <acpi/acpi_bus.h> |
| 26 | #endif | 26 | #endif |
| 27 | 27 | ||
| 28 | static int __init flat_acpi_madt_oem_check(char *oem_id, char *oem_table_id) | 28 | static int flat_acpi_madt_oem_check(char *oem_id, char *oem_table_id) |
| 29 | { | 29 | { |
| 30 | return 1; | 30 | return 1; |
| 31 | } | 31 | } |
| @@ -170,7 +170,7 @@ struct genapic apic_flat = { | |||
| 170 | * We cannot use logical delivery in this case because the mask | 170 | * We cannot use logical delivery in this case because the mask |
| 171 | * overflows, so use physical mode. | 171 | * overflows, so use physical mode. |
| 172 | */ | 172 | */ |
| 173 | static int __init physflat_acpi_madt_oem_check(char *oem_id, char *oem_table_id) | 173 | static int physflat_acpi_madt_oem_check(char *oem_id, char *oem_table_id) |
| 174 | { | 174 | { |
| 175 | #ifdef CONFIG_ACPI | 175 | #ifdef CONFIG_ACPI |
| 176 | /* | 176 | /* |
diff --git a/arch/x86/kernel/genx2apic_cluster.c b/arch/x86/kernel/genx2apic_cluster.c index e4bf2cc0d743..f6a2c8eb48a6 100644 --- a/arch/x86/kernel/genx2apic_cluster.c +++ b/arch/x86/kernel/genx2apic_cluster.c | |||
| @@ -12,7 +12,7 @@ | |||
| 12 | 12 | ||
| 13 | DEFINE_PER_CPU(u32, x86_cpu_to_logical_apicid); | 13 | DEFINE_PER_CPU(u32, x86_cpu_to_logical_apicid); |
| 14 | 14 | ||
| 15 | static int __init x2apic_acpi_madt_oem_check(char *oem_id, char *oem_table_id) | 15 | static int x2apic_acpi_madt_oem_check(char *oem_id, char *oem_table_id) |
| 16 | { | 16 | { |
| 17 | if (cpu_has_x2apic) | 17 | if (cpu_has_x2apic) |
| 18 | return 1; | 18 | return 1; |
diff --git a/arch/x86/kernel/genx2apic_phys.c b/arch/x86/kernel/genx2apic_phys.c index 8f1343df2627..d042211768b7 100644 --- a/arch/x86/kernel/genx2apic_phys.c +++ b/arch/x86/kernel/genx2apic_phys.c | |||
| @@ -19,7 +19,7 @@ static int set_x2apic_phys_mode(char *arg) | |||
| 19 | } | 19 | } |
| 20 | early_param("x2apic_phys", set_x2apic_phys_mode); | 20 | early_param("x2apic_phys", set_x2apic_phys_mode); |
| 21 | 21 | ||
| 22 | static int __init x2apic_acpi_madt_oem_check(char *oem_id, char *oem_table_id) | 22 | static int x2apic_acpi_madt_oem_check(char *oem_id, char *oem_table_id) |
| 23 | { | 23 | { |
| 24 | if (cpu_has_x2apic && x2apic_phys) | 24 | if (cpu_has_x2apic && x2apic_phys) |
| 25 | return 1; | 25 | return 1; |
diff --git a/arch/x86/kernel/genx2apic_uv_x.c b/arch/x86/kernel/genx2apic_uv_x.c index bfd532843df6..2c7dbdb98278 100644 --- a/arch/x86/kernel/genx2apic_uv_x.c +++ b/arch/x86/kernel/genx2apic_uv_x.c | |||
| @@ -15,7 +15,6 @@ | |||
| 15 | #include <linux/ctype.h> | 15 | #include <linux/ctype.h> |
| 16 | #include <linux/init.h> | 16 | #include <linux/init.h> |
| 17 | #include <linux/sched.h> | 17 | #include <linux/sched.h> |
| 18 | #include <linux/bootmem.h> | ||
| 19 | #include <linux/module.h> | 18 | #include <linux/module.h> |
| 20 | #include <linux/hardirq.h> | 19 | #include <linux/hardirq.h> |
| 21 | #include <asm/smp.h> | 20 | #include <asm/smp.h> |
| @@ -30,7 +29,7 @@ DEFINE_PER_CPU(int, x2apic_extra_bits); | |||
| 30 | 29 | ||
| 31 | static enum uv_system_type uv_system_type; | 30 | static enum uv_system_type uv_system_type; |
| 32 | 31 | ||
| 33 | static int __init uv_acpi_madt_oem_check(char *oem_id, char *oem_table_id) | 32 | static int uv_acpi_madt_oem_check(char *oem_id, char *oem_table_id) |
| 34 | { | 33 | { |
| 35 | if (!strcmp(oem_id, "SGI")) { | 34 | if (!strcmp(oem_id, "SGI")) { |
| 36 | if (!strcmp(oem_table_id, "UVL")) | 35 | if (!strcmp(oem_table_id, "UVL")) |
| @@ -398,16 +397,16 @@ void __init uv_system_init(void) | |||
| 398 | printk(KERN_DEBUG "UV: Found %d blades\n", uv_num_possible_blades()); | 397 | printk(KERN_DEBUG "UV: Found %d blades\n", uv_num_possible_blades()); |
| 399 | 398 | ||
| 400 | bytes = sizeof(struct uv_blade_info) * uv_num_possible_blades(); | 399 | bytes = sizeof(struct uv_blade_info) * uv_num_possible_blades(); |
| 401 | uv_blade_info = alloc_bootmem_pages(bytes); | 400 | uv_blade_info = kmalloc(bytes, GFP_KERNEL); |
| 402 | 401 | ||
| 403 | get_lowmem_redirect(&lowmem_redir_base, &lowmem_redir_size); | 402 | get_lowmem_redirect(&lowmem_redir_base, &lowmem_redir_size); |
| 404 | 403 | ||
| 405 | bytes = sizeof(uv_node_to_blade[0]) * num_possible_nodes(); | 404 | bytes = sizeof(uv_node_to_blade[0]) * num_possible_nodes(); |
| 406 | uv_node_to_blade = alloc_bootmem_pages(bytes); | 405 | uv_node_to_blade = kmalloc(bytes, GFP_KERNEL); |
| 407 | memset(uv_node_to_blade, 255, bytes); | 406 | memset(uv_node_to_blade, 255, bytes); |
| 408 | 407 | ||
| 409 | bytes = sizeof(uv_cpu_to_blade[0]) * num_possible_cpus(); | 408 | bytes = sizeof(uv_cpu_to_blade[0]) * num_possible_cpus(); |
| 410 | uv_cpu_to_blade = alloc_bootmem_pages(bytes); | 409 | uv_cpu_to_blade = kmalloc(bytes, GFP_KERNEL); |
| 411 | memset(uv_cpu_to_blade, 255, bytes); | 410 | memset(uv_cpu_to_blade, 255, bytes); |
| 412 | 411 | ||
| 413 | blade = 0; | 412 | blade = 0; |
diff --git a/arch/x86/kernel/i386_ksyms_32.c b/arch/x86/kernel/i386_ksyms_32.c index dd7ebee446af..43cec6bdda63 100644 --- a/arch/x86/kernel/i386_ksyms_32.c +++ b/arch/x86/kernel/i386_ksyms_32.c | |||
| @@ -5,7 +5,7 @@ | |||
| 5 | #include <asm/desc.h> | 5 | #include <asm/desc.h> |
| 6 | #include <asm/ftrace.h> | 6 | #include <asm/ftrace.h> |
| 7 | 7 | ||
| 8 | #ifdef CONFIG_FTRACE | 8 | #ifdef CONFIG_FUNCTION_TRACER |
| 9 | /* mcount is defined in assembly */ | 9 | /* mcount is defined in assembly */ |
| 10 | EXPORT_SYMBOL(mcount); | 10 | EXPORT_SYMBOL(mcount); |
| 11 | #endif | 11 | #endif |
diff --git a/arch/x86/kernel/io_apic.c b/arch/x86/kernel/io_apic.c index b764d7429c61..7a3f2028e2eb 100644 --- a/arch/x86/kernel/io_apic.c +++ b/arch/x86/kernel/io_apic.c | |||
| @@ -3611,6 +3611,8 @@ int __init probe_nr_irqs(void) | |||
| 3611 | /* something wrong ? */ | 3611 | /* something wrong ? */ |
| 3612 | if (nr < nr_min) | 3612 | if (nr < nr_min) |
| 3613 | nr = nr_min; | 3613 | nr = nr_min; |
| 3614 | if (WARN_ON(nr > NR_IRQS)) | ||
| 3615 | nr = NR_IRQS; | ||
| 3614 | 3616 | ||
| 3615 | return nr; | 3617 | return nr; |
| 3616 | } | 3618 | } |
diff --git a/arch/x86/kernel/irq.c b/arch/x86/kernel/irq.c index ccf6c503fc3b..d1d4dc52f649 100644 --- a/arch/x86/kernel/irq.c +++ b/arch/x86/kernel/irq.c | |||
| @@ -36,7 +36,7 @@ void ack_bad_irq(unsigned int irq) | |||
| 36 | } | 36 | } |
| 37 | 37 | ||
| 38 | #ifdef CONFIG_X86_32 | 38 | #ifdef CONFIG_X86_32 |
| 39 | # define irq_stats(x) (&per_cpu(irq_stat,x)) | 39 | # define irq_stats(x) (&per_cpu(irq_stat, x)) |
| 40 | #else | 40 | #else |
| 41 | # define irq_stats(x) cpu_pda(x) | 41 | # define irq_stats(x) cpu_pda(x) |
| 42 | #endif | 42 | #endif |
| @@ -113,7 +113,7 @@ int show_interrupts(struct seq_file *p, void *v) | |||
| 113 | if (i == 0) { | 113 | if (i == 0) { |
| 114 | seq_printf(p, " "); | 114 | seq_printf(p, " "); |
| 115 | for_each_online_cpu(j) | 115 | for_each_online_cpu(j) |
| 116 | seq_printf(p, "CPU%-8d",j); | 116 | seq_printf(p, "CPU%-8d", j); |
| 117 | seq_putc(p, '\n'); | 117 | seq_putc(p, '\n'); |
| 118 | } | 118 | } |
| 119 | 119 | ||
diff --git a/arch/x86/kernel/k8.c b/arch/x86/kernel/k8.c index 304d8bad6559..cbc4332a77b2 100644 --- a/arch/x86/kernel/k8.c +++ b/arch/x86/kernel/k8.c | |||
| @@ -18,7 +18,6 @@ static u32 *flush_words; | |||
| 18 | struct pci_device_id k8_nb_ids[] = { | 18 | struct pci_device_id k8_nb_ids[] = { |
| 19 | { PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_K8_NB_MISC) }, | 19 | { PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_K8_NB_MISC) }, |
| 20 | { PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_10H_NB_MISC) }, | 20 | { PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_10H_NB_MISC) }, |
| 21 | { PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_11H_NB_MISC) }, | ||
| 22 | {} | 21 | {} |
| 23 | }; | 22 | }; |
| 24 | EXPORT_SYMBOL(k8_nb_ids); | 23 | EXPORT_SYMBOL(k8_nb_ids); |
diff --git a/arch/x86/kernel/machine_kexec_32.c b/arch/x86/kernel/machine_kexec_32.c index 0732adba05ca..7a385746509a 100644 --- a/arch/x86/kernel/machine_kexec_32.c +++ b/arch/x86/kernel/machine_kexec_32.c | |||
| @@ -162,7 +162,10 @@ void machine_kexec(struct kimage *image) | |||
| 162 | page_list[VA_PTE_0] = (unsigned long)kexec_pte0; | 162 | page_list[VA_PTE_0] = (unsigned long)kexec_pte0; |
| 163 | page_list[PA_PTE_1] = __pa(kexec_pte1); | 163 | page_list[PA_PTE_1] = __pa(kexec_pte1); |
| 164 | page_list[VA_PTE_1] = (unsigned long)kexec_pte1; | 164 | page_list[VA_PTE_1] = (unsigned long)kexec_pte1; |
| 165 | page_list[PA_SWAP_PAGE] = (page_to_pfn(image->swap_page) << PAGE_SHIFT); | 165 | |
| 166 | if (image->type == KEXEC_TYPE_DEFAULT) | ||
| 167 | page_list[PA_SWAP_PAGE] = (page_to_pfn(image->swap_page) | ||
| 168 | << PAGE_SHIFT); | ||
| 166 | 169 | ||
| 167 | /* The segment registers are funny things, they have both a | 170 | /* The segment registers are funny things, they have both a |
| 168 | * visible and an invisible part. Whenever the visible part is | 171 | * visible and an invisible part. Whenever the visible part is |
diff --git a/arch/x86/kernel/microcode_amd.c b/arch/x86/kernel/microcode_amd.c index 7a1f8eeac2c7..5f8e5d75a254 100644 --- a/arch/x86/kernel/microcode_amd.c +++ b/arch/x86/kernel/microcode_amd.c | |||
| @@ -39,7 +39,7 @@ | |||
| 39 | #include <asm/microcode.h> | 39 | #include <asm/microcode.h> |
| 40 | 40 | ||
| 41 | MODULE_DESCRIPTION("AMD Microcode Update Driver"); | 41 | MODULE_DESCRIPTION("AMD Microcode Update Driver"); |
| 42 | MODULE_AUTHOR("Peter Oruba <peter.oruba@amd.com>"); | 42 | MODULE_AUTHOR("Peter Oruba"); |
| 43 | MODULE_LICENSE("GPL v2"); | 43 | MODULE_LICENSE("GPL v2"); |
| 44 | 44 | ||
| 45 | #define UCODE_MAGIC 0x00414d44 | 45 | #define UCODE_MAGIC 0x00414d44 |
diff --git a/arch/x86/kernel/microcode_core.c b/arch/x86/kernel/microcode_core.c index 936d8d55f230..82fb2809ce32 100644 --- a/arch/x86/kernel/microcode_core.c +++ b/arch/x86/kernel/microcode_core.c | |||
| @@ -480,8 +480,8 @@ static int __init microcode_init(void) | |||
| 480 | 480 | ||
| 481 | printk(KERN_INFO | 481 | printk(KERN_INFO |
| 482 | "Microcode Update Driver: v" MICROCODE_VERSION | 482 | "Microcode Update Driver: v" MICROCODE_VERSION |
| 483 | " <tigran@aivazian.fsnet.co.uk>" | 483 | " <tigran@aivazian.fsnet.co.uk>," |
| 484 | " <peter.oruba@amd.com>\n"); | 484 | " Peter Oruba\n"); |
| 485 | 485 | ||
| 486 | return 0; | 486 | return 0; |
| 487 | } | 487 | } |
diff --git a/arch/x86/kernel/pci-gart_64.c b/arch/x86/kernel/pci-gart_64.c index e3f75bbcedea..a42b02b4df68 100644 --- a/arch/x86/kernel/pci-gart_64.c +++ b/arch/x86/kernel/pci-gart_64.c | |||
| @@ -744,7 +744,7 @@ void __init gart_iommu_init(void) | |||
| 744 | long i; | 744 | long i; |
| 745 | 745 | ||
| 746 | if (cache_k8_northbridges() < 0 || num_k8_northbridges == 0) { | 746 | if (cache_k8_northbridges() < 0 || num_k8_northbridges == 0) { |
| 747 | printk(KERN_INFO "PCI-GART: No AMD northbridge found.\n"); | 747 | printk(KERN_INFO "PCI-GART: No AMD GART found.\n"); |
| 748 | return; | 748 | return; |
| 749 | } | 749 | } |
| 750 | 750 | ||
diff --git a/arch/x86/kernel/pci-swiotlb_64.c b/arch/x86/kernel/pci-swiotlb_64.c index c4ce0332759e..3c539d111abb 100644 --- a/arch/x86/kernel/pci-swiotlb_64.c +++ b/arch/x86/kernel/pci-swiotlb_64.c | |||
| @@ -18,9 +18,21 @@ swiotlb_map_single_phys(struct device *hwdev, phys_addr_t paddr, size_t size, | |||
| 18 | return swiotlb_map_single(hwdev, phys_to_virt(paddr), size, direction); | 18 | return swiotlb_map_single(hwdev, phys_to_virt(paddr), size, direction); |
| 19 | } | 19 | } |
| 20 | 20 | ||
| 21 | static void *x86_swiotlb_alloc_coherent(struct device *hwdev, size_t size, | ||
| 22 | dma_addr_t *dma_handle, gfp_t flags) | ||
| 23 | { | ||
| 24 | void *vaddr; | ||
| 25 | |||
| 26 | vaddr = dma_generic_alloc_coherent(hwdev, size, dma_handle, flags); | ||
| 27 | if (vaddr) | ||
| 28 | return vaddr; | ||
| 29 | |||
| 30 | return swiotlb_alloc_coherent(hwdev, size, dma_handle, flags); | ||
| 31 | } | ||
| 32 | |||
| 21 | struct dma_mapping_ops swiotlb_dma_ops = { | 33 | struct dma_mapping_ops swiotlb_dma_ops = { |
| 22 | .mapping_error = swiotlb_dma_mapping_error, | 34 | .mapping_error = swiotlb_dma_mapping_error, |
| 23 | .alloc_coherent = swiotlb_alloc_coherent, | 35 | .alloc_coherent = x86_swiotlb_alloc_coherent, |
| 24 | .free_coherent = swiotlb_free_coherent, | 36 | .free_coherent = swiotlb_free_coherent, |
| 25 | .map_single = swiotlb_map_single_phys, | 37 | .map_single = swiotlb_map_single_phys, |
| 26 | .unmap_single = swiotlb_unmap_single, | 38 | .unmap_single = swiotlb_unmap_single, |
diff --git a/arch/x86/kernel/process_64.c b/arch/x86/kernel/process_64.c index cd8c0ed02b7e..c958120fb1b6 100644 --- a/arch/x86/kernel/process_64.c +++ b/arch/x86/kernel/process_64.c | |||
| @@ -63,6 +63,13 @@ void idle_notifier_register(struct notifier_block *n) | |||
| 63 | { | 63 | { |
| 64 | atomic_notifier_chain_register(&idle_notifier, n); | 64 | atomic_notifier_chain_register(&idle_notifier, n); |
| 65 | } | 65 | } |
| 66 | EXPORT_SYMBOL_GPL(idle_notifier_register); | ||
| 67 | |||
| 68 | void idle_notifier_unregister(struct notifier_block *n) | ||
| 69 | { | ||
| 70 | atomic_notifier_chain_unregister(&idle_notifier, n); | ||
| 71 | } | ||
| 72 | EXPORT_SYMBOL_GPL(idle_notifier_unregister); | ||
| 66 | 73 | ||
| 67 | void enter_idle(void) | 74 | void enter_idle(void) |
| 68 | { | 75 | { |
diff --git a/arch/x86/kernel/reboot.c b/arch/x86/kernel/reboot.c index f4c93f1cfc19..724adfc63cb9 100644 --- a/arch/x86/kernel/reboot.c +++ b/arch/x86/kernel/reboot.c | |||
| @@ -29,11 +29,7 @@ EXPORT_SYMBOL(pm_power_off); | |||
| 29 | 29 | ||
| 30 | static const struct desc_ptr no_idt = {}; | 30 | static const struct desc_ptr no_idt = {}; |
| 31 | static int reboot_mode; | 31 | static int reboot_mode; |
| 32 | /* | 32 | enum reboot_type reboot_type = BOOT_KBD; |
| 33 | * Keyboard reset and triple fault may result in INIT, not RESET, which | ||
| 34 | * doesn't work when we're in vmx root mode. Try ACPI first. | ||
| 35 | */ | ||
| 36 | enum reboot_type reboot_type = BOOT_ACPI; | ||
| 37 | int reboot_force; | 33 | int reboot_force; |
| 38 | 34 | ||
| 39 | #if defined(CONFIG_X86_32) && defined(CONFIG_SMP) | 35 | #if defined(CONFIG_X86_32) && defined(CONFIG_SMP) |
diff --git a/arch/x86/kernel/setup_percpu.c b/arch/x86/kernel/setup_percpu.c index 410c88f0bfeb..ae0c0d3bb770 100644 --- a/arch/x86/kernel/setup_percpu.c +++ b/arch/x86/kernel/setup_percpu.c | |||
| @@ -218,7 +218,7 @@ static void __init setup_node_to_cpumask_map(void) | |||
| 218 | /* allocate the map */ | 218 | /* allocate the map */ |
| 219 | map = alloc_bootmem_low(nr_node_ids * sizeof(cpumask_t)); | 219 | map = alloc_bootmem_low(nr_node_ids * sizeof(cpumask_t)); |
| 220 | 220 | ||
| 221 | pr_debug(KERN_DEBUG "Node to cpumask map at %p for %d nodes\n", | 221 | pr_debug("Node to cpumask map at %p for %d nodes\n", |
| 222 | map, nr_node_ids); | 222 | map, nr_node_ids); |
| 223 | 223 | ||
| 224 | /* node_to_cpumask() will now work */ | 224 | /* node_to_cpumask() will now work */ |
diff --git a/arch/x86/kernel/smpboot.c b/arch/x86/kernel/smpboot.c index 7ece815ea637..7b1093397319 100644 --- a/arch/x86/kernel/smpboot.c +++ b/arch/x86/kernel/smpboot.c | |||
| @@ -893,9 +893,11 @@ do_rest: | |||
| 893 | smpboot_setup_warm_reset_vector(start_ip); | 893 | smpboot_setup_warm_reset_vector(start_ip); |
| 894 | /* | 894 | /* |
| 895 | * Be paranoid about clearing APIC errors. | 895 | * Be paranoid about clearing APIC errors. |
| 896 | */ | 896 | */ |
| 897 | apic_write(APIC_ESR, 0); | 897 | if (APIC_INTEGRATED(apic_version[boot_cpu_physical_apicid])) { |
| 898 | apic_read(APIC_ESR); | 898 | apic_write(APIC_ESR, 0); |
| 899 | apic_read(APIC_ESR); | ||
| 900 | } | ||
| 899 | } | 901 | } |
| 900 | 902 | ||
| 901 | /* | 903 | /* |
diff --git a/arch/x86/kernel/syscall_64.c b/arch/x86/kernel/syscall_64.c index 3d1be4f0fac5..de87d6008295 100644 --- a/arch/x86/kernel/syscall_64.c +++ b/arch/x86/kernel/syscall_64.c | |||
| @@ -8,12 +8,12 @@ | |||
| 8 | #define __NO_STUBS | 8 | #define __NO_STUBS |
| 9 | 9 | ||
| 10 | #define __SYSCALL(nr, sym) extern asmlinkage void sym(void) ; | 10 | #define __SYSCALL(nr, sym) extern asmlinkage void sym(void) ; |
| 11 | #undef ASM_X86__UNISTD_64_H | 11 | #undef _ASM_X86_UNISTD_64_H |
| 12 | #include <asm/unistd_64.h> | 12 | #include <asm/unistd_64.h> |
| 13 | 13 | ||
| 14 | #undef __SYSCALL | 14 | #undef __SYSCALL |
| 15 | #define __SYSCALL(nr, sym) [nr] = sym, | 15 | #define __SYSCALL(nr, sym) [nr] = sym, |
| 16 | #undef ASM_X86__UNISTD_64_H | 16 | #undef _ASM_X86_UNISTD_64_H |
| 17 | 17 | ||
| 18 | typedef void (*sys_call_ptr_t)(void); | 18 | typedef void (*sys_call_ptr_t)(void); |
| 19 | 19 | ||
diff --git a/arch/x86/kernel/tlb_32.c b/arch/x86/kernel/tlb_32.c index e00534b33534..f4049f3513b6 100644 --- a/arch/x86/kernel/tlb_32.c +++ b/arch/x86/kernel/tlb_32.c | |||
| @@ -154,6 +154,12 @@ void native_flush_tlb_others(const cpumask_t *cpumaskp, struct mm_struct *mm, | |||
| 154 | flush_mm = mm; | 154 | flush_mm = mm; |
| 155 | flush_va = va; | 155 | flush_va = va; |
| 156 | cpus_or(flush_cpumask, cpumask, flush_cpumask); | 156 | cpus_or(flush_cpumask, cpumask, flush_cpumask); |
| 157 | |||
| 158 | /* | ||
| 159 | * Make the above memory operations globally visible before | ||
| 160 | * sending the IPI. | ||
| 161 | */ | ||
| 162 | smp_mb(); | ||
| 157 | /* | 163 | /* |
| 158 | * We have to send the IPI only to | 164 | * We have to send the IPI only to |
| 159 | * CPUs affected. | 165 | * CPUs affected. |
diff --git a/arch/x86/kernel/tlb_64.c b/arch/x86/kernel/tlb_64.c index dcbf7a1159ea..8f919ca69494 100644 --- a/arch/x86/kernel/tlb_64.c +++ b/arch/x86/kernel/tlb_64.c | |||
| @@ -183,6 +183,11 @@ void native_flush_tlb_others(const cpumask_t *cpumaskp, struct mm_struct *mm, | |||
| 183 | cpus_or(f->flush_cpumask, cpumask, f->flush_cpumask); | 183 | cpus_or(f->flush_cpumask, cpumask, f->flush_cpumask); |
| 184 | 184 | ||
| 185 | /* | 185 | /* |
| 186 | * Make the above memory operations globally visible before | ||
| 187 | * sending the IPI. | ||
| 188 | */ | ||
| 189 | smp_mb(); | ||
| 190 | /* | ||
| 186 | * We have to send the IPI only to | 191 | * We have to send the IPI only to |
| 187 | * CPUs affected. | 192 | * CPUs affected. |
| 188 | */ | 193 | */ |
diff --git a/arch/x86/kernel/tlb_uv.c b/arch/x86/kernel/tlb_uv.c index 8b8c0d6640fa..04431f34fd16 100644 --- a/arch/x86/kernel/tlb_uv.c +++ b/arch/x86/kernel/tlb_uv.c | |||
| @@ -6,7 +6,7 @@ | |||
| 6 | * This code is released under the GNU General Public License version 2 or | 6 | * This code is released under the GNU General Public License version 2 or |
| 7 | * later. | 7 | * later. |
| 8 | */ | 8 | */ |
| 9 | #include <linux/mc146818rtc.h> | 9 | #include <linux/seq_file.h> |
| 10 | #include <linux/proc_fs.h> | 10 | #include <linux/proc_fs.h> |
| 11 | #include <linux/kernel.h> | 11 | #include <linux/kernel.h> |
| 12 | 12 | ||
diff --git a/arch/x86/kernel/traps.c b/arch/x86/kernel/traps.c index e062974cce34..04d242ab0161 100644 --- a/arch/x86/kernel/traps.c +++ b/arch/x86/kernel/traps.c | |||
| @@ -931,14 +931,6 @@ do_device_not_available(struct pt_regs *regs, long error) | |||
| 931 | } | 931 | } |
| 932 | 932 | ||
| 933 | #ifdef CONFIG_X86_32 | 933 | #ifdef CONFIG_X86_32 |
| 934 | #ifdef CONFIG_X86_MCE | ||
| 935 | dotraplinkage void __kprobes do_machine_check(struct pt_regs *regs, long error) | ||
| 936 | { | ||
| 937 | conditional_sti(regs); | ||
| 938 | machine_check_vector(regs, error); | ||
| 939 | } | ||
| 940 | #endif | ||
| 941 | |||
| 942 | dotraplinkage void do_iret_error(struct pt_regs *regs, long error_code) | 934 | dotraplinkage void do_iret_error(struct pt_regs *regs, long error_code) |
| 943 | { | 935 | { |
| 944 | siginfo_t info; | 936 | siginfo_t info; |
diff --git a/arch/x86/kernel/tsc.c b/arch/x86/kernel/tsc.c index 161bb850fc47..424093b157d3 100644 --- a/arch/x86/kernel/tsc.c +++ b/arch/x86/kernel/tsc.c | |||
| @@ -55,7 +55,7 @@ u64 native_sched_clock(void) | |||
| 55 | rdtscll(this_offset); | 55 | rdtscll(this_offset); |
| 56 | 56 | ||
| 57 | /* return the value in ns */ | 57 | /* return the value in ns */ |
| 58 | return cycles_2_ns(this_offset); | 58 | return __cycles_2_ns(this_offset); |
| 59 | } | 59 | } |
| 60 | 60 | ||
| 61 | /* We need to define a real function for sched_clock, to override the | 61 | /* We need to define a real function for sched_clock, to override the |
| @@ -759,7 +759,7 @@ __cpuinit int unsynchronized_tsc(void) | |||
| 759 | if (!cpu_has_tsc || tsc_unstable) | 759 | if (!cpu_has_tsc || tsc_unstable) |
| 760 | return 1; | 760 | return 1; |
| 761 | 761 | ||
| 762 | #ifdef CONFIG_SMP | 762 | #ifdef CONFIG_X86_SMP |
| 763 | if (apic_is_clustered_box()) | 763 | if (apic_is_clustered_box()) |
| 764 | return 1; | 764 | return 1; |
| 765 | #endif | 765 | #endif |
| @@ -813,10 +813,6 @@ void __init tsc_init(void) | |||
| 813 | cpu_khz = calibrate_cpu(); | 813 | cpu_khz = calibrate_cpu(); |
| 814 | #endif | 814 | #endif |
| 815 | 815 | ||
| 816 | lpj = ((u64)tsc_khz * 1000); | ||
| 817 | do_div(lpj, HZ); | ||
| 818 | lpj_fine = lpj; | ||
| 819 | |||
| 820 | printk("Detected %lu.%03lu MHz processor.\n", | 816 | printk("Detected %lu.%03lu MHz processor.\n", |
| 821 | (unsigned long)cpu_khz / 1000, | 817 | (unsigned long)cpu_khz / 1000, |
| 822 | (unsigned long)cpu_khz % 1000); | 818 | (unsigned long)cpu_khz % 1000); |
| @@ -836,6 +832,10 @@ void __init tsc_init(void) | |||
| 836 | /* now allow native_sched_clock() to use rdtsc */ | 832 | /* now allow native_sched_clock() to use rdtsc */ |
| 837 | tsc_disabled = 0; | 833 | tsc_disabled = 0; |
| 838 | 834 | ||
| 835 | lpj = ((u64)tsc_khz * 1000); | ||
| 836 | do_div(lpj, HZ); | ||
| 837 | lpj_fine = lpj; | ||
| 838 | |||
| 839 | use_tsc_delay(); | 839 | use_tsc_delay(); |
| 840 | /* Check and install the TSC clocksource */ | 840 | /* Check and install the TSC clocksource */ |
| 841 | dmi_check_system(bad_tsc_dmi_table); | 841 | dmi_check_system(bad_tsc_dmi_table); |
diff --git a/arch/x86/kernel/vsmp_64.c b/arch/x86/kernel/vsmp_64.c index 7766d36983fc..a688f3bfaec2 100644 --- a/arch/x86/kernel/vsmp_64.c +++ b/arch/x86/kernel/vsmp_64.c | |||
| @@ -78,7 +78,7 @@ static unsigned __init_or_module vsmp_patch(u8 type, u16 clobbers, void *ibuf, | |||
| 78 | 78 | ||
| 79 | static void __init set_vsmp_pv_ops(void) | 79 | static void __init set_vsmp_pv_ops(void) |
| 80 | { | 80 | { |
| 81 | void *address; | 81 | void __iomem *address; |
| 82 | unsigned int cap, ctl, cfg; | 82 | unsigned int cap, ctl, cfg; |
| 83 | 83 | ||
| 84 | /* set vSMP magic bits to indicate vSMP capable kernel */ | 84 | /* set vSMP magic bits to indicate vSMP capable kernel */ |
diff --git a/arch/x86/kernel/x8664_ksyms_64.c b/arch/x86/kernel/x8664_ksyms_64.c index b545f371b5f5..695e426aa354 100644 --- a/arch/x86/kernel/x8664_ksyms_64.c +++ b/arch/x86/kernel/x8664_ksyms_64.c | |||
| @@ -12,7 +12,7 @@ | |||
| 12 | #include <asm/desc.h> | 12 | #include <asm/desc.h> |
| 13 | #include <asm/ftrace.h> | 13 | #include <asm/ftrace.h> |
| 14 | 14 | ||
| 15 | #ifdef CONFIG_FTRACE | 15 | #ifdef CONFIG_FUNCTION_TRACER |
| 16 | /* mcount is defined in assembly */ | 16 | /* mcount is defined in assembly */ |
| 17 | EXPORT_SYMBOL(mcount); | 17 | EXPORT_SYMBOL(mcount); |
| 18 | #endif | 18 | #endif |
diff --git a/arch/x86/kernel/xsave.c b/arch/x86/kernel/xsave.c index 9abac8a9d823..b13acb75e822 100644 --- a/arch/x86/kernel/xsave.c +++ b/arch/x86/kernel/xsave.c | |||
| @@ -248,7 +248,7 @@ clear: | |||
| 248 | * This will be saved when ever the FP and extended state context is | 248 | * This will be saved when ever the FP and extended state context is |
| 249 | * saved on the user stack during the signal handler delivery to the user. | 249 | * saved on the user stack during the signal handler delivery to the user. |
| 250 | */ | 250 | */ |
| 251 | void prepare_fx_sw_frame(void) | 251 | static void prepare_fx_sw_frame(void) |
| 252 | { | 252 | { |
| 253 | int size_extended = (xstate_size - sizeof(struct i387_fxsave_struct)) + | 253 | int size_extended = (xstate_size - sizeof(struct i387_fxsave_struct)) + |
| 254 | FP_XSTATE_MAGIC2_SIZE; | 254 | FP_XSTATE_MAGIC2_SIZE; |
