diff options
author | Ingo Molnar <mingo@elte.hu> | 2009-04-29 08:46:59 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2009-04-29 08:47:05 -0400 |
commit | e7fd5d4b3d240f42c30a9e3d20a4689c4d3a795a (patch) | |
tree | 4ba588631dd8189a818a91c9e3976526071178b6 /arch/x86/kernel/apic | |
parent | 1130b0296184bc21806225fd06d533515a99d2db (diff) | |
parent | 56a50adda49b2020156616c4eb15353e0f9ad7de (diff) |
Merge branch 'linus' into perfcounters/core
Merge reason: This brach was on -rc1, refresh it to almost-rc4 to pick up
the latest upstream fixes.
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'arch/x86/kernel/apic')
-rw-r--r-- | arch/x86/kernel/apic/apic.c | 6 | ||||
-rw-r--r-- | arch/x86/kernel/apic/apic_flat_64.c | 4 | ||||
-rw-r--r-- | arch/x86/kernel/apic/io_apic.c | 7 | ||||
-rw-r--r-- | arch/x86/kernel/apic/nmi.c | 5 | ||||
-rw-r--r-- | arch/x86/kernel/apic/x2apic_uv_x.c | 31 |
5 files changed, 46 insertions, 7 deletions
diff --git a/arch/x86/kernel/apic/apic.c b/arch/x86/kernel/apic/apic.c index fb504f843e58..e9021a908020 100644 --- a/arch/x86/kernel/apic/apic.c +++ b/arch/x86/kernel/apic/apic.c | |||
@@ -432,6 +432,12 @@ static void __cpuinit setup_APIC_timer(void) | |||
432 | { | 432 | { |
433 | struct clock_event_device *levt = &__get_cpu_var(lapic_events); | 433 | struct clock_event_device *levt = &__get_cpu_var(lapic_events); |
434 | 434 | ||
435 | if (cpu_has(¤t_cpu_data, X86_FEATURE_ARAT)) { | ||
436 | lapic_clockevent.features &= ~CLOCK_EVT_FEAT_C3STOP; | ||
437 | /* Make LAPIC timer preferrable over percpu HPET */ | ||
438 | lapic_clockevent.rating = 150; | ||
439 | } | ||
440 | |||
435 | memcpy(levt, &lapic_clockevent, sizeof(*levt)); | 441 | memcpy(levt, &lapic_clockevent, sizeof(*levt)); |
436 | levt->cpumask = cpumask_of(smp_processor_id()); | 442 | levt->cpumask = cpumask_of(smp_processor_id()); |
437 | 443 | ||
diff --git a/arch/x86/kernel/apic/apic_flat_64.c b/arch/x86/kernel/apic/apic_flat_64.c index 0014714ea97b..306e5e88fb6f 100644 --- a/arch/x86/kernel/apic/apic_flat_64.c +++ b/arch/x86/kernel/apic/apic_flat_64.c | |||
@@ -212,7 +212,7 @@ struct apic apic_flat = { | |||
212 | .trampoline_phys_high = DEFAULT_TRAMPOLINE_PHYS_HIGH, | 212 | .trampoline_phys_high = DEFAULT_TRAMPOLINE_PHYS_HIGH, |
213 | .wait_for_init_deassert = NULL, | 213 | .wait_for_init_deassert = NULL, |
214 | .smp_callin_clear_local_apic = NULL, | 214 | .smp_callin_clear_local_apic = NULL, |
215 | .inquire_remote_apic = NULL, | 215 | .inquire_remote_apic = default_inquire_remote_apic, |
216 | 216 | ||
217 | .read = native_apic_mem_read, | 217 | .read = native_apic_mem_read, |
218 | .write = native_apic_mem_write, | 218 | .write = native_apic_mem_write, |
@@ -362,7 +362,7 @@ struct apic apic_physflat = { | |||
362 | .trampoline_phys_high = DEFAULT_TRAMPOLINE_PHYS_HIGH, | 362 | .trampoline_phys_high = DEFAULT_TRAMPOLINE_PHYS_HIGH, |
363 | .wait_for_init_deassert = NULL, | 363 | .wait_for_init_deassert = NULL, |
364 | .smp_callin_clear_local_apic = NULL, | 364 | .smp_callin_clear_local_apic = NULL, |
365 | .inquire_remote_apic = NULL, | 365 | .inquire_remote_apic = default_inquire_remote_apic, |
366 | 366 | ||
367 | .read = native_apic_mem_read, | 367 | .read = native_apic_mem_read, |
368 | .write = native_apic_mem_write, | 368 | .write = native_apic_mem_write, |
diff --git a/arch/x86/kernel/apic/io_apic.c b/arch/x86/kernel/apic/io_apic.c index 767fe7e46d68..30da617d18e4 100644 --- a/arch/x86/kernel/apic/io_apic.c +++ b/arch/x86/kernel/apic/io_apic.c | |||
@@ -2524,7 +2524,6 @@ static void irq_complete_move(struct irq_desc **descp) | |||
2524 | static inline void irq_complete_move(struct irq_desc **descp) {} | 2524 | static inline void irq_complete_move(struct irq_desc **descp) {} |
2525 | #endif | 2525 | #endif |
2526 | 2526 | ||
2527 | #ifdef CONFIG_X86_X2APIC | ||
2528 | static void __eoi_ioapic_irq(unsigned int irq, struct irq_cfg *cfg) | 2527 | static void __eoi_ioapic_irq(unsigned int irq, struct irq_cfg *cfg) |
2529 | { | 2528 | { |
2530 | int apic, pin; | 2529 | int apic, pin; |
@@ -2558,6 +2557,7 @@ eoi_ioapic_irq(struct irq_desc *desc) | |||
2558 | spin_unlock_irqrestore(&ioapic_lock, flags); | 2557 | spin_unlock_irqrestore(&ioapic_lock, flags); |
2559 | } | 2558 | } |
2560 | 2559 | ||
2560 | #ifdef CONFIG_X86_X2APIC | ||
2561 | static void ack_x2apic_level(unsigned int irq) | 2561 | static void ack_x2apic_level(unsigned int irq) |
2562 | { | 2562 | { |
2563 | struct irq_desc *desc = irq_to_desc(irq); | 2563 | struct irq_desc *desc = irq_to_desc(irq); |
@@ -2634,6 +2634,9 @@ static void ack_apic_level(unsigned int irq) | |||
2634 | */ | 2634 | */ |
2635 | ack_APIC_irq(); | 2635 | ack_APIC_irq(); |
2636 | 2636 | ||
2637 | if (irq_remapped(irq)) | ||
2638 | eoi_ioapic_irq(desc); | ||
2639 | |||
2637 | /* Now we can move and renable the irq */ | 2640 | /* Now we can move and renable the irq */ |
2638 | if (unlikely(do_unmask_irq)) { | 2641 | if (unlikely(do_unmask_irq)) { |
2639 | /* Only migrate the irq if the ack has been received. | 2642 | /* Only migrate the irq if the ack has been received. |
@@ -3667,12 +3670,14 @@ int arch_setup_hpet_msi(unsigned int irq) | |||
3667 | { | 3670 | { |
3668 | int ret; | 3671 | int ret; |
3669 | struct msi_msg msg; | 3672 | struct msi_msg msg; |
3673 | struct irq_desc *desc = irq_to_desc(irq); | ||
3670 | 3674 | ||
3671 | ret = msi_compose_msg(NULL, irq, &msg); | 3675 | ret = msi_compose_msg(NULL, irq, &msg); |
3672 | if (ret < 0) | 3676 | if (ret < 0) |
3673 | return ret; | 3677 | return ret; |
3674 | 3678 | ||
3675 | hpet_msi_write(irq, &msg); | 3679 | hpet_msi_write(irq, &msg); |
3680 | desc->status |= IRQ_MOVE_PCNTXT; | ||
3676 | set_irq_chip_and_handler_name(irq, &hpet_msi_type, handle_edge_irq, | 3681 | set_irq_chip_and_handler_name(irq, &hpet_msi_type, handle_edge_irq, |
3677 | "edge"); | 3682 | "edge"); |
3678 | 3683 | ||
diff --git a/arch/x86/kernel/apic/nmi.c b/arch/x86/kernel/apic/nmi.c index d6bd62407152..ce4fbfa315a1 100644 --- a/arch/x86/kernel/apic/nmi.c +++ b/arch/x86/kernel/apic/nmi.c | |||
@@ -138,7 +138,7 @@ int __init check_nmi_watchdog(void) | |||
138 | if (!prev_nmi_count) | 138 | if (!prev_nmi_count) |
139 | goto error; | 139 | goto error; |
140 | 140 | ||
141 | alloc_cpumask_var(&backtrace_mask, GFP_KERNEL); | 141 | alloc_cpumask_var(&backtrace_mask, GFP_KERNEL|__GFP_ZERO); |
142 | printk(KERN_INFO "Testing NMI watchdog ... "); | 142 | printk(KERN_INFO "Testing NMI watchdog ... "); |
143 | 143 | ||
144 | #ifdef CONFIG_SMP | 144 | #ifdef CONFIG_SMP |
@@ -414,7 +414,8 @@ nmi_watchdog_tick(struct pt_regs *regs, unsigned reason) | |||
414 | touched = 1; | 414 | touched = 1; |
415 | } | 415 | } |
416 | 416 | ||
417 | if (cpumask_test_cpu(cpu, backtrace_mask)) { | 417 | /* We can be called before check_nmi_watchdog, hence NULL check. */ |
418 | if (backtrace_mask != NULL && cpumask_test_cpu(cpu, backtrace_mask)) { | ||
418 | static DEFINE_SPINLOCK(lock); /* Serialise the printks */ | 419 | static DEFINE_SPINLOCK(lock); /* Serialise the printks */ |
419 | 420 | ||
420 | spin_lock(&lock); | 421 | spin_lock(&lock); |
diff --git a/arch/x86/kernel/apic/x2apic_uv_x.c b/arch/x86/kernel/apic/x2apic_uv_x.c index 1248318436e8..2bda69352976 100644 --- a/arch/x86/kernel/apic/x2apic_uv_x.c +++ b/arch/x86/kernel/apic/x2apic_uv_x.c | |||
@@ -19,6 +19,7 @@ | |||
19 | #include <linux/timer.h> | 19 | #include <linux/timer.h> |
20 | #include <linux/cpu.h> | 20 | #include <linux/cpu.h> |
21 | #include <linux/init.h> | 21 | #include <linux/init.h> |
22 | #include <linux/io.h> | ||
22 | 23 | ||
23 | #include <asm/uv/uv_mmrs.h> | 24 | #include <asm/uv/uv_mmrs.h> |
24 | #include <asm/uv/uv_hub.h> | 25 | #include <asm/uv/uv_hub.h> |
@@ -34,6 +35,17 @@ DEFINE_PER_CPU(int, x2apic_extra_bits); | |||
34 | 35 | ||
35 | static enum uv_system_type uv_system_type; | 36 | static enum uv_system_type uv_system_type; |
36 | 37 | ||
38 | static int early_get_nodeid(void) | ||
39 | { | ||
40 | union uvh_node_id_u node_id; | ||
41 | unsigned long *mmr; | ||
42 | |||
43 | mmr = early_ioremap(UV_LOCAL_MMR_BASE | UVH_NODE_ID, sizeof(*mmr)); | ||
44 | node_id.v = *mmr; | ||
45 | early_iounmap(mmr, sizeof(*mmr)); | ||
46 | return node_id.s.node_id; | ||
47 | } | ||
48 | |||
37 | static int uv_acpi_madt_oem_check(char *oem_id, char *oem_table_id) | 49 | static int uv_acpi_madt_oem_check(char *oem_id, char *oem_table_id) |
38 | { | 50 | { |
39 | if (!strcmp(oem_id, "SGI")) { | 51 | if (!strcmp(oem_id, "SGI")) { |
@@ -42,6 +54,8 @@ static int uv_acpi_madt_oem_check(char *oem_id, char *oem_table_id) | |||
42 | else if (!strcmp(oem_table_id, "UVX")) | 54 | else if (!strcmp(oem_table_id, "UVX")) |
43 | uv_system_type = UV_X2APIC; | 55 | uv_system_type = UV_X2APIC; |
44 | else if (!strcmp(oem_table_id, "UVH")) { | 56 | else if (!strcmp(oem_table_id, "UVH")) { |
57 | __get_cpu_var(x2apic_extra_bits) = | ||
58 | early_get_nodeid() << (UV_APIC_PNODE_SHIFT - 1); | ||
45 | uv_system_type = UV_NON_UNIQUE_APIC; | 59 | uv_system_type = UV_NON_UNIQUE_APIC; |
46 | return 1; | 60 | return 1; |
47 | } | 61 | } |
@@ -549,7 +563,8 @@ void __init uv_system_init(void) | |||
549 | unsigned long gnode_upper, lowmem_redir_base, lowmem_redir_size; | 563 | unsigned long gnode_upper, lowmem_redir_base, lowmem_redir_size; |
550 | int bytes, nid, cpu, lcpu, pnode, blade, i, j, m_val, n_val; | 564 | int bytes, nid, cpu, lcpu, pnode, blade, i, j, m_val, n_val; |
551 | int max_pnode = 0; | 565 | int max_pnode = 0; |
552 | unsigned long mmr_base, present; | 566 | unsigned long mmr_base, present, paddr; |
567 | unsigned short pnode_mask; | ||
553 | 568 | ||
554 | map_low_mmrs(); | 569 | map_low_mmrs(); |
555 | 570 | ||
@@ -592,6 +607,7 @@ void __init uv_system_init(void) | |||
592 | } | 607 | } |
593 | } | 608 | } |
594 | 609 | ||
610 | pnode_mask = (1 << n_val) - 1; | ||
595 | node_id.v = uv_read_local_mmr(UVH_NODE_ID); | 611 | node_id.v = uv_read_local_mmr(UVH_NODE_ID); |
596 | gnode_upper = (((unsigned long)node_id.s.node_id) & | 612 | gnode_upper = (((unsigned long)node_id.s.node_id) & |
597 | ~((1 << n_val) - 1)) << m_val; | 613 | ~((1 << n_val) - 1)) << m_val; |
@@ -615,7 +631,7 @@ void __init uv_system_init(void) | |||
615 | uv_cpu_hub_info(cpu)->numa_blade_id = blade; | 631 | uv_cpu_hub_info(cpu)->numa_blade_id = blade; |
616 | uv_cpu_hub_info(cpu)->blade_processor_id = lcpu; | 632 | uv_cpu_hub_info(cpu)->blade_processor_id = lcpu; |
617 | uv_cpu_hub_info(cpu)->pnode = pnode; | 633 | uv_cpu_hub_info(cpu)->pnode = pnode; |
618 | uv_cpu_hub_info(cpu)->pnode_mask = (1 << n_val) - 1; | 634 | uv_cpu_hub_info(cpu)->pnode_mask = pnode_mask; |
619 | uv_cpu_hub_info(cpu)->gpa_mask = (1 << (m_val + n_val)) - 1; | 635 | uv_cpu_hub_info(cpu)->gpa_mask = (1 << (m_val + n_val)) - 1; |
620 | uv_cpu_hub_info(cpu)->gnode_upper = gnode_upper; | 636 | uv_cpu_hub_info(cpu)->gnode_upper = gnode_upper; |
621 | uv_cpu_hub_info(cpu)->global_mmr_base = mmr_base; | 637 | uv_cpu_hub_info(cpu)->global_mmr_base = mmr_base; |
@@ -631,6 +647,17 @@ void __init uv_system_init(void) | |||
631 | lcpu, blade); | 647 | lcpu, blade); |
632 | } | 648 | } |
633 | 649 | ||
650 | /* Add blade/pnode info for nodes without cpus */ | ||
651 | for_each_online_node(nid) { | ||
652 | if (uv_node_to_blade[nid] >= 0) | ||
653 | continue; | ||
654 | paddr = node_start_pfn(nid) << PAGE_SHIFT; | ||
655 | paddr = uv_soc_phys_ram_to_gpa(paddr); | ||
656 | pnode = (paddr >> m_val) & pnode_mask; | ||
657 | blade = boot_pnode_to_blade(pnode); | ||
658 | uv_node_to_blade[nid] = blade; | ||
659 | } | ||
660 | |||
634 | map_gru_high(max_pnode); | 661 | map_gru_high(max_pnode); |
635 | map_mmr_high(max_pnode); | 662 | map_mmr_high(max_pnode); |
636 | map_config_high(max_pnode); | 663 | map_config_high(max_pnode); |