From patchwork Sun Apr 5 13:59:23 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gleb Natapov X-Patchwork-Id: 16431 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n35DxSHo007194 for ; Sun, 5 Apr 2009 13:59:28 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755302AbZDEN71 (ORCPT ); Sun, 5 Apr 2009 09:59:27 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1755296AbZDEN71 (ORCPT ); Sun, 5 Apr 2009 09:59:27 -0400 Received: from mx2.redhat.com ([66.187.237.31]:37593 "EHLO mx2.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755194AbZDEN70 (ORCPT ); Sun, 5 Apr 2009 09:59:26 -0400 Received: from int-mx2.corp.redhat.com (int-mx2.corp.redhat.com [172.16.27.26]) by mx2.redhat.com (8.13.8/8.13.8) with ESMTP id n35DxPbx011008 for ; Sun, 5 Apr 2009 09:59:25 -0400 Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx2.corp.redhat.com (8.13.1/8.13.1) with ESMTP id n35DxQJN002151; Sun, 5 Apr 2009 09:59:26 -0400 Received: from dhcp-1-237.tlv.redhat.com (dhcp-1-237.tlv.redhat.com [10.35.1.237]) by ns3.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id n35DxOpG028869; Sun, 5 Apr 2009 09:59:24 -0400 Received: from trex.usersys.redhat.com (localhost [127.0.0.1]) by dhcp-1-237.tlv.redhat.com (Postfix) with ESMTP id B58C118D41F; Sun, 5 Apr 2009 16:59:23 +0300 (IDT) From: Gleb Natapov Subject: [PATCH 5/9] Complete decoding of call near in decode stage. To: avi@redhat.com Cc: kvm@vger.kernel.org Date: Sun, 05 Apr 2009 16:59:23 +0300 Message-ID: <20090405135923.3014.90777.stgit@trex.usersys.redhat.com> In-Reply-To: <20090405135902.3014.62767.stgit@trex.usersys.redhat.com> References: <20090405135902.3014.62767.stgit@trex.usersys.redhat.com> User-Agent: StGIT/0.14.2 MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.58 on 172.16.27.26 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org Signed-off-by: Gleb Natapov --- arch/x86/kvm/x86_emulate.c | 15 ++------------- 1 files changed, 2 insertions(+), 13 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/arch/x86/kvm/x86_emulate.c b/arch/x86/kvm/x86_emulate.c index 1790933..3c23af0 100644 --- a/arch/x86/kvm/x86_emulate.c +++ b/arch/x86/kvm/x86_emulate.c @@ -196,7 +196,7 @@ static u32 opcode_table[256] = { SrcNone | ByteOp | ImplicitOps, SrcNone | ImplicitOps, SrcNone | ByteOp | ImplicitOps, SrcNone | ImplicitOps, /* 0xE8 - 0xEF */ - ImplicitOps | Stack, SrcImm | ImplicitOps, + SrcImm | ImplicitOps | Stack, SrcImm | ImplicitOps, SrcImm | Src2Imm16 | ImplicitOps, SrcImmByte | ImplicitOps, SrcNone | ByteOp | ImplicitOps, SrcNone | ImplicitOps, SrcNone | ByteOp | ImplicitOps, SrcNone | ImplicitOps, @@ -1789,18 +1789,7 @@ special_insn: io_dir_in = 0; goto do_io; case 0xe8: /* call (near) */ { - long int rel; - switch (c->op_bytes) { - case 2: - rel = insn_fetch(s16, 2, c->eip); - break; - case 4: - rel = insn_fetch(s32, 4, c->eip); - break; - default: - DPRINTF("Call: Invalid op_bytes\n"); - goto cannot_emulate; - } + long int rel = c->src.val; c->src.val = (unsigned long) c->eip; jmp_rel(c, rel); emulate_push(ctxt);