All of lore.kernel.org
 help / color / mirror / Atom feed
From: Keith Packard via <qemu-devel@nongnu.org>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: qemu-devel@nongnu.org
Subject: Re: [PATCH 3/5] target/rx: Reset the CPU at qemu reset time
Date: Tue, 18 Feb 2025 12:09:35 -0800	[thread overview]
Message-ID: <87v7t7ypz4.fsf@keithp.com> (raw)
In-Reply-To: <CAFEAcA-Z13YZaHWfdp0xnW2tQL88OtxwF0nTdSoj2eJkULSbFw@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 1069 bytes --]

From: Peter Maydell <peter.maydell@linaro.org>
Date: Mon, 17 Feb 2025 09:53:58 +0000

> Reset of devices not plugged into buses (of which CPUs
> are the most common kind) is a mess. But having them
> call qemu_register_reset() themselves in their own
> realize method isn't the usual workaround. Instead we
> get the board code to do it (usually in the same function
> that handles arranging to sort out the in-QEMU boot
> loader, see eg hw/arm/boot.c).

Oh, thanks so much! I was confused about how to select the right
starting PC value -- when loading a kernel image, the code wanted to
set the PC to the kernel entry point, but otherwise it wanted to use the
reset vector. That "worked" because the kernel loading code set the PC
after the reset vector was loaded from ROM.

With your advice, I've made the hardware layer register the reset
handler which just calls cpu_reset and then sets the initial PC value,
either from the loaded kernel or using the reset vector contents. So
much cleaner and "obviously" doing what we want.

-- 
-keith

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 832 bytes --]

  reply	other threads:[~2025-02-18 20:10 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é
2025-02-17  9:53   ` Peter Maydell
2025-02-18 20:09     ` Keith Packard via [this message]
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=87v7t7ypz4.fsf@keithp.com \
    --to=qemu-devel@nongnu.org \
    --cc=keithp@keithp.com \
    --cc=peter.maydell@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.