aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86_64/kernel
diff options
context:
space:
mode:
authorLen Brown <len.brown@intel.com>2006-06-29 19:57:46 -0400
committerLen Brown <len.brown@intel.com>2006-06-29 19:57:46 -0400
commitd120cfb544ed6161b9d32fb6c4648c471807ee6b (patch)
tree7757ad0198d8df76ff5c60f939a687687c41da00 /arch/x86_64/kernel
parent9dce0e950dbfab4148f35ac6f297d8638cdc63c4 (diff)
parentbf7e8511088963078484132636839b59e25cf14f (diff)
merge linus into release branch
Conflicts: drivers/acpi/acpi_memhotplug.c
Diffstat (limited to 'arch/x86_64/kernel')
-rw-r--r--arch/x86_64/kernel/entry.S2
-rw-r--r--arch/x86_64/kernel/i8259.c6
-rw-r--r--arch/x86_64/kernel/io_apic.c25
-rw-r--r--arch/x86_64/kernel/irq.c18
-rw-r--r--arch/x86_64/kernel/mce.c4
-rw-r--r--arch/x86_64/kernel/nmi.c2
-rw-r--r--arch/x86_64/kernel/smp.c4
-rw-r--r--arch/x86_64/kernel/smpboot.c8
8 files changed, 45 insertions, 24 deletions
diff --git a/arch/x86_64/kernel/entry.S b/arch/x86_64/kernel/entry.S
index 7290e72b9a34..22cac4487b57 100644
--- a/arch/x86_64/kernel/entry.S
+++ b/arch/x86_64/kernel/entry.S
@@ -588,7 +588,7 @@ END(common_interrupt)
588 */ 588 */
589 .macro apicinterrupt num,func 589 .macro apicinterrupt num,func
590 INTR_FRAME 590 INTR_FRAME
591 pushq $\num-256 591 pushq $~(\num)
592 CFI_ADJUST_CFA_OFFSET 8 592 CFI_ADJUST_CFA_OFFSET 8
593 interrupt \func 593 interrupt \func
594 jmp ret_from_intr 594 jmp ret_from_intr
diff --git a/arch/x86_64/kernel/i8259.c b/arch/x86_64/kernel/i8259.c
index 86b2c1e197aa..3dd1659427dc 100644
--- a/arch/x86_64/kernel/i8259.c
+++ b/arch/x86_64/kernel/i8259.c
@@ -235,7 +235,7 @@ void make_8259A_irq(unsigned int irq)
235{ 235{
236 disable_irq_nosync(irq); 236 disable_irq_nosync(irq);
237 io_apic_irqs &= ~(1<<irq); 237 io_apic_irqs &= ~(1<<irq);
238 irq_desc[irq].handler = &i8259A_irq_type; 238 irq_desc[irq].chip = &i8259A_irq_type;
239 enable_irq(irq); 239 enable_irq(irq);
240} 240}
241 241
@@ -468,12 +468,12 @@ void __init init_ISA_irqs (void)
468 /* 468 /*
469 * 16 old-style INTA-cycle interrupts: 469 * 16 old-style INTA-cycle interrupts:
470 */ 470 */
471 irq_desc[i].handler = &i8259A_irq_type; 471 irq_desc[i].chip = &i8259A_irq_type;
472 } else { 472 } else {
473 /* 473 /*
474 * 'high' PCI IRQs filled in on demand 474 * 'high' PCI IRQs filled in on demand
475 */ 475 */
476 irq_desc[i].handler = &no_irq_type; 476 irq_desc[i].chip = &no_irq_type;
477 } 477 }
478 } 478 }
479} 479}
diff --git a/arch/x86_64/kernel/io_apic.c b/arch/x86_64/kernel/io_apic.c
index c768d8a036d0..401b687fef21 100644
--- a/arch/x86_64/kernel/io_apic.c
+++ b/arch/x86_64/kernel/io_apic.c
@@ -876,15 +876,17 @@ static struct hw_interrupt_type ioapic_edge_type;
876#define IOAPIC_EDGE 0 876#define IOAPIC_EDGE 0
877#define IOAPIC_LEVEL 1 877#define IOAPIC_LEVEL 1
878 878
879static inline void ioapic_register_intr(int irq, int vector, unsigned long trigger) 879static void ioapic_register_intr(int irq, int vector, unsigned long trigger)
880{ 880{
881 unsigned idx = use_pci_vector() && !platform_legacy_irq(irq) ? vector : irq; 881 unsigned idx;
882
883 idx = use_pci_vector() && !platform_legacy_irq(irq) ? vector : irq;
882 884
883 if ((trigger == IOAPIC_AUTO && IO_APIC_irq_trigger(irq)) || 885 if ((trigger == IOAPIC_AUTO && IO_APIC_irq_trigger(irq)) ||
884 trigger == IOAPIC_LEVEL) 886 trigger == IOAPIC_LEVEL)
885 irq_desc[idx].handler = &ioapic_level_type; 887 irq_desc[idx].chip = &ioapic_level_type;
886 else 888 else
887 irq_desc[idx].handler = &ioapic_edge_type; 889 irq_desc[idx].chip = &ioapic_edge_type;
888 set_intr_gate(vector, interrupt[idx]); 890 set_intr_gate(vector, interrupt[idx]);
889} 891}
890 892
@@ -986,7 +988,7 @@ static void __init setup_ExtINT_IRQ0_pin(unsigned int apic, unsigned int pin, in
986 * The timer IRQ doesn't have to know that behind the 988 * The timer IRQ doesn't have to know that behind the
987 * scene we have a 8259A-master in AEOI mode ... 989 * scene we have a 8259A-master in AEOI mode ...
988 */ 990 */
989 irq_desc[0].handler = &ioapic_edge_type; 991 irq_desc[0].chip = &ioapic_edge_type;
990 992
991 /* 993 /*
992 * Add it to the IO-APIC irq-routing table: 994 * Add it to the IO-APIC irq-routing table:
@@ -1616,6 +1618,13 @@ static void set_ioapic_affinity_vector (unsigned int vector,
1616#endif // CONFIG_SMP 1618#endif // CONFIG_SMP
1617#endif // CONFIG_PCI_MSI 1619#endif // CONFIG_PCI_MSI
1618 1620
1621static int ioapic_retrigger(unsigned int irq)
1622{
1623 send_IPI_self(IO_APIC_VECTOR(irq));
1624
1625 return 1;
1626}
1627
1619/* 1628/*
1620 * Level and edge triggered IO-APIC interrupts need different handling, 1629 * Level and edge triggered IO-APIC interrupts need different handling,
1621 * so we use two separate IRQ descriptors. Edge triggered IRQs can be 1630 * so we use two separate IRQ descriptors. Edge triggered IRQs can be
@@ -1636,6 +1645,7 @@ static struct hw_interrupt_type ioapic_edge_type __read_mostly = {
1636#ifdef CONFIG_SMP 1645#ifdef CONFIG_SMP
1637 .set_affinity = set_ioapic_affinity, 1646 .set_affinity = set_ioapic_affinity,
1638#endif 1647#endif
1648 .retrigger = ioapic_retrigger,
1639}; 1649};
1640 1650
1641static struct hw_interrupt_type ioapic_level_type __read_mostly = { 1651static struct hw_interrupt_type ioapic_level_type __read_mostly = {
@@ -1649,6 +1659,7 @@ static struct hw_interrupt_type ioapic_level_type __read_mostly = {
1649#ifdef CONFIG_SMP 1659#ifdef CONFIG_SMP
1650 .set_affinity = set_ioapic_affinity, 1660 .set_affinity = set_ioapic_affinity,
1651#endif 1661#endif
1662 .retrigger = ioapic_retrigger,
1652}; 1663};
1653 1664
1654static inline void init_IO_APIC_traps(void) 1665static inline void init_IO_APIC_traps(void)
@@ -1683,7 +1694,7 @@ static inline void init_IO_APIC_traps(void)
1683 make_8259A_irq(irq); 1694 make_8259A_irq(irq);
1684 else 1695 else
1685 /* Strange. Oh, well.. */ 1696 /* Strange. Oh, well.. */
1686 irq_desc[irq].handler = &no_irq_type; 1697 irq_desc[irq].chip = &no_irq_type;
1687 } 1698 }
1688 } 1699 }
1689} 1700}
@@ -1900,7 +1911,7 @@ static inline void check_timer(void)
1900 apic_printk(APIC_VERBOSE, KERN_INFO "...trying to set up timer as Virtual Wire IRQ..."); 1911 apic_printk(APIC_VERBOSE, KERN_INFO "...trying to set up timer as Virtual Wire IRQ...");
1901 1912
1902 disable_8259A_irq(0); 1913 disable_8259A_irq(0);
1903 irq_desc[0].handler = &lapic_irq_type; 1914 irq_desc[0].chip = &lapic_irq_type;
1904 apic_write(APIC_LVT0, APIC_DM_FIXED | vector); /* Fixed mode */ 1915 apic_write(APIC_LVT0, APIC_DM_FIXED | vector); /* Fixed mode */
1905 enable_8259A_irq(0); 1916 enable_8259A_irq(0);
1906 1917
diff --git a/arch/x86_64/kernel/irq.c b/arch/x86_64/kernel/irq.c
index 59518d4d4358..a1f1df5f7bfc 100644
--- a/arch/x86_64/kernel/irq.c
+++ b/arch/x86_64/kernel/irq.c
@@ -79,7 +79,7 @@ int show_interrupts(struct seq_file *p, void *v)
79 for_each_online_cpu(j) 79 for_each_online_cpu(j)
80 seq_printf(p, "%10u ", kstat_cpu(j).irqs[i]); 80 seq_printf(p, "%10u ", kstat_cpu(j).irqs[i]);
81#endif 81#endif
82 seq_printf(p, " %14s", irq_desc[i].handler->typename); 82 seq_printf(p, " %14s", irq_desc[i].chip->typename);
83 83
84 seq_printf(p, " %s", action->name); 84 seq_printf(p, " %s", action->name);
85 for (action=action->next; action; action = action->next) 85 for (action=action->next; action; action = action->next)
@@ -115,8 +115,14 @@ skip:
115 */ 115 */
116asmlinkage unsigned int do_IRQ(struct pt_regs *regs) 116asmlinkage unsigned int do_IRQ(struct pt_regs *regs)
117{ 117{
118 /* high bits used in ret_from_ code */ 118 /* high bit used in ret_from_ code */
119 unsigned irq = regs->orig_rax & 0xff; 119 unsigned irq = ~regs->orig_rax;
120
121 if (unlikely(irq >= NR_IRQS)) {
122 printk(KERN_EMERG "%s: cannot handle IRQ %d\n",
123 __FUNCTION__, irq);
124 BUG();
125 }
120 126
121 exit_idle(); 127 exit_idle();
122 irq_enter(); 128 irq_enter();
@@ -140,13 +146,13 @@ void fixup_irqs(cpumask_t map)
140 if (irq == 2) 146 if (irq == 2)
141 continue; 147 continue;
142 148
143 cpus_and(mask, irq_affinity[irq], map); 149 cpus_and(mask, irq_desc[irq].affinity, map);
144 if (any_online_cpu(mask) == NR_CPUS) { 150 if (any_online_cpu(mask) == NR_CPUS) {
145 printk("Breaking affinity for irq %i\n", irq); 151 printk("Breaking affinity for irq %i\n", irq);
146 mask = map; 152 mask = map;
147 } 153 }
148 if (irq_desc[irq].handler->set_affinity) 154 if (irq_desc[irq].chip->set_affinity)
149 irq_desc[irq].handler->set_affinity(irq, mask); 155 irq_desc[irq].chip->set_affinity(irq, mask);
150 else if (irq_desc[irq].action && !(warned++)) 156 else if (irq_desc[irq].action && !(warned++))
151 printk("Cannot set affinity for irq %i\n", irq); 157 printk("Cannot set affinity for irq %i\n", irq);
152 } 158 }
diff --git a/arch/x86_64/kernel/mce.c b/arch/x86_64/kernel/mce.c
index acd5816b1a6f..88845674c661 100644
--- a/arch/x86_64/kernel/mce.c
+++ b/arch/x86_64/kernel/mce.c
@@ -629,7 +629,7 @@ static __cpuinit void mce_remove_device(unsigned int cpu)
629#endif 629#endif
630 630
631/* Get notified when a cpu comes on/off. Be hotplug friendly. */ 631/* Get notified when a cpu comes on/off. Be hotplug friendly. */
632static int 632static __cpuinit int
633mce_cpu_callback(struct notifier_block *nfb, unsigned long action, void *hcpu) 633mce_cpu_callback(struct notifier_block *nfb, unsigned long action, void *hcpu)
634{ 634{
635 unsigned int cpu = (unsigned long)hcpu; 635 unsigned int cpu = (unsigned long)hcpu;
@@ -647,7 +647,7 @@ mce_cpu_callback(struct notifier_block *nfb, unsigned long action, void *hcpu)
647 return NOTIFY_OK; 647 return NOTIFY_OK;
648} 648}
649 649
650static struct notifier_block mce_cpu_notifier = { 650static struct notifier_block __cpuinitdata mce_cpu_notifier = {
651 .notifier_call = mce_cpu_callback, 651 .notifier_call = mce_cpu_callback,
652}; 652};
653 653
diff --git a/arch/x86_64/kernel/nmi.c b/arch/x86_64/kernel/nmi.c
index 399489c93132..0ef9cf2bc45e 100644
--- a/arch/x86_64/kernel/nmi.c
+++ b/arch/x86_64/kernel/nmi.c
@@ -607,11 +607,13 @@ void set_nmi_callback(nmi_callback_t callback)
607 vmalloc_sync_all(); 607 vmalloc_sync_all();
608 rcu_assign_pointer(nmi_callback, callback); 608 rcu_assign_pointer(nmi_callback, callback);
609} 609}
610EXPORT_SYMBOL_GPL(set_nmi_callback);
610 611
611void unset_nmi_callback(void) 612void unset_nmi_callback(void)
612{ 613{
613 nmi_callback = dummy_nmi_callback; 614 nmi_callback = dummy_nmi_callback;
614} 615}
616EXPORT_SYMBOL_GPL(unset_nmi_callback);
615 617
616#ifdef CONFIG_SYSCTL 618#ifdef CONFIG_SYSCTL
617 619
diff --git a/arch/x86_64/kernel/smp.c b/arch/x86_64/kernel/smp.c
index acee4bc3f6fa..5a1c0a3bf872 100644
--- a/arch/x86_64/kernel/smp.c
+++ b/arch/x86_64/kernel/smp.c
@@ -135,10 +135,10 @@ asmlinkage void smp_invalidate_interrupt(struct pt_regs *regs)
135 135
136 cpu = smp_processor_id(); 136 cpu = smp_processor_id();
137 /* 137 /*
138 * orig_rax contains the interrupt vector - 256. 138 * orig_rax contains the negated interrupt vector.
139 * Use that to determine where the sender put the data. 139 * Use that to determine where the sender put the data.
140 */ 140 */
141 sender = regs->orig_rax + 256 - INVALIDATE_TLB_VECTOR_START; 141 sender = ~regs->orig_rax - INVALIDATE_TLB_VECTOR_START;
142 f = &per_cpu(flush_state, sender); 142 f = &per_cpu(flush_state, sender);
143 143
144 if (!cpu_isset(cpu, f->flush_cpumask)) 144 if (!cpu_isset(cpu, f->flush_cpumask))
diff --git a/arch/x86_64/kernel/smpboot.c b/arch/x86_64/kernel/smpboot.c
index 4e9755179ecf..540c0ccbcccc 100644
--- a/arch/x86_64/kernel/smpboot.c
+++ b/arch/x86_64/kernel/smpboot.c
@@ -455,10 +455,12 @@ cpumask_t cpu_coregroup_map(int cpu)
455 struct cpuinfo_x86 *c = cpu_data + cpu; 455 struct cpuinfo_x86 *c = cpu_data + cpu;
456 /* 456 /*
457 * For perf, we return last level cache shared map. 457 * For perf, we return last level cache shared map.
458 * TBD: when power saving sched policy is added, we will return 458 * And for power savings, we return cpu_core_map
459 * cpu_core_map when power saving policy is enabled
460 */ 459 */
461 return c->llc_shared_map; 460 if (sched_mc_power_savings || sched_smt_power_savings)
461 return cpu_core_map[cpu];
462 else
463 return c->llc_shared_map;
462} 464}
463 465
464/* representing cpus for which sibling maps can be computed */ 466/* representing cpus for which sibling maps can be computed */