From: Peter Maydell <peter.mayd...@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: signature.asc
Description: PGP signature

Reply via email to