From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: Re: [PATCH 1/3] KVM: x86 emulator: Make one byte instruction emulation separate Date: Thu, 10 Mar 2011 11:05:38 +0200 Message-ID: <4D789462.3020207@redhat.com> References: <20110310163519.9f4c9d69.yoshikawa.takuya@oss.ntt.co.jp> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: mtosatti@redhat.com, gleb@redhat.com, takuya.yoshikawa@gmail.com, kvm@vger.kernel.org To: Takuya Yoshikawa Return-path: Received: from mx1.redhat.com ([209.132.183.28]:56108 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752476Ab1CJJFq (ORCPT ); Thu, 10 Mar 2011 04:05:46 -0500 In-Reply-To: <20110310163519.9f4c9d69.yoshikawa.takuya@oss.ntt.co.jp> Sender: kvm-owner@vger.kernel.org List-ID: On 03/10/2011 09:35 AM, Takuya Yoshikawa wrote: > x86_emulate_insn() is too long and has many confusing goto statements. > > This patch is the first part of a work which tries to split it into > a few meaningful functions: just encapsulates the switch statement for > the one byte instruction emulation as emulate_onebyte_insn(). I, too, dislike the switch statements. So I started on a path to eliminate it completely - take a look at struct opcode::execute. If present, it is executed instead of the code in the switch statements. The plan is to migrate all of the contents of the switch statements into ->execute() callbacks. This way, all of the information about an instruction is present in the decode tables. -- error compiling committee.c: too many arguments to function