Linux CXL
 help / color / mirror / Atom feed
From: Joshua Lant <joshualant@gmail.com>
To: linux-cxl@vger.kernel.org
Cc: qemu-devel@nongnu.org, Jonathan.Cameron@huawei.com,
	arpit1.kumar@samsung.com, Joshua Lant <joshualant@gmail.com>
Subject: [RFC QEMU PATCH 01/10] docs: Add documentation for cxl-vcs-switch
Date: Wed, 29 Apr 2026 14:48:35 +0100	[thread overview]
Message-ID: <20260429135717.3048713-2-joshualant@gmail.com> (raw)
In-Reply-To: <20260429135717.3048713-1-joshualant@gmail.com>

Signed-off-by: Joshua Lant <joshualant@gmail.com>
---
 docs/system/devices/cxl.rst | 90 ++++++++++++++++++++++++++++++++++---
 1 file changed, 85 insertions(+), 5 deletions(-)

diff --git a/docs/system/devices/cxl.rst b/docs/system/devices/cxl.rst
index 32b1b5d773..9e8452e576 100644
--- a/docs/system/devices/cxl.rst
+++ b/docs/system/devices/cxl.rst
@@ -119,11 +119,11 @@ and associated component register access via PCI bars.
 CXL Switch
 ~~~~~~~~~~
 Here we consider a simple CXL switch with only a single
-virtual hierarchy. Whilst more complex devices exist, their
-visibility to a particular host is generally the same as for
-a simple switch design. Hosts often have no awareness
-of complex rerouting and device pooling, they simply see
-devices being hot added or hot removed.
+virtual hierarchy. Whilst more complex devices exist (see VCS
+Switching below), their visibility to a particular host is
+generally the same as for a simple switch design. Hosts often
+have no awareness of complex rerouting and device pooling,
+they simply see devices being hot added or hot removed.
 
 A CXL switch has a similar architecture to those in PCIe,
 with a single upstream port, internal PCI bus and multiple
@@ -467,6 +467,86 @@ Example configuration:
 Guest OS communication with the MCTP CCI can then be established using standard
 MCTP configuration tools.
 
