linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* gcc 4.5.1 / as 2.20.51.0.11 miscompiling  drivers/char/i8k.c ?
@ 2010-11-06 11:15 Jim
  2010-11-07 21:31 ` Andi Kleen
  0 siblings, 1 reply; 129+ messages in thread
From: Jim @ 2010-11-06 11:15 UTC (permalink / raw)
  To: Linux Kernel Mailing List


After upgrading my Dell laptop, both OS+kernel the i8k interface was giving
nonsensical output. As it turned out it's not the kernel but compiler
upgrade which broke this.

Guys at Archlinux have found the underlying cause (but don't seem to have
submitted a patch yet):
  https://bbs.archlinux.org/viewtopic.php?pid=780692#p780692
gcc seems to optimize the assembly statements away.

And indeed, applying this patch makes the i8k interface work again,
i.e. replacing the asm(..) construct by  asm volatile(..)

--- i8k.c.ORIG  2010-08-02 17:20:46.000000000 +0200
+++ i8k.c       2010-10-30 13:03:07.000000000 +0200
@@ -119,7 +119,7 @@
        int eax = regs->eax;

 #if defined(CONFIG_X86_64)
-       asm("pushq %%rax\n\t"
+       asm volatile("pushq %%rax\n\t"
                "movl 0(%%rax),%%edx\n\t"
                "pushq %%rdx\n\t"
                "movl 4(%%rax),%%ebx\n\t"
@@ -145,7 +145,7 @@
                :    "a"(regs)
                :    "%ebx", "%ecx", "%edx", "%esi", "%edi", "memory");
 #else
-       asm("pushl %%eax\n\t"
+       asm volatile("pushl %%eax\n\t"
            "movl 0(%%eax),%%edx\n\t"
            "push %%edx\n\t"
            "movl 4(%%eax),%%ebx\n\t"


gcc version:
Reading specs from /usr/lib/gcc/i486-slackware-linux/4.5.1/specs
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/i486-slackware-linux/4.5.1/lto-wrapper
Target: i486-slackware-linux
Configured with: ../gcc-4.5.1/configure --prefix=/usr --libdir=/usr/lib
--mandir=/usr/man --infodir=/usr/info --enable-shared --enable-bootstrap
--enable-languages=ada,c,c++,fortran,java,objc --enable-threads=posix
--enable-checking=release --with-system-zlib
--with-python-dir=/lib/python2.6/site-packages
--disable-libunwind-exceptions --enable-__cxa_atexit --enable-libssp
--with-gnu-ld --verbose --with-arch=i486 --target=i486-slackware-linux
--build=i486-slackware-linux --host=i486-slackware-linux
Thread model: posix
gcc version 4.5.1 (GCC)

as version:
GNU assembler (Linux/GNU Binutils) 2.20.51.0.11.20100810
Copyright 2010 Free Software Foundation, Inc.
This program is free software; you may redistribute it under the terms of
the GNU General Public License version 3 or later.
This program has absolutely no warranty.
This assembler was configured for a target of `i486-slackware-linux'.

I would be happy to submit a proper patch if I new this is actually the
correct fix, also there might be other places in the kernel source
suffering from this ??

Thanks,
  Jim Bos


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

end of thread, other threads:[~2011-06-14 18:07 UTC | newest]

Thread overview: 129+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-11-06 11:15 gcc 4.5.1 / as 2.20.51.0.11 miscompiling drivers/char/i8k.c ? Jim
2010-11-07 21:31 ` Andi Kleen
2010-11-07 22:41   ` Andreas Schwab
2010-11-07 23:03     ` Andi Kleen
2010-11-08 10:49       ` Richard Guenther
2010-11-08 11:20         ` Andi Kleen
2010-11-08 11:20           ` Richard Guenther
2010-11-08 11:47             ` Paul Koning
2010-11-08 11:53               ` Jakub Jelinek
2010-11-08 12:20           ` Michael Matz
2010-11-08 18:39           ` Dave Korn
2010-11-09 13:00             ` Michael Matz
2010-11-09 13:48               ` Andi Kleen
2010-11-09 13:57                 ` Andreas Schwab
2010-11-09 16:43                   ` Jim
2010-11-13 11:13                     ` [PATCH] i8k: Tell gcc that *regs gets clobbered Jim Bos
2010-11-15  0:52                     ` gcc 4.5.1 / as 2.20.51.0.11 miscompiling drivers/char/i8k.c ? James Cloos
2010-11-15  3:21                       ` Linus Torvalds
2010-11-15  8:56                         ` Jakub Jelinek
2010-11-15  9:12                           ` Andi Kleen
2010-11-15  9:20                           ` Jakub Jelinek
2010-11-15 10:03                           ` Jakub Jelinek
2010-11-15 10:54                             ` Andi Kleen
2010-11-15 11:16                               ` Jakub Jelinek
2010-11-15 11:37                                 ` Andi Kleen
2010-11-15 17:36                                   ` Jim Bos
2010-11-15 17:44                                     ` Jakub Jelinek
2010-11-15 18:17                                       ` Jim Bos
2010-11-15 18:26                                         ` Jakub Jelinek
2010-11-15 19:10                                           ` Jim Bos
2010-11-15 16:04                                 ` Linus Torvalds
2010-11-15 17:40                                   ` Jim Bos
2010-11-15 18:08                                     ` Linus Torvalds
2010-11-15 18:30                                       ` Jim Bos
2010-11-15 18:37                                         ` Jim Bos
2010-11-15 18:56                                         ` Linus Torvalds
2010-11-15 18:58                                         ` Jakub Jelinek
2010-11-15 19:12                                           ` Jakub Jelinek
2010-11-15 19:21                                             ` Linus Torvalds
2010-11-15 19:51                                               ` Jakub Jelinek
2010-11-15 20:22                                                 ` Jim Bos
2011-06-03 13:05                                                   ` 2.6.39.1 immediately reboots/resets on EFI system Jim Bos
2011-06-03 13:33                                                     ` Matthew Garrett
2011-06-03 14:26                                                       ` Jim Bos
2011-06-03 14:46                                                         ` Matthew Garrett
2011-06-05 10:40                                                           ` Jim Bos
2011-06-05 12:57                                                             ` Maarten Lankhorst
2011-06-06 15:01                                                           ` Maarten Lankhorst
2011-06-06 15:40                                                             ` Jim Bos
2011-06-06 15:44                                                             ` Matthew Garrett
2011-06-06 15:27                                                         ` Maarten Lankhorst
2011-06-06 16:11                                                           ` Jim Bos
2011-06-06 16:43                                                             ` Maarten Lankhorst
2011-06-07  0:19                                                               ` Yinghai Lu
2011-06-07  1:41                                                                 ` Matthew Garrett
2011-06-07  2:05                                                                   ` Yinghai Lu
2011-06-07  8:25                                                                     ` Maarten Lankhorst
2011-06-07 15:14                                                                       ` Yinghai Lu
2011-06-07  9:08                                                                     ` Maarten Lankhorst
2011-06-07 12:22                                                                       ` Maarten Lankhorst
2011-06-07 22:25                                                                         ` Yinghai Lu
2011-06-08 16:44                                                                           ` Jim Bos
2011-06-08 19:17                                                                             ` Yinghai Lu
2011-06-08 19:23                                                                               ` Matthew Garrett
2011-06-08 19:27                                                                                 ` Yinghai Lu
2011-06-08 19:29                                                                                   ` Matthew Garrett
2011-06-08 19:35                                                                                     ` Yinghai Lu
2011-06-08 19:38                                                                                       ` Matthew Garrett
2011-06-08 19:46                                                                                         ` Yinghai Lu
2011-06-08 19:52                                                                                           ` Matthew Garrett
2011-06-08 19:48                                                                                         ` Yinghai Lu
2011-06-08 19:52                                                                                           ` Matthew Garrett
2011-06-08 20:03                                                                                             ` Yinghai Lu
2011-06-08 20:09                                                                                               ` Matthew Garrett
2011-06-08 20:23                                                                                                 ` Yinghai Lu
2011-06-08 20:30                                                                                                   ` Matthew Garrett
2011-06-08 20:36                                                                                                     ` Yinghai Lu
2011-06-08 20:42                                                                                                       ` Matthew Garrett
2011-06-08 20:46                                                                                                         ` Yinghai Lu
2011-06-08 21:06                                                                                                           ` Matthew Garrett
2011-06-08 21:06                                                                                                         ` Linus Torvalds
2011-06-08 21:28                                                                                                           ` Matthew Garrett
2011-06-08 21:31                                                                                                             ` H. Peter Anvin
2011-06-08 21:36                                                                                                               ` Matthew Garrett
2011-06-08 21:31                                                                                                             ` Linus Torvalds
2011-06-08 21:42                                                                                                               ` Matthew Garrett
2011-06-08 21:51                                                                                                               ` H. Peter Anvin
2011-06-08 22:57                                                                                                                 ` Linus Torvalds
2011-06-08 23:54                                                                                                                   ` Maarten Lankhorst
2011-06-08 21:38                                                                                                             ` Yinghai Lu
2011-06-10 16:47                                                                       ` Matthew Garrett
2011-06-10 17:51                                                                         ` Maarten Lankhorst
2011-06-10 17:54                                                                           ` Matthew Garrett
2011-06-10 22:45                                                                             ` Maarten Lankhorst
2011-06-10 22:58                                                                               ` Yinghai Lu
2011-06-10 23:03                                                                                 ` Matthew Garrett
2011-06-10 23:17                                                                                   ` Greg KH
2011-06-10 23:22                                                                                     ` Maarten Lankhorst
2011-06-10 23:25                                                                                     ` H. Peter Anvin
2011-06-10 23:26                                                                                   ` Yinghai Lu
2011-06-10 23:32                                                                                     ` H. Peter Anvin
2011-06-10 23:55                                                                                       ` Yinghai Lu
2011-06-11  0:00                                                                                         ` H. Peter Anvin
2011-06-11  0:19                                                                                           ` Yinghai Lu
2011-06-14 18:06                                                                                             ` H. Peter Anvin
2011-06-11 15:29                                                                                     ` Matthew Garrett
2011-06-10 23:00                                                                               ` Yinghai Lu
2011-06-13 16:47                                                                               ` Matthew Garrett
2011-06-13 17:52                                                                                 ` Maarten Lankhorst
2011-06-13 18:00                                                                                   ` Matthew Garrett
2011-06-13 18:14                                                                                     ` Maarten Lankhorst
2011-06-13 18:17                                                                                       ` Matthew Garrett
2011-06-13 18:23                                                                                         ` Maarten Lankhorst
2011-06-13 18:33                                                                                           ` Matthew Garrett
2011-06-13 18:45                                                                                             ` Maarten Lankhorst
2011-06-14 14:34                                                                                             ` Maarten Lankhorst
2011-06-14 14:50                                                                                             ` Maarten Lankhorst
2011-06-14 14:55                                                                                               ` Matthew Garrett
2010-11-15 22:43                                                 ` gcc 4.5.1 / as 2.20.51.0.11 miscompiling drivers/char/i8k.c ? Andi Kleen
2010-11-15 22:46                                                   ` Jakub Jelinek
2010-11-15 19:53                                             ` Richard Henderson
2010-11-15 10:24                           ` Richard Guenther
2010-11-15 18:45         ` Jeff Law
2010-11-15 19:04           ` Linus Torvalds
2010-11-15 22:07           ` Richard Guenther
2010-11-15 22:58             ` Jeff Law
2010-11-15 23:07               ` Richard Guenther
2010-11-16  4:10                 ` Jeff Law
2010-11-15 18:42     ` Jeff Law

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).