linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] X86: Hook apic vector allocation domain only when interrupt routing are set to ignore
@ 2014-04-24 21:52 Oren Twaig
  2014-04-25  8:01 ` Ingo Molnar
  2014-04-25 14:22 ` Andi Kleen
  0 siblings, 2 replies; 11+ messages in thread
From: Oren Twaig @ 2014-04-24 21:52 UTC (permalink / raw)
  To: Thomas Gleixner, Ingo Molnar, Andi Kleen, H. Peter Anvin
  Cc: x86, linux-kernel, Shai Fultheim

vSMP Foundation provides locality based interrupt routing which needed
vector_allocation_domain to allow all online cpus can handle all possible
vectors. 

Enforcing Interrupt Routing Comply (IRC) mode requires us to unplug this hook as
otherwise the IOAPIC, MSI and MSIX destination selectors to always select the
lowest online cpu as the destination. I.e affinity of HW interrupts cannot be
controled by kernel and/or userspace code.

The purpose of the patch is to fix the code to set override vector allocation
domain only when IRC is set to ignore to allow the kernel and userspace to
effectively control the destination of the HW interrupts.

Signed-off-by: Oren Twaig <oren@scalemp.com>
Acked-by: Shai Fultheim <shai@scalemp.com>
---

 arch/x86/kernel/vsmp_64.c |   10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/arch/x86/kernel/vsmp_64.c b/arch/x86/kernel/vsmp_64.c
index f6584a9..b7f8e5b 100644
--- a/arch/x86/kernel/vsmp_64.c
+++ b/arch/x86/kernel/vsmp_64.c
@@ -26,6 +26,8 @@
 
 #define TOPOLOGY_REGISTER_OFFSET 0x10
 
+static int irc = 1;
+
 #if defined CONFIG_PCI && defined CONFIG_PARAVIRT
 /*
  * Interrupt control on vSMPowered systems:
@@ -101,6 +103,10 @@ static void __init set_vsmp_pv_ops(void)
 #ifdef CONFIG_SMP
 	if (cap & ctl & BIT(8)) {
 		ctl &= ~BIT(8);
+
+		/* Interrupt routing set to ignore */
+		irc = 0;
+
 #ifdef CONFIG_PROC_FS
 		/* Don't let users change irq affinity via procfs */
 		no_irq_affinity = 1;
@@ -218,7 +224,9 @@ static void vsmp_apic_post_init(void)
 {
 	/* need to update phys_pkg_id */
 	apic->phys_pkg_id = apicid_phys_pkg_id;
-	apic->vector_allocation_domain = fill_vector_allocation_domain;
+
+	if (!irc)
+		apic->vector_allocation_domain = fill_vector_allocation_domain;
 }
 
 void __init vsmp_init(void)

^ permalink raw reply related	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2014-04-28  7:07 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-04-24 21:52 [PATCH v2] X86: Hook apic vector allocation domain only when interrupt routing are set to ignore Oren Twaig
2014-04-25  8:01 ` Ingo Molnar
2014-04-25 11:08   ` Oren Twaig
2014-04-26  6:09     ` Ingo Molnar
2014-04-27  6:55       ` Oren Twaig
2014-04-27 11:50         ` Ingo Molnar
2014-04-25 14:22 ` Andi Kleen
2014-04-27  6:57   ` Oren Twaig
2014-04-27 11:54     ` Ingo Molnar
2014-04-27 18:34     ` Andi Kleen
2014-04-28  7:06       ` Oren Twaig

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).