Skip to content

RFC support unaligned access to xHCI Capability

CJ Chen qemu-arm qemu-devel qemu-riscv 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v2 RFC Latest9 patches 16 repliesIn review

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/9doc/devel/memory.rst: additional explanation for unaligned accessdocs/devel/memory.rst+18 -02 replies
2/9hw/riscv: iommu-trap: remove .impl.unaligned = truehw/riscv/riscv-iommu.c+0 -11 reply
3/9hw: npcm7xx_fiu and mx_pic change .impl.unaligned = truehw/ssi/npcm7xx_fiu.c hw/xtensa/mx_pic.c+6 -04 replies
4/9hw/nvme/ctrl: specify the 'valid' field in MemoryRegionOpshw/nvme/ctrl.c+5 -00 replies
5/9system/memory: support unaligned accesssystem/memory.c system/physmem.c+119 -361 reply
6/9hw/usb/hcd-xhci: allow unaligned access to Capability Registershw/usb/hcd-xhci.c+3 -10 replies
7/9system/memory: assert on invalid unaligned combosystem/memory.c+1 -01 reply
8/9hw/misc: add test device for memory accesshw/misc/Kconfig hw/misc/memaccess-testdev.c hw/misc/meson.build +1 more+440 -02 replies
9/9tests/qtest: add test for memory region accesstests/qtest/memaccess-test.c tests/qtest/meson.build+606 -04 replies

Reviews trailers per patch

4 of 9 patches have a Reviewed-by or Acked-by.

PatchCJ ChenTomoyuki HiroseDaniel Henrique BarbozaPhilippe Mathieu-Daudé
1/9A-b
2/9T-b A-b R-b
3/9T-b A-b
4/9T-b Based-on-a-patch-by
5/9T-b Based-on-a-patch-by
6/9T-b Based-on-a-patch-by
7/9T-b A-b R-b
8/9T-b
9/9

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

Read the v2 thread

Cover letter [RFC PATCH v2 0/9] support unaligned access to xHCI Capability

This patch set aims to support unaligned access to xHCI Capability Registers.

To achieve this, we introduce the emulation of an unaligned access through multiple aligned accesses. This patch set also adds a test device and several tests using this device to verify that the emulation functions correctly.

Using these changes, unaligned access to xHCI Capability Registers is now supported.

During development, I required a lot of 'MemoryRegionOps' structs with its own read/write functions for tests. In the QEMU project, a large number of similar functions or structs are often written in '.inc' files. I followed this approach for the test functions but would appreciate feedback on whether this is appropriate.

---
v1 ... v2:
- Fix the typo of ops size of big-l-valid.
- Replaced the huge macro blocks with dynamic loops that fill in the MemoryRegionOps arrays at runtime.
- Remove test cases valid.unaligned = false,impl.unaligned = true.
- Modification to the memory document about the alignment issue.
- Update the npcm7xx_fiu, mx_pic and risc-v-iommu configuration to align with the unaligned-access policy.
- Document memory.rst clarify that .valid=true,.impl=false causes split unaligned accesses (may have side effects); forbid .valid=false,.impl=true via assertion.

---
CJ Chen (4):
doc/devel/memory.rst: additional explanation for unaligned access hw/riscv: iommu-trap: remove .impl.unaligned = true
hw: npcm7xx_fiu and mx_pic change .impl.unaligned = true system/memory: assert on invalid unaligned combo

Tomoyuki Hirose (5):
hw/nvme/ctrl: specify the 'valid' field in MemoryRegionOps system/memory: support unaligned access hw/usb/hcd-xhci: allow unaligned access to Capability Registers hw/misc: add test device for memory access tests/qtest: add test for memory region access

 docs/devel/memory.rst               |  18 +
 hw/misc/Kconfig                     |   4 +
 hw/misc/memaccess-testdev.c         | 331 +++++++++++++++
 hw/misc/meson.build                 |   1 +
 hw/nvme/ctrl.c                      |   5 +
 hw/riscv/riscv-iommu.c              |   1 -
 hw/ssi/npcm7xx_fiu.c                |   3 +
 hw/usb/hcd-xhci.c                   |   4 +-
 hw/xtensa/mx_pic.c                  |   3 +
 include/hw/misc/memaccess-testdev.h | 104 +++++
 system/memory.c                     | 148 +++++--
 system/physmem.c                    |   8 -
 tests/qtest/memaccess-test.c        | 597 ++++++++++++++++++++++++++++
 tests/qtest/meson.build             |   9 +
 14 files changed, 1198 insertions(+), 38 deletions(-)
 create mode 100644 hw/misc/memaccess-testdev.c
 create mode 100644 include/hw/misc/memaccess-testdev.h
 create mode 100644 tests/qtest/memaccess-test.c

base-commit: 5836af0783213b9355a6bbf85d9e6bc4c9c9363f

Signature · 1 line
2.25.1