Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 39025ba3 authored by Oren Twaig's avatar Oren Twaig Committed by Ingo Molnar
Browse files

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: default avatarOren Twaig <oren@scalemp.com>
Acked-by: default avatarShai 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: default avatarIngo Molnar <mingo@kernel.org>
parent 8f2dd677
Loading
Loading
Loading
Loading
+10 −1
Original line number Diff line number Diff line
@@ -26,6 +26,9 @@

#define TOPOLOGY_REGISTER_OFFSET 0x10

/* Flag below is initialized once during vSMP PCI initialization. */
static int irq_routing_comply = 1;

#if defined CONFIG_PCI && defined CONFIG_PARAVIRT
/*
 * Interrupt control on vSMPowered systems:
@@ -101,6 +104,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 */
		irq_routing_comply = 0;

#ifdef CONFIG_PROC_FS
		/* Don't let users change irq affinity via procfs */
		no_irq_affinity = 1;
@@ -218,6 +225,8 @@ static void vsmp_apic_post_init(void)
{
	/* need to update phys_pkg_id */
	apic->phys_pkg_id = apicid_phys_pkg_id;

	if (!irq_routing_comply)
		apic->vector_allocation_domain = fill_vector_allocation_domain;
}