From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: Re: [PATCH] move grp decoding to functions to make x86_emulate_insn() clearer Date: Thu, 20 Sep 2007 20:25:37 +0200 Message-ID: <46F2BB21.2080209@qumranet.com> References: <46EF99C1.4070801@bull.net> <11903005973031-git-send-email-Laurent.Vivier@bull.net> <46F2B129.9060603@qumranet.com> <46F2BAD9.1080209@bull.net> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Cc: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org To: Laurent Vivier Return-path: In-Reply-To: <46F2BAD9.1080209-6ktuUTfB/bM@public.gmane.org> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: kvm-devel-bounces-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org Errors-To: kvm-devel-bounces-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org List-Id: kvm.vger.kernel.org Laurent Vivier wrote: > Avi Kivity wrote: >> Laurent Vivier wrote: >>> To improve readability, move push, writeback, and grp 1a/2/3/4/5 >>> emulation parts to functions. >>> +static inline int emulate_grp45(struct x86_emulate_ctxt *ctxt, >>> + struct x86_emulate_ops *ops, >>> + unsigned long *_eflags, >>> + int *no_wb) >>> >> >> If you move _eflags and no_wb to the decode cache (in a separate >> patch) then this patch can be much nicer. > > I agree but this increases the size of the structure shared with the > userspace with variable used only locally in x86_emulate.c, is it > acceptable ? > It isn't shared with userspace, just part of the vcpu. Looking a bit more, eflags is already present in x86_emulate_ctxt (and could be moved from there), and no_wb can be merged into opcode_table and twobyte_opcode_table, so long term there is no size change. -- Any sufficiently difficult bug is indistinguishable from a feature. ------------------------------------------------------------------------- This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2005. http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/