rpms/kernel/F-8 linux-2.6-x86-Reserve-FIRST_DEVICE_VECTOR-in-used_vectors-bit.patch, NONE, 1.1 kernel.spec, 1.552, 1.553

Chuck Ebbert cebbert at fedoraproject.org
Mon Oct 13 18:56:51 UTC 2008


Author: cebbert

Update of /cvs/pkgs/rpms/kernel/F-8
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv27651

Modified Files:
	kernel.spec 
Added Files:
	linux-2.6-x86-Reserve-FIRST_DEVICE_VECTOR-in-used_vectors-bit.patch 
Log Message:
x86: Reserve FIRST_DEVICE_VECTOR in used_vectors bitmap.

linux-2.6-x86-Reserve-FIRST_DEVICE_VECTOR-in-used_vectors-bit.patch:

--- NEW FILE linux-2.6-x86-Reserve-FIRST_DEVICE_VECTOR-in-used_vectors-bit.patch ---
>From a272a28f520c58a84853e098b4ee565486ca5062 Mon Sep 17 00:00:00 2001
From: Stefan Bader <stefan.bader at canonical.com>
Date: Sat, 27 Sep 2008 11:07:30 -0400
Subject: [PATCH] x86: Reserve FIRST_DEVICE_VECTOR in used_vectors bitmap.

Someone from the community found out, that after repeatedly unloading and
loading a device driver that uses MSI IRQs, the system eventually assigned
the vector initially reserved for IRQ0 to the device driver.

The reason for this is, that although IRQ0 is tied to the FIRST_DEVICE_VECTOR
when declaring the irq_vector table, the corresponding bit in the used_vectors
map is not set. So, if vectors are released and assigned often enough, the
vector will get assigned to another interrupt. This happens more often with
MSI interrupts as those are exclusively using a vector.

Fix this by setting the bit for the FIRST_DEVICE_VECTOR in the bitmap.

[Note that this is a special case, as there will be no upstream 
commit to tag with Cc: <stable at kernel.org>, because this bug got 
eliminated via not backportable means: APIC code unification.]

Acked-by: Ingo Molnar <mingo at elte.hu>
Signed-off-by: Stefan Bader <stefan.bader at canonical.com>
---
 arch/x86/kernel/io_apic_32.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/arch/x86/kernel/io_apic_32.c b/arch/x86/kernel/io_apic_32.c
index 09cddb5..bfd9fc5 100644
--- a/arch/x86/kernel/io_apic_32.c
+++ b/arch/x86/kernel/io_apic_32.c
@@ -2314,6 +2314,9 @@ void __init setup_IO_APIC(void)
 	for (i = first_system_vector; i < NR_VECTORS; i++)
 		set_bit(i, used_vectors);
 
+	/* Mark FIRST_DEVICE_VECTOR which is assigned to IRQ0 as used. */
+	set_bit(FIRST_DEVICE_VECTOR, used_vectors);
+
 	enable_IO_APIC();
 
 	io_apic_irqs = ~PIC_IRQS;
-- 
1.5.4.3



Index: kernel.spec
===================================================================
RCS file: /cvs/pkgs/rpms/kernel/F-8/kernel.spec,v
retrieving revision 1.552
retrieving revision 1.553
diff -u -r1.552 -r1.553
--- kernel.spec	13 Oct 2008 18:51:38 -0000	1.552
+++ kernel.spec	13 Oct 2008 18:56:21 -0000	1.553
@@ -591,6 +591,7 @@
 Patch100: linux-2.6-x86-pci-detect-end_bus_number.patch
 Patch102: linux-2.6-x86-improve-up-kernel-when-cpu-hotplug-and-smp.patch
 Patch103: linux-2.6-x86-avoid-dereferencing-beyond-stack-THREAD_SIZE.patch
+Patch104: linux-2.6-x86-Reserve-FIRST_DEVICE_VECTOR-in-used_vectors-bit.patch
 
 Patch120: linux-2.6-pci-disable-aspm-per-acpi-fadt-setting.patch
 Patch121: linux-2.6-pci-disable-aspm-on-pre-1.1-devices.patch
@@ -1044,6 +1045,8 @@
 ApplyPatch linux-2.6-x86-improve-up-kernel-when-cpu-hotplug-and-smp.patch
 # fix oops in get_wchan()
 ApplyPatch linux-2.6-x86-avoid-dereferencing-beyond-stack-THREAD_SIZE.patch
+# reserve first device vector on x86-32
+ApplyPatch linux-2.6-x86-Reserve-FIRST_DEVICE_VECTOR-in-used_vectors-bit.patch
 
 # disable ASPM on devices that don't support it
 ApplyPatch linux-2.6-pci-disable-aspm-per-acpi-fadt-setting.patch
@@ -1868,6 +1871,9 @@
 
 
 %changelog
+* Mon Oct 13 2008 Chuck Ebbert <cebbert at redhat.com> 2.6.26.6-43
+- x86: Reserve FIRST_DEVICE_VECTOR in used_vectors bitmap.
+
 * Mon Oct 13 2008 Chuck Ebbert <cebbert at redhat.com> 2.6.26.6-42
 - libata: pata_marvell: use the upstream patch for playing nice with ahci
 




More information about the scm-commits mailing list