lkml.org 
[lkml]   [1998]   [Apr]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
SubjectRe: Big problem with linux-2.0.33, gcc-2.8.0 and iopl()
Date
> I upgraded to gcc 2.8.0 and after a kernel recompilation,
> the X refused to startup -- Xserver core dumped! I traced the problem
> up to an outb() call. The problem is related with the iopl()
> call. After an iopl(3), any inb() causes a seg fault! The same inb()
> preceeded by an appropriate ioperm() works fine.

I had exactly the same problem after upgrading from gcc 2.7.2.3 to 2.8.1.
Also, the same bug caused weird SVGAlib coredumps (but not for all video
cards). Both coredumps were fairly reproducible; in fact, they were
unavoidable.
I sent a fix to linux-kernel, but it does not seem to come into 3.0.34pre6.
So, agian: the solution (for me) was to apply the following patch.


diff -urp linux-2.0.33/arch/i386/kernel/ioport.c linux/arch/i386/kernel/ioport.c
--- linux-2.0.33/arch/i386/kernel/ioport.c Wed Jan 11 22:10:53 1995
+++ linux/arch/i386/kernel/ioport.c Wed Apr 1 11:07:56 1998
@@ -76,7 +76,7 @@ unsigned int *stack;
asmlinkage int sys_iopl(long ebx,long ecx,long edx,
long esi, long edi, long ebp, long eax, long ds,
long es, long fs, long gs, long orig_eax,
- long eip,long cs,long eflags,long esp,long ss)
+ long eip,long cs,volatile long eflags,long esp,long ss)
{
unsigned int level = ebx;

The problem was that gcc-2.8.1 optimizes away the last assignment in
sys_iopl which prevents this function from having any effect (and IMHO
gcc does the rigth thing). The respective argument just should be volatile.

Regards,
Sergei

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu

\
 
 \ /
  Last update: 2005-03-22 13:42    [W:0.019 / U:0.152 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site