From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: Re: [Patch 6/7] RealMode: Adds support for mov seg, r (0x8e) instruction Date: Tue, 27 May 2008 13:12:23 +0300 Message-ID: <483BDE87.4000407@qumranet.com> References: <20080527084115.2b0cfae1@frecb000711.frec.bull.fr> <20080527101923.77e62e21@frecb000711.frec.bull.fr> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: "kvm@vger.kernel.org" , Anthony Liguori , Mohammed Gamal , "Kamble, Nitin A" , Marcelo Tosatti , laurent.vivier@bull.net, Alexander Graf To: Guillaume Thouvenin Return-path: Received: from il.qumranet.com ([212.179.150.194]:31782 "EHLO il.qumranet.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755974AbYE0KMZ (ORCPT ); Tue, 27 May 2008 06:12:25 -0400 In-Reply-To: <20080527101923.77e62e21@frecb000711.frec.bull.fr> Sender: kvm-owner@vger.kernel.org List-ID: Guillaume Thouvenin wrote: > Adds support for mov r, sreg (0x8c) instruction. > We also introduce a table called vcpu_sreg_table[] to avoid an > unreadable switch. This table is also used to emulate instruction 0X8c. > > > +/* > + * This table is used by instruction like Ox8c to avoid long ugly switch. > + * The order is important, index is given by c->modrm_reg. > + */ > +static u16 vcpu_sreg_table[] = { > + VCPU_SREG_ES, > + VCPU_SREG_CS, > + VCPU_SREG_SS, > + VCPU_SREG_DS, > + VCPU_SREG_FS, > + VCPU_SREG_GS, > +}; > + > > 'static u16' -> 'static const u8' Also, you can make the ordering explicit: static const u8 vcpu_sreg_table[] = { [0]: VCPU_SREG_ES, ... }; -- error compiling committee.c: too many arguments to function