aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorThomas Gleixner <tglx@linutronix.de>2017-12-28 05:33:33 -0500
committerThomas Gleixner <tglx@linutronix.de>2017-12-29 08:20:48 -0500
commita31e58e129f73ab5b04016330b13ed51fde7a961 (patch)
tree4fd2d50430834799dd56bc284a0ad4e8f0a61344 /drivers
parent64e05d118e357bb52a084b609436acf292ce7944 (diff)
x86/apic: Switch all APICs to Fixed delivery mode
Some of the APIC incarnations are operating in lowest priority delivery mode. This worked as long as the vector management code allocated the same vector on all possible CPUs for each interrupt. Lowest priority delivery mode does not necessarily respect the affinity setting and may redirect to some other online CPU. This was documented somewhere in the old code and the conversion to single target delivery missed to update the delivery mode of the affected APIC drivers which results in spurious interrupts on some of the affected CPU/Chipset combinations. Switch the APIC drivers over to Fixed delivery mode and remove all leftovers of lowest priority delivery mode. Switching to Fixed delivery mode is not a problem on these CPUs because the kernel already uses Fixed delivery mode for IPIs. The reason for this is that th SDM explicitely forbids lowest prio mode for IPIs. The reason is obvious: If the irq routing does not honor destination targets in lowest prio mode then an IPI targeted at CPU1 might end up on CPU0, which would be a fatal problem in many cases. As a consequence of this change, the apic::irq_delivery_mode field is now pointless, but this needs to be cleaned up in a separate patch. Fixes: fdba46ffb4c2 ("x86/apic: Get rid of multi CPU affinity") Reported-by: vcaputo@pengaru.com Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Tested-by: vcaputo@pengaru.com Cc: Pavel Machek <pavel@ucw.cz> Link: https://lkml.kernel.org/r/alpine.DEB.2.20.1712281140440.1688@nanos
Diffstat (limited to 'drivers')
-rw-r--r--drivers/pci/host/pci-hyperv.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/drivers/pci/host/pci-hyperv.c b/drivers/pci/host/pci-hyperv.c
index 0fe3ea164ee5..e7d94473aedd 100644
--- a/drivers/pci/host/pci-hyperv.c
+++ b/drivers/pci/host/pci-hyperv.c
@@ -985,9 +985,7 @@ static u32 hv_compose_msi_req_v1(
985 int_pkt->wslot.slot = slot; 985 int_pkt->wslot.slot = slot;
986 int_pkt->int_desc.vector = vector; 986 int_pkt->int_desc.vector = vector;
987 int_pkt->int_desc.vector_count = 1; 987 int_pkt->int_desc.vector_count = 1;
988 int_pkt->int_desc.delivery_mode = 988 int_pkt->int_desc.delivery_mode = dest_Fixed;
989 (apic->irq_delivery_mode == dest_LowestPrio) ?
990 dest_LowestPrio : dest_Fixed;
991 989
992 /* 990 /*
993 * Create MSI w/ dummy vCPU set, overwritten by subsequent retarget in 991 * Create MSI w/ dummy vCPU set, overwritten by subsequent retarget in
@@ -1008,9 +1006,7 @@ static u32 hv_compose_msi_req_v2(
1008 int_pkt->wslot.slot = slot; 1006 int_pkt->wslot.slot = slot;
1009 int_pkt->int_desc.vector = vector; 1007 int_pkt->int_desc.vector = vector;
1010 int_pkt->int_desc.vector_count = 1; 1008 int_pkt->int_desc.vector_count = 1;
1011 int_pkt->int_desc.delivery_mode = 1009 int_pkt->int_desc.delivery_mode = dest_Fixed;
1012 (apic->irq_delivery_mode == dest_LowestPrio) ?
1013 dest_LowestPrio : dest_Fixed;
1014 1010
1015 /* 1011 /*
1016 * Create MSI w/ dummy vCPU set targeting just one vCPU, overwritten 1012 * Create MSI w/ dummy vCPU set targeting just one vCPU, overwritten