+CXL Multi-VCS Switching
+-----------------------
+
+The cxl-vcs-switch object allows for a Fabric Manager to dynamically reconfigure
+the switching within a multi-upstream port CXL/PCIe topology, This moves beyond
+the static switching configuration described above. The use of vcs=X on an
+endpoint device indicates that it should be hidden from guests at boot. Each
+upstream port with vcs=X set will conceptually become an upstream PPB. Any
+downstream port that is connected to an upstream port with vcs=X set will
+automatically become a vPPB for that VCS. The overall cxl-virtual-switch has a
+single CCI mailbox used for config/status of all ports within the switch.
+Setting local-fm=true indicates that this QEMU instance has the CCI mailbox
+attached. Setting it false will create listeners for commands from a remote
+QEMU process (yet to be implemented).
+
+An example of how the topology is described on the CLI is shown below:
+
+  -object cxl-vcs-switch,id=vcs0,usp-ppbs=2,dsp-ppbs=4,local-fm=true \
+  -device pxb-cxl,bus_nr=12,bus=pcie.0,id=cxl.0,hdm_for_passthrough=true \
+  -device cxl-rp,port=0,bus=cxl.0,id=root_port1,chassis=0,slot=1 \
+  -device pxb-cxl,bus_nr=22,bus=pcie.0,id=cxl.1,hdm_for_passthrough=true \
+  -device cxl-rp,port=0,bus=cxl.1,id=root_port2,chassis=1,slot=1 \
+  -device cxl-upstream,port=0,sn=1234,bus=root_port1,id=us0,addr=0.0,multifunction=on,vcs=vcs0,usppb=0 \
+  -device cxl-upstream,port=0,sn=5678,bus=root_port2,id=us1,addr=0.0,multifunction=on,vcs=vcs0,usppb=1 \
+  -device cxl-switch-mailbox-cci,bus=root_port1,addr=0.3,target=vcs0 \
+  -device usb-cxl-mctp,bus=ehci.0,id=usb0,target=vcs0 \
+  -device cxl-downstream,port=0,bus=us0,id=dsp0,slot=3 \
+  -device cxl-downstream,port=1,bus=us0,id=dsp1,slot=4 \
+  -device cxl-downstream,port=0,bus=us1,id=dsp2,slot=7 \
+  -device cxl-downstream,port=1,bus=us1,id=dsp3,slot=8 \
+  -device cxl-type3,persistent-memdev=cxl-mem1,id=cxl-ep1,lsa=cxl-lsa1,sn=99,vcs=vcs0,dsppb=0 \
+  -device cxl-type3,persistent-memdev=cxl-mem2,id=cxl-ep2,lsa=cxl-lsa2,sn=100,vcs=vcs0,dsppb=1 \
+  -device cxl-type3,persistent-memdev=cxl-mem3,id=cxl-ep3,lsa=cxl-lsa3,sn=101,vcs=vcs0,dsppb=2 \
+  -device cxl-type3,persistent-memdev=cxl-mem4,id=cxl-ep4,lsa=cxl-lsa4,sn=102,vcs=vcs0,dsppb=3 \
+  -machine cxl-fmw.0.targets.0=cxl.0,cxl-fmw.0.size=8G,cxl-fmw.1.targets.0=cxl.1,cxl-fmw.1.size=8G
+
+Example topology involving VCS switching::
+
+               +--------------------+  +--------------------+
+               |   Host Bridge 0    |  |   Host Bridge 1    |
+               +----------+---------+  +----------+---------+
+    +-------+             |                       |
+    | MCTP  |             |                       |
+    | USB/  |  +----------+---------+  +----------+---------+
+    | I2C   |  |    Root Port 0     |  |    Root Port 1     |
+    +-----+-+  +----------+---------+  +----------+---------+
+          |               |                       |
+          |               |                       |
+   +------|---------------+-----------------------+-----------------------+
+   |    +-+--------+      |  cxl-vcs-switch (vcs0)|                       |
+   | +--| CCI MBOX |---*  |                       |                       |
+   | |  +----------+      |                       |                       |
+   | |  +-----------------+--------+      +-------+------------------+    |
+   | +--+                 |   VCS0 |  *---+       |             VCS1 |    |
+   |    | +---------------+------+ |      | +-----+----------------+ |    |
+   |    | |                      | |      | |                      | |    |
+   |    | |        USP 0         | |      | |        USP 1         | |    |
+   |    | |                      | |      | |                      | |    |
+   |    | +----+------------+----+ |      | +----+------------+----+ |    |
+   |    |      |            |      |      |      |            |      |    |
+   |    | +----+----+  +----+----+ |      | +----+----+  +----+----+ |    |
+   |    | |  DSP 0  |  |  DSP 1  | |      | |  DSP 2  |  |  DSP 3  | |    |
+   |    | |(vPPB 0) |  |(vPPB 1) | |      | |(vPPB 0) |  |(vPPB 1) | |    |
+   |    | |         |  |         | |      | |         |  |         | |    |
+   |    | +---------+  +---------+ |      | +---------+  +----+----+ |    |
+   |    +--------------------------+      +-------------------+------+    |
+   |                                                          |           |
+   |           +----------------------------------------------+           |
+   |           |                                                          |
+   |           |            -                    -            -           |
+   +-----------|------------|--------------------|------------|-----------+
+               |            |                    |            |
+          +---------+  +---------+          +---------+  +---------+
+          |CXL/PCIe |  |CXL/PCIe |          |CXL/PCIe |  |CXL/PCIe |
+          |  EP 0   |  |  EP 1   |          |  EP 2   |  |  EP 3   |
+          | (PPB0)  |  | (PPB1)  |          | (PPB2)  |  | (PPB3)  |
+          +---------+  +---------+          +---------+  +---------+
+                 PPB0 Bound to VCS1, vPPB1. Others unbound...
+
+
 References
 ----------
 
-- 
2.47.3


  reply	other threads:[~2026-04-29 13:57 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-29 13:48 [RFC QEMU PATCH 00/10] Initial Support for VCS Switching Joshua Lant
2026-04-29 13:48 ` Joshua Lant [this message]
2026-04-29 13:48 ` [RFC QEMU PATCH 02/10] qdev/qbus: Allow hidden devices to be busless on QEMU startup Joshua Lant
2026-04-29 13:48 ` [RFC QEMU PATCH 03/10] cxl-type3: Properly unmap the memory-backend on device exit Joshua Lant
2026-04-29 13:48 ` [RFC QEMU PATCH 04/10] cxl_downstream: enable power controller present capability Joshua Lant
2026-04-29 13:48 ` [RFC QEMU PATCH 05/10] cxl-vcs-switch: Initial support for CXL VCS Joshua Lant
2026-04-29 13:48 ` [RFC QEMU PATCH 06/10] cxl-upstream-port: Add support for targeting a VCS switch Joshua Lant
2026-04-29 13:48 ` [RFC QEMU PATCH 07/10] cxl-downstream-port: Add support for VCS switching Joshua Lant
2026-04-29 13:48 ` [RFC QEMU PATCH 08/10] cxl-cci-mailbox: Add support for targeting a VCS switch Joshua Lant
2026-04-29 13:48 ` [RFC QEMU PATCH 09/10] cxl-mailbox-utils: Add support for VCS bind/unbind commands Joshua Lant
2026-04-29 13:48 ` [RFC QEMU PATCH 10/10] cxl-mailbox-utils: Add support for VCS Get Virtual CXL Switch Info command Joshua Lant

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260429135717.3048713-2-joshualant@gmail.com \
    --to=joshualant@gmail.com \
    --cc=Jonathan.Cameron@huawei.com \
    --cc=arpit1.kumar@samsung.com \
    --cc=linux-cxl@vger.kernel.org \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox