This is a note to let you know that I've just added the patch titled
i8k: Tell gcc that *regs gets clobbered
to the 2.6.33-longterm tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/longterm/longterm-queue-2.6.33.git;a=summary
The filename of the patch is:
i8k-tell-gcc-that-regs-gets-clobbered.patch
and it can be found in the queue-2.6.33 subdirectory.
If you, or anyone else, feels it should not be added to the 2.6.33 longterm
tree,
please let <[email protected]> know about it.
>From 6b4e81db2552bad04100e7d5ddeed7e848f53b48 Mon Sep 17 00:00:00 2001
From: Jim Bos <[email protected]>
Date: Sat, 13 Nov 2010 12:13:53 +0100
Subject: i8k: Tell gcc that *regs gets clobbered
From: Jim Bos <[email protected]>
commit 6b4e81db2552bad04100e7d5ddeed7e848f53b48 upstream.
More recent GCC caused the i8k driver to stop working, on Slackware
compiler was upgraded from gcc-4.4.4 to gcc-4.5.1 after which it didn't
work anymore, meaning the driver didn't load or gave total nonsensical
output.
As it turned out the asm(..) statement forgot to mention it modifies the
*regs variable.
Credits to Andi Kleen and Andreas Schwab for providing the fix.
Signed-off-by: Jim Bos <[email protected]>
Cc: Andi Kleen <[email protected]>
Cc: Andreas Schwab <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
---
drivers/char/i8k.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
--- a/drivers/char/i8k.c
+++ b/drivers/char/i8k.c
@@ -141,7 +141,7 @@ static int i8k_smm(struct smm_regs *regs
"lahf\n\t"
"shrl $8,%%eax\n\t"
"andl $1,%%eax\n"
- :"=a"(rc)
+ :"=a"(rc), "+m" (*regs)
: "a"(regs)
: "%ebx", "%ecx", "%edx", "%esi", "%edi", "memory");
#else
@@ -166,7 +166,8 @@ static int i8k_smm(struct smm_regs *regs
"movl %%edx,0(%%eax)\n\t"
"lahf\n\t"
"shrl $8,%%eax\n\t"
- "andl $1,%%eax\n":"=a"(rc)
+ "andl $1,%%eax\n"
+ :"=a"(rc), "+m" (*regs)
: "a"(regs)
: "%ebx", "%ecx", "%edx", "%esi", "%edi", "memory");
#endif
Patches currently in longterm-queue-2.6.33 which might be from [email protected]
are
/home/gregkh/linux/longterm/longterm-queue-2.6.33/queue-2.6.33/fix-gcc-4.5.1-miscompiling-drivers-char-i8k.c-again.patch
/home/gregkh/linux/longterm/longterm-queue-2.6.33/queue-2.6.33/i8k-tell-gcc-that-regs-gets-clobbered.patch
_______________________________________________
stable mailing list
[email protected]
http://linux.kernel.org/mailman/listinfo/stable