]>
Commit | Line | Data |
---|---|---|
9e44e803 GKH |
1 | From bc1f419c76a2d6450413ce4349f4e4a07be011d5 Mon Sep 17 00:00:00 2001 |
2 | From: Luca Tettamanti <kronos.it@gmail.com> | |
3 | Date: Wed, 25 May 2011 20:43:31 +0200 | |
4 | Subject: i8k: Avoid lahf in 64-bit code | |
5 | ||
6 | From: Luca Tettamanti <kronos.it@gmail.com> | |
7 | ||
8 | commit bc1f419c76a2d6450413ce4349f4e4a07be011d5 upstream. | |
9 | ||
10 | i8k uses lahf to read the flag register in 64-bit code; early x86-64 | |
11 | CPUs, however, lack this instruction and we get an invalid opcode | |
12 | exception at runtime. | |
13 | Use pushf to load the flag register into the stack instead. | |
14 | ||
15 | Signed-off-by: Luca Tettamanti <kronos.it@gmail.com> | |
16 | Reported-by: Jeff Rickman <jrickman@myamigos.us> | |
17 | Tested-by: Jeff Rickman <jrickman@myamigos.us> | |
18 | Tested-by: Harry G McGavran Jr <w5pny@arrl.net> | |
19 | Cc: Massimo Dal Zotto <dz@debian.org> | |
20 | Signed-off-by: Jean Delvare <khali@linux-fr.org> | |
21 | Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> | |
22 | ||
23 | --- | |
24 | drivers/char/i8k.c | 4 ++-- | |
25 | 1 file changed, 2 insertions(+), 2 deletions(-) | |
26 | ||
27 | --- a/drivers/char/i8k.c | |
28 | +++ b/drivers/char/i8k.c | |
29 | @@ -139,8 +139,8 @@ static int i8k_smm(struct smm_regs *regs | |
30 | "movl %%edi,20(%%rax)\n\t" | |
31 | "popq %%rdx\n\t" | |
32 | "movl %%edx,0(%%rax)\n\t" | |
33 | - "lahf\n\t" | |
34 | - "shrl $8,%%eax\n\t" | |
35 | + "pushfq\n\t" | |
36 | + "popq %%rax\n\t" | |
37 | "andl $1,%%eax\n" | |
38 | :"=a"(rc) | |
39 | : "a"(regs) |