diff options
author | Luca Tettamanti <kronos.it@gmail.com> | 2011-05-25 14:43:31 -0400 |
---|---|---|
committer | Jean Delvare <khali@endymion.delvare> | 2011-05-25 14:43:31 -0400 |
commit | bc1f419c76a2d6450413ce4349f4e4a07be011d5 (patch) | |
tree | b89b92a6eca16ddd70336da9e26659b6b2414a90 /drivers/char | |
parent | 4a7df24ddc7097cd789a7527187826552ea0765e (diff) |
i8k: Avoid lahf in 64-bit code
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@gmail.com>
Reported-by: Jeff Rickman <jrickman@myamigos.us>
Tested-by: Jeff Rickman <jrickman@myamigos.us>
Tested-by: Harry G McGavran Jr <w5pny@arrl.net>
Cc: stable@kernel.org
Cc: Massimo Dal Zotto <dz@debian.org>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
Diffstat (limited to 'drivers/char')
-rw-r--r-- | drivers/char/i8k.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/char/i8k.c b/drivers/char/i8k.c index d72433f2d310..ee017166545e 100644 --- a/drivers/char/i8k.c +++ b/drivers/char/i8k.c | |||
@@ -139,8 +139,8 @@ static int i8k_smm(struct smm_regs *regs) | |||
139 | "movl %%edi,20(%%rax)\n\t" | 139 | "movl %%edi,20(%%rax)\n\t" |
140 | "popq %%rdx\n\t" | 140 | "popq %%rdx\n\t" |
141 | "movl %%edx,0(%%rax)\n\t" | 141 | "movl %%edx,0(%%rax)\n\t" |
142 | "lahf\n\t" | 142 | "pushfq\n\t" |
143 | "shrl $8,%%eax\n\t" | 143 | "popq %%rax\n\t" |
144 | "andl $1,%%eax\n" | 144 | "andl $1,%%eax\n" |
145 | :"=a"(rc) | 145 | :"=a"(rc) |
146 | : "a"(regs) | 146 | : "a"(regs) |