All of lore.kernel.org
 help / color / mirror / Atom feed
* [Bug 1881249] [NEW] CPU fetch from unpopulated ROM on reset
@ 2020-05-29  7:47 Philippe Mathieu-Daudé
  2020-05-29  7:55 ` [Bug 1881249] " Philippe Mathieu-Daudé
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: Philippe Mathieu-Daudé @ 2020-05-29  7:47 UTC (permalink / raw)
  To: qemu-devel

Public bug reported:

Some architectures fetch the $PC/$SP register as vectors in memory, usually ROM.
The CPU reset() handler is called before the ROM code is populated, resulting in fetching incorrect PC/SP.

Architectures affected:
- M68K
- RX
- ARM M-profile

** Affects: qemu
     Importance: Undecided
         Status: New


** Tags: arm m68k reset

-- 
You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.
https://bugs.launchpad.net/bugs/1881249

Title:
  CPU fetch from unpopulated ROM on reset

Status in QEMU:
  New

Bug description:
  Some architectures fetch the $PC/$SP register as vectors in memory, usually ROM.
  The CPU reset() handler is called before the ROM code is populated, resulting in fetching incorrect PC/SP.

  Architectures affected:
  - M68K
  - RX
  - ARM M-profile

To manage notifications about this bug go to:
https://bugs.launchpad.net/qemu/+bug/1881249/+subscriptions


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug 1881249] Re: CPU fetch from unpopulated ROM on reset
  2020-05-29  7:47 [Bug 1881249] [NEW] CPU fetch from unpopulated ROM on reset Philippe Mathieu-Daudé
@ 2020-05-29  7:55 ` Philippe Mathieu-Daudé
  2020-05-29  8:02 ` Philippe Mathieu-Daudé
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Philippe Mathieu-Daudé @ 2020-05-29  7:55 UTC (permalink / raw)
  To: qemu-devel

Different comments from Peter Maydell regarding this issue:

- https://www.mail-archive.com/qemu-devel@nongnu.org/msg683768.html

"We should be able to do this with the new 3-phase
reset API : the rom loader reset should happen in phase 2,
and the Arm CPU should only load the new PC and SP in
phase 3."

- https://www.mail-archive.com/qemu-devel@nongnu.org/msg686480.html

"The expectation at the moment is that the board code should
register a reset function with qemu_register_reset() which
calls cpu_reset(). Relying on doing a reset in realize won't
work for the case where there's a QEMU system reset, because
we don't re-init/realize everything, we just call all the
reset hooks.

If m68k reads pc/sp from memory on reset you'll probably run
into the same reset-ordering vs hw/cpu/loader.c that Arm M-profile
has; we currently work around that in the arm reset function."

- https://www.mail-archive.com/qemu-devel@nongnu.org/msg683856.html

-- 
You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.
https://bugs.launchpad.net/bugs/1881249

Title:
  CPU fetch from unpopulated ROM on reset

Status in QEMU:
  New

Bug description:
  Some architectures fetch the $PC/$SP register as vectors in memory, usually ROM.
  The CPU reset() handler is called before the ROM code is populated, resulting in fetching incorrect PC/SP.

  Architectures affected:
  - M68K
  - RX
  - ARM M-profile

To manage notifications about this bug go to:
https://bugs.launchpad.net/qemu/+bug/1881249/+subscriptions


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug 1881249] Re: CPU fetch from unpopulated ROM on reset
  2020-05-29  7:47 [Bug 1881249] [NEW] CPU fetch from unpopulated ROM on reset Philippe Mathieu-Daudé
  2020-05-29  7:55 ` [Bug 1881249] " Philippe Mathieu-Daudé
@ 2020-05-29  8:02 ` Philippe Mathieu-Daudé
  2020-05-29 10:00 ` Peter Maydell
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Philippe Mathieu-Daudé @ 2020-05-29  8:02 UTC (permalink / raw)
  To: qemu-devel

Related (invalidated thus rejected) series:

- https://www.mail-archive.com/qemu-devel@nongnu.org/msg683763.html

"Support device reset handler priority configuration"

This series adds support for configuring device reset handler priority, and 
uses it to ensure that the ARMv7-M CPU reset handler is invoked after the ROM 
reset handler.

- https://www.mail-archive.com/qemu-devel@nongnu.org/msg686413.html

"Avoid latent bug calling cpu_reset() on uninitialized vCPU"

cpu_reset() might modify architecture-specific fields allocated
by qemu_init_vcpu(). To avoid bugs similar to the one fixed in
commit 00d0f7cb66 when introducing new architectures, move the
cpu_reset() calls after qemu_init_vcpu().

-- 
You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.
https://bugs.launchpad.net/bugs/1881249

Title:
  CPU fetch from unpopulated ROM on reset

Status in QEMU:
  New

Bug description:
  Some architectures fetch the $PC/$SP register as vectors in memory, usually ROM.
  The CPU reset() handler is called before the ROM code is populated, resulting in fetching incorrect PC/SP.

  Architectures affected:
  - M68K
  - RX
  - ARM M-profile

To manage notifications about this bug go to:
https://bugs.launchpad.net/qemu/+bug/1881249/+subscriptions


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug 1881249] Re: CPU fetch from unpopulated ROM on reset
  2020-05-29  7:47 [Bug 1881249] [NEW] CPU fetch from unpopulated ROM on reset Philippe Mathieu-Daudé
  2020-05-29  7:55 ` [Bug 1881249] " Philippe Mathieu-Daudé
  2020-05-29  8:02 ` Philippe Mathieu-Daudé
@ 2020-05-29 10:00 ` Peter Maydell
  2020-11-05 10:56 ` Peter Maydell
  2021-05-09 15:44 ` Philippe Mathieu-Daudé
  4 siblings, 0 replies; 6+ messages in thread
From: Peter Maydell @ 2020-05-29 10:00 UTC (permalink / raw)
  To: qemu-devel

I had an initial look at fixing this for arm via 3-phase reset, but ran
into the problem that currently CPU reset is triggered via a
qemu_register_reset() hook, and qemu_register_reset() itself does not
have a 3-phase reset API, so the reset hook for resetting the CPUs will
end up doing all 3 phases of reset for the CPU before the reset hook for
reset-from-sysbus-root does all 3 phases for other devices. (I forget
whether rom-data-copy happens via sysbus reset or is its own
qemu_register_reset hook, but either way the same issue applies.)

One approach to this would be to add 3-phase support to
qemu_register_reset(), I guess.

-- 
You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.
https://bugs.launchpad.net/bugs/1881249

Title:
  CPU fetch from unpopulated ROM on reset

Status in QEMU:
  New

Bug description:
  Some architectures fetch the $PC/$SP register as vectors in memory, usually ROM.
  The CPU reset() handler is called before the ROM code is populated, resulting in fetching incorrect PC/SP.

  Architectures affected:
  - M68K
  - RX
  - ARM M-profile

To manage notifications about this bug go to:
https://bugs.launchpad.net/qemu/+bug/1881249/+subscriptions


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug 1881249] Re: CPU fetch from unpopulated ROM on reset
  2020-05-29  7:47 [Bug 1881249] [NEW] CPU fetch from unpopulated ROM on reset Philippe Mathieu-Daudé
                   ` (2 preceding siblings ...)
  2020-05-29 10:00 ` Peter Maydell
@ 2020-11-05 10:56 ` Peter Maydell
  2021-05-09 15:44 ` Philippe Mathieu-Daudé
  4 siblings, 0 replies; 6+ messages in thread
From: Peter Maydell @ 2020-11-05 10:56 UTC (permalink / raw)
  To: qemu-devel

** Changed in: qemu
       Status: New => Confirmed

-- 
You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.
https://bugs.launchpad.net/bugs/1881249

Title:
  CPU fetch from unpopulated ROM on reset

Status in QEMU:
  Confirmed

Bug description:
  Some architectures fetch the $PC/$SP register as vectors in memory, usually ROM.
  The CPU reset() handler is called before the ROM code is populated, resulting in fetching incorrect PC/SP.

  Architectures affected:
  - M68K
  - RX
  - ARM M-profile

To manage notifications about this bug go to:
https://bugs.launchpad.net/qemu/+bug/1881249/+subscriptions


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug 1881249] Re: CPU fetch from unpopulated ROM on reset
  2020-05-29  7:47 [Bug 1881249] [NEW] CPU fetch from unpopulated ROM on reset Philippe Mathieu-Daudé
                   ` (3 preceding siblings ...)
  2020-11-05 10:56 ` Peter Maydell
@ 2021-05-09 15:44 ` Philippe Mathieu-Daudé
  4 siblings, 0 replies; 6+ messages in thread
From: Philippe Mathieu-Daudé @ 2021-05-09 15:44 UTC (permalink / raw)
  To: qemu-devel

This is an automated cleanup. This bug report has been moved to QEMU's
new bug tracker on gitlab.com and thus gets marked as 'invalid' now.
Please continue with the discussion here:

 https://gitlab.com/qemu-project/qemu/-/issues/236


** Changed in: qemu
       Status: Confirmed => Invalid

** Bug watch added: gitlab.com/qemu-project/qemu/-/issues #236
   https://gitlab.com/qemu-project/qemu/-/issues/236

-- 
You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.
https://bugs.launchpad.net/bugs/1881249

Title:
  CPU fetch from unpopulated ROM on reset

Status in QEMU:
  Invalid

Bug description:
  Some architectures fetch the $PC/$SP register as vectors in memory, usually ROM.
  The CPU reset() handler is called before the ROM code is populated, resulting in fetching incorrect PC/SP.

  Architectures affected:
  - M68K
  - RX
  - ARM M-profile

To manage notifications about this bug go to:
https://bugs.launchpad.net/qemu/+bug/1881249/+subscriptions


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2021-05-09 15:52 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-29  7:47 [Bug 1881249] [NEW] CPU fetch from unpopulated ROM on reset Philippe Mathieu-Daudé
2020-05-29  7:55 ` [Bug 1881249] " Philippe Mathieu-Daudé
2020-05-29  8:02 ` Philippe Mathieu-Daudé
2020-05-29 10:00 ` Peter Maydell
2020-11-05 10:56 ` Peter Maydell
2021-05-09 15:44 ` Philippe Mathieu-Daudé

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.