Skip to content

hw/cxl: Move CXL emulation options and state to machines.

Jonathan Cameron linux-cxl qemu-devel 3 versions – New

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v3 Latest8 patches 0 repliesNew
  2. v28 patches 4 repliesSuperseded
  3. v18 patches 4 repliesSuperseded

Changes since v1 (thanks to Paolo Bonzini) from the cover letter

* Update 'description' of cxl-fmw as suggested to mention it's an array.
* Add a wrapper cxl_hook_up_pxb_registers() to cxl-host.c as it'll be common for all machines using CXL with PXB.

Patches in v3 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/8hw/cxl: Make the CXL fixed memory window setup a machine parameter.docs/system/devices/cxl.rst hw/core/machine.c hw/cxl/cxl-host-stubs.c +11 more+150 -1260 replies
2/8hw/acpi/cxl: Pass in the CXLState directly rather than MachineStatehw/acpi/cxl.c hw/i386/acpi-build.c include/hw/acpi/cxl.h+9 -90 replies
3/8hw/cxl: Push linking of CXL targets into i386/pc rather than in machine.chw/cxl/cxl-host-stubs.c hw/cxl/cxl-host.c hw/i386/pc.c +3 more+10 -100 replies
4/8tests/acpi: Allow modification of q35 CXL CEDT table.tests/qtest/bios-tables-test-allowed-diff.h+1 -00 replies
5/8pci/pci_expander_bridge: For CXL HB delay the HB register memory region setup.hw/cxl/cxl-host-stubs.c hw/cxl/cxl-host.c hw/i386/pc.c +5 more+75 -130 replies
6/8tests/acpi: Update q35/CEDT.cxl for new memory addresses.tests/data/acpi/q35/CEDT.cxl tests/qtest/bios-tables-test-allowed-diff.h+0 -10 replies
7/8hw/cxl: Move the CXLState from MachineState to machine type specific state.hw/core/machine.c hw/i386/acpi-build.c hw/i386/pc.c +2 more+21 -270 replies
8/8hw/machine: Drop cxl_supported flag as no longer usefulhw/i386/pc.c include/hw/boards.h+0 -20 replies

Reviews trailers per patch

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

PatchBen WidawskyDavidlohr Bueso
1/8R-b R-b
2/8R-b
3/8R-b
4/8R-b
5/8R-b
6/8R-b
7/8R-b
8/8R-b

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

Read the v3 thread

Cover letter [PATCH v3 0/8] hw/cxl: Move CXL emulation options and state to machines.

Changes since v2: (reviews from Davidlohr and Ben - thanks!)
- Update qemu-options.hx to reflect that cxl-fmw is now a machine property. (Davidlohr Bueso)
- Pick up David (patch 1) and Ben's RBs (all).

Changes since v1 (thanks to Paolo Bonzini)
* Update 'description' of cxl-fmw as suggested to mention it's an array.
* Add a wrapper cxl_hook_up_pxb_registers() to cxl-host.c as it'll be common for all machines using CXL with PXB.

V1 Cover letter:

Currently the only machine with CXL support upstream is i386/pc but arm/virt patches have been posted and once this is merged an updated series will follow. Switch support is queued behind this as well because they both include documentation updates.

Paolo Bonzini highlighted a couple of issues with the current CXL emulation code.

* Top level parameter rather than machine for fixed memory windows

The --cxl-fixed-memory-window top level command line parameters won't play well with efforts to make it possible to instantiate entire machines via RPC. Better to move these to be machine configuration. This change is relatively straight forward, but does result in very long command lines (cannot break fixed window setup into multiple -M entries).

* Move all CXL stuff to machine specific code and helpers

To simplify the various interactions between machine setup and host bridges etc, currently various CXL steps are called from the generic core/machine.c and softmmu/vl.c + there are CXL elements in MachineState.

Much of this is straight forward to do with one exception:
The CXL pci_expander_bridge host bridges require MMIO register space. This series does this by walking the bus and filling the register space in via the machine_done callback. This is similar to the walk done for identifying host bridges in the ACPI building code but it is rather ugly and postpones rejection of PXB_CXL instances where cxl=off (default).

All comments welcome, but the first patch at least changes the command-line so to avoid have to add backwards compatibility code, it would be great to merge that before 7.1 is released.

Thanks,

Jonathan

Jonathan Cameron (8):
hw/cxl: Make the CXL fixed memory window setup a machine parameter. hw/acpi/cxl: Pass in the CXLState directly rather than MachineState hw/cxl: Push linking of CXL targets into i386/pc rather than in
machine.c
tests/acpi: Allow modification of q35 CXL CEDT table. pci/pci_expander_bridge: For CXL HB delay the HB register memory
region setup.
tests/acpi: Update q35/CEDT.cxl for new memory addresses. hw/cxl: Move the CXLState from MachineState to machine type specific
state.
hw/machine: Drop cxl_supported flag as no longer useful

 docs/system/devices/cxl.rst                 |   4 +-
 hw/acpi/cxl.c                               |   9 +-
 hw/core/machine.c                           |  28 ------
 hw/cxl/cxl-host-stubs.c                     |   9 +-
 hw/cxl/cxl-host.c                           | 100 ++++++++++++++++++--
 hw/i386/acpi-build.c                        |   8 +-
 hw/i386/pc.c                                |  31 +++---
 hw/pci-bridge/meson.build                   |   5 +-
 hw/pci-bridge/pci_expander_bridge.c         |  32 ++++---
 hw/pci-bridge/pci_expander_bridge_stubs.c   |  14 +++
 include/hw/acpi/cxl.h                       |   5 +-
 include/hw/boards.h                         |   3 +-
 include/hw/cxl/cxl.h                        |   9 +-
 include/hw/cxl/cxl_host.h                   |  23 +++++
 include/hw/i386/pc.h                        |   2 +
 include/hw/pci-bridge/pci_expander_bridge.h |  12 +++
 qapi/machine.json                           |  13 +++
 qemu-options.hx                             |  73 +++++++-------
 softmmu/vl.c                                |  46 ---------
 tests/data/acpi/q35/CEDT.cxl                | Bin 184 -> 184 bytes
 tests/qtest/bios-tables-test.c              |   4 +-
 tests/qtest/cxl-test.c                      |   4 +-
 22 files changed, 256 insertions(+), 178 deletions(-)
 create mode 100644 hw/pci-bridge/pci_expander_bridge_stubs.c
 create mode 100644 include/hw/cxl/cxl_host.h
 create mode 100644 include/hw/pci-bridge/pci_expander_bridge.h
Signature · 1 line
2.32.0