Commit bc1f419c authored by Luca Tettamanti's avatar Luca Tettamanti Committed by Jean Delvare

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: default avatarLuca Tettamanti <kronos.it@gmail.com>
Reported-by: default avatarJeff Rickman <jrickman@myamigos.us>
Tested-by: default avatarJeff Rickman <jrickman@myamigos.us>
Tested-by: default avatarHarry G McGavran Jr <w5pny@arrl.net>
Cc: stable@kernel.org
Cc: Massimo Dal Zotto <dz@debian.org>
Signed-off-by: default avatarJean Delvare <khali@linux-fr.org>
parent 4a7df24d
......@@ -139,8 +139,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)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment