From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50200) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z7oX9-0005jk-3o for qemu-devel@nongnu.org; Wed, 24 Jun 2015 13:32:24 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z7oX5-00010K-1w for qemu-devel@nongnu.org; Wed, 24 Jun 2015 13:32:22 -0400 Received: from cantor2.suse.de ([195.135.220.15]:47557 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z7oX4-00010C-No for qemu-devel@nongnu.org; Wed, 24 Jun 2015 13:32:18 -0400 Message-ID: <558AE9A1.3020005@suse.de> Date: Wed, 24 Jun 2015 19:32:17 +0200 From: =?UTF-8?B?QW5kcmVhcyBGw6RyYmVy?= MIME-Version: 1.0 References: <1434648295-30584-1-git-send-email-crosthwaite.peter@gmail.com> <1434648295-30584-9-git-send-email-crosthwaite.peter@gmail.com> In-Reply-To: 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: Peter Crosthwaite , Peter Crosthwaite Cc: "qemu-devel@nongnu.org Developers" , Richard Henderson , Eduardo Habkost , Aurelien Jarno , Peter Crosthwaite 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 >=20 > 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. 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] --=20 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)