]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blame - releases/2.6.38.8/i8k-avoid-lahf-in-64-bit-code.patch
Fixes for 4.19
[thirdparty/kernel/stable-queue.git] / releases / 2.6.38.8 / i8k-avoid-lahf-in-64-bit-code.patch
CommitLineData
9e44e803
GKH
1From bc1f419c76a2d6450413ce4349f4e4a07be011d5 Mon Sep 17 00:00:00 2001
2From: Luca Tettamanti <kronos.it@gmail.com>
3Date: Wed, 25 May 2011 20:43:31 +0200
4Subject: i8k: Avoid lahf in 64-bit code
5
6From: Luca Tettamanti <kronos.it@gmail.com>
7
8commit bc1f419c76a2d6450413ce4349f4e4a07be011d5 upstream.
9
10i8k uses lahf to read the flag register in 64-bit code; early x86-64
11CPUs, however, lack this instruction and we get an invalid opcode
12exception at runtime.
13Use pushf to load the flag register into the stack instead.
14
15Signed-off-by: Luca Tettamanti <kronos.it@gmail.com>
16Reported-by: Jeff Rickman <jrickman@myamigos.us>
17Tested-by: Jeff Rickman <jrickman@myamigos.us>
18Tested-by: Harry G McGavran Jr <w5pny@arrl.net>
19Cc: Massimo Dal Zotto <dz@debian.org>
20Signed-off-by: Jean Delvare <khali@linux-fr.org>
21Signed-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)