From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Message-Id: <20120205220953.271302918@pcw.home.local> Date: Sun, 05 Feb 2012 23:11:18 +0100 From: Willy Tarreau To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Luca Tettamanti , Massimo Dal Zotto , Jean Delvare , Greg KH Subject: [PATCH 89/91] i8k: Avoid lahf in 64-bit code In-Reply-To: <0635750f5f06ed2ca212b91fcb5c4483@local> Sender: linux-kernel-owner@vger.kernel.org List-ID: 2.6.27-longterm review patch. If anyone has any objections, please let us know. ------------------ commit bc1f419c76a2d6450413ce4349f4e4a07be011d5 upstream. 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 Reported-by: Jeff Rickman Tested-by: Jeff Rickman Tested-by: Harry G McGavran Jr Cc: Massimo Dal Zotto Signed-off-by: Jean Delvare Signed-off-by: Greg Kroah-Hartman --- drivers/char/i8k.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) Index: longterm-2.6.27/drivers/char/i8k.c =================================================================== --- longterm-2.6.27.orig/drivers/char/i8k.c 2012-02-05 22:34:47.136914619 +0100 +++ longterm-2.6.27/drivers/char/i8k.c 2012-02-05 22:34:47.574914836 +0100 @@ -138,8 +138,8 @@ "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)