All the mail mirrored from lore.kernel.org
 help / color / mirror / Atom feed
From: "Andreas Färber" <afaerber@suse.de>
To: Peter Crosthwaite <peter.crosthwaite@xilinx.com>,
	Peter Crosthwaite <crosthwaitepeter@gmail.com>
Cc: "qemu-devel@nongnu.org Developers" <qemu-devel@nongnu.org>,
	Richard Henderson <rth@twiddle.net>,
	Eduardo Habkost <ehabkost@redhat.com>,
	Aurelien Jarno <aurelien@aurel32.net>,
	Peter Crosthwaite <crosthwaite.peter@gmail.com>
Subject: Re: [Qemu-devel] [PATCH v3 8/8] cpu-exec: Purge all uses of ENV_GET_CPU()
Date: Wed, 24 Jun 2015 19:32:17 +0200	[thread overview]
Message-ID: <558AE9A1.3020005@suse.de> (raw)
In-Reply-To: <CAEgOgz7BUe68xG=8hY8v+pSy6JatWo=FG-uxtESFau5D7gx3Lg@mail.gmail.com>

Am 24.06.2015 um 04:10 schrieb Peter Crosthwaite:
> On Thu, Jun 18, 2015 at 10:24 AM, Peter Crosthwaite
> <crosthwaitepeter@gmail.com> 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 <crosthwaite.peter@gmail.com>
> 
> 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 = 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 = cpu_sparc_exec (env);
>> +        trapnr = cpu_sparc_exec(cs);
>>
>>          switch (trapnr) {
>>  #ifndef TARGET_SPARC64
[snip]

-- 
SUSE Linux GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Felix Imendörffer, Jane Smithard, Dilip Upmanyu, Graham Norton; HRB
21284 (AG Nürnberg)

  reply	other threads:[~2015-06-24 17:32 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-18 17:24 [Qemu-devel] [PATCH v3 0/8] More core code ENV_GET_CPU removals Peter Crosthwaite
2015-06-18 17:24 ` [Qemu-devel] [PATCH v3 1/8] cpus: Add Error argument to cpu_exec_init() Peter Crosthwaite
2015-06-18 17:24 ` [Qemu-devel] [PATCH v3 2/8] cpus: Convert cpu_index into a bitmap Peter Crosthwaite
2015-07-02 15:45   ` Andreas Färber
2015-06-18 17:24 ` [Qemu-devel] [PATCH v3 3/8] ppc: Move cpu_exec_init() call to realize function Peter Crosthwaite
2015-06-18 17:24 ` [Qemu-devel] [PATCH v3 4/8] translate-all: Change tb_flush() env argument to cpu Peter Crosthwaite
2015-06-18 17:24 ` [Qemu-devel] [PATCH v3 5/8] gdbserver: _fork: Change fn to accept cpu instead of env Peter Crosthwaite
2015-06-18 19:23   ` Eduardo Habkost
2015-06-18 17:24 ` [Qemu-devel] [PATCH v3 6/8] cpus: Change tcg_cpu_exec arg to cpu, not env Peter Crosthwaite
2015-06-18 19:30   ` Eduardo Habkost
2015-06-18 17:24 ` [Qemu-devel] [PATCH v3 7/8] cpus: Change exec_init() " Peter Crosthwaite
2015-06-18 19:35   ` Eduardo Habkost
2015-06-24  2:09     ` Peter Crosthwaite
2015-06-18 17:24 ` [Qemu-devel] [PATCH v3 8/8] cpu-exec: Purge all uses of ENV_GET_CPU() Peter Crosthwaite
2015-06-24  2:10   ` Peter Crosthwaite
2015-06-24 17:32     ` Andreas Färber [this message]
2015-06-24 17:50       ` Peter Crosthwaite
2015-06-25 16:15       ` Andreas Färber
2015-06-18 19:22 ` [Qemu-devel] [PATCH v3 0/8] More core code ENV_GET_CPU removals Eduardo Habkost

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=558AE9A1.3020005@suse.de \
    --to=afaerber@suse.de \
    --cc=aurelien@aurel32.net \
    --cc=crosthwaite.peter@gmail.com \
    --cc=crosthwaitepeter@gmail.com \
    --cc=ehabkost@redhat.com \
    --cc=peter.crosthwaite@xilinx.com \
    --cc=qemu-devel@nongnu.org \
    --cc=rth@twiddle.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.