Skip to content

hw/net/xilinx_ethlite: Map RAM buffers as RAM and remove tswap() calls

Philippe Mathieu-Daudé qemu-arm qemu-devel 3 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest posting 2/219 patches 2 repliesIn review
  2. v2 posting 1/24 of 19 patches 0 repliesSuperseded
  3. v120 patches 24 repliesSuperseded

Changes in v2 from the cover letter

- Addressed Edgar review comments
- New patch to map RSVD I/O region (Paolo)
- Added Edgar R-b tags

Patches in v2 posting 2/2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/19hw/microblaze: Restrict MemoryRegionOps are implemented as 32-bithw/char/xilinx_uartlite.c hw/intc/xilinx_intc.c hw/net/xilinx_ethlite.c +1 more+16 -00 replies
2/19hw/net/xilinx_ethlite: Convert some debug logs to trace eventshw/net/trace-events hw/net/xilinx_ethlite.c+7 -20 replies
3/19hw/net/xilinx_ethlite: Remove unuseful debug logshw/net/xilinx_ethlite.c+0 -80 replies
4/19hw/net/xilinx_ethlite: Update QOM stylehw/net/xilinx_ethlite.c+22 -260 replies
5/19hw/net/xilinx_ethlite: Correct maximum RX buffer sizehw/net/xilinx_ethlite.c+5 -10 replies
6/19hw/net/xilinx_ethlite: Map MDIO registers (as unimplemented)hw/net/xilinx_ethlite.c+12 -00 replies
7/19hw/net/xilinx_ethlite: Rename rxbuf -> port_indexhw/net/xilinx_ethlite.c+5 -60 replies
8/19hw/net/xilinx_ethlite: Introduce txbuf_ptr() helperhw/net/xilinx_ethlite.c+16 -20 replies
9/19hw/net/xilinx_ethlite: Introduce rxbuf_ptr() helperhw/net/xilinx_ethlite.c+30 -100 replies
10/19hw/net/xilinx_ethlite: Access TX_GIE register for each porthw/net/xilinx_ethlite.c+10 -20 replies
11/19hw/net/xilinx_ethlite: Access TX_LEN register for each porthw/net/xilinx_ethlite.c+6 -20 replies
12/19hw/net/xilinx_ethlite: Access TX_CTRL register for each porthw/net/xilinx_ethlite.c+7 -80 replies
13/19hw/net/xilinx_ethlite: Map RX_CTRL as MMIOhw/net/xilinx_ethlite.c+67 -150 replies
14/19hw/net/xilinx_ethlite: Map TX_LEN as MMIOhw/net/xilinx_ethlite.c+61 -120 replies
15/19hw/net/xilinx_ethlite: Map TX_GIE as MMIOhw/net/xilinx_ethlite.c+7 -100 replies
16/19hw/net/xilinx_ethlite: Map TX_CTRL as MMIOhw/net/xilinx_ethlite.c+24 -300 replies
17/19hw/net/xilinx_ethlite: Map the RAM buffer as RAM memory regionhw/net/xilinx_ethlite.c+17 -640 replies
18/19hw/net/xilinx_ethlite: Rename 'mmio' MR as 'container'hw/net/xilinx_ethlite.c+8 -80 replies
19/19hw/net/xilinx_ethlite: Map RESERVED I/O as unimplementedhw/net/xilinx_ethlite.c+11 -01 reply

Reviews trailers per patch

All 19 patches have a Reviewed-by or Acked-by.

PatchAnton JohanssonEdgar E. IglesiasAlex Bennée
1/19R-b
2/19R-b
3/19R-b
4/19R-b
5/19R-b
6/19R-b
7/19R-b
8/19R-b
9/19R-b
10/19R-b
11/19R-b
12/19R-b
13/19R-b
14/19R-b
15/19R-b
16/19R-b
17/19R-b
18/19R-b
19/19R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 3 reviewers.

Read the v2 thread

Cover letter [PATCH RESEND v2 00/19] hw/net/xilinx_ethlite: Map RAM buffers as RAM and remove tswap() calls

Missing review: patch #19 (new)

Since v1:
- Addressed Edgar review comments
- New patch to map RSVD I/O region (Paolo)
- Added Edgar R-b tags

This is the result of a long discussion with Edgar (started few years ago!) and Paolo:
https://lore.kernel.org/qemu-devel/[email protected]/
After clarification from Richard on MMIO/RAM accesses, I figured strengthening the model regions would make things obvious, eventually allowing to remove the tswap() calls for good.

This costly series mostly plays around with MemoryRegions.

The model has a mix of RAM/MMIO in its address range. Currently they are implemented as a MMIO array of u32. Since the core memory layer swaps accesses for MMIO, the device implementation has to swap them back.
In order to avoid that, we'll map the RAM regions as RAM MRs. First we move each MMIO register to new MMIO regions (RX and TX). Then what is left are the RAM buffers; we convert them to RAM MRs, removing the need for tswap() at all.

Once reviewed, I'll respin my "hw/microblaze: Allow running cross-endian vCPUs" series based on this.

Tested using 'make check-functional-microblaze{,el}'.

Please review,

Phil.

Philippe Mathieu-Daudé (19):
hw/microblaze: Restrict MemoryRegionOps are implemented as 32-bit hw/net/xilinx_ethlite: Convert some debug logs to trace events hw/net/xilinx_ethlite: Remove unuseful debug logs hw/net/xilinx_ethlite: Update QOM style hw/net/xilinx_ethlite: Correct maximum RX buffer size hw/net/xilinx_ethlite: Map MDIO registers (as unimplemented) hw/net/xilinx_ethlite: Rename rxbuf -> port_index hw/net/xilinx_ethlite: Introduce txbuf_ptr() helper hw/net/xilinx_ethlite: Introduce rxbuf_ptr() helper hw/net/xilinx_ethlite: Access TX_GIE register for each port hw/net/xilinx_ethlite: Access TX_LEN register for each port hw/net/xilinx_ethlite: Access TX_CTRL register for each port hw/net/xilinx_ethlite: Map RX_CTRL as MMIO hw/net/xilinx_ethlite: Map TX_LEN as MMIO hw/net/xilinx_ethlite: Map TX_GIE as MMIO hw/net/xilinx_ethlite: Map TX_CTRL as MMIO hw/net/xilinx_ethlite: Map the RAM buffer as RAM memory region hw/net/xilinx_ethlite: Rename 'mmio' MR as 'container' hw/net/xilinx_ethlite: Map RESERVED I/O as unimplemented

 hw/char/xilinx_uartlite.c |   4 +
 hw/intc/xilinx_intc.c     |   4 +
 hw/net/xilinx_ethlite.c   | 371 ++++++++++++++++++++++++--------------
 hw/timer/xilinx_timer.c   |   4 +
 hw/net/trace-events       |   4 +
 5 files changed, 256 insertions(+), 131 deletions(-)
Signature · 1 line
2.45.2