patch-2.4.21 linux-2.4.21/arch/i386/kernel/ioport.c

Next file: linux-2.4.21/arch/i386/kernel/microcode.c
Previous file: linux-2.4.21/arch/i386/kernel/io_apic.c
Back to the patch index
Back to the overall index

diff -urN linux-2.4.20/arch/i386/kernel/ioport.c linux-2.4.21/arch/i386/kernel/ioport.c
@@ -72,17 +72,18 @@
 		 */
 		memset(t->io_bitmap,0xff,(IO_BITMAP_SIZE+1)*4);
 		t->ioperm = 1;
-		/*
-		 * this activates it in the TSS
-		 */
-		tss->bitmap = IO_BITMAP_OFFSET;
 	}
 
 	/*
 	 * do it in the per-thread copy and in the TSS ...
 	 */
 	set_bitmap(t->io_bitmap, from, num, !turn_on);
-	set_bitmap(tss->io_bitmap, from, num, !turn_on);
+	if (tss->bitmap == IO_BITMAP_OFFSET) { /* already active? */
+		set_bitmap(tss->io_bitmap, from, num, !turn_on);
+	} else {
+		memcpy(tss->io_bitmap, t->io_bitmap, IO_BITMAP_BYTES);
+		tss->bitmap = IO_BITMAP_OFFSET; /* Activate it in the TSS */
+	}
 
 	return 0;
 }

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)