aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOren Twaig <oren@scalemp.com>2014-04-28 03:21:37 -0400
committerIngo Molnar <mingo@kernel.org>2014-04-28 03:27:34 -0400
commit39025ba38278f3003ee538409f7c98970620ef49 (patch)
treef3ed243da52148e4fb188e2805ad048e32a34727
parent8f2dd677bec68fb55904799a82674c9e64b23be3 (diff)
x86/vsmp: Fix irq routing
Correct IRQ routing in case a vSMP box is detected but the Interrupt Routing Comply (IRC) value is set to "comply", which leads to incorrect IRQ routing. Before the patch: When a vSMP box was detected and IRC was set to "comply", users (and the kernel) couldn't effectively set the destination of the IRQs. This is because the hook inside vsmp_64.c always setup all CPUs as the IRQ destination using cpumask_setall() as the return value for IRQ allocation mask. Later, this "overrided" mask caused the kernel to set the IRQ destination to the lowest online CPU in the mask (CPU0 usually). After the patch: When the IRC is set to "comply", users (and the kernel) can control the destination of the IRQs as we will not be changing the default "apic->vector_allocation_domain". Signed-off-by: Oren Twaig <oren@scalemp.com> Acked-by: Shai Fultheim <shai@scalemp.com> Link: http://lkml.kernel.org/r/1398669697-2123-1-git-send-email-oren@scalemp.com [ Minor readability edits. ] Signed-off-by: Ingo Molnar <mingo@kernel.org>
-rw-r--r--arch/x86/kernel/vsmp_64.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/arch/x86/kernel/vsmp_64.c b/arch/x86/kernel/vsmp_64.c
index f6584a90aba3..5edc34b5b951 100644
--- a/arch/x86/kernel/vsmp_64.c
+++ b/arch/x86/kernel/vsmp_64.c
@@ -26,6 +26,9 @@
26 26
27#define TOPOLOGY_REGISTER_OFFSET 0x10 27#define TOPOLOGY_REGISTER_OFFSET 0x10
28 28
29/* Flag below is initialized once during vSMP PCI initialization. */
30static int irq_routing_comply = 1;
31
29#if defined CONFIG_PCI && defined CONFIG_PARAVIRT 32#if defined CONFIG_PCI && defined CONFIG_PARAVIRT
30/* 33/*
31 * Interrupt control on vSMPowered systems: 34 * Interrupt control on vSMPowered systems:
@@ -101,6 +104,10 @@ static void __init set_vsmp_pv_ops(void)
101#ifdef CONFIG_SMP 104#ifdef CONFIG_SMP
102 if (cap & ctl & BIT(8)) { 105 if (cap & ctl & BIT(8)) {
103 ctl &= ~BIT(8); 106 ctl &= ~BIT(8);
107
108 /* Interrupt routing set to ignore */
109 irq_routing_comply = 0;
110
104#ifdef CONFIG_PROC_FS 111#ifdef CONFIG_PROC_FS
105 /* Don't let users change irq affinity via procfs */ 112 /* Don't let users change irq affinity via procfs */
106 no_irq_affinity = 1; 113 no_irq_affinity = 1;
@@ -218,7 +225,9 @@ static void vsmp_apic_post_init(void)
218{ 225{
219 /* need to update phys_pkg_id */ 226 /* need to update phys_pkg_id */
220 apic->phys_pkg_id = apicid_phys_pkg_id; 227 apic->phys_pkg_id = apicid_phys_pkg_id;
221 apic->vector_allocation_domain = fill_vector_allocation_domain; 228
229 if (!irq_routing_comply)
230 apic->vector_allocation_domain = fill_vector_allocation_domain;
222} 231}
223 232
224void __init vsmp_init(void) 233void __init vsmp_init(void)