[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20110727214823.BF1732403FF@tassilo.jf.intel.com>
Date: Wed, 27 Jul 2011 14:48:23 -0700 (PDT)
From: Andi Kleen <andi@...stfloor.org>
To: kronos.it@...il.com, jrickman@...migos.us, w5pny@...l.net,
dz@...ian.org, khali@...ux-fr.org, gregkh@...e.de,
ak@...ux.intel.com, linux-kernel@...r.kernel.org,
stable@...nel.org, tim.bird@...sony.com
Subject: [PATCH] [25/99] i8k: Avoid lahf in 64-bit code
2.6.35-longterm review patch. If anyone has any objections, please let me know.
------------------
From: Luca Tettamanti <kronos.it@...il.com>
commit bc1f419c76a2d6450413ce4349f4e4a07be011d5 upstream.
i8k uses lahf to read the flag register in 64-bit code; early x86-64
CPUs, however, lack this instruction and we get an invalid opcode
exception at runtime.
Use pushf to load the flag register into the stack instead.
Signed-off-by: Luca Tettamanti <kronos.it@...il.com>
Reported-by: Jeff Rickman <jrickman@...migos.us>
Tested-by: Jeff Rickman <jrickman@...migos.us>
Tested-by: Harry G McGavran Jr <w5pny@...l.net>
Cc: Massimo Dal Zotto <dz@...ian.org>
Signed-off-by: Jean Delvare <khali@...ux-fr.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@...e.de>
Signed-off-by: Andi Kleen <ak@...ux.intel.com>
---
drivers/char/i8k.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
Index: linux-2.6.35.y/drivers/char/i8k.c
===================================================================
--- linux-2.6.35.y.orig/drivers/char/i8k.c
+++ linux-2.6.35.y/drivers/char/i8k.c
@@ -138,8 +138,8 @@ static int i8k_smm(struct smm_regs *regs
"movl %%edi,20(%%rax)\n\t"
"popq %%rdx\n\t"
"movl %%edx,0(%%rax)\n\t"
- "lahf\n\t"
- "shrl $8,%%eax\n\t"
+ "pushfq\n\t"
+ "popq %%rax\n\t"
"andl $1,%%eax\n"
:"=a"(rc)
: "a"(regs)
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists