From: "Philippe Mathieu-Daudé" <philmd@linaro.org>
To: Keith Packard <keithp@keithp.com>, qemu-devel@nongnu.org
Cc: Peter Maydell <peter.maydell@linaro.org>,
Igor Mammedov <imammedo@redhat.com>
Subject: Re: [PATCH 3/5] target/rx: Reset the CPU at qemu reset time
Date: Mon, 17 Feb 2025 08:41:23 +0100 [thread overview]
Message-ID: <03b45083-6dbe-4ef9-a31d-6a2deccc8e22@linaro.org> (raw)
In-Reply-To: <20250215021654.1786679-4-keithp@keithp.com>
+Peter/Igor
On 15/2/25 03:16, Keith Packard via wrote:
> This ensure that the CPU gets reset every time QEMU resets.
>
> Signed-off-by: Keith Packard <keithp@keithp.com>
> ---
> target/rx/cpu.c | 11 ++++++++++-
> 1 file changed, 10 insertions(+), 1 deletion(-)
>
> diff --git a/target/rx/cpu.c b/target/rx/cpu.c
> index 37a6fdd569..04dd34b310 100644
> --- a/target/rx/cpu.c
> +++ b/target/rx/cpu.c
> @@ -27,6 +27,7 @@
> #include "hw/loader.h"
> #include "fpu/softfloat.h"
> #include "tcg/debug-assert.h"
> +#include "system/reset.h"
>
> static void rx_cpu_set_pc(CPUState *cs, vaddr value)
> {
> @@ -129,6 +130,13 @@ static ObjectClass *rx_cpu_class_by_name(const char *cpu_model)
> return oc;
> }
>
> +static void rx_cpu_reset(void *opaque)
> +{
> + RXCPU *cpu = opaque;
> +
> + cpu_reset(CPU(cpu));
> +}
> +
> static void rx_cpu_realize(DeviceState *dev, Error **errp)
> {
> CPUState *cs = CPU(dev);
> @@ -142,9 +150,10 @@ static void rx_cpu_realize(DeviceState *dev, Error **errp)
> }
>
> qemu_init_vcpu(cs);
> - cpu_reset(cs);
>
> rcc->parent_realize(dev, errp);
> +
> + qemu_register_reset(rx_cpu_reset, RX_CPU(cs));
Yeah. I guess this is part of some generic effort to generalize
CPU reset, previously started here
https://lore.kernel.org/qemu-devel/20230918160257.30127-1-philmd@linaro.org/
which led to another issue Igor is trying to solves:
https://lore.kernel.org/qemu-devel/20250207162048.1890669-1-imammedo@redhat.com/
> }
>
> static void rx_cpu_set_irq(void *opaque, int no, int request)
next prev parent reply other threads:[~2025-02-17 7:42 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-02-15 2:16 [PATCH 0/5] Renesas RX target fixes Keith Packard via
2025-02-15 2:16 ` [PATCH 1/5] hw/rx: Allow execution without either bios or kernel Keith Packard via
2025-02-15 18:12 ` Richard Henderson
2025-02-15 2:16 ` [PATCH 2/5] target/rx: Set exception vector base to 0xffffff80 Keith Packard via
2025-02-15 18:12 ` Richard Henderson
2025-02-15 2:16 ` [PATCH 3/5] target/rx: Reset the CPU at qemu reset time Keith Packard via
2025-02-17 7:41 ` Philippe Mathieu-Daudé [this message]
2025-02-17 9:53 ` Peter Maydell
2025-02-18 20:09 ` Keith Packard via
2025-02-15 2:16 ` [PATCH 4/5] target/rx: Load reset vector from memory after first run Keith Packard via
2025-02-15 18:24 ` Richard Henderson
2025-02-17 9:49 ` Peter Maydell
2025-02-18 20:22 ` Keith Packard via
2025-02-18 20:11 ` Keith Packard via
2025-02-18 20:18 ` Keith Packard via
2025-02-15 2:16 ` [PATCH 5/5] target/rx: Remove TCG_CALL_NO_WG from helpers which write env Keith Packard via
2025-02-15 9:21 ` Keith Packard via
2025-02-15 17:09 ` Richard Henderson
2025-02-15 18:42 ` Richard Henderson
2025-02-18 21:20 ` [PATCH 0/4] Renesas RX target fixes (v2) Keith Packard via
2025-02-18 21:21 ` [PATCH 1/4] target/rx: Set exception vector base to 0xffffff80 Keith Packard via
2025-03-07 11:26 ` Peter Maydell
2025-02-18 21:21 ` [PATCH 2/4] target/rx: Remove TCG_CALL_NO_WG from helpers which write env Keith Packard via
2025-03-07 11:22 ` Peter Maydell
2025-02-18 21:21 ` [PATCH 3/4] hw/rx: Reset the CPU at qemu reset time Keith Packard via
2025-03-07 13:26 ` Peter Maydell
2025-06-01 1:13 ` Keith Packard via
2025-02-18 21:21 ` [PATCH 4/4] rx: Support loading of ELF files too Keith Packard via
2025-03-07 13:38 ` Peter Maydell
2025-06-01 0:35 ` Keith Packard via
2025-03-07 13:51 ` [PATCH 0/4] Renesas RX target fixes (v2) 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=03b45083-6dbe-4ef9-a31d-6a2deccc8e22@linaro.org \
--to=philmd@linaro.org \
--cc=imammedo@redhat.com \
--cc=keithp@keithp.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.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).