qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [QEMU PATCH 0/1] CXL: Enable FMAPI Add for MHSLDs
@ 2025-09-27  0:18 anisa.su887
  2025-09-27  0:18 ` [QEMU PATCH 1/1] hw/cxl/cxl-mailbox-utils: Enable FMAPI Initiate Add for MHSLD anisa.su887
  0 siblings, 1 reply; 4+ messages in thread
From: anisa.su887 @ 2025-09-27  0:18 UTC (permalink / raw)
  To: qemu-devel; +Cc: Jonathan.Cameron, dave, linux-cxl, Anisa Su

From: Anisa Su <anisa.su@samsung.com>

This patch adds support for FMAPI Initiate Add command (5604h) for MHSLDs. It
is based on the following branch:
https://gitlab.com/jic23/qemu/-/tree/cxl-2025-07-03

This code was tested by starting 2 VMs, host_1, which initializes the MHSLD, and
host_2, with the following topologies, then sending the FMAPI command from both
hosts.

host_1 = "-device usb-ehci,id=ehci \
     -object memory-backend-file,id=cxl-mem1,mem-path=/tmp/t3_cxl1.raw,size=4G \
     -object memory-backend-file,id=cxl-lsa1,mem-path=/tmp/t3_lsa1.raw,size=1M \
     -device pxb-cxl,bus_nr=12,bus=pcie.0,id=cxl.1,hdm_for_passthrough=true \
     -device cxl-rp,port=0,bus=cxl.1,id=cxl_rp_port0,chassis=0,slot=2 \
     -device cxl-mhsld,bus=cxl_rp_port0,num-dc-regions=2,volatile-dc-memdev=cxl-mem1,id=cxl-mhd0,sn=99,mhd-head=0,mhd-state_file=mhd_metadata,mhd-init=true \
     -device usb-cxl-mctp,bus=ehci.0,id=usb0,target=cxl-mhd0\
     -machine cxl-fmw.0.targets.0=cxl.1,cxl-fmw.0.size=4G,cxl-fmw.0.interleave-granularity=1k"

host_2 = "-device usb-ehci,id=ehci \
     -object memory-backend-file,id=cxl-mem1,mem-path=/tmp/t3_cxl1.raw,size=4G \
     -object memory-backend-file,id=cxl-lsa1,mem-path=/tmp/t3_lsa1.raw,size=1M \
     -device pxb-cxl,bus_nr=12,bus=pcie.0,id=cxl.1,hdm_for_passthrough=true \
     -device cxl-rp,port=0,bus=cxl.1,id=cxl_rp_port0,chassis=0,slot=2 \
     -device cxl-mhsld,bus=cxl_rp_port0,num-dc-regions=2,volatile-dc-memdev=cxl-mem1,id=cxl-mhd0,sn=99,mhd-head=1,mhd-state_file=mhd_metadata,mhd-init=false \
     -device usb-cxl-mctp,bus=ehci.0,id=usb0,target=cxl-mhd0\
     -machine cxl-fmw.0.targets.0=cxl.1,cxl-fmw.0.size=4G,cxl-fmw.0.interleave-granularity=1k"

libcxlmi is cloned on both hosts and used to send the FMAPI add/release commands
from both host_1 and host_2 and the expected behavior is verified by printing
the response payload from the Get DC Region Lists command (5603h).
The following interactive program from libcxlmi is
used to do so: https://github.com/computexpresslink/libcxlmi/blob/main/examples/fmapi-mctp.c

Question:
Currently, the input payload to FMAPI Init Add contains an array of CXLDCExtentRaw
elements. The mshld_reserve_extents() function expects a pointer of type
CxlDynamicCapacityExtentList, so a loop is introduced to convert CXLDCExtentRaw[]
to CxlDynamicCapacityExtentList.

I am wondering why the typedefs for extents/extent list in qapi-types-cxl.h
are separate from the typedefs in cxl_device.h? Is there a nice way to avoid
introducing a loop here just to convert types here?

Anisa Su (1):
  hw/cxl/cxl-mailbox-utils: Enable FMAPI Initiate Add for MHSLD

 hw/cxl/cxl-mailbox-utils.c | 25 +++++++++++++++++++++++++
 1 file changed, 25 insertions(+)

-- 
2.51.0



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2025-10-28 16:58 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-09-27  0:18 [QEMU PATCH 0/1] CXL: Enable FMAPI Add for MHSLDs anisa.su887
2025-09-27  0:18 ` [QEMU PATCH 1/1] hw/cxl/cxl-mailbox-utils: Enable FMAPI Initiate Add for MHSLD anisa.su887
2025-10-28 16:21   ` Jonathan Cameron via
2025-10-28 16:56     ` Anisa Su

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).