[PATCH] Do not trap access to timer and keyboard

Samuel Thibault samuel.thibault at ens-lyon.org
Sun Oct 24 06:18:28 PDT 2010


Adam Jackson, le Fri 19 Mar 2010 14:29:55 -0400, a écrit :
> Well in that case, the ioperm() is definitely bogus on all platforms,
> since all it can do is make us crash.  But it indicates that the int10
> wrapper needs to do a better job of emulating those ports, since the
> kernel is definitely going to be using them.

Could we at least apply the patch below to fix mga-g450?

Samuel

commit 9d14b2727078837a2e4c8a9e61ec2ac0b39f008f
Author: Samuel Thibault <samuel.thibault at ens-lyon.org>
Date:   Sat Mar 13 01:49:47 2010 +0100

    Disable timer/keyboard trapping on GNU/Hurd for now
    
    Trapping disabled for now, as some VBIOSes (mga-g450 notably) use these
    ports, and the int10 wrapper is not emulating them.
    
    It's effectively what happens in the Linux variant too, as iopl() is used there,
    making the ioperm() meaningless.
    
    Signed-off-by: Olaf Buddenhagen <antrik at users.sf.net>
    Signed-off-by: Samuel Thibault <samuel.thibault at ens-lyon.org>

diff --git a/hw/xfree86/os-support/hurd/hurd_video.c b/hw/xfree86/os-support/hurd/hurd_video.c
index 4a99db3..ff4557f 100644
--- a/hw/xfree86/os-support/hurd/hurd_video.c
+++ b/hw/xfree86/os-support/hurd/hurd_video.c
@@ -124,8 +124,17 @@ xf86EnableIO()
 	FatalError("xf86EnableIO: ioperm() failed (%s)\n", strerror(errno));
 	return FALSE;
     }
+#if 0
+    /*
+     * Trapping disabled for now, as some VBIOSes (mga-g450 notably) use these
+     * ports, and the int10 wrapper is not emulating them. (Note that it's
+     * effectively what happens in the Linux variant too, as iopl() is used
+     * there, making the ioperm() meaningless.)
+     *
+     * Reenable this when int10 gets fixed.  */
     ioperm(0x40,4,0); /* trap access to the timer chip */
     ioperm(0x60,4,0); /* trap access to the keyboard controller */
+#endif
     return TRUE;
 }
 	
diff --git a/hw/xfree86/os-support/linux/lnx_video.c b/hw/xfree86/os-support/linux/lnx_video.c
index b97757c..39c728d 100644
--- a/hw/xfree86/os-support/linux/lnx_video.c
+++ b/hw/xfree86/os-support/linux/lnx_video.c
@@ -530,6 +530,8 @@ xf86EnableIO(void)
 		return FALSE;
         }
 # if !defined(__alpha__)
+	/* XXX: this is actually not trapping anything because of iopl(3)
+	 * above */
 	ioperm(0x40,4,0); /* trap access to the timer chip */
 	ioperm(0x60,4,0); /* trap access to the keyboard controller */
 # endif


More information about the xorg-devel mailing list