linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* ioperm bitmap stuff for 2.4
@ 2003-05-17 18:12 Nuno Monteiro
  2003-05-17 18:50 ` Barry K. Nathan
  0 siblings, 1 reply; 2+ messages in thread
From: Nuno Monteiro @ 2003-05-17 18:12 UTC (permalink / raw)
  To: Linux Kernel ML

[-- Attachment #1: Type: text/plain, Size: 661 bytes --]

[ let's see if three is the charm, the two previous attempts didnt make 
it to the list... ]

Hi people,


Is the ioperm patch necessary in 2.4 also? The fix by Brian Gerst was 
commited to the 2.5 branch 
(http://marc.theaimsgroup.com/?l=bk-commits-head&m=105275597307968&w=2) 
some days ago, and as of yesterday vendors are starting to ship a similar 
fix to their kernels, so I suppose it is indeed necessary. What about the 
attached patch? It applies to both 2.4.20 and .21-rc2, please review.


(Please forgive me if this has been discussed before, I did a quick 
search of the lkml archives and couldnt find anything relevant to 2.4)



Cheers,

			Nuno

[-- Attachment #2: 2.4-042-ioperm-fix.patch --]
[-- Type: text/x-diff, Size: 783 bytes --]

--- linux-2.4.20-gw3/arch/i386/kernel/ioport.c	2003-05-16 23:42:47.000000000 +0100
+++ linux-2.4.20-gw4/arch/i386/kernel/ioport.c	2003-05-16 23:42:49.000000000 +0100
@@ -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_SIZE);
+		tss->bitmap = IO_BITMAP_OFFSET; /* Activate it in the TSS */
+	}
 
 	return 0;
 }

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: ioperm bitmap stuff for 2.4
  2003-05-17 18:12 ioperm bitmap stuff for 2.4 Nuno Monteiro
@ 2003-05-17 18:50 ` Barry K. Nathan
  0 siblings, 0 replies; 2+ messages in thread
From: Barry K. Nathan @ 2003-05-17 18:50 UTC (permalink / raw)
  To: Nuno Monteiro; +Cc: Linux Kernel ML

On Sat, May 17, 2003 at 07:12:18PM +0100, Nuno Monteiro wrote:
> [ let's see if three is the charm, the two previous attempts didnt make 
> it to the list... ]

Seems like it. :)

> Hi people,
> 
> 
> Is the ioperm patch necessary in 2.4 also? The fix by Brian Gerst was 
> commited to the 2.5 branch 
> (http://marc.theaimsgroup.com/?l=bk-commits-head&m=105275597307968&w=2) 
> some days ago, and as of yesterday vendors are starting to ship a similar 
> fix to their kernels, so I suppose it is indeed necessary. What about the 
> attached patch? It applies to both 2.4.20 and .21-rc2, please review.
> 
> 
> (Please forgive me if this has been discussed before, I did a quick 
> search of the lkml archives and couldnt find anything relevant to 2.4)

Yeah, I couldn't find any discussion of 2.4 either. So for my own
kernels I pulled a patch out of Red Hat's kernels, and it looks
*exactly* like your patch.

-Barry K. Nathan <barryn@pobox.com>

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2003-05-17 18:37 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-05-17 18:12 ioperm bitmap stuff for 2.4 Nuno Monteiro
2003-05-17 18:50 ` Barry K. Nathan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).