Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756646Ab1FPHGH (ORCPT ); Thu, 16 Jun 2011 03:06:07 -0400 Received: from out4.smtp.messagingengine.com ([66.111.4.28]:54716 "EHLO out4.smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756597Ab1FPHF6 (ORCPT ); Thu, 16 Jun 2011 03:05:58 -0400 X-Sasl-enc: 2VGh1i37TND4eswlcmDKX7NcI8Hc9B37SrDM3ORvI/dG 1308207958 X-Mailbox-Line: From gregkh@clark.kroah.org Wed Jun 15 17:16:13 2011 Message-Id: <20110616001613.251602035@clark.kroah.org> User-Agent: quilt/0.48-16.4 Date: Wed, 15 Jun 2011 17:15:37 -0700 From: Greg KH To: linux-kernel@vger.kernel.org, stable@kernel.org Cc: stable-review@kernel.org, torvalds@linux-foundation.org, akpm@linux-foundation.org, alan@lxorguk.ukuu.org.uk, Luca Tettamanti , Massimo Dal Zotto , Jean Delvare Subject: [40/91] i8k: Avoid lahf in 64-bit code In-Reply-To: <20110616001900.GA25375@kroah.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1408 Lines: 45 2.6.32-longterm review patch. If anyone has any objections, please let us know. ------------------ From: Luca Tettamanti 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 file changed, 2 insertions(+), 2 deletions(-) --- a/drivers/char/i8k.c +++ b/drivers/char/i8k.c @@ -138,8 +138,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) -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/