aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorRavikiran Thirumalai <kiran.thirumalai@gmail.com>2012-06-02 18:11:35 -0400
committerIngo Molnar <mingo@kernel.org>2012-06-11 04:59:13 -0400
commit110c1e1f1bf61e5dca53ff5c9dc75243ce87c002 (patch)
treee2b892c3ea56692c1560c63d874a3d870fcf3190 /arch
parent7db971b235480849aa5b9209b67b62e987b3181b (diff)
x86/vsmp: Ignore IOAPIC IRQ affinity if possible
vSMP can route interrupts more optimally based on internal knowledge the OS does not have. In order to support this optimization, all CPUs must be able to handle all possible IOAPIC interrupts. Fix this by setting the vector allocation domain for all CPUs and by enabling this feature in vSMP. Signed-off-by: Ravikiran Thirumalai <kiran.thirumalai@gmail.com> Signed-off-by: Shai Fultheim <shai@scalemp.com> [ Rebased, simplified, and reworded the commit message. ] Signed-off-by: Ido Yariv <ido@wizery.com> Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'arch')
-rw-r--r--arch/x86/kernel/vsmp_64.c27
1 files changed, 23 insertions, 4 deletions
diff --git a/arch/x86/kernel/vsmp_64.c b/arch/x86/kernel/vsmp_64.c
index 59eea855f45..6b96a7374f9 100644
--- a/arch/x86/kernel/vsmp_64.c
+++ b/arch/x86/kernel/vsmp_64.c
@@ -16,6 +16,7 @@
16#include <linux/pci_ids.h> 16#include <linux/pci_ids.h>
17#include <linux/pci_regs.h> 17#include <linux/pci_regs.h>
18#include <linux/smp.h> 18#include <linux/smp.h>
19#include <linux/irq.h>
19 20
20#include <asm/apic.h> 21#include <asm/apic.h>
21#include <asm/pci-direct.h> 22#include <asm/pci-direct.h>
@@ -95,6 +96,15 @@ static void __init set_vsmp_pv_ops(void)
95 ctl = readl(address + 4); 96 ctl = readl(address + 4);
96 printk(KERN_INFO "vSMP CTL: capabilities:0x%08x control:0x%08x\n", 97 printk(KERN_INFO "vSMP CTL: capabilities:0x%08x control:0x%08x\n",
97 cap, ctl); 98 cap, ctl);
99
100 /* If possible, let the vSMP foundation route the interrupt optimally */
101#ifdef CONFIG_SMP
102 if (cap & ctl & BIT(8)) {
103 ctl &= ~BIT(8);
104 no_irq_affinity = 1;
105 }
106#endif
107
98 if (cap & ctl & (1 << 4)) { 108 if (cap & ctl & (1 << 4)) {
99 /* Setup irq ops and turn on vSMP IRQ fastpath handling */ 109 /* Setup irq ops and turn on vSMP IRQ fastpath handling */
100 pv_irq_ops.irq_disable = PV_CALLEE_SAVE(vsmp_irq_disable); 110 pv_irq_ops.irq_disable = PV_CALLEE_SAVE(vsmp_irq_disable);
@@ -102,12 +112,11 @@ static void __init set_vsmp_pv_ops(void)
102 pv_irq_ops.save_fl = PV_CALLEE_SAVE(vsmp_save_fl); 112 pv_irq_ops.save_fl = PV_CALLEE_SAVE(vsmp_save_fl);
103 pv_irq_ops.restore_fl = PV_CALLEE_SAVE(vsmp_restore_fl); 113 pv_irq_ops.restore_fl = PV_CALLEE_SAVE(vsmp_restore_fl);
104 pv_init_ops.patch = vsmp_patch; 114 pv_init_ops.patch = vsmp_patch;
105
106 ctl &= ~(1 << 4); 115 ctl &= ~(1 << 4);
107 writel(ctl, address + 4);
108 ctl = readl(address + 4);
109 printk(KERN_INFO "vSMP CTL: control set to:0x%08x\n", ctl);
110 } 116 }
117 writel(ctl, address + 4);
118 ctl = readl(address + 4);
119 pr_info("vSMP CTL: control set to:0x%08x\n", ctl);
111 120
112 early_iounmap(address, 8); 121 early_iounmap(address, 8);
113} 122}
@@ -192,10 +201,20 @@ static int apicid_phys_pkg_id(int initial_apic_id, int index_msb)
192 return hard_smp_processor_id() >> index_msb; 201 return hard_smp_processor_id() >> index_msb;
193} 202}
194 203
204/*
205 * In vSMP, all cpus should be capable of handling interrupts, regardless of
206 * the APIC used.
207 */
208static void fill_vector_allocation_domain(int cpu, struct cpumask *retmask)
209{
210 cpumask_setall(retmask);
211}
212
195static void vsmp_apic_post_init(void) 213static void vsmp_apic_post_init(void)
196{ 214{
197 /* need to update phys_pkg_id */ 215 /* need to update phys_pkg_id */
198 apic->phys_pkg_id = apicid_phys_pkg_id; 216 apic->phys_pkg_id = apicid_phys_pkg_id;
217 apic->vector_allocation_domain = fill_vector_allocation_domain;
199} 218}
200 219
201void __init vsmp_init(void) 220void __init vsmp_init(void)