Skip to content

Commit bc1f419

Browse files
tettamantiJean Delvare
authored andcommitted
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>
1 parent 4a7df24 commit bc1f419

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

‎drivers/char/i8k.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,8 +139,8 @@ static int i8k_smm(struct smm_regs *regs)
139139
"movl %%edi,20(%%rax)\n\t"
140140
"popq %%rdx\n\t"
141141
"movl %%edx,0(%%rax)\n\t"
142-
"lahf\n\t"
143-
"shrl $8,%%eax\n\t"
142+
"pushfq\n\t"
143+
"popq %%rax\n\t"
144144
"andl $1,%%eax\n"
145145
:"=a"(rc)
146146
: "a"(regs)

0 commit comments

Comments
 (0)