qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Richard Henderson <richard.henderson@linaro.org>
To: "Philippe Mathieu-Daudé" <philmd@linaro.org>, qemu-devel@nongnu.org
Cc: "Peter Maydell" <peter.maydell@linaro.org>,
	qemu-arm@nongnu.org, "Igor Mitsyanko" <i.mitsyanko@gmail.com>,
	"Rob Herring" <robh@kernel.org>, "Joel Stanley" <joel@jms.id.au>,
	"Edgar E. Iglesias" <edgar.iglesias@gmail.com>,
	"Cédric Le Goater" <clg@kaod.org>,
	"Andrew Jeffery" <andrew@codeconstruct.com.au>,
	"Gavin Shan" <gshan@redhat.com>,
	"Alistair Francis" <alistair@alistair23.me>,
	"Igor Mammedov" <imammedo@redhat.com>
Subject: Re: [PATCH v2 5/6] hw/arm/vexpress: Check for CPU types in machine_run_board_init()
Date: Thu, 25 Jan 2024 09:09:31 +1000	[thread overview]
Message-ID: <264a79c2-7aad-468b-b53e-a269b524bb11@linaro.org> (raw)
In-Reply-To: <20240123222508.13826-6-philmd@linaro.org>

On 1/24/24 08:25, Philippe Mathieu-Daudé wrote:
> Restrict MachineClass::valid_cpu_types[] to the single
> valid CPU types.
> 
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> ---
>   hw/arm/vexpress.c | 10 ++++++++++
>   1 file changed, 10 insertions(+)
> 
> diff --git a/hw/arm/vexpress.c b/hw/arm/vexpress.c
> index f1b45245d5..a3561a1b56 100644
> --- a/hw/arm/vexpress.c
> +++ b/hw/arm/vexpress.c
> @@ -783,22 +783,32 @@ static void vexpress_class_init(ObjectClass *oc, void *data)
>   
>   static void vexpress_a9_class_init(ObjectClass *oc, void *data)
>   {
> +    static const char * const valid_cpu_types[] = {
> +        ARM_CPU_TYPE_NAME("cortex-a9"),
> +        NULL
> +    };
>       MachineClass *mc = MACHINE_CLASS(oc);
>       VexpressMachineClass *vmc = VEXPRESS_MACHINE_CLASS(oc);
>   
>       mc->desc = "ARM Versatile Express for Cortex-A9";
>       mc->default_cpu_type = ARM_CPU_TYPE_NAME("cortex-a9");
> +    mc->valid_cpu_types = valid_cpu_types;

Repetition of the cpu type here.  Do you still need default_cpu_type?
I didn't see it in the highbank patch, but it might have been outside the patch context.

If it is needed, perhaps "default_cpu_type = valid_cpu_types[0]".

Otherwise,
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>


r~


  reply	other threads:[~2024-01-24 23:10 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-23 22:25 [PATCH v2 0/6] hw/arm/cortex-a: Check for CPU types in machine_run_board_init() Philippe Mathieu-Daudé
2024-01-23 22:25 ` [PATCH v2 1/6] hw/arm/exynos: Add missing QOM parent for CPU cores Philippe Mathieu-Daudé
2024-01-24 23:11   ` Richard Henderson
2024-01-25  2:09   ` Gavin Shan
2024-01-23 22:25 ` [PATCH v2 2/6] hw/arm/exynos: Check for CPU types in machine_run_board_init() Philippe Mathieu-Daudé
2024-01-24 23:06   ` Richard Henderson
2024-01-25  2:11   ` Gavin Shan
2024-01-23 22:25 ` [PATCH v2 3/6] hw/arm/highbank: Add missing QOM parent for CPU cores Philippe Mathieu-Daudé
2024-01-24 23:11   ` Richard Henderson
2024-01-25  2:13   ` Gavin Shan
2024-01-23 22:25 ` [PATCH v2 4/6] hw/arm/highbank: Check for CPU types in machine_run_board_init() Philippe Mathieu-Daudé
2024-01-24 23:06   ` Richard Henderson
2024-01-25  2:15   ` Gavin Shan
2024-01-23 22:25 ` [PATCH v2 5/6] hw/arm/vexpress: " Philippe Mathieu-Daudé
2024-01-24 23:09   ` Richard Henderson [this message]
2024-01-25  4:49     ` Philippe Mathieu-Daudé
2024-01-25  2:16   ` Gavin Shan
2024-01-23 22:25 ` [PATCH v2 6/6] hw/arm/zynq: " Philippe Mathieu-Daudé
2024-01-24 23:10   ` Richard Henderson
2024-01-25  2:17   ` Gavin Shan

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=264a79c2-7aad-468b-b53e-a269b524bb11@linaro.org \
    --to=richard.henderson@linaro.org \
    --cc=alistair@alistair23.me \
    --cc=andrew@codeconstruct.com.au \
    --cc=clg@kaod.org \
    --cc=edgar.iglesias@gmail.com \
    --cc=gshan@redhat.com \
    --cc=i.mitsyanko@gmail.com \
    --cc=imammedo@redhat.com \
    --cc=joel@jms.id.au \
    --cc=peter.maydell@linaro.org \
    --cc=philmd@linaro.org \
    --cc=qemu-arm@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=robh@kernel.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 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).