From bb74c2db4d880914f1420bba00fa9e98ab23d7ec Mon Sep 17 00:00:00 2001 From: Alexander Motin Date: Mon, 15 Jun 2009 13:47:49 +0000 Subject: [PATCH] Forbid multi-vector MSI interrupt vectors migration to another CPU once allocated. MSI have strict vectors allocation requirements, which are not satisfied now during reallocation. This is not the best possible solution, but better then just broken, as it was. No objections: current@, arch@, jhb@ --- sys/amd64/amd64/msi.c | 2 ++ sys/i386/i386/msi.c | 2 ++ 2 files changed, 4 insertions(+) diff --git a/sys/amd64/amd64/msi.c b/sys/amd64/amd64/msi.c index b34d835d08ce..0583541859c4 100644 --- a/sys/amd64/amd64/msi.c +++ b/sys/amd64/amd64/msi.c @@ -210,6 +210,8 @@ msi_assign_cpu(struct intsrc *isrc, u_int apic_id) old_id = msi->msi_cpu; if (old_vector && old_id == apic_id) return; + if (old_vector && !msi->msi_msix && msi->msi_first->msi_count > 1) + return; /* Allocate IDT vector on this cpu. */ vector = apic_alloc_vector(apic_id, msi->msi_irq); if (vector == 0) diff --git a/sys/i386/i386/msi.c b/sys/i386/i386/msi.c index 8b18a10965bf..e42f3d15556e 100644 --- a/sys/i386/i386/msi.c +++ b/sys/i386/i386/msi.c @@ -210,6 +210,8 @@ msi_assign_cpu(struct intsrc *isrc, u_int apic_id) old_id = msi->msi_cpu; if (old_vector && old_id == apic_id) return; + if (old_vector && !msi->msi_msix && msi->msi_first->msi_count > 1) + return; /* Allocate IDT vector on this cpu. */ vector = apic_alloc_vector(apic_id, msi->msi_irq); if (vector == 0)