qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Richard Henderson <richard.henderson@linaro.org>
To: "Philippe Mathieu-Daudé" <f4bug@amsat.org>, qemu-devel@nongnu.org
Cc: Paolo Bonzini <pbonzini@redhat.com>,
	Thomas Huth <thuth@redhat.com>,
	Taylor Simpson <tsimpson@quicinc.com>
Subject: Re: [PATCH 11/15] target: Use ArchCPU as interface to target CPU
Date: Thu, 10 Feb 2022 09:47:43 +1100	[thread overview]
Message-ID: <83e91592-af1b-de86-83ce-a3fcf467fdf7@linaro.org> (raw)
In-Reply-To: <20220209215446.58402-12-f4bug@amsat.org>

On 2/10/22 08:54, Philippe Mathieu-Daudé wrote:
> diff --git a/target/hexagon/cpu.h b/target/hexagon/cpu.h
> index 25c67e43a2..4dce40a360 100644
> --- a/target/hexagon/cpu.h
> +++ b/target/hexagon/cpu.h
> @@ -143,7 +143,7 @@ typedef struct HexagonCPUClass {
>       DeviceReset parent_reset;
>   } HexagonCPUClass;
>   
> -typedef struct HexagonCPU {
> +typedef struct ArchCPU {
>       /*< private >*/
>       CPUState parent_obj;
>       /*< public >*/

There's still the typedef of ArchCPU below, which ought to be redundant now.
It may or may not be less confusing to separate out the typedef for HexagonCPU.
It definitely would be worthwhile to convert hexagon to OBJECT_DECLARE_TYPE (cc Taylor).

> diff --git a/target/microblaze/cpu-qom.h b/target/microblaze/cpu-qom.h
> index e520eefb12..8f11fe4d73 100644
> --- a/target/microblaze/cpu-qom.h
> +++ b/target/microblaze/cpu-qom.h
> @@ -25,7 +25,9 @@
>   
>   #define TYPE_MICROBLAZE_CPU "microblaze-cpu"
>   
> -OBJECT_DECLARE_TYPE(MicroBlazeCPU, MicroBlazeCPUClass,
> +typedef struct ArchCPU MicroBlazeCPU;
> +
> +OBJECT_DECLARE_TYPE(ArchCPU, MicroBlazeCPUClass,
>                       MICROBLAZE_CPU)
>   
>   /**
> diff --git a/target/microblaze/cpu.h b/target/microblaze/cpu.h
> index acfd35d3f7..d511b6b877 100644
> --- a/target/microblaze/cpu.h
> +++ b/target/microblaze/cpu.h
> @@ -25,6 +25,8 @@
>   #include "fpu/softfloat-types.h"
>   
>   typedef struct CPUArchState CPUMBState;
> +typedef struct ArchCPU MicroBlazeCPU;

Duplicate typedef.

> diff --git a/target/nios2/cpu.h b/target/nios2/cpu.h
> index 629b9e2301..05def159b1 100644
> --- a/target/nios2/cpu.h
> +++ b/target/nios2/cpu.h
> @@ -32,7 +32,7 @@ typedef struct CPUArchState CPUNios2State;
>   
>   #define TYPE_NIOS2_CPU "nios2-cpu"
>   
> -OBJECT_DECLARE_TYPE(Nios2CPU, Nios2CPUClass,
> +OBJECT_DECLARE_TYPE(ArchCPU, Nios2CPUClass,
>                       NIOS2_CPU)
>   
>   /**
> @@ -171,7 +171,7 @@ struct CPUArchState {
>    *
>    * A Nios2 CPU.
>    */
> -struct Nios2CPU {
> +struct ArchCPU {
>       /*< private >*/
>       CPUState parent_obj;
>       /*< public >*/

Missing Nios2CPU typedef.
Still have the 'typedef Nios2CPU ArchCPU' below.

> diff --git a/target/riscv/cpu.h b/target/riscv/cpu.h
> index 79144ddc24..5981be47d9 100644
> --- a/target/riscv/cpu.h
> +++ b/target/riscv/cpu.h
> @@ -285,7 +285,7 @@ struct CPUArchState {
>       uint64_t kvm_timer_frequency;
>   };
>   
> -OBJECT_DECLARE_TYPE(RISCVCPU, RISCVCPUClass,
> +OBJECT_DECLARE_TYPE(ArchCPU, RISCVCPUClass,
>                       RISCV_CPU)
>   
>   /**
> @@ -309,7 +309,7 @@ struct RISCVCPUClass {
>    *
>    * A RISCV CPU.
>    */
> -struct RISCVCPU {
> +struct ArchCPU {
>       /*< private >*/
>       CPUState parent_obj;
>       /*< public >*/
> @@ -430,7 +430,6 @@ void riscv_cpu_set_fflags(CPURISCVState *env, target_ulong);
>   #define TB_FLAGS_MSTATUS_FS MSTATUS_FS
>   #define TB_FLAGS_MSTATUS_VS MSTATUS_VS
>   
> -typedef RISCVCPU ArchCPU;
>   #include "exec/cpu-all.h"
>   
>   FIELD(TB_FLAGS, MEM_IDX, 0, 3)

Missing RISCVCPU typedef.


r~


  parent reply	other threads:[~2022-02-09 22:48 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-09 21:54 [PATCH 00/15] target: Use ArchCPU & CPUArchState as abstract interface to target CPU Philippe Mathieu-Daudé via
2022-02-09 21:54 ` [PATCH 01/15] meson: Display libfdt as disabled when system emulation is disabled Philippe Mathieu-Daudé via
2022-02-09 21:54 ` [PATCH 02/15] hw/m68k/mcf: Add missing 'exec/hwaddr.h' header Philippe Mathieu-Daudé via
2022-02-09 22:11   ` Richard Henderson
2022-02-10  8:34   ` Thomas Huth
2022-02-09 21:54 ` [PATCH 03/15] hw/tricore: Remove unused and incorrect header Philippe Mathieu-Daudé via
2022-02-09 22:12   ` Richard Henderson
2022-02-10  8:26   ` Thomas Huth
2022-02-09 21:54 ` [PATCH 04/15] exec/cpu_ldst: Include 'cpu.h' to get target_ulong definition Philippe Mathieu-Daudé via
2022-02-09 21:54 ` [PATCH 05/15] cpu: Add missing 'exec/exec-all.h' and 'qemu/accel.h' headers Philippe Mathieu-Daudé via
2022-02-09 21:54 ` [PATCH 06/15] target/i386/cpu: Ensure accelerators set CPU addressble physical bits Philippe Mathieu-Daudé via
2022-02-09 21:54 ` [PATCH 07/15] target/i386/tcg/sysemu: Include missing 'exec/exec-all.h' header Philippe Mathieu-Daudé via
2022-02-09 21:54 ` [PATCH 08/15] target: Include missing 'cpu.h' Philippe Mathieu-Daudé via
2022-02-09 21:54 ` [PATCH 09/15] target: Use forward declared type instead of structure type Philippe Mathieu-Daudé via
2022-02-09 21:54 ` [PATCH 10/15] target: Use CPUArchState as interface to target-specific CPU state Philippe Mathieu-Daudé via
2022-02-09 21:54 ` [PATCH 11/15] target: Use ArchCPU as interface to target CPU Philippe Mathieu-Daudé via
2022-02-09 22:33   ` Philippe Mathieu-Daudé via
2022-02-09 22:48     ` Richard Henderson
2022-02-09 22:47   ` Richard Henderson [this message]
2022-02-10 17:35     ` Taylor Simpson
2022-02-11  1:21       ` Richard Henderson
2022-02-11  2:57         ` Taylor Simpson
2022-02-09 21:54 ` [RFC PATCH 12/15] hw/m68k: Restrict M68kCPU type to target/ code Philippe Mathieu-Daudé via
2022-02-09 22:50   ` Richard Henderson
2022-02-09 23:09     ` Philippe Mathieu-Daudé via
2022-02-09 23:18       ` Richard Henderson
2022-02-09 21:54 ` [RFC PATCH 13/15] hw/mips: Restrict MIPSCPU " Philippe Mathieu-Daudé via
2022-02-09 21:54 ` [RFC PATCH 14/15] hw/sparc: Restrict SPARCCPU " Philippe Mathieu-Daudé via
2022-02-09 21:54 ` [RFC PATCH 15/15] hw/sh4: Restrict SuperHCPU " Philippe Mathieu-Daudé via

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=83e91592-af1b-de86-83ce-a3fcf467fdf7@linaro.org \
    --to=richard.henderson@linaro.org \
    --cc=f4bug@amsat.org \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=thuth@redhat.com \
    --cc=tsimpson@quicinc.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).