qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: anisa.su887@gmail.com
To: qemu-devel@nongnu.org
Cc: Jonathan.Cameron@huawei.com, dave@stgolabs.net,
	linux-cxl@vger.kernel.org, Anisa Su <anisa.su@samsung.com>
Subject: [QEMU PATCH 0/1] CXL: Enable FMAPI Add for MHSLDs
Date: Sat, 27 Sep 2025 00:18:06 +0000	[thread overview]
Message-ID: <20250927002125.860668-1-anisa.su887@gmail.com> (raw)

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



             reply	other threads:[~2025-09-27  0:24 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-09-27  0:18 anisa.su887 [this message]
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

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=20250927002125.860668-1-anisa.su887@gmail.com \
    --to=anisa.su887@gmail.com \
    --cc=Jonathan.Cameron@huawei.com \
    --cc=anisa.su@samsung.com \
    --cc=dave@stgolabs.net \
    --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;
as well as URLs for NNTP newsgroup(s).