Bugzilla – Attachment 398908 Details for
Bug 625041
KVM/Xorg/fbdev: X segfaults on logout
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Forgot Password
[patch]
xf86-input-vmmouse-iopl-driver.diff
xf86-input-vmmouse-iopl-driver.diff (text/plain), 1.65 KB, created by
Stefan Dirsch
on 2010-11-07 21:21:25 UTC
(
hide
)
Description:
xf86-input-vmmouse-iopl-driver.diff
Filename:
MIME Type:
Creator:
Stefan Dirsch
Created:
2010-11-07 21:21:25 UTC
Size:
1.65 KB
patch
obsolete
>diff --git a/shared/vmmouse_proto.c b/shared/vmmouse_proto.c >index b50e071..08d471d 100644 >--- a/shared/vmmouse_proto.c >+++ b/shared/vmmouse_proto.c >@@ -33,6 +33,8 @@ > */ > > >+#include <stdio.h> >+#include <sys/io.h> > #include "vmmouse_proto.h" > > >@@ -119,6 +121,31 @@ VMMouseProtoInOut(VMMouseProtoCmd *cmd) // IN/OUT > #endif > } > >+/* >+ *----------------------------------------------------------------------------- >+ * >+ * VMMouseGetIOPL -- >+ * >+ * Helper to figure out the current I/O privilege level (idea by >+ * Jiri Kosina <jkosina@suse.cz>) >+ * >+ * Results: >+ * Returns I/O privilege level >+ * >+ * Side effects: >+ * None >+ * >+ *----------------------------------------------------------------------------- >+ */ >+ >+int >+VMMouseGetIOPL() >+{ >+ unsigned long eflags; >+ >+ asm ("pushf\n\tpop %0" : "=r" (eflags)); >+ return (eflags >> 12) & 3; >+} > > /* > *----------------------------------------------------------------------------- >@@ -140,8 +167,25 @@ VMMouseProtoInOut(VMMouseProtoCmd *cmd) // IN/OUT > void > VMMouseProto_SendCmd(VMMouseProtoCmd *cmd) // IN/OUT > { >+ int cpl; >+ > cmd->in.magic = VMMOUSE_PROTO_MAGIC; > cmd->in.port = VMMOUSE_PROTO_PORT; > >+#if defined __i386__ || defined __x86_64__ >+ cpl = VMMouseGetIOPL(); >+ fprintf(stderr, "Current I/O privilege level: %d", cpl); >+ /* >+ * To access i/o ports above 0x3ff, we need to be in iopl(3). >+ */ >+ fprintf(stderr, "Switching to I/O privilege level 3."); >+ iopl(3); >+#endif >+ > VMMouseProtoInOut(cmd); >+ >+#if defined __i386__ || defined __x86_64__ >+ fprintf(stderr, "Switching back to previous I/O privilege level %d.\n", cpl); >+ iopl(cpl); >+#endif > }
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
Actions:
View
|
Diff
Attachments on
bug 625041
:
378001
|
398872
|
398903
|
398904
| 398908 |
398913
|
398920
|
489411