From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56160) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z7ooN-0002ja-HZ for qemu-devel@nongnu.org; Wed, 24 Jun 2015 13:50:12 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z7ooK-0001AT-4z for qemu-devel@nongnu.org; Wed, 24 Jun 2015 13:50:11 -0400 Received: from mail-yk0-f171.google.com ([209.85.160.171]:35778) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z7ooK-00019c-11 for qemu-devel@nongnu.org; Wed, 24 Jun 2015 13:50:08 -0400 Received: by ykdy1 with SMTP id y1so27902265ykd.2 for ; Wed, 24 Jun 2015 10:50:07 -0700 (PDT) MIME-Version: 1.0 Sender: peter.crosthwaite@petalogix.com In-Reply-To: <558AE9A1.3020005@suse.de> References: <1434648295-30584-1-git-send-email-crosthwaite.peter@gmail.com> <1434648295-30584-9-git-send-email-crosthwaite.peter@gmail.com> <558AE9A1.3020005@suse.de> Date: Wed, 24 Jun 2015 10:50:07 -0700 Message-ID: From: Peter Crosthwaite Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH v3 8/8] cpu-exec: Purge all uses of ENV_GET_CPU() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: =?UTF-8?Q?Andreas_F=C3=A4rber?= Cc: Eduardo Habkost , Peter Crosthwaite , "qemu-devel@nongnu.org Developers" , Peter Crosthwaite , Aurelien Jarno , Richard Henderson On Wed, Jun 24, 2015 at 10:32 AM, Andreas F=C3=A4rber wr= ote: > Am 24.06.2015 um 04:10 schrieb Peter Crosthwaite: >> On Thu, Jun 18, 2015 at 10:24 AM, Peter Crosthwaite >> wrote: >>> Remove un-needed usages of ENV_GET_CPU() by converting the APIs to use >>> CPUState pointers and retrieving the env_ptr as minimally needed. >>> >>> Scripted conversion for target-* change: >>> >>> for I in target-*/cpu.h; do >>> sed -i \ >>> 's/\(^int cpu_[^_]*_exec(\)[^ ][^ ]* \*s);$/\1CPUState *cpu);/' \ >>> $I; >>> done >>> >>> Signed-off-by: Peter Crosthwaite >> >> Dropping this patch in v4 as no RBs yet. > > On a brief look this looks good to me, queued on qom-cpu-next for now. > > One comment inline. > > How good do we look after this? I spot 61 uses, with one bad one in > target-arm/helper.c. We are good. With the multi-arch series make changes, all remaining ENV_GET_CPU uses are in arch-obj multi-compiled common code, or user mode code. This series is a last of these ENV_GET_CPU patches (unless more get added). Regards, Peter Most of them in linux-user and softmmu headers, one > in cputlb.c which we had previously discussed with Paolo to be a > non-issue for multi-arch. > >>> --- >>> Changed since v2 (Aurelien review): >>> s/CPU_GET_ENV/ENV_GET_CPU/ >>> Changed since RFC v2 (RTH review): >>> Apply target-* change pattern to all arches. >>> Avoid use of cpu_ptr for X86 specifics >>> Add () to ENV_GET_CPU macros in commit message >>> Add BSD and Linux user needed changes >>> Add missing architecture changes >>> --- >>> bsd-user/main.c | 3 ++- >>> cpu-exec.c | 28 +++++++++++++--------------- >>> cpus.c | 3 +-- >>> linux-user/main.c | 28 ++++++++++++++-------------- >>> target-alpha/cpu.h | 2 +- >>> target-arm/cpu.h | 2 +- >>> target-cris/cpu.h | 2 +- >>> target-i386/cpu.h | 2 +- >>> target-lm32/cpu.h | 2 +- >>> target-m68k/cpu.h | 2 +- >>> target-microblaze/cpu.h | 2 +- >>> target-mips/cpu.h | 2 +- >>> target-moxie/cpu.h | 2 +- >>> target-openrisc/cpu.h | 2 +- >>> target-ppc/cpu.h | 2 +- >>> target-s390x/cpu.h | 2 +- >>> target-sh4/cpu.h | 2 +- >>> target-sparc/cpu.h | 2 +- >>> target-tricore/cpu.h | 2 +- >>> target-unicore32/cpu.h | 3 ++- >>> target-xtensa/cpu.h | 2 +- >>> 21 files changed, 48 insertions(+), 49 deletions(-) >>> >>> diff --git a/bsd-user/main.c b/bsd-user/main.c >>> index 45a1436..7196285 100644 >>> --- a/bsd-user/main.c >>> +++ b/bsd-user/main.c >>> @@ -166,6 +166,7 @@ static void set_idt(int n, unsigned int dpl) >>> >>> void cpu_loop(CPUX86State *env) >>> { >>> + CPUState *cs =3D CPU(x86_env_get_cpu(env)); > > An (unwritten?) convention has been to avoid double-casts by having an > explicit X86CPU *cpu variable. Will re-review the preceding patches for > the same nit. > > Regards, > Andreas > >>> int trapnr; >>> abi_ulong pc; >>> //target_siginfo_t info; >>> @@ -512,7 +513,7 @@ void cpu_loop(CPUSPARCState *env) >>> //target_siginfo_t info; >>> >>> while (1) { >>> - trapnr =3D cpu_sparc_exec (env); >>> + trapnr =3D cpu_sparc_exec(cs); >>> >>> switch (trapnr) { >>> #ifndef TARGET_SPARC64 > [snip] > > -- > SUSE Linux GmbH, Maxfeldstr. 5, 90409 N=C3=BCrnberg, Germany > GF: Felix Imend=C3=B6rffer, Jane Smithard, Dilip Upmanyu, Graham Norton; = HRB > 21284 (AG N=C3=BCrnberg) >