[PATCH 0/5] alpha, avr, or1k, rx, tricore: Convert to translate_for_debug

Peter Maydell posted 5 patches 1 month ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20261020122752.3651914-1-peter.maydell@linaro.org
Maintainers: Richard Henderson <richard.henderson@linaro.org>, Michael Rolnik <mrolnik@gmail.com>, Stafford Horne <shorne@gmail.com>, Yoshinori Sato <yoshinori.sato@nifty.com>
target/alpha/cpu.h      |  3 ++-
target/avr/cpu.h        |  3 ++-
target/or1k/cpu.h       |  3 ++-
target/rx/cpu.h         |  3 ++-
target/tricore/cpu.h    |  3 ++-
target/alpha/cpu.c      |  2 +-
target/alpha/helper.c   | 15 +++++++++++++--
target/avr/cpu.c        |  2 +-
target/avr/helper.c     | 11 +++++++++--
target/or1k/cpu.c       |  2 +-
target/or1k/mmu.c       | 21 ++++++++++++++++-----
target/rx/cpu.c         |  2 +-
target/rx/helper.c      | 10 ++++++++--
target/tricore/cpu.c    |  2 +-
target/tricore/helper.c | 13 ++++++++++---
15 files changed, 71 insertions(+), 24 deletions(-)
[PATCH 0/5] alpha, avr, or1k, rx, tricore: Convert to translate_for_debug
Posted by Peter Maydell 1 month ago
Earlier this year I did some work on the API that target CPUs use to
provide "translate this virtual address to physical for a debug
access". We now have a new method, translate_for_debug, but still
support the old get_phys_addr_debug method as well.

This series does a bit of cleanup by converting five target
architectures from the legacy method to the new one. Conversion
is straightforward.

I have opted to follow the riscv translate_for_debug implementation in
having the returned attrs set .debug and not also .unspecified (via
MEMTXATTRS_UNSPECIFIED or otherwise), since on a per-architecture
basis we can see that we don't want to set any of the other attributes
in MemTxAttrs. This is a minor behaviour change from using the
fallback codepath in cpu_translate_for_debug(), which starts with
MEMTXATTRS_UNSPECIFIED and adds .debug, since it can't know whether
the target architecture makes use of the various attribute fields.
The only thing that we use the .unspecified field for is that the
IOMMUs check it to see if they can look at attrs.requester_id etc, and
debug accesses aren't going to be going through an IOMMU anyway, so
this isn't a behaviour change in practice.

(There are another 10 archs still to convert, but I figured I'd just
start with these five and see if there were review comments before
doing the rest of them.)

thanks
--PMM

Peter Maydell (5):
  target/alpha: Convert to translate_for_debug
  target/avr: Convert to translate_for_debug
  target/or1k: Convert to translate_for_debug
  target/rx: Convert to translate_for_debug
  target/tricore: Convert to translate_for_debug

 target/alpha/cpu.h      |  3 ++-
 target/avr/cpu.h        |  3 ++-
 target/or1k/cpu.h       |  3 ++-
 target/rx/cpu.h         |  3 ++-
 target/tricore/cpu.h    |  3 ++-
 target/alpha/cpu.c      |  2 +-
 target/alpha/helper.c   | 15 +++++++++++++--
 target/avr/cpu.c        |  2 +-
 target/avr/helper.c     | 11 +++++++++--
 target/or1k/cpu.c       |  2 +-
 target/or1k/mmu.c       | 21 ++++++++++++++++-----
 target/rx/cpu.c         |  2 +-
 target/rx/helper.c      | 10 ++++++++--
 target/tricore/cpu.c    |  2 +-
 target/tricore/helper.c | 13 ++++++++++---
 15 files changed, 71 insertions(+), 24 deletions(-)

-- 
2.43.0
Re: [PATCH 0/5] alpha, avr, or1k, rx, tricore: Convert to translate_for_debug
Posted by Philippe Mathieu-Daudé 1 month ago
On 20/10/26 14:27, Peter Maydell wrote:

> Peter Maydell (5):
>    target/alpha: Convert to translate_for_debug
>    target/avr: Convert to translate_for_debug
>    target/or1k: Convert to translate_for_debug
>    target/rx: Convert to translate_for_debug
>    target/tricore: Convert to translate_for_debug

Queued, thanks.