From: Alistair Francis <alistair23@gmail.com>
To: "Philippe Mathieu-Daudé" <philmd@redhat.com>
Cc: Peter Maydell <peter.maydell@linaro.org>,
Eduardo Habkost <ehabkost@redhat.com>,
Alistair Francis <alistair@alistair23.me>,
"qemu-devel@nongnu.org Developers" <qemu-devel@nongnu.org>,
Subbaraya Sundeep <sundeep.lkml@gmail.com>,
qemu-arm <qemu-arm@nongnu.org>,
Igor Mammedov <imammedo@redhat.com>
Subject: Re: [Qemu-devel] [PATCH] hw/arm/msf2-som: Exit when the cpu is not the expected one
Date: Mon, 17 Jun 2019 10:15:14 -0700 [thread overview]
Message-ID: <CAKmqyKOc-ZnGhUgsBzHx2oGoBCoKStTHVWySUqP5kF88LvuqTQ@mail.gmail.com> (raw)
In-Reply-To: <20190617160136.29930-1-philmd@redhat.com>
On Mon, Jun 17, 2019 at 9:19 AM Philippe Mathieu-Daudé
<philmd@redhat.com> wrote:
>
> This machine correctly defines its default_cpu_type to cortex-m3
> and report an error if the user requested another cpu_type,
> however it does not exit, and this can confuse users trying
> to use another core:
>
> $ qemu-system-arm -M emcraft-sf2 -cpu cortex-m4 -kernel test-m4.elf
> qemu-system-arm: This board can only be used with CPU cortex-m3-arm-cpu
> [output related to M3 core ...]
>
> The CPU is indeed a M3 core:
>
> (qemu) info qom-tree
> /machine (emcraft-sf2-machine)
> /unattached (container)
> /device[0] (msf2-soc)
> /armv7m (armv7m)
> /cpu (cortex-m3-arm-cpu)
>
> Add the missing exit() call to return to the shell.
>
> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
Alistair
> ---
> hw/arm/msf2-som.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/hw/arm/msf2-som.c b/hw/arm/msf2-som.c
> index 8c550a8bdd..2c9984bb3b 100644
> --- a/hw/arm/msf2-som.c
> +++ b/hw/arm/msf2-som.c
> @@ -53,6 +53,7 @@ static void emcraft_sf2_s2s010_init(MachineState *machine)
> if (strcmp(machine->cpu_type, mc->default_cpu_type) != 0) {
> error_report("This board can only be used with CPU %s",
> mc->default_cpu_type);
> + exit(1);
> }
>
> memory_region_init_ram(ddr, NULL, "ddr-ram", DDR_SIZE,
> --
> 2.20.1
>
>
next prev parent reply other threads:[~2019-06-17 17:20 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-06-17 16:01 [Qemu-devel] [PATCH] hw/arm/msf2-som: Exit when the cpu is not the expected one Philippe Mathieu-Daudé
2019-06-17 17:15 ` Alistair Francis [this message]
2019-06-17 17:20 ` Eduardo Habkost
2019-07-01 11:14 ` Peter Maydell
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=CAKmqyKOc-ZnGhUgsBzHx2oGoBCoKStTHVWySUqP5kF88LvuqTQ@mail.gmail.com \
--to=alistair23@gmail.com \
--cc=alistair@alistair23.me \
--cc=ehabkost@redhat.com \
--cc=imammedo@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=philmd@redhat.com \
--cc=qemu-arm@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=sundeep.lkml@gmail.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).