Skip to content

RFC memattrs: target/arm: add user-defined and requester ID memattrs

Joe Komlodi qemu-devel 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 RFC Latest5 patches 5 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/5target/arm: Add requester ID to memattrstarget/arm/cpu.c target/arm/cpu.h target/arm/ptw.c+15 -00 replies
2/5memattrs: Fix target_tlb_bit whitespaceinclude/exec/memattrs.h+3 -30 replies
3/5memattrs: Add user-defined attributeinclude/exec/memattrs.h+2 -01 reply
4/5target/arm: Add user-defined memattrstarget/arm/cpu.c target/arm/cpu.h target/arm/ptw.c+8 -00 replies
5/5hw/pci: Add user-defined memattrshw/pci/pci.c include/hw/pci/pci_device.h+4 -00 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [RFC PATCH 0/5] memattrs: target/arm: add user-defined and requester ID memattrs

Hi all,

This adds requester IDs to ARM CPUs and adds a "user-defined" memory attribute.

The requester ID on ARM CPUs is there because I've seen some cases where
there's an IOMMU between a CPU and memory that uses the CPU's requester
ID to look up how it should translate, such as an SMMU TBU or some other
IOMMU-like device.
For a specific downstream example I've seen, Xilinx overrides CPU
attributes with ones passed in by an object property in order to have
their IOMMUs work:
https://github.com/Xilinx/qemu/blob/23b643ba1683a47ef49447a45643fe2172d6f8ca/accel/tcg/cputlb.c#L1127.
The object property with the memory attributes is declared here, for
reference: https://github.com/Xilinx/qemu/blob/23b643ba1683a47ef49447a45643fe2172d6f8ca/target/arm/cpu.c#L1310.

The user-defined attribute represents optional user signals that are a part of AMBA-AXI. As the name suggests, these are defined per-implementation and devices that receive these have their own interpretation of what the user-defined attribute means.

We add them in CPUs and PCI transactions, because some of their attributes are set in functions in ways that are not user-facing. DMAs or other devices that set attributes (using address_space_rw or some other means), can add them on a per-device basis.

RFC because it's possible we might want this implementated in some other way, and it touches some pretty frequently used code that I'm somewhat familiar with, but not 100% familiar with.

Thanks,
Joe

Joe Komlodi (5):
target/arm: Add requester ID to memattrs
memattrs: Fix target_tlb_bit whitespace
memattrs: Add user-defined attribute
target/arm: Add user-defined memattrs
hw/pci: Add user-defined memattrs

 hw/pci/pci.c                | 3 +++
 include/exec/memattrs.h     | 8 +++++---
 include/hw/pci/pci_device.h | 1 +
 target/arm/cpu.c            | 6 ++++++
 target/arm/cpu.h            | 8 ++++++++
 target/arm/ptw.c            | 9 +++++++++
 6 files changed, 32 insertions(+), 3 deletions(-)
Signature · 1 line
2.44.0.rc0.258.g7320e95886-goog