All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alistair Francis <alistair23@gmail.com>
To: Richard Henderson <richard.henderson@linaro.org>
Cc: "qemu-devel@nongnu.org Developers" <qemu-devel@nongnu.org>
Subject: Re: [Qemu-devel] [PATCH v3 08/39] target/alpha: Use env_cpu, env_archcpu
Date: Thu, 9 May 2019 10:56:00 -0700	[thread overview]
Message-ID: <CAKmqyKP8Qgbzv3V=hq4zktd0bDs-EnXRS_p=t6agd=CT37pjkQ@mail.gmail.com> (raw)
In-Reply-To: <20190508000641.19090-9-richard.henderson@linaro.org>

On Tue, May 7, 2019 at 5:07 PM Richard Henderson
<richard.henderson@linaro.org> wrote:
>
> With exactly one exception, most uses of alpha_env_get_cpu
> were failures to use the more proper, ENV_GET_CPU macro,
> now replaced by env_cpu.
>
> Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>

Reviewed-by: Alistair Francis <alistair.francis@wdc.com>

Alistair

> ---
>  target/alpha/cpu.h          | 5 -----
>  linux-user/alpha/cpu_loop.c | 2 +-
>  target/alpha/helper.c       | 8 +++-----
>  target/alpha/sys_helper.c   | 8 ++++----
>  4 files changed, 8 insertions(+), 15 deletions(-)
>
> diff --git a/target/alpha/cpu.h b/target/alpha/cpu.h
> index 2c7f75f584..53c085f691 100644
> --- a/target/alpha/cpu.h
> +++ b/target/alpha/cpu.h
> @@ -273,11 +273,6 @@ struct AlphaCPU {
>      QEMUTimer *alarm_timer;
>  };
>
> -static inline AlphaCPU *alpha_env_get_cpu(CPUAlphaState *env)
> -{
> -    return container_of(env, AlphaCPU, env);
> -}
> -
>  #define ENV_OFFSET offsetof(AlphaCPU, env)
>
>  #ifndef CONFIG_USER_ONLY
> diff --git a/linux-user/alpha/cpu_loop.c b/linux-user/alpha/cpu_loop.c
> index 61992571e1..7a94eee84c 100644
> --- a/linux-user/alpha/cpu_loop.c
> +++ b/linux-user/alpha/cpu_loop.c
> @@ -23,7 +23,7 @@
>
>  void cpu_loop(CPUAlphaState *env)
>  {
> -    CPUState *cs = CPU(alpha_env_get_cpu(env));
> +    CPUState *cs = env_cpu(env);
>      int trapnr;
>      target_siginfo_t info;
>      abi_long sysret;
> diff --git a/target/alpha/helper.c b/target/alpha/helper.c
> index 7201576aae..08dfb834a5 100644
> --- a/target/alpha/helper.c
> +++ b/target/alpha/helper.c
> @@ -119,7 +119,7 @@ static int get_physical_address(CPUAlphaState *env, target_ulong addr,
>                                  int prot_need, int mmu_idx,
>                                  target_ulong *pphys, int *pprot)
>  {
> -    CPUState *cs = CPU(alpha_env_get_cpu(env));
> +    CPUState *cs = env_cpu(env);
>      target_long saddr = addr;
>      target_ulong phys = 0;
>      target_ulong L1pte, L2pte, L3pte;
> @@ -463,8 +463,7 @@ void alpha_cpu_dump_state(CPUState *cs, FILE *f, int flags)
>     We expect that ENV->PC has already been updated.  */
>  void QEMU_NORETURN helper_excp(CPUAlphaState *env, int excp, int error)
>  {
> -    AlphaCPU *cpu = alpha_env_get_cpu(env);
> -    CPUState *cs = CPU(cpu);
> +    CPUState *cs = env_cpu(env);
>
>      cs->exception_index = excp;
>      env->error_code = error;
> @@ -475,8 +474,7 @@ void QEMU_NORETURN helper_excp(CPUAlphaState *env, int excp, int error)
>  void QEMU_NORETURN dynamic_excp(CPUAlphaState *env, uintptr_t retaddr,
>                                  int excp, int error)
>  {
> -    AlphaCPU *cpu = alpha_env_get_cpu(env);
> -    CPUState *cs = CPU(cpu);
> +    CPUState *cs = env_cpu(env);
>
>      cs->exception_index = excp;
>      env->error_code = error;
> diff --git a/target/alpha/sys_helper.c b/target/alpha/sys_helper.c
> index ac22323191..f9c34b1144 100644
> --- a/target/alpha/sys_helper.c
> +++ b/target/alpha/sys_helper.c
> @@ -44,17 +44,17 @@ uint64_t helper_load_pcc(CPUAlphaState *env)
>  #ifndef CONFIG_USER_ONLY
>  void helper_tbia(CPUAlphaState *env)
>  {
> -    tlb_flush(CPU(alpha_env_get_cpu(env)));
> +    tlb_flush(env_cpu(env));
>  }
>
>  void helper_tbis(CPUAlphaState *env, uint64_t p)
>  {
> -    tlb_flush_page(CPU(alpha_env_get_cpu(env)), p);
> +    tlb_flush_page(env_cpu(env), p);
>  }
>
>  void helper_tb_flush(CPUAlphaState *env)
>  {
> -    tb_flush(CPU(alpha_env_get_cpu(env)));
> +    tb_flush(env_cpu(env));
>  }
>
>  void helper_halt(uint64_t restart)
> @@ -78,7 +78,7 @@ uint64_t helper_get_walltime(void)
>
>  void helper_set_alarm(CPUAlphaState *env, uint64_t expire)
>  {
> -    AlphaCPU *cpu = alpha_env_get_cpu(env);
> +    AlphaCPU *cpu = env_archcpu(env);
>
>      if (expire) {
>          env->alarm_expire = expire;
> --
> 2.17.1
>
>


  reply	other threads:[~2019-05-09 18:01 UTC|newest]

Thread overview: 81+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-08  0:06 [Qemu-devel] [PATCH v3 00/39] tcg: Move the softmmu tlb to CPUNegativeOffsetState Richard Henderson
2019-05-08  0:06 ` [Qemu-devel] [PATCH v3 01/39] tcg: Fold CPUTLBWindow into CPUTLBDesc Richard Henderson
2019-05-09 17:48   ` Alistair Francis
2019-05-08  0:06 ` [Qemu-devel] [PATCH v3 02/39] tcg: Split out target/arch/cpu-param.h Richard Henderson
2019-05-08  0:06 ` [Qemu-devel] [PATCH v3 03/39] tcg: Create struct CPUTLB Richard Henderson
2019-05-08  0:06 ` [Qemu-devel] [PATCH v3 04/39] cpu: Define CPUArchState with typedef Richard Henderson
2019-05-08  0:06 ` [Qemu-devel] [PATCH v3 05/39] cpu: Define ArchCPU Richard Henderson
2019-05-08  0:06 ` [Qemu-devel] [PATCH v3 06/39] cpu: Replace ENV_GET_CPU with env_cpu Richard Henderson
2019-05-08  0:06 ` [Qemu-devel] [PATCH v3 07/39] cpu: Introduce env_archcpu Richard Henderson
2019-05-09 17:52   ` Alistair Francis
2019-05-08  0:06 ` [Qemu-devel] [PATCH v3 08/39] target/alpha: Use env_cpu, env_archcpu Richard Henderson
2019-05-09 17:56   ` Alistair Francis [this message]
2019-05-08  0:06 ` [Qemu-devel] [PATCH v3 09/39] target/arm: " Richard Henderson
2019-05-09 17:57   ` Alistair Francis
2019-05-08  0:06 ` [Qemu-devel] [PATCH v3 10/39] target/cris: Reindent mmu.c Richard Henderson
2019-05-08  6:26   ` Philippe Mathieu-Daudé
2019-05-09 18:01   ` Alistair Francis
2019-05-08  0:06 ` [Qemu-devel] [PATCH v3 11/39] target/cris: Reindent op_helper.c Richard Henderson
2019-05-08  6:28   ` Philippe Mathieu-Daudé
2019-05-09 18:03   ` Alistair Francis
2019-05-08  0:06 ` [Qemu-devel] [PATCH v3 12/39] target/cris: Use env_cpu, env_archcpu Richard Henderson
2019-05-09 18:04   ` Alistair Francis
2019-05-08  0:06 ` [Qemu-devel] [PATCH v3 13/39] target/hppa: " Richard Henderson
2019-05-09 18:05   ` Alistair Francis
2019-05-08  0:06 ` [Qemu-devel] [PATCH v3 14/39] target/i386: " Richard Henderson
2019-05-09 18:07   ` Alistair Francis
2019-05-08  0:06 ` [Qemu-devel] [PATCH v3 15/39] target/lm32: " Richard Henderson
2019-05-09 18:08   ` Alistair Francis
2019-05-08  0:06 ` [Qemu-devel] [PATCH v3 16/39] target/m68k: " Richard Henderson
2019-05-09 18:16   ` Alistair Francis
2019-05-08  0:06 ` [Qemu-devel] [PATCH v3 17/39] target/microblaze: " Richard Henderson
2019-05-08  0:06 ` [Qemu-devel] [PATCH v3 18/39] target/mips: " Richard Henderson
2019-05-08  8:15   ` Aleksandar Markovic
2019-05-08 14:32     ` Richard Henderson
2019-05-08 21:53       ` Philippe Mathieu-Daudé
2019-05-09 21:19         ` Aleksandar Markovic
2019-05-11 14:31       ` Aleksandar Markovic
2019-05-16  6:29       ` Aleksandar Markovic
2019-05-08  0:06 ` [Qemu-devel] [PATCH v3 19/39] target/moxie: " Richard Henderson
2019-05-09 18:19   ` Alistair Francis
2019-05-08  0:06 ` [Qemu-devel] [PATCH v3 20/39] target/nios2: " Richard Henderson
2019-05-09 18:20   ` Alistair Francis
2019-05-08  0:06 ` [Qemu-devel] [PATCH v3 21/39] target/openrisc: " Richard Henderson
2019-05-09 18:20   ` Alistair Francis
2019-05-08  0:06 ` [Qemu-devel] [PATCH v3 22/39] target/ppc: " Richard Henderson
2019-05-09 18:28   ` Alistair Francis
2019-05-08  0:06 ` [Qemu-devel] [PATCH v3 23/39] target/riscv: " Richard Henderson
2019-05-08  0:06 ` [Qemu-devel] [PATCH v3 24/39] target/s390x: " Richard Henderson
2019-05-09 18:31   ` Alistair Francis
2019-05-08  0:06 ` [Qemu-devel] [PATCH v3 25/39] target/sh4: " Richard Henderson
2019-05-09 20:14   ` Alistair Francis
2019-05-08  0:06 ` [Qemu-devel] [PATCH v3 26/39] target/sparc: " Richard Henderson
2019-05-09 20:15   ` Alistair Francis
2019-05-08  0:06 ` [Qemu-devel] [PATCH v3 27/39] target/tilegx: Use env_cpu Richard Henderson
2019-05-09 20:16   ` Alistair Francis
2019-05-08  0:06 ` [Qemu-devel] [PATCH v3 28/39] target/tricore: " Richard Henderson
2019-05-09 20:16   ` Alistair Francis
2019-05-08  0:06 ` [Qemu-devel] [PATCH v3 29/39] target/unicore32: Use env_cpu, env_archcpu Richard Henderson
2019-05-09 20:17   ` Alistair Francis
2019-05-08  0:06 ` [Qemu-devel] [PATCH v3 30/39] target/xtensa: " Richard Henderson
2019-05-09 20:19   ` Alistair Francis
2019-05-08  0:06 ` [Qemu-devel] [PATCH v3 31/39] cpu: Move ENV_OFFSET to exec/gen-icount.h Richard Henderson
2019-05-08  0:06 ` [Qemu-devel] [PATCH v3 32/39] cpu: Introduce cpu_set_cpustate_pointers Richard Henderson
2019-05-09 20:32   ` Alistair Francis
2019-05-08  0:06 ` [Qemu-devel] [PATCH v3 33/39] cpu: Introduce CPUNegativeOffsetState Richard Henderson
2019-05-09 20:36   ` Alistair Francis
2019-05-08  0:06 ` [Qemu-devel] [PATCH v3 34/39] cpu: Move icount_decr to CPUNegativeOffsetState Richard Henderson
2019-05-09 20:26   ` Alistair Francis
2019-05-08  0:06 ` [Qemu-devel] [PATCH v3 35/39] cpu: Move the softmmu tlb " Richard Henderson
2019-05-10 20:57   ` Alistair Francis
2019-05-08  0:06 ` [Qemu-devel] [PATCH v3 36/39] cpu: Remove CPU_COMMON Richard Henderson
2019-05-10 20:58   ` Alistair Francis
2019-05-11 13:21   ` Aleksandar Markovic
2019-05-08  0:06 ` [Qemu-devel] [PATCH v3 37/39] tcg/aarch64: Use LDP to load tlb mask+table Richard Henderson
2019-05-10 21:01   ` Alistair Francis
2019-05-08  0:06 ` [Qemu-devel] [PATCH v3 38/39] tcg/arm: Use LDRD " Richard Henderson
2019-05-10 21:08   ` Alistair Francis
2019-05-11 19:13     ` Richard Henderson
2019-05-13 23:10       ` Alistair Francis
2019-05-08  0:06 ` [Qemu-devel] [PATCH v3 39/39] tcg/arm: Remove mostly unreachable tlb special case Richard Henderson
2019-05-10 21:04   ` Alistair Francis

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='CAKmqyKP8Qgbzv3V=hq4zktd0bDs-EnXRS_p=t6agd=CT37pjkQ@mail.gmail.com' \
    --to=alistair23@gmail.com \
    --cc=qemu-devel@nongnu.org \
    --cc=richard.henderson@linaro.org \
    /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.