From: Avi Kivity Subject: [PATCH 08/15] KVM: x86 emulator: introduce Force64 for forcing operand size to 64 bits Date: Sun, 1 Aug 2010 17:23:26 +0300 Message-ID: <1280672613-14026-9-git-send-email-avi@redhat.com> References: <1280672613-14026-1-git-send-email-avi@redhat.com> To: kvm@vger.kernel.org, Marcelo Tosatti Return-path: Received: from mx1.redhat.com ([209.132.183.28]:16877 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756136Ab0HAOXi (ORCPT ); Sun, 1 Aug 2010 10:23:38 -0400 Received: from int-mx03.intmail.prod.int.phx2.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.16]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o71ENbTK027286 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Sun, 1 Aug 2010 10:23:38 -0400 Received: from cleopatra.tlv.redhat.com (cleopatra.tlv.redhat.com [10.35.255.11]) by int-mx03.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o71ENalY002388 for ; Sun, 1 Aug 2010 10:23:37 -0400 In-Reply-To: <1280672613-14026-1-git-send-email-avi@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: Signed-off-by: Avi Kivity --- arch/x86/kvm/emulate.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c index a114fa9..d7d95de 100644 --- a/arch/x86/kvm/emulate.c +++ b/arch/x86/kvm/emulate.c @@ -83,6 +83,7 @@ #define Group (1<<14) /* Bits 3:5 of modrm byte extend opcode */ #define GroupDual (1<<15) /* Alternate decoding of mod == 3 */ /* Misc flags */ +#define Force64 (1<<24) /* Force operand size to 64 bits in 64-bit mode */ #define Undefined (1<<25) /* No Such Instruction */ #define Lock (1<<26) /* lock prefix is allowed for the instruction */ #define Priv (1<<27) /* instruction generates #GP if current CPL != 0 */ @@ -2398,7 +2399,7 @@ done_prefixes: return -1; } - if (mode == X86EMUL_MODE_PROT64 && (c->d & Stack)) + if (mode == X86EMUL_MODE_PROT64 && (c->d & (Stack | Force64))) c->op_bytes = 8; /* ModRM and SIB bytes. */ -- 1.7.1