mbox series

[0/4] Renesas RX target fixes (v2)

Message ID 20250218212103.2024039-1-keithp@keithp.com (mailing list archive)
Headers show
Series Renesas RX target fixes (v2) | expand

Message

Keith Packard Feb. 18, 2025, 9:20 p.m. UTC
With feedback from Peter Maydell and Richard Henderson, I've updated
this series to address two concerns:

 1. The hardware model is now responsible for guiding the CPU reset
    process.

 2. Loading the reset vector from memory is now delayed until cpu_reset
    is finished to ensure memory_dispatch is initialized.

First, there are two critical flaws in the emulation. These are
needed for this model to work correctly:

 1. The exception vector base is 0xffffff80 not 0xffffffc0. This
    prevents exceptions from working at all.

 2. Many tcg helpers inappropriately used TCG_CALL_NO_WG even though
    they modified virtual registers stored in global memory. This
    causes these operations to fail unless one-insn-per-tb was enabled.

The third patch changes how the cpu is reset so that it is driven by
the hw code instead of the target code. Now the cpu is reset each time
qemu is reset and the initial PC value is either set from the loaded
kernel or from the reset vector. This should look a lot more like how
other models manage this process.

The final patch adds the ability to load an ELF file rather than
a binary memory image. It's purely a new feature and not required for
this model to be usable; without this, it's fairly easy to use
the loader device; that just requires the loaded image to include the
exception vectors with the correct reset vector value.

Keith Packard (4):
  target/rx: Set exception vector base to 0xffffff80
  target/rx: Remove TCG_CALL_NO_WG from helpers which write env
  hw/rx: Reset the CPU at qemu reset time
  rx: Support loading of ELF files too

 hw/rx/rx-gdbsim.c  | 72 +++++++++++++++++++++++++++++++++++++++++++++-
 target/rx/cpu.c    |  9 ++----
 target/rx/cpu.h    |  3 ++
 target/rx/helper.c |  2 +-
 target/rx/helper.h | 34 +++++++++++-----------
 5 files changed, 94 insertions(+), 26 deletions(-)