From mboxrd@z Thu Jan 1 00:00:00 1970 From: Marcelo Tosatti Subject: Re: [PATCH 00/22] Direct decode in emulator Date: Fri, 30 Jul 2010 22:58:03 -0300 Message-ID: <20100731015803.GA12551@amt.cnet> References: <1280405515-22459-1-git-send-email-avi@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: kvm@vger.kernel.org To: Avi Kivity Return-path: Received: from mx1.redhat.com ([209.132.183.28]:25095 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754372Ab0GaD0F (ORCPT ); Fri, 30 Jul 2010 23:26:05 -0400 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o6V3Q3Bf022984 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Fri, 30 Jul 2010 23:26:03 -0400 Content-Disposition: inline In-Reply-To: <1280405515-22459-1-git-send-email-avi@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: On Thu, Jul 29, 2010 at 03:11:33PM +0300, Avi Kivity wrote: > Currently the emulator decoder is indirect in two ways: groups are looked up > in a separate table based on group number; and opcode execution is looked up > in a big switch (actually two) after the opcode flags lookup. > > This patchset converts groups to direct decode and begins the work for opcode > decode. > > The motivations are: > - reduce errors from discrepancies between the two tables (like we had for > IRET) > - make the code easier to read, removing many switch () statements > - eventually remove the #UD mini-decoder in x86.c by adding subgroup support > to the emulator > > Avi Kivity (22): > KVM: x86 emulator: drop parentheses in repreat macros > KVM: x86 emulator: introduce 'struct opcode' > KVM: x86 emulator: Add wrappers for easily defining opcodes > KVM: x86 emulator: move group tables to top > KVM: x86 emulator: reserve group code 0 > KVM: x86 emulator: allow specifying group directly in opcode > KVM: x86 emulator: convert group 1 to new style > KVM: x86 emulator: convert group 1A to new style > KVM: x86 emulator: convert group 3 to new style > KVM: x86 emulator: convert group 4 to new style > KVM: x86 emulator: convert group 5 to new style > KVM: x86 emulator: convert group 7 to new style > KVM: x86 emulator: convert group 8 to new style > KVM: x86 emulator: convert group 9 to new style > KVM: x86 emulator: drop support for old-style groups > KVM: x86 emulator: move ByteOp and Dst back to bits 0:3 > KVM: x86 emulator: store x86_emulate_ops in emulation context > KVM: x86 emulator: allow storing emulator execution function in > decode tables > KVM: x86 emulator: move x86_decode_insn() downwards > KVM: x86 emulator: move decode tables downwards > KVM: x86 emulator: allow repeat macro arguments to contain commas > KVM: x86 emulator: convert some push instructions to direct decode > > arch/x86/include/asm/kvm_emulate.h | 10 +- > arch/x86/kvm/emulate.c | 1253 +++++++++++++++++++----------------- > arch/x86/kvm/x86.c | 7 +- > 3 files changed, 661 insertions(+), 609 deletions(-) Applied, thanks.