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:55:57 +0200 Message-ID: <46F2C23D.1070909@qumranet.com> References: <46EF99C1.4070801@bull.net> <11903005973031-git-send-email-Laurent.Vivier@bull.net> <46F2B129.9060603@qumranet.com> <46F2BAD9.1080209@bull.net> <46F2BB21.2080209@qumranet.com> <46F2C053.90207@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: <46F2C053.90207-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: >>> >>> 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. > > OK > >> Looking a bit more, eflags is already present in x86_emulate_ctxt (and > > OK, I think we can do the same thing with cr2 ? > For the present, yes. For the future, cr2 should be killed off since it's wrong to depend on it: sometimes we emulate not in response to a page fault, so we don't have a cr2, and sometimes, when the access crosses a page boundary, cr2 may point at the second half of the access instead of the correct location. I already fixed most of the uses of cr2, but I think some remain (mov abs is one example). -- 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/