Skip to content

hw/cxl: Link speed and width control

Jonathan Cameron linux-cxl qemu-devel 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest6 patches 4 repliesIn review

Changes since RFC from the cover letter

- rebase

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/6hw/pci-bridge/cxl_root_port: Provide x-speed and x-width properties.hw/pci-bridge/cxl_root_port.c+5 -01 reply
2/6hw/pci-bridge/cxl_upstream: Provide x-speed and x-width properties.hw/pci-bridge/cxl_downstream.c+10 -132 replies
3/6hw/pcie: Factor out PCI Express link register filling common to EP.hw/pci/pcie.c+48 -390 replies
4/6hw/pcie: Provide a utility function for control of EP / SW USP linkhw/pci/pcie.c include/hw/pci/pcie.h+20 -00 replies
5/6hw/mem/cxl-type3: Add properties to control link speed and widthhw/mem/cxl_type3.c include/hw/cxl/cxl_device.h+10 -00 replies
6/6hw/pci-bridge/cxl-upstream: Add properties to control link speed and widthhw/pci-bridge/cxl_upstream.c include/hw/pci-bridge/cxl_upstream_port.h+10 -00 replies

Reviews trailers per patch

1 of 6 patches has a Reviewed-by or Acked-by.

PatchFan Ni
1/6R-b
2/6
3/6
4/6
5/6
6/6

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH qemu 0/6] hw/cxl: Link speed and width control

Changes since RFC:
- rebase

Question:
- I could enable this for all PCIe device (including ports). Does that makes sense, or is it better to limit this to my cases? It is quite easy to build broken setups (downstream device reports faster link than the port etc) because QEMU 'link' training' is simplistic. I'm not sure it is worth making it more clever.

The Generic Ports support added the ability to describe the bandwidth and Latency within a host to a CXL host bridge. To be able to test the of the discovery path used by Linux [1] we also need to be able to create bottlenecks at difference places in the topology. There are two parts to this
* CXL link characteristics as described by PCI Express Capability Link status etc.
* Bandwidth and latency across CXL Switches (via CDAT data from the switch USP)
* Bandwidth and latency from the CXL type 3 device port to the actual memory (Via CDAT data from the EP).

Currently we have fixed values for the CXL CDAT tables, and to test this I recommend changing those as per the patch at the end of this cover letter (so they aren't always the bottleneck). Making those configurable will be handled in a future patch set.

RFC has a set of examples but those were to help testing the kernel code rather than providing much info for QEMU review so I haven't repeated them ehre.

https://lore.kernel.org/qemu-devel/[email protected]/

Jonathan Cameron (6):
hw/pci-bridge/cxl_root_port: Provide x-speed and x-width properties. hw/pci-bridge/cxl_upstream: Provide x-speed and x-width properties. hw/pcie: Factor out PCI Express link register filling common to EP. hw/pcie: Provide a utility function for control of EP / SW USP link hw/mem/cxl-type3: Add properties to control link speed and width hw/pci-bridge/cxl-upstream: Add properties to control link speed and
width

 include/hw/cxl/cxl_device.h               |   4 +
 include/hw/pci-bridge/cxl_upstream_port.h |   4 +
 include/hw/pci/pcie.h                     |   2 +
 hw/mem/cxl_type3.c                        |   6 ++
 hw/pci-bridge/cxl_downstream.c            |  23 +++--
 hw/pci-bridge/cxl_root_port.c             |   5 ++
 hw/pci-bridge/cxl_upstream.c              |   6 ++
 hw/pci/pcie.c                             | 105 ++++++++++++++--------
 8 files changed, 103 insertions(+), 52 deletions(-)
Signature · 1 line
2.43.0