diff options
| author | Ingo Molnar <mingo@elte.hu> | 2009-08-11 08:19:09 -0400 |
|---|---|---|
| committer | Ingo Molnar <mingo@elte.hu> | 2009-08-11 08:19:09 -0400 |
| commit | 89034bc2c7b839702c00a704e79d112737f98be0 (patch) | |
| tree | e65b1f3d4c751baa840efc81bc4734f089379eb3 /arch/x86/kernel | |
| parent | fb82ad719831db58e9baa4c67015aae3fe27e7e3 (diff) | |
| parent | 85dfd81dc57e8183a277ddd7a56aa65c96f3f487 (diff) | |
Merge branch 'linus' into tracing/core
Conflicts:
kernel/trace/trace_events_filter.c
We use the tracing/core version.
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'arch/x86/kernel')
| -rw-r--r-- | arch/x86/kernel/apic/io_apic.c | 3 | ||||
| -rw-r--r-- | arch/x86/kernel/apic/x2apic_cluster.c | 10 | ||||
| -rw-r--r-- | arch/x86/kernel/apic/x2apic_phys.c | 10 | ||||
| -rw-r--r-- | arch/x86/kernel/apic/x2apic_uv_x.c | 38 | ||||
| -rw-r--r-- | arch/x86/kernel/apm_32.c | 2 | ||||
| -rw-r--r-- | arch/x86/kernel/cpu/amd.c | 2 | ||||
| -rw-r--r-- | arch/x86/kernel/cpu/mcheck/mce.c | 6 | ||||
| -rw-r--r-- | arch/x86/kernel/cpu/perf_counter.c | 253 | ||||
| -rw-r--r-- | arch/x86/kernel/efi.c | 4 | ||||
| -rw-r--r-- | arch/x86/kernel/efi_64.c | 6 | ||||
| -rw-r--r-- | arch/x86/kernel/head_32.S | 6 | ||||
| -rw-r--r-- | arch/x86/kernel/irqinit.c | 2 | ||||
| -rw-r--r-- | arch/x86/kernel/mfgpt_32.c | 2 | ||||
| -rw-r--r-- | arch/x86/kernel/reboot.c | 50 | ||||
| -rw-r--r-- | arch/x86/kernel/setup.c | 13 | ||||
| -rw-r--r-- | arch/x86/kernel/tsc.c | 29 | ||||
| -rw-r--r-- | arch/x86/kernel/vmi_32.c | 2 | ||||
| -rw-r--r-- | arch/x86/kernel/vmlinux.lds.S | 23 |
18 files changed, 366 insertions, 95 deletions
diff --git a/arch/x86/kernel/apic/io_apic.c b/arch/x86/kernel/apic/io_apic.c index 2284a4812b68..d2ed6c5ddc80 100644 --- a/arch/x86/kernel/apic/io_apic.c +++ b/arch/x86/kernel/apic/io_apic.c | |||
| @@ -3793,6 +3793,9 @@ int arch_enable_uv_irq(char *irq_name, unsigned int irq, int cpu, int mmr_blade, | |||
| 3793 | mmr_pnode = uv_blade_to_pnode(mmr_blade); | 3793 | mmr_pnode = uv_blade_to_pnode(mmr_blade); |
| 3794 | uv_write_global_mmr64(mmr_pnode, mmr_offset, mmr_value); | 3794 | uv_write_global_mmr64(mmr_pnode, mmr_offset, mmr_value); |
| 3795 | 3795 | ||
| 3796 | if (cfg->move_in_progress) | ||
| 3797 | send_cleanup_vector(cfg); | ||
| 3798 | |||
| 3796 | return irq; | 3799 | return irq; |
| 3797 | } | 3800 | } |
| 3798 | 3801 | ||
diff --git a/arch/x86/kernel/apic/x2apic_cluster.c b/arch/x86/kernel/apic/x2apic_cluster.c index 8e4cbb255c38..a5371ec36776 100644 --- a/arch/x86/kernel/apic/x2apic_cluster.c +++ b/arch/x86/kernel/apic/x2apic_cluster.c | |||
| @@ -17,11 +17,13 @@ static int x2apic_acpi_madt_oem_check(char *oem_id, char *oem_table_id) | |||
| 17 | return x2apic_enabled(); | 17 | return x2apic_enabled(); |
| 18 | } | 18 | } |
| 19 | 19 | ||
| 20 | /* Start with all IRQs pointing to boot CPU. IRQ balancing will shift them. */ | 20 | /* |
| 21 | 21 | * need to use more than cpu 0, because we need more vectors when | |
| 22 | * MSI-X are used. | ||
| 23 | */ | ||
| 22 | static const struct cpumask *x2apic_target_cpus(void) | 24 | static const struct cpumask *x2apic_target_cpus(void) |
| 23 | { | 25 | { |
| 24 | return cpumask_of(0); | 26 | return cpu_online_mask; |
| 25 | } | 27 | } |
| 26 | 28 | ||
| 27 | /* | 29 | /* |
| @@ -170,7 +172,7 @@ static unsigned long set_apic_id(unsigned int id) | |||
| 170 | 172 | ||
| 171 | static int x2apic_cluster_phys_pkg_id(int initial_apicid, int index_msb) | 173 | static int x2apic_cluster_phys_pkg_id(int initial_apicid, int index_msb) |
| 172 | { | 174 | { |
| 173 | return current_cpu_data.initial_apicid >> index_msb; | 175 | return initial_apicid >> index_msb; |
| 174 | } | 176 | } |
| 175 | 177 | ||
| 176 | static void x2apic_send_IPI_self(int vector) | 178 | static void x2apic_send_IPI_self(int vector) |
diff --git a/arch/x86/kernel/apic/x2apic_phys.c b/arch/x86/kernel/apic/x2apic_phys.c index a284359627e7..a8989aadc99a 100644 --- a/arch/x86/kernel/apic/x2apic_phys.c +++ b/arch/x86/kernel/apic/x2apic_phys.c | |||
| @@ -27,11 +27,13 @@ static int x2apic_acpi_madt_oem_check(char *oem_id, char *oem_table_id) | |||
| 27 | return 0; | 27 | return 0; |
| 28 | } | 28 | } |
| 29 | 29 | ||
| 30 | /* Start with all IRQs pointing to boot CPU. IRQ balancing will shift them. */ | 30 | /* |
| 31 | 31 | * need to use more than cpu 0, because we need more vectors when | |
| 32 | * MSI-X are used. | ||
| 33 | */ | ||
| 32 | static const struct cpumask *x2apic_target_cpus(void) | 34 | static const struct cpumask *x2apic_target_cpus(void) |
| 33 | { | 35 | { |
| 34 | return cpumask_of(0); | 36 | return cpu_online_mask; |
| 35 | } | 37 | } |
| 36 | 38 | ||
| 37 | static void x2apic_vector_allocation_domain(int cpu, struct cpumask *retmask) | 39 | static void x2apic_vector_allocation_domain(int cpu, struct cpumask *retmask) |
| @@ -162,7 +164,7 @@ static unsigned long set_apic_id(unsigned int id) | |||
| 162 | 164 | ||
| 163 | static int x2apic_phys_pkg_id(int initial_apicid, int index_msb) | 165 | static int x2apic_phys_pkg_id(int initial_apicid, int index_msb) |
| 164 | { | 166 | { |
| 165 | return current_cpu_data.initial_apicid >> index_msb; | 167 | return initial_apicid >> index_msb; |
| 166 | } | 168 | } |
| 167 | 169 | ||
| 168 | static void x2apic_send_IPI_self(int vector) | 170 | static void x2apic_send_IPI_self(int vector) |
diff --git a/arch/x86/kernel/apic/x2apic_uv_x.c b/arch/x86/kernel/apic/x2apic_uv_x.c index 096d19aea2f7..832e908adcb5 100644 --- a/arch/x86/kernel/apic/x2apic_uv_x.c +++ b/arch/x86/kernel/apic/x2apic_uv_x.c | |||
| @@ -261,7 +261,7 @@ struct apic apic_x2apic_uv_x = { | |||
| 261 | .apic_id_registered = uv_apic_id_registered, | 261 | .apic_id_registered = uv_apic_id_registered, |
| 262 | 262 | ||
| 263 | .irq_delivery_mode = dest_Fixed, | 263 | .irq_delivery_mode = dest_Fixed, |
| 264 | .irq_dest_mode = 1, /* logical */ | 264 | .irq_dest_mode = 0, /* physical */ |
| 265 | 265 | ||
| 266 | .target_cpus = uv_target_cpus, | 266 | .target_cpus = uv_target_cpus, |
| 267 | .disable_esr = 0, | 267 | .disable_esr = 0, |
| @@ -362,12 +362,6 @@ static __init void get_lowmem_redirect(unsigned long *base, unsigned long *size) | |||
| 362 | BUG(); | 362 | BUG(); |
| 363 | } | 363 | } |
| 364 | 364 | ||
| 365 | static __init void map_low_mmrs(void) | ||
| 366 | { | ||
| 367 | init_extra_mapping_uc(UV_GLOBAL_MMR32_BASE, UV_GLOBAL_MMR32_SIZE); | ||
| 368 | init_extra_mapping_uc(UV_LOCAL_MMR_BASE, UV_LOCAL_MMR_SIZE); | ||
| 369 | } | ||
| 370 | |||
| 371 | enum map_type {map_wb, map_uc}; | 365 | enum map_type {map_wb, map_uc}; |
| 372 | 366 | ||
| 373 | static __init void map_high(char *id, unsigned long base, int shift, | 367 | static __init void map_high(char *id, unsigned long base, int shift, |
| @@ -395,26 +389,6 @@ static __init void map_gru_high(int max_pnode) | |||
| 395 | map_high("GRU", gru.s.base, shift, max_pnode, map_wb); | 389 | map_high("GRU", gru.s.base, shift, max_pnode, map_wb); |
| 396 | } | 390 | } |
| 397 | 391 | ||
| 398 | static __init void map_config_high(int max_pnode) | ||
| 399 | { | ||
| 400 | union uvh_rh_gam_cfg_overlay_config_mmr_u cfg; | ||
| 401 | int shift = UVH_RH_GAM_CFG_OVERLAY_CONFIG_MMR_BASE_SHFT; | ||
| 402 | |||
| 403 | cfg.v = uv_read_local_mmr(UVH_RH_GAM_CFG_OVERLAY_CONFIG_MMR); | ||
| 404 | if (cfg.s.enable) | ||
| 405 | map_high("CONFIG", cfg.s.base, shift, max_pnode, map_uc); | ||
| 406 | } | ||
| 407 | |||
| 408 | static __init void map_mmr_high(int max_pnode) | ||
| 409 | { | ||
| 410 | union uvh_rh_gam_mmr_overlay_config_mmr_u mmr; | ||
| 411 | int shift = UVH_RH_GAM_MMR_OVERLAY_CONFIG_MMR_BASE_SHFT; | ||
| 412 | |||
| 413 | mmr.v = uv_read_local_mmr(UVH_RH_GAM_MMR_OVERLAY_CONFIG_MMR); | ||
| 414 | if (mmr.s.enable) | ||
| 415 | map_high("MMR", mmr.s.base, shift, max_pnode, map_uc); | ||
| 416 | } | ||
| 417 | |||
| 418 | static __init void map_mmioh_high(int max_pnode) | 392 | static __init void map_mmioh_high(int max_pnode) |
| 419 | { | 393 | { |
| 420 | union uvh_rh_gam_mmioh_overlay_config_mmr_u mmioh; | 394 | union uvh_rh_gam_mmioh_overlay_config_mmr_u mmioh; |
| @@ -566,8 +540,6 @@ void __init uv_system_init(void) | |||
| 566 | unsigned long mmr_base, present, paddr; | 540 | unsigned long mmr_base, present, paddr; |
| 567 | unsigned short pnode_mask; | 541 | unsigned short pnode_mask; |
| 568 | 542 | ||
| 569 | map_low_mmrs(); | ||
| 570 | |||
| 571 | m_n_config.v = uv_read_local_mmr(UVH_SI_ADDR_MAP_CONFIG); | 543 | m_n_config.v = uv_read_local_mmr(UVH_SI_ADDR_MAP_CONFIG); |
| 572 | m_val = m_n_config.s.m_skt; | 544 | m_val = m_n_config.s.m_skt; |
| 573 | n_val = m_n_config.s.n_skt; | 545 | n_val = m_n_config.s.n_skt; |
| @@ -591,6 +563,8 @@ void __init uv_system_init(void) | |||
| 591 | bytes = sizeof(struct uv_blade_info) * uv_num_possible_blades(); | 563 | bytes = sizeof(struct uv_blade_info) * uv_num_possible_blades(); |
| 592 | uv_blade_info = kmalloc(bytes, GFP_KERNEL); | 564 | uv_blade_info = kmalloc(bytes, GFP_KERNEL); |
| 593 | BUG_ON(!uv_blade_info); | 565 | BUG_ON(!uv_blade_info); |
| 566 | for (blade = 0; blade < uv_num_possible_blades(); blade++) | ||
| 567 | uv_blade_info[blade].memory_nid = -1; | ||
| 594 | 568 | ||
| 595 | get_lowmem_redirect(&lowmem_redir_base, &lowmem_redir_size); | 569 | get_lowmem_redirect(&lowmem_redir_base, &lowmem_redir_size); |
| 596 | 570 | ||
| @@ -629,6 +603,9 @@ void __init uv_system_init(void) | |||
| 629 | lcpu = uv_blade_info[blade].nr_possible_cpus; | 603 | lcpu = uv_blade_info[blade].nr_possible_cpus; |
| 630 | uv_blade_info[blade].nr_possible_cpus++; | 604 | uv_blade_info[blade].nr_possible_cpus++; |
| 631 | 605 | ||
| 606 | /* Any node on the blade, else will contain -1. */ | ||
| 607 | uv_blade_info[blade].memory_nid = nid; | ||
| 608 | |||
| 632 | uv_cpu_hub_info(cpu)->lowmem_remap_base = lowmem_redir_base; | 609 | uv_cpu_hub_info(cpu)->lowmem_remap_base = lowmem_redir_base; |
| 633 | uv_cpu_hub_info(cpu)->lowmem_remap_top = lowmem_redir_size; | 610 | uv_cpu_hub_info(cpu)->lowmem_remap_top = lowmem_redir_size; |
| 634 | uv_cpu_hub_info(cpu)->m_val = m_val; | 611 | uv_cpu_hub_info(cpu)->m_val = m_val; |
| @@ -662,11 +639,10 @@ void __init uv_system_init(void) | |||
| 662 | pnode = (paddr >> m_val) & pnode_mask; | 639 | pnode = (paddr >> m_val) & pnode_mask; |
| 663 | blade = boot_pnode_to_blade(pnode); | 640 | blade = boot_pnode_to_blade(pnode); |
| 664 | uv_node_to_blade[nid] = blade; | 641 | uv_node_to_blade[nid] = blade; |
| 642 | max_pnode = max(pnode, max_pnode); | ||
| 665 | } | 643 | } |
| 666 | 644 | ||
| 667 | map_gru_high(max_pnode); | 645 | map_gru_high(max_pnode); |
| 668 | map_mmr_high(max_pnode); | ||
| 669 | map_config_high(max_pnode); | ||
| 670 | map_mmioh_high(max_pnode); | 646 | map_mmioh_high(max_pnode); |
| 671 | 647 | ||
| 672 | uv_cpu_init(); | 648 | uv_cpu_init(); |
diff --git a/arch/x86/kernel/apm_32.c b/arch/x86/kernel/apm_32.c index 79302e9a33a4..442b5508893f 100644 --- a/arch/x86/kernel/apm_32.c +++ b/arch/x86/kernel/apm_32.c | |||
| @@ -811,7 +811,7 @@ static int apm_do_idle(void) | |||
| 811 | u8 ret = 0; | 811 | u8 ret = 0; |
| 812 | int idled = 0; | 812 | int idled = 0; |
| 813 | int polling; | 813 | int polling; |
| 814 | int err; | 814 | int err = 0; |
| 815 | 815 | ||
| 816 | polling = !!(current_thread_info()->status & TS_POLLING); | 816 | polling = !!(current_thread_info()->status & TS_POLLING); |
| 817 | if (polling) { | 817 | if (polling) { |
diff --git a/arch/x86/kernel/cpu/amd.c b/arch/x86/kernel/cpu/amd.c index 28e5f5956042..e2485b03f1cf 100644 --- a/arch/x86/kernel/cpu/amd.c +++ b/arch/x86/kernel/cpu/amd.c | |||
| @@ -356,7 +356,7 @@ static void __cpuinit early_init_amd(struct cpuinfo_x86 *c) | |||
| 356 | #endif | 356 | #endif |
| 357 | #if defined(CONFIG_X86_LOCAL_APIC) && defined(CONFIG_PCI) | 357 | #if defined(CONFIG_X86_LOCAL_APIC) && defined(CONFIG_PCI) |
| 358 | /* check CPU config space for extended APIC ID */ | 358 | /* check CPU config space for extended APIC ID */ |
| 359 | if (c->x86 >= 0xf) { | 359 | if (cpu_has_apic && c->x86 >= 0xf) { |
| 360 | unsigned int val; | 360 | unsigned int val; |
| 361 | val = read_pci_config(0, 24, 0, 0x68); | 361 | val = read_pci_config(0, 24, 0, 0x68); |
| 362 | if ((val & ((1 << 17) | (1 << 18))) == ((1 << 17) | (1 << 18))) | 362 | if ((val & ((1 << 17) | (1 << 18))) == ((1 << 17) | (1 << 18))) |
diff --git a/arch/x86/kernel/cpu/mcheck/mce.c b/arch/x86/kernel/cpu/mcheck/mce.c index 484c1e5f658e..1cfb623ce11c 100644 --- a/arch/x86/kernel/cpu/mcheck/mce.c +++ b/arch/x86/kernel/cpu/mcheck/mce.c | |||
| @@ -1692,17 +1692,15 @@ static ssize_t set_trigger(struct sys_device *s, struct sysdev_attribute *attr, | |||
| 1692 | const char *buf, size_t siz) | 1692 | const char *buf, size_t siz) |
| 1693 | { | 1693 | { |
| 1694 | char *p; | 1694 | char *p; |
| 1695 | int len; | ||
| 1696 | 1695 | ||
| 1697 | strncpy(mce_helper, buf, sizeof(mce_helper)); | 1696 | strncpy(mce_helper, buf, sizeof(mce_helper)); |
| 1698 | mce_helper[sizeof(mce_helper)-1] = 0; | 1697 | mce_helper[sizeof(mce_helper)-1] = 0; |
| 1699 | len = strlen(mce_helper); | ||
| 1700 | p = strchr(mce_helper, '\n'); | 1698 | p = strchr(mce_helper, '\n'); |
| 1701 | 1699 | ||
| 1702 | if (*p) | 1700 | if (p) |
| 1703 | *p = 0; | 1701 | *p = 0; |
| 1704 | 1702 | ||
| 1705 | return len; | 1703 | return strlen(mce_helper) + !!p; |
| 1706 | } | 1704 | } |
| 1707 | 1705 | ||
| 1708 | static ssize_t set_ignore_ce(struct sys_device *s, | 1706 | static ssize_t set_ignore_ce(struct sys_device *s, |
diff --git a/arch/x86/kernel/cpu/perf_counter.c b/arch/x86/kernel/cpu/perf_counter.c index 36c3dc7b8991..a7aa8f900954 100644 --- a/arch/x86/kernel/cpu/perf_counter.c +++ b/arch/x86/kernel/cpu/perf_counter.c | |||
| @@ -66,6 +66,52 @@ static DEFINE_PER_CPU(struct cpu_hw_counters, cpu_hw_counters) = { | |||
| 66 | }; | 66 | }; |
| 67 | 67 | ||
| 68 | /* | 68 | /* |
| 69 | * Not sure about some of these | ||
| 70 | */ | ||
| 71 | static const u64 p6_perfmon_event_map[] = | ||
| 72 | { | ||
| 73 | [PERF_COUNT_HW_CPU_CYCLES] = 0x0079, | ||
| 74 | [PERF_COUNT_HW_INSTRUCTIONS] = 0x00c0, | ||
| 75 | [PERF_COUNT_HW_CACHE_REFERENCES] = 0x0000, | ||
| 76 | [PERF_COUNT_HW_CACHE_MISSES] = 0x0000, | ||
| 77 | [PERF_COUNT_HW_BRANCH_INSTRUCTIONS] = 0x00c4, | ||
| 78 | [PERF_COUNT_HW_BRANCH_MISSES] = 0x00c5, | ||
| 79 | [PERF_COUNT_HW_BUS_CYCLES] = 0x0062, | ||
| 80 | }; | ||
| 81 | |||
| 82 | static u64 p6_pmu_event_map(int event) | ||
| 83 | { | ||
| 84 | return p6_perfmon_event_map[event]; | ||
| 85 | } | ||
| 86 | |||
| 87 | /* | ||
| 88 | * Counter setting that is specified not to count anything. | ||
| 89 | * We use this to effectively disable a counter. | ||
| 90 | * | ||
| 91 | * L2_RQSTS with 0 MESI unit mask. | ||
| 92 | */ | ||
| 93 | #define P6_NOP_COUNTER 0x0000002EULL | ||
| 94 | |||
| 95 | static u64 p6_pmu_raw_event(u64 event) | ||
| 96 | { | ||
| 97 | #define P6_EVNTSEL_EVENT_MASK 0x000000FFULL | ||
| 98 | #define P6_EVNTSEL_UNIT_MASK 0x0000FF00ULL | ||
| 99 | #define P6_EVNTSEL_EDGE_MASK 0x00040000ULL | ||
| 100 | #define P6_EVNTSEL_INV_MASK 0x00800000ULL | ||
| 101 | #define P6_EVNTSEL_COUNTER_MASK 0xFF000000ULL | ||
| 102 | |||
| 103 | #define P6_EVNTSEL_MASK \ | ||
| 104 | (P6_EVNTSEL_EVENT_MASK | \ | ||
| 105 | P6_EVNTSEL_UNIT_MASK | \ | ||
| 106 | P6_EVNTSEL_EDGE_MASK | \ | ||
| 107 | P6_EVNTSEL_INV_MASK | \ | ||
| 108 | P6_EVNTSEL_COUNTER_MASK) | ||
| 109 | |||
| 110 | return event & P6_EVNTSEL_MASK; | ||
| 111 | } | ||
| 112 | |||
| 113 | |||
| 114 | /* | ||
| 69 | * Intel PerfMon v3. Used on Core2 and later. | 115 | * Intel PerfMon v3. Used on Core2 and later. |
| 70 | */ | 116 | */ |
| 71 | static const u64 intel_perfmon_event_map[] = | 117 | static const u64 intel_perfmon_event_map[] = |
| @@ -666,6 +712,7 @@ static int __hw_perf_counter_init(struct perf_counter *counter) | |||
| 666 | { | 712 | { |
| 667 | struct perf_counter_attr *attr = &counter->attr; | 713 | struct perf_counter_attr *attr = &counter->attr; |
| 668 | struct hw_perf_counter *hwc = &counter->hw; | 714 | struct hw_perf_counter *hwc = &counter->hw; |
| 715 | u64 config; | ||
| 669 | int err; | 716 | int err; |
| 670 | 717 | ||
| 671 | if (!x86_pmu_initialized()) | 718 | if (!x86_pmu_initialized()) |
| @@ -718,14 +765,40 @@ static int __hw_perf_counter_init(struct perf_counter *counter) | |||
| 718 | 765 | ||
| 719 | if (attr->config >= x86_pmu.max_events) | 766 | if (attr->config >= x86_pmu.max_events) |
| 720 | return -EINVAL; | 767 | return -EINVAL; |
| 768 | |||
| 721 | /* | 769 | /* |
| 722 | * The generic map: | 770 | * The generic map: |
| 723 | */ | 771 | */ |
| 724 | hwc->config |= x86_pmu.event_map(attr->config); | 772 | config = x86_pmu.event_map(attr->config); |
| 773 | |||
| 774 | if (config == 0) | ||
| 775 | return -ENOENT; | ||
| 776 | |||
| 777 | if (config == -1LL) | ||
| 778 | return -EINVAL; | ||
| 779 | |||
| 780 | hwc->config |= config; | ||
| 725 | 781 | ||
| 726 | return 0; | 782 | return 0; |
| 727 | } | 783 | } |
| 728 | 784 | ||
| 785 | static void p6_pmu_disable_all(void) | ||
| 786 | { | ||
| 787 | struct cpu_hw_counters *cpuc = &__get_cpu_var(cpu_hw_counters); | ||
| 788 | u64 val; | ||
| 789 | |||
| 790 | if (!cpuc->enabled) | ||
| 791 | return; | ||
| 792 | |||
| 793 | cpuc->enabled = 0; | ||
| 794 | barrier(); | ||
| 795 | |||
| 796 | /* p6 only has one enable register */ | ||
| 797 | rdmsrl(MSR_P6_EVNTSEL0, val); | ||
| 798 | val &= ~ARCH_PERFMON_EVENTSEL0_ENABLE; | ||
| 799 | wrmsrl(MSR_P6_EVNTSEL0, val); | ||
| 800 | } | ||
| 801 | |||
| 729 | static void intel_pmu_disable_all(void) | 802 | static void intel_pmu_disable_all(void) |
| 730 | { | 803 | { |
| 731 | wrmsrl(MSR_CORE_PERF_GLOBAL_CTRL, 0); | 804 | wrmsrl(MSR_CORE_PERF_GLOBAL_CTRL, 0); |
| @@ -767,6 +840,23 @@ void hw_perf_disable(void) | |||
| 767 | return x86_pmu.disable_all(); | 840 | return x86_pmu.disable_all(); |
| 768 | } | 841 | } |
| 769 | 842 | ||
| 843 | static void p6_pmu_enable_all(void) | ||
| 844 | { | ||
| 845 | struct cpu_hw_counters *cpuc = &__get_cpu_var(cpu_hw_counters); | ||
| 846 | unsigned long val; | ||
| 847 | |||
| 848 | if (cpuc->enabled) | ||
| 849 | return; | ||
| 850 | |||
| 851 | cpuc->enabled = 1; | ||
| 852 | barrier(); | ||
| 853 | |||
| 854 | /* p6 only has one enable register */ | ||
| 855 | rdmsrl(MSR_P6_EVNTSEL0, val); | ||
| 856 | val |= ARCH_PERFMON_EVENTSEL0_ENABLE; | ||
| 857 | wrmsrl(MSR_P6_EVNTSEL0, val); | ||
| 858 | } | ||
| 859 | |||
| 770 | static void intel_pmu_enable_all(void) | 860 | static void intel_pmu_enable_all(void) |
| 771 | { | 861 | { |
| 772 | wrmsrl(MSR_CORE_PERF_GLOBAL_CTRL, x86_pmu.intel_ctrl); | 862 | wrmsrl(MSR_CORE_PERF_GLOBAL_CTRL, x86_pmu.intel_ctrl); |
| @@ -784,13 +874,13 @@ static void amd_pmu_enable_all(void) | |||
| 784 | barrier(); | 874 | barrier(); |
| 785 | 875 | ||
| 786 | for (idx = 0; idx < x86_pmu.num_counters; idx++) { | 876 | for (idx = 0; idx < x86_pmu.num_counters; idx++) { |
| 877 | struct perf_counter *counter = cpuc->counters[idx]; | ||
| 787 | u64 val; | 878 | u64 val; |
| 788 | 879 | ||
| 789 | if (!test_bit(idx, cpuc->active_mask)) | 880 | if (!test_bit(idx, cpuc->active_mask)) |
| 790 | continue; | 881 | continue; |
| 791 | rdmsrl(MSR_K7_EVNTSEL0 + idx, val); | 882 | |
| 792 | if (val & ARCH_PERFMON_EVENTSEL0_ENABLE) | 883 | val = counter->hw.config; |
| 793 | continue; | ||
| 794 | val |= ARCH_PERFMON_EVENTSEL0_ENABLE; | 884 | val |= ARCH_PERFMON_EVENTSEL0_ENABLE; |
| 795 | wrmsrl(MSR_K7_EVNTSEL0 + idx, val); | 885 | wrmsrl(MSR_K7_EVNTSEL0 + idx, val); |
| 796 | } | 886 | } |
| @@ -819,16 +909,13 @@ static inline void intel_pmu_ack_status(u64 ack) | |||
| 819 | 909 | ||
| 820 | static inline void x86_pmu_enable_counter(struct hw_perf_counter *hwc, int idx) | 910 | static inline void x86_pmu_enable_counter(struct hw_perf_counter *hwc, int idx) |
| 821 | { | 911 | { |
| 822 | int err; | 912 | (void)checking_wrmsrl(hwc->config_base + idx, |
| 823 | err = checking_wrmsrl(hwc->config_base + idx, | ||
| 824 | hwc->config | ARCH_PERFMON_EVENTSEL0_ENABLE); | 913 | hwc->config | ARCH_PERFMON_EVENTSEL0_ENABLE); |
| 825 | } | 914 | } |
| 826 | 915 | ||
| 827 | static inline void x86_pmu_disable_counter(struct hw_perf_counter *hwc, int idx) | 916 | static inline void x86_pmu_disable_counter(struct hw_perf_counter *hwc, int idx) |
| 828 | { | 917 | { |
| 829 | int err; | 918 | (void)checking_wrmsrl(hwc->config_base + idx, hwc->config); |
| 830 | err = checking_wrmsrl(hwc->config_base + idx, | ||
| 831 | hwc->config); | ||
| 832 | } | 919 | } |
| 833 | 920 | ||
| 834 | static inline void | 921 | static inline void |
| @@ -836,13 +923,24 @@ intel_pmu_disable_fixed(struct hw_perf_counter *hwc, int __idx) | |||
| 836 | { | 923 | { |
| 837 | int idx = __idx - X86_PMC_IDX_FIXED; | 924 | int idx = __idx - X86_PMC_IDX_FIXED; |
| 838 | u64 ctrl_val, mask; | 925 | u64 ctrl_val, mask; |
| 839 | int err; | ||
| 840 | 926 | ||
| 841 | mask = 0xfULL << (idx * 4); | 927 | mask = 0xfULL << (idx * 4); |
| 842 | 928 | ||
| 843 | rdmsrl(hwc->config_base, ctrl_val); | 929 | rdmsrl(hwc->config_base, ctrl_val); |
| 844 | ctrl_val &= ~mask; | 930 | ctrl_val &= ~mask; |
| 845 | err = checking_wrmsrl(hwc->config_base, ctrl_val); | 931 | (void)checking_wrmsrl(hwc->config_base, ctrl_val); |
| 932 | } | ||
| 933 | |||
| 934 | static inline void | ||
| 935 | p6_pmu_disable_counter(struct hw_perf_counter *hwc, int idx) | ||
| 936 | { | ||
| 937 | struct cpu_hw_counters *cpuc = &__get_cpu_var(cpu_hw_counters); | ||
| 938 | u64 val = P6_NOP_COUNTER; | ||
| 939 | |||
| 940 | if (cpuc->enabled) | ||
| 941 | val |= ARCH_PERFMON_EVENTSEL0_ENABLE; | ||
| 942 | |||
| 943 | (void)checking_wrmsrl(hwc->config_base + idx, val); | ||
| 846 | } | 944 | } |
| 847 | 945 | ||
| 848 | static inline void | 946 | static inline void |
| @@ -943,6 +1041,19 @@ intel_pmu_enable_fixed(struct hw_perf_counter *hwc, int __idx) | |||
| 943 | err = checking_wrmsrl(hwc->config_base, ctrl_val); | 1041 | err = checking_wrmsrl(hwc->config_base, ctrl_val); |
| 944 | } | 1042 | } |
| 945 | 1043 | ||
| 1044 | static void p6_pmu_enable_counter(struct hw_perf_counter *hwc, int idx) | ||
| 1045 | { | ||
| 1046 | struct cpu_hw_counters *cpuc = &__get_cpu_var(cpu_hw_counters); | ||
| 1047 | u64 val; | ||
| 1048 | |||
| 1049 | val = hwc->config; | ||
| 1050 | if (cpuc->enabled) | ||
| 1051 | val |= ARCH_PERFMON_EVENTSEL0_ENABLE; | ||
| 1052 | |||
| 1053 | (void)checking_wrmsrl(hwc->config_base + idx, val); | ||
| 1054 | } | ||
| 1055 | |||
| 1056 | |||
| 946 | static void intel_pmu_enable_counter(struct hw_perf_counter *hwc, int idx) | 1057 | static void intel_pmu_enable_counter(struct hw_perf_counter *hwc, int idx) |
| 947 | { | 1058 | { |
| 948 | if (unlikely(hwc->config_base == MSR_ARCH_PERFMON_FIXED_CTR_CTRL)) { | 1059 | if (unlikely(hwc->config_base == MSR_ARCH_PERFMON_FIXED_CTR_CTRL)) { |
| @@ -959,8 +1070,6 @@ static void amd_pmu_enable_counter(struct hw_perf_counter *hwc, int idx) | |||
| 959 | 1070 | ||
| 960 | if (cpuc->enabled) | 1071 | if (cpuc->enabled) |
| 961 | x86_pmu_enable_counter(hwc, idx); | 1072 | x86_pmu_enable_counter(hwc, idx); |
| 962 | else | ||
| 963 | x86_pmu_disable_counter(hwc, idx); | ||
| 964 | } | 1073 | } |
| 965 | 1074 | ||
| 966 | static int | 1075 | static int |
| @@ -1176,6 +1285,49 @@ static void intel_pmu_reset(void) | |||
| 1176 | local_irq_restore(flags); | 1285 | local_irq_restore(flags); |
| 1177 | } | 1286 | } |
| 1178 | 1287 | ||
| 1288 | static int p6_pmu_handle_irq(struct pt_regs *regs) | ||
| 1289 | { | ||
| 1290 | struct perf_sample_data data; | ||
| 1291 | struct cpu_hw_counters *cpuc; | ||
| 1292 | struct perf_counter *counter; | ||
| 1293 | struct hw_perf_counter *hwc; | ||
| 1294 | int idx, handled = 0; | ||
| 1295 | u64 val; | ||
| 1296 | |||
| 1297 | data.regs = regs; | ||
| 1298 | data.addr = 0; | ||
| 1299 | |||
| 1300 | cpuc = &__get_cpu_var(cpu_hw_counters); | ||
| 1301 | |||
| 1302 | for (idx = 0; idx < x86_pmu.num_counters; idx++) { | ||
| 1303 | if (!test_bit(idx, cpuc->active_mask)) | ||
| 1304 | continue; | ||
| 1305 | |||
| 1306 | counter = cpuc->counters[idx]; | ||
| 1307 | hwc = &counter->hw; | ||
| 1308 | |||
| 1309 | val = x86_perf_counter_update(counter, hwc, idx); | ||
| 1310 | if (val & (1ULL << (x86_pmu.counter_bits - 1))) | ||
| 1311 | continue; | ||
| 1312 | |||
| 1313 | /* | ||
| 1314 | * counter overflow | ||
| 1315 | */ | ||
| 1316 | handled = 1; | ||
| 1317 | data.period = counter->hw.last_period; | ||
| 1318 | |||
| 1319 | if (!x86_perf_counter_set_period(counter, hwc, idx)) | ||
| 1320 | continue; | ||
| 1321 | |||
| 1322 | if (perf_counter_overflow(counter, 1, &data)) | ||
| 1323 | p6_pmu_disable_counter(hwc, idx); | ||
| 1324 | } | ||
| 1325 | |||
| 1326 | if (handled) | ||
| 1327 | inc_irq_stat(apic_perf_irqs); | ||
| 1328 | |||
| 1329 | return handled; | ||
| 1330 | } | ||
| 1179 | 1331 | ||
| 1180 | /* | 1332 | /* |
| 1181 | * This handler is triggered by the local APIC, so the APIC IRQ handling | 1333 | * This handler is triggered by the local APIC, so the APIC IRQ handling |
| @@ -1185,14 +1337,13 @@ static int intel_pmu_handle_irq(struct pt_regs *regs) | |||
| 1185 | { | 1337 | { |
| 1186 | struct perf_sample_data data; | 1338 | struct perf_sample_data data; |
| 1187 | struct cpu_hw_counters *cpuc; | 1339 | struct cpu_hw_counters *cpuc; |
| 1188 | int bit, cpu, loops; | 1340 | int bit, loops; |
| 1189 | u64 ack, status; | 1341 | u64 ack, status; |
| 1190 | 1342 | ||
| 1191 | data.regs = regs; | 1343 | data.regs = regs; |
| 1192 | data.addr = 0; | 1344 | data.addr = 0; |
| 1193 | 1345 | ||
| 1194 | cpu = smp_processor_id(); | 1346 | cpuc = &__get_cpu_var(cpu_hw_counters); |
| 1195 | cpuc = &per_cpu(cpu_hw_counters, cpu); | ||
| 1196 | 1347 | ||
| 1197 | perf_disable(); | 1348 | perf_disable(); |
| 1198 | status = intel_pmu_get_status(); | 1349 | status = intel_pmu_get_status(); |
| @@ -1249,14 +1400,13 @@ static int amd_pmu_handle_irq(struct pt_regs *regs) | |||
| 1249 | struct cpu_hw_counters *cpuc; | 1400 | struct cpu_hw_counters *cpuc; |
| 1250 | struct perf_counter *counter; | 1401 | struct perf_counter *counter; |
| 1251 | struct hw_perf_counter *hwc; | 1402 | struct hw_perf_counter *hwc; |
| 1252 | int cpu, idx, handled = 0; | 1403 | int idx, handled = 0; |
| 1253 | u64 val; | 1404 | u64 val; |
| 1254 | 1405 | ||
| 1255 | data.regs = regs; | 1406 | data.regs = regs; |
| 1256 | data.addr = 0; | 1407 | data.addr = 0; |
| 1257 | 1408 | ||
| 1258 | cpu = smp_processor_id(); | 1409 | cpuc = &__get_cpu_var(cpu_hw_counters); |
| 1259 | cpuc = &per_cpu(cpu_hw_counters, cpu); | ||
| 1260 | 1410 | ||
| 1261 | for (idx = 0; idx < x86_pmu.num_counters; idx++) { | 1411 | for (idx = 0; idx < x86_pmu.num_counters; idx++) { |
| 1262 | if (!test_bit(idx, cpuc->active_mask)) | 1412 | if (!test_bit(idx, cpuc->active_mask)) |
| @@ -1353,6 +1503,32 @@ static __read_mostly struct notifier_block perf_counter_nmi_notifier = { | |||
| 1353 | .priority = 1 | 1503 | .priority = 1 |
| 1354 | }; | 1504 | }; |
| 1355 | 1505 | ||
| 1506 | static struct x86_pmu p6_pmu = { | ||
| 1507 | .name = "p6", | ||
| 1508 | .handle_irq = p6_pmu_handle_irq, | ||
| 1509 | .disable_all = p6_pmu_disable_all, | ||
| 1510 | .enable_all = p6_pmu_enable_all, | ||
| 1511 | .enable = p6_pmu_enable_counter, | ||
| 1512 | .disable = p6_pmu_disable_counter, | ||
| 1513 | .eventsel = MSR_P6_EVNTSEL0, | ||
| 1514 | .perfctr = MSR_P6_PERFCTR0, | ||
| 1515 | .event_map = p6_pmu_event_map, | ||
| 1516 | .raw_event = p6_pmu_raw_event, | ||
| 1517 | .max_events = ARRAY_SIZE(p6_perfmon_event_map), | ||
| 1518 | .max_period = (1ULL << 31) - 1, | ||
| 1519 | .version = 0, | ||
| 1520 | .num_counters = 2, | ||
| 1521 | /* | ||
| 1522 | * Counters have 40 bits implemented. However they are designed such | ||
| 1523 | * that bits [32-39] are sign extensions of bit 31. As such the | ||
| 1524 | * effective width of a counter for P6-like PMU is 32 bits only. | ||
| 1525 | * | ||
| 1526 | * See IA-32 Intel Architecture Software developer manual Vol 3B | ||
| 1527 | */ | ||
| 1528 | .counter_bits = 32, | ||
| 1529 | .counter_mask = (1ULL << 32) - 1, | ||
| 1530 | }; | ||
| 1531 | |||
| 1356 | static struct x86_pmu intel_pmu = { | 1532 | static struct x86_pmu intel_pmu = { |
| 1357 | .name = "Intel", | 1533 | .name = "Intel", |
| 1358 | .handle_irq = intel_pmu_handle_irq, | 1534 | .handle_irq = intel_pmu_handle_irq, |
| @@ -1392,6 +1568,37 @@ static struct x86_pmu amd_pmu = { | |||
| 1392 | .max_period = (1ULL << 47) - 1, | 1568 | .max_period = (1ULL << 47) - 1, |
| 1393 | }; | 1569 | }; |
| 1394 | 1570 | ||
| 1571 | static int p6_pmu_init(void) | ||
| 1572 | { | ||
| 1573 | switch (boot_cpu_data.x86_model) { | ||
| 1574 | case 1: | ||
| 1575 | case 3: /* Pentium Pro */ | ||
| 1576 | case 5: | ||
| 1577 | case 6: /* Pentium II */ | ||
| 1578 | case 7: | ||
| 1579 | case 8: | ||
| 1580 | case 11: /* Pentium III */ | ||
| 1581 | break; | ||
| 1582 | case 9: | ||
| 1583 | case 13: | ||
| 1584 | /* Pentium M */ | ||
| 1585 | break; | ||
| 1586 | default: | ||
| 1587 | pr_cont("unsupported p6 CPU model %d ", | ||
| 1588 | boot_cpu_data.x86_model); | ||
| 1589 | return -ENODEV; | ||
| 1590 | } | ||
| 1591 | |||
| 1592 | if (!cpu_has_apic) { | ||
| 1593 | pr_info("no Local APIC, try rebooting with lapic"); | ||
| 1594 | return -ENODEV; | ||
| 1595 | } | ||
| 1596 | |||
| 1597 | x86_pmu = p6_pmu; | ||
| 1598 | |||
| 1599 | return 0; | ||
| 1600 | } | ||
| 1601 | |||
| 1395 | static int intel_pmu_init(void) | 1602 | static int intel_pmu_init(void) |
| 1396 | { | 1603 | { |
| 1397 | union cpuid10_edx edx; | 1604 | union cpuid10_edx edx; |
| @@ -1400,8 +1607,14 @@ static int intel_pmu_init(void) | |||
| 1400 | unsigned int ebx; | 1607 | unsigned int ebx; |
| 1401 | int version; | 1608 | int version; |
| 1402 | 1609 | ||
| 1403 | if (!cpu_has(&boot_cpu_data, X86_FEATURE_ARCH_PERFMON)) | 1610 | if (!cpu_has(&boot_cpu_data, X86_FEATURE_ARCH_PERFMON)) { |
| 1611 | /* check for P6 processor family */ | ||
| 1612 | if (boot_cpu_data.x86 == 6) { | ||
| 1613 | return p6_pmu_init(); | ||
| 1614 | } else { | ||
| 1404 | return -ENODEV; | 1615 | return -ENODEV; |
| 1616 | } | ||
| 1617 | } | ||
| 1405 | 1618 | ||
| 1406 | /* | 1619 | /* |
| 1407 | * Check whether the Architectural PerfMon supports | 1620 | * Check whether the Architectural PerfMon supports |
diff --git a/arch/x86/kernel/efi.c b/arch/x86/kernel/efi.c index 96f7ac0bbf01..fe26ba3e3451 100644 --- a/arch/x86/kernel/efi.c +++ b/arch/x86/kernel/efi.c | |||
| @@ -354,7 +354,7 @@ void __init efi_init(void) | |||
| 354 | */ | 354 | */ |
| 355 | c16 = tmp = early_ioremap(efi.systab->fw_vendor, 2); | 355 | c16 = tmp = early_ioremap(efi.systab->fw_vendor, 2); |
| 356 | if (c16) { | 356 | if (c16) { |
| 357 | for (i = 0; i < sizeof(vendor) && *c16; ++i) | 357 | for (i = 0; i < sizeof(vendor) - 1 && *c16; ++i) |
| 358 | vendor[i] = *c16++; | 358 | vendor[i] = *c16++; |
| 359 | vendor[i] = '\0'; | 359 | vendor[i] = '\0'; |
| 360 | } else | 360 | } else |
| @@ -512,7 +512,7 @@ void __init efi_enter_virtual_mode(void) | |||
| 512 | && end_pfn <= max_pfn_mapped)) | 512 | && end_pfn <= max_pfn_mapped)) |
| 513 | va = __va(md->phys_addr); | 513 | va = __va(md->phys_addr); |
| 514 | else | 514 | else |
| 515 | va = efi_ioremap(md->phys_addr, size); | 515 | va = efi_ioremap(md->phys_addr, size, md->type); |
| 516 | 516 | ||
| 517 | md->virt_addr = (u64) (unsigned long) va; | 517 | md->virt_addr = (u64) (unsigned long) va; |
| 518 | 518 | ||
diff --git a/arch/x86/kernel/efi_64.c b/arch/x86/kernel/efi_64.c index 22c3b7828c50..ac0621a7ac3d 100644 --- a/arch/x86/kernel/efi_64.c +++ b/arch/x86/kernel/efi_64.c | |||
| @@ -98,10 +98,14 @@ void __init efi_call_phys_epilog(void) | |||
| 98 | early_runtime_code_mapping_set_exec(0); | 98 | early_runtime_code_mapping_set_exec(0); |
| 99 | } | 99 | } |
| 100 | 100 | ||
| 101 | void __iomem *__init efi_ioremap(unsigned long phys_addr, unsigned long size) | 101 | void __iomem *__init efi_ioremap(unsigned long phys_addr, unsigned long size, |
| 102 | u32 type) | ||
| 102 | { | 103 | { |
| 103 | unsigned long last_map_pfn; | 104 | unsigned long last_map_pfn; |
| 104 | 105 | ||
| 106 | if (type == EFI_MEMORY_MAPPED_IO) | ||
| 107 | return ioremap(phys_addr, size); | ||
| 108 | |||
| 105 | last_map_pfn = init_memory_mapping(phys_addr, phys_addr + size); | 109 | last_map_pfn = init_memory_mapping(phys_addr, phys_addr + size); |
| 106 | if ((last_map_pfn << PAGE_SHIFT) < phys_addr + size) | 110 | if ((last_map_pfn << PAGE_SHIFT) < phys_addr + size) |
| 107 | return NULL; | 111 | return NULL; |
diff --git a/arch/x86/kernel/head_32.S b/arch/x86/kernel/head_32.S index 8663afb56535..0d98a01cbdb2 100644 --- a/arch/x86/kernel/head_32.S +++ b/arch/x86/kernel/head_32.S | |||
| @@ -602,7 +602,11 @@ ignore_int: | |||
| 602 | #endif | 602 | #endif |
| 603 | iret | 603 | iret |
| 604 | 604 | ||
| 605 | .section .cpuinit.data,"wa" | 605 | #ifndef CONFIG_HOTPLUG_CPU |
| 606 | __CPUINITDATA | ||
| 607 | #else | ||
| 608 | __REFDATA | ||
| 609 | #endif | ||
| 606 | .align 4 | 610 | .align 4 |
| 607 | ENTRY(initial_code) | 611 | ENTRY(initial_code) |
| 608 | .long i386_start_kernel | 612 | .long i386_start_kernel |
diff --git a/arch/x86/kernel/irqinit.c b/arch/x86/kernel/irqinit.c index 696f0e475c2d..92b7703d3d58 100644 --- a/arch/x86/kernel/irqinit.c +++ b/arch/x86/kernel/irqinit.c | |||
| @@ -187,7 +187,7 @@ static void __init apic_intr_init(void) | |||
| 187 | #ifdef CONFIG_X86_THERMAL_VECTOR | 187 | #ifdef CONFIG_X86_THERMAL_VECTOR |
| 188 | alloc_intr_gate(THERMAL_APIC_VECTOR, thermal_interrupt); | 188 | alloc_intr_gate(THERMAL_APIC_VECTOR, thermal_interrupt); |
| 189 | #endif | 189 | #endif |
| 190 | #ifdef CONFIG_X86_THRESHOLD | 190 | #ifdef CONFIG_X86_MCE_THRESHOLD |
| 191 | alloc_intr_gate(THRESHOLD_APIC_VECTOR, threshold_interrupt); | 191 | alloc_intr_gate(THRESHOLD_APIC_VECTOR, threshold_interrupt); |
| 192 | #endif | 192 | #endif |
| 193 | #if defined(CONFIG_X86_NEW_MCE) && defined(CONFIG_X86_LOCAL_APIC) | 193 | #if defined(CONFIG_X86_NEW_MCE) && defined(CONFIG_X86_LOCAL_APIC) |
diff --git a/arch/x86/kernel/mfgpt_32.c b/arch/x86/kernel/mfgpt_32.c index 846510b78a09..2a62d843f015 100644 --- a/arch/x86/kernel/mfgpt_32.c +++ b/arch/x86/kernel/mfgpt_32.c | |||
| @@ -347,7 +347,7 @@ static irqreturn_t mfgpt_tick(int irq, void *dev_id) | |||
| 347 | 347 | ||
| 348 | static struct irqaction mfgptirq = { | 348 | static struct irqaction mfgptirq = { |
| 349 | .handler = mfgpt_tick, | 349 | .handler = mfgpt_tick, |
| 350 | .flags = IRQF_DISABLED | IRQF_NOBALANCING, | 350 | .flags = IRQF_DISABLED | IRQF_NOBALANCING | IRQF_TIMER, |
| 351 | .name = "mfgpt-timer" | 351 | .name = "mfgpt-timer" |
| 352 | }; | 352 | }; |
| 353 | 353 | ||
diff --git a/arch/x86/kernel/reboot.c b/arch/x86/kernel/reboot.c index d2d1ce8170f0..9eb897603705 100644 --- a/arch/x86/kernel/reboot.c +++ b/arch/x86/kernel/reboot.c | |||
| @@ -3,6 +3,7 @@ | |||
| 3 | #include <linux/init.h> | 3 | #include <linux/init.h> |
| 4 | #include <linux/pm.h> | 4 | #include <linux/pm.h> |
| 5 | #include <linux/efi.h> | 5 | #include <linux/efi.h> |
| 6 | #include <linux/dmi.h> | ||
| 6 | #include <acpi/reboot.h> | 7 | #include <acpi/reboot.h> |
| 7 | #include <asm/io.h> | 8 | #include <asm/io.h> |
| 8 | #include <asm/apic.h> | 9 | #include <asm/apic.h> |
| @@ -17,7 +18,6 @@ | |||
| 17 | #include <asm/cpu.h> | 18 | #include <asm/cpu.h> |
| 18 | 19 | ||
| 19 | #ifdef CONFIG_X86_32 | 20 | #ifdef CONFIG_X86_32 |
| 20 | # include <linux/dmi.h> | ||
| 21 | # include <linux/ctype.h> | 21 | # include <linux/ctype.h> |
| 22 | # include <linux/mc146818rtc.h> | 22 | # include <linux/mc146818rtc.h> |
| 23 | #else | 23 | #else |
| @@ -249,6 +249,14 @@ static struct dmi_system_id __initdata reboot_dmi_table[] = { | |||
| 249 | DMI_MATCH(DMI_PRODUCT_NAME, "VGN-Z540N"), | 249 | DMI_MATCH(DMI_PRODUCT_NAME, "VGN-Z540N"), |
| 250 | }, | 250 | }, |
| 251 | }, | 251 | }, |
| 252 | { /* Handle problems with rebooting on CompuLab SBC-FITPC2 */ | ||
| 253 | .callback = set_bios_reboot, | ||
| 254 | .ident = "CompuLab SBC-FITPC2", | ||
| 255 | .matches = { | ||
| 256 | DMI_MATCH(DMI_SYS_VENDOR, "CompuLab"), | ||
| 257 | DMI_MATCH(DMI_PRODUCT_NAME, "SBC-FITPC2"), | ||
| 258 | }, | ||
| 259 | }, | ||
| 252 | { } | 260 | { } |
| 253 | }; | 261 | }; |
| 254 | 262 | ||
| @@ -396,6 +404,46 @@ EXPORT_SYMBOL(machine_real_restart); | |||
| 396 | 404 | ||
| 397 | #endif /* CONFIG_X86_32 */ | 405 | #endif /* CONFIG_X86_32 */ |
| 398 | 406 | ||
| 407 | /* | ||
| 408 | * Some Apple MacBook and MacBookPro's needs reboot=p to be able to reboot | ||
| 409 | */ | ||
| 410 | static int __init set_pci_reboot(const struct dmi_system_id *d) | ||
| 411 | { | ||
| 412 | if (reboot_type != BOOT_CF9) { | ||
| 413 | reboot_type = BOOT_CF9; | ||
| 414 | printk(KERN_INFO "%s series board detected. " | ||
| 415 | "Selecting PCI-method for reboots.\n", d->ident); | ||
| 416 | } | ||
| 417 | return 0; | ||
| 418 | } | ||
| 419 | |||
| 420 | static struct dmi_system_id __initdata pci_reboot_dmi_table[] = { | ||
| 421 | { /* Handle problems with rebooting on Apple MacBook5,2 */ | ||
| 422 | .callback = set_pci_reboot, | ||
| 423 | .ident = "Apple MacBook", | ||
| 424 | .matches = { | ||
| 425 | DMI_MATCH(DMI_SYS_VENDOR, "Apple Inc."), | ||
| 426 | DMI_MATCH(DMI_PRODUCT_NAME, "MacBook5,2"), | ||
| 427 | }, | ||
| 428 | }, | ||
| 429 | { /* Handle problems with rebooting on Apple MacBookPro5,1 */ | ||
| 430 | .callback = set_pci_reboot, | ||
| 431 | .ident = "Apple MacBookPro5,1", | ||
| 432 | .matches = { | ||
| 433 | DMI_MATCH(DMI_SYS_VENDOR, "Apple Inc."), | ||
| 434 | DMI_MATCH(DMI_PRODUCT_NAME, "MacBookPro5,1"), | ||
| 435 | }, | ||
| 436 | }, | ||
| 437 | { } | ||
| 438 | }; | ||
| 439 | |||
| 440 | static int __init pci_reboot_init(void) | ||
| 441 | { | ||
| 442 | dmi_check_system(pci_reboot_dmi_table); | ||
| 443 | return 0; | ||
| 444 | } | ||
| 445 | core_initcall(pci_reboot_init); | ||
| 446 | |||
| 399 | static inline void kb_wait(void) | 447 | static inline void kb_wait(void) |
| 400 | { | 448 | { |
| 401 | int i; | 449 | int i; |
diff --git a/arch/x86/kernel/setup.c b/arch/x86/kernel/setup.c index de2cab132844..63f32d220ef2 100644 --- a/arch/x86/kernel/setup.c +++ b/arch/x86/kernel/setup.c | |||
| @@ -672,6 +672,19 @@ static struct dmi_system_id __initdata bad_bios_dmi_table[] = { | |||
| 672 | DMI_MATCH(DMI_BIOS_VENDOR, "Phoenix Technologies"), | 672 | DMI_MATCH(DMI_BIOS_VENDOR, "Phoenix Technologies"), |
| 673 | }, | 673 | }, |
| 674 | }, | 674 | }, |
| 675 | { | ||
| 676 | /* | ||
| 677 | * AMI BIOS with low memory corruption was found on Intel DG45ID board. | ||
| 678 | * It hase different DMI_BIOS_VENDOR = "Intel Corp.", for now we will | ||
| 679 | * match only DMI_BOARD_NAME and see if there is more bad products | ||
| 680 | * with this vendor. | ||
| 681 | */ | ||
| 682 | .callback = dmi_low_memory_corruption, | ||
| 683 | .ident = "AMI BIOS", | ||
| 684 | .matches = { | ||
| 685 | DMI_MATCH(DMI_BOARD_NAME, "DG45ID"), | ||
| 686 | }, | ||
| 687 | }, | ||
| 675 | #endif | 688 | #endif |
| 676 | {} | 689 | {} |
| 677 | }; | 690 | }; |
diff --git a/arch/x86/kernel/tsc.c b/arch/x86/kernel/tsc.c index 6e1a368d21d4..71f4368b357e 100644 --- a/arch/x86/kernel/tsc.c +++ b/arch/x86/kernel/tsc.c | |||
| @@ -275,15 +275,20 @@ static unsigned long pit_calibrate_tsc(u32 latch, unsigned long ms, int loopmin) | |||
| 275 | * use the TSC value at the transitions to calculate a pretty | 275 | * use the TSC value at the transitions to calculate a pretty |
| 276 | * good value for the TSC frequencty. | 276 | * good value for the TSC frequencty. |
| 277 | */ | 277 | */ |
| 278 | static inline int pit_verify_msb(unsigned char val) | ||
| 279 | { | ||
| 280 | /* Ignore LSB */ | ||
| 281 | inb(0x42); | ||
| 282 | return inb(0x42) == val; | ||
| 283 | } | ||
| 284 | |||
| 278 | static inline int pit_expect_msb(unsigned char val, u64 *tscp, unsigned long *deltap) | 285 | static inline int pit_expect_msb(unsigned char val, u64 *tscp, unsigned long *deltap) |
| 279 | { | 286 | { |
| 280 | int count; | 287 | int count; |
| 281 | u64 tsc = 0; | 288 | u64 tsc = 0; |
| 282 | 289 | ||
| 283 | for (count = 0; count < 50000; count++) { | 290 | for (count = 0; count < 50000; count++) { |
| 284 | /* Ignore LSB */ | 291 | if (!pit_verify_msb(val)) |
| 285 | inb(0x42); | ||
| 286 | if (inb(0x42) != val) | ||
| 287 | break; | 292 | break; |
| 288 | tsc = get_cycles(); | 293 | tsc = get_cycles(); |
| 289 | } | 294 | } |
| @@ -336,8 +341,7 @@ static unsigned long quick_pit_calibrate(void) | |||
| 336 | * to do that is to just read back the 16-bit counter | 341 | * to do that is to just read back the 16-bit counter |
| 337 | * once from the PIT. | 342 | * once from the PIT. |
| 338 | */ | 343 | */ |
| 339 | inb(0x42); | 344 | pit_verify_msb(0); |
| 340 | inb(0x42); | ||
| 341 | 345 | ||
| 342 | if (pit_expect_msb(0xff, &tsc, &d1)) { | 346 | if (pit_expect_msb(0xff, &tsc, &d1)) { |
| 343 | for (i = 1; i <= MAX_QUICK_PIT_ITERATIONS; i++) { | 347 | for (i = 1; i <= MAX_QUICK_PIT_ITERATIONS; i++) { |
| @@ -348,8 +352,19 @@ static unsigned long quick_pit_calibrate(void) | |||
| 348 | * Iterate until the error is less than 500 ppm | 352 | * Iterate until the error is less than 500 ppm |
| 349 | */ | 353 | */ |
| 350 | delta -= tsc; | 354 | delta -= tsc; |
| 351 | if (d1+d2 < delta >> 11) | 355 | if (d1+d2 >= delta >> 11) |
| 352 | goto success; | 356 | continue; |
| 357 | |||
| 358 | /* | ||
| 359 | * Check the PIT one more time to verify that | ||
| 360 | * all TSC reads were stable wrt the PIT. | ||
| 361 | * | ||
| 362 | * This also guarantees serialization of the | ||
| 363 | * last cycle read ('d2') in pit_expect_msb. | ||
| 364 | */ | ||
| 365 | if (!pit_verify_msb(0xfe - i)) | ||
| 366 | break; | ||
| 367 | goto success; | ||
| 353 | } | 368 | } |
| 354 | } | 369 | } |
| 355 | printk("Fast TSC calibration failed\n"); | 370 | printk("Fast TSC calibration failed\n"); |
diff --git a/arch/x86/kernel/vmi_32.c b/arch/x86/kernel/vmi_32.c index b263423fbe2a..95a7289e4b0c 100644 --- a/arch/x86/kernel/vmi_32.c +++ b/arch/x86/kernel/vmi_32.c | |||
| @@ -441,7 +441,7 @@ vmi_startup_ipi_hook(int phys_apicid, unsigned long start_eip, | |||
| 441 | ap.ds = __USER_DS; | 441 | ap.ds = __USER_DS; |
| 442 | ap.es = __USER_DS; | 442 | ap.es = __USER_DS; |
| 443 | ap.fs = __KERNEL_PERCPU; | 443 | ap.fs = __KERNEL_PERCPU; |
| 444 | ap.gs = 0; | 444 | ap.gs = __KERNEL_STACK_CANARY; |
| 445 | 445 | ||
| 446 | ap.eflags = 0; | 446 | ap.eflags = 0; |
| 447 | 447 | ||
diff --git a/arch/x86/kernel/vmlinux.lds.S b/arch/x86/kernel/vmlinux.lds.S index 367e87882041..78d185d797de 100644 --- a/arch/x86/kernel/vmlinux.lds.S +++ b/arch/x86/kernel/vmlinux.lds.S | |||
| @@ -112,11 +112,6 @@ SECTIONS | |||
| 112 | _sdata = .; | 112 | _sdata = .; |
| 113 | DATA_DATA | 113 | DATA_DATA |
| 114 | CONSTRUCTORS | 114 | CONSTRUCTORS |
| 115 | |||
| 116 | #ifdef CONFIG_X86_64 | ||
| 117 | /* End of data section */ | ||
| 118 | _edata = .; | ||
| 119 | #endif | ||
| 120 | } :data | 115 | } :data |
| 121 | 116 | ||
| 122 | #ifdef CONFIG_X86_32 | 117 | #ifdef CONFIG_X86_32 |
| @@ -156,10 +151,8 @@ SECTIONS | |||
| 156 | .data.read_mostly : AT(ADDR(.data.read_mostly) - LOAD_OFFSET) { | 151 | .data.read_mostly : AT(ADDR(.data.read_mostly) - LOAD_OFFSET) { |
| 157 | *(.data.read_mostly) | 152 | *(.data.read_mostly) |
| 158 | 153 | ||
| 159 | #ifdef CONFIG_X86_32 | ||
| 160 | /* End of data section */ | 154 | /* End of data section */ |
| 161 | _edata = .; | 155 | _edata = .; |
| 162 | #endif | ||
| 163 | } | 156 | } |
| 164 | 157 | ||
| 165 | #ifdef CONFIG_X86_64 | 158 | #ifdef CONFIG_X86_64 |
| @@ -400,8 +393,8 @@ SECTIONS | |||
| 400 | 393 | ||
| 401 | 394 | ||
| 402 | #ifdef CONFIG_X86_32 | 395 | #ifdef CONFIG_X86_32 |
| 403 | ASSERT((_end - LOAD_OFFSET <= KERNEL_IMAGE_SIZE), | 396 | . = ASSERT((_end - LOAD_OFFSET <= KERNEL_IMAGE_SIZE), |
| 404 | "kernel image bigger than KERNEL_IMAGE_SIZE") | 397 | "kernel image bigger than KERNEL_IMAGE_SIZE"); |
| 405 | #else | 398 | #else |
| 406 | /* | 399 | /* |
| 407 | * Per-cpu symbols which need to be offset from __per_cpu_load | 400 | * Per-cpu symbols which need to be offset from __per_cpu_load |
| @@ -414,12 +407,12 @@ INIT_PER_CPU(irq_stack_union); | |||
| 414 | /* | 407 | /* |
| 415 | * Build-time check on the image size: | 408 | * Build-time check on the image size: |
| 416 | */ | 409 | */ |
| 417 | ASSERT((_end - _text <= KERNEL_IMAGE_SIZE), | 410 | . = ASSERT((_end - _text <= KERNEL_IMAGE_SIZE), |
| 418 | "kernel image bigger than KERNEL_IMAGE_SIZE") | 411 | "kernel image bigger than KERNEL_IMAGE_SIZE"); |
| 419 | 412 | ||
| 420 | #ifdef CONFIG_SMP | 413 | #ifdef CONFIG_SMP |
| 421 | ASSERT((per_cpu__irq_stack_union == 0), | 414 | . = ASSERT((per_cpu__irq_stack_union == 0), |
| 422 | "irq_stack_union is not at start of per-cpu area"); | 415 | "irq_stack_union is not at start of per-cpu area"); |
| 423 | #endif | 416 | #endif |
| 424 | 417 | ||
| 425 | #endif /* CONFIG_X86_32 */ | 418 | #endif /* CONFIG_X86_32 */ |
| @@ -427,7 +420,7 @@ ASSERT((per_cpu__irq_stack_union == 0), | |||
| 427 | #ifdef CONFIG_KEXEC | 420 | #ifdef CONFIG_KEXEC |
| 428 | #include <asm/kexec.h> | 421 | #include <asm/kexec.h> |
| 429 | 422 | ||
| 430 | ASSERT(kexec_control_code_size <= KEXEC_CONTROL_CODE_MAX_SIZE, | 423 | . = ASSERT(kexec_control_code_size <= KEXEC_CONTROL_CODE_MAX_SIZE, |
| 431 | "kexec control code size is too big") | 424 | "kexec control code size is too big"); |
| 432 | #endif | 425 | #endif |
| 433 | 426 | ||
