From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49275) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YzUzt-0001Lu-Hj for qemu-devel@nongnu.org; Mon, 01 Jun 2015 15:03:42 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YzUzo-0002Ku-F4 for qemu-devel@nongnu.org; Mon, 01 Jun 2015 15:03:41 -0400 Received: from mail-qk0-x236.google.com ([2607:f8b0:400d:c09::236]:35730) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YzUzo-0002Ko-Bs for qemu-devel@nongnu.org; Mon, 01 Jun 2015 15:03:36 -0400 Received: by qkhq76 with SMTP id q76so60501572qkh.2 for ; Mon, 01 Jun 2015 12:03:36 -0700 (PDT) Sender: Richard Henderson Message-ID: <556CAC83.4080906@twiddle.net> Date: Mon, 01 Jun 2015 12:03:31 -0700 From: Richard Henderson MIME-Version: 1.0 References: In-Reply-To: Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [RFC v2 02/34] cpu-exec: Purge all uses of CPU_GET_ENV List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Crosthwaite , qemu-devel@nongnu.org Cc: edgar.iglesias@gmail.com, Peter Crosthwaite , pbonzini@redhat.com, afaerber@suse.de, peter.maydell@linaro.org On 05/30/2015 11:11 PM, Peter Crosthwaite wrote: > Remove un-needed usages of CPU_GET_ENV by converting the APIs to use > CPUState pointers and retrieving the env_ptr as minimally needed. > > FIXME: apply target-foo change pattern to all archs. Yes, please. > #ifdef TARGET_I386 > X86CPU *x86_cpu = X86_CPU(cpu); > + CPUArchState *env = (CPUArchState *)cpu->env_ptr; > #endif CPUArchState *env = &x86_cpu.env; > #ifdef TARGET_I386 > + env = cpu->env_ptr; > x86_cpu = X86_CPU(cpu); > #endif Likewise. Or, indeed, it might be worth propagating away "env" entirely, so you don't have to reload it here at the end of the setjmp. Otherwise this starter patch looks good. r~