From: Jonathan Cameron <Jonathan.Cameron@huawei.com>
To: Jonathan Cameron via <qemu-devel@nongnu.org>, <linuxarm@huawei.com>
Cc: "Jonathan Cameron" <Jonathan.Cameron@huawei.com>,
"Klaus Jensen" <k.jensen@samsung.com>,
cminyard@mvista.com, "Fan Ni" <fan.ni@samsung.com>,
"Anisa Su" <anisa.su@samsung.com>,
linux-cxl@vger.kernel.org, mst@redhat.com,
"Philippe Mathieu-Daudé" <philmd@linaro.org>
Subject: Re: [RFC PATCH qemu 3/5] hw/cxl/i2c_mctp_cxl: Initial device emulation
Date: Tue, 10 Jun 2025 17:39:05 +0100 [thread overview]
Message-ID: <20250610170104.00001392@huawei.com> (raw)
In-Reply-To: <20250609163334.922346-4-Jonathan.Cameron@huawei.com>
On Mon, 9 Jun 2025 17:33:31 +0100
Jonathan Cameron via <qemu-devel@nongnu.org> wrote:
> The CCI and Fabric Manager APIs are used to configure CXL switches and
> devices. DMTF has defined an MCTP binding specification to carry these
> messages. The end goal of this work is to hook this up to emulated CXL
> switches and devices to allow control of the configuration.
>
> Since this relies on i2c target mode, this can currently only be used with
> an SoC that includes the Aspeed I2C controller.
>
> Note, only get timestamp added for now.
>
> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Not very important given this is an RFC, but a chunk of code in here isn't
used so I'll drop it from future version...
(I noticed whilst wondering why Anisa didn't update it in they
FMAPI DCD series).
> ---
> include/hw/cxl/cxl_device.h | 8 +
> include/hw/pci-bridge/cxl_upstream_port.h | 1 +
> hw/cxl/cxl-mailbox-utils.c | 49 ++++
> hw/cxl/i2c_mctp_cxl.c | 289 ++++++++++++++++++++++
> hw/cxl/Kconfig | 4 +
> hw/cxl/meson.build | 4 +
> 6 files changed, 355 insertions(+)
>
> diff --git a/include/hw/cxl/cxl_device.h b/include/hw/cxl/cxl_device.h
> index 6086d4c85b..8d87c7151e 100644
> --- a/include/hw/cxl/cxl_device.h
> +++ b/include/hw/cxl/cxl_device.h
> @@ -360,6 +360,10 @@ int cxl_process_cci_message(CXLCCI *cci, uint8_t set, uint8_t cmd,
> size_t len_in, uint8_t *pl_in,
> size_t *len_out, uint8_t *pl_out,
> bool *bg_started);
> +
> +void cxl_initialize_t3_mctpcci(CXLCCI *cci, DeviceState *d, DeviceState *intf,
> + size_t payload_max);
> +
> diff --git a/hw/cxl/cxl-mailbox-utils.c b/hw/cxl/cxl-mailbox-utils.c
> index 475547f212..4c9852642e 100644
> --- a/hw/cxl/cxl-mailbox-utils.c
> +++ b/hw/cxl/cxl-mailbox-utils.c
> @@ -3690,6 +3690,29 @@ void cxl_initialize_mailbox_t3(CXLCCI *cci, DeviceState *d, size_t payload_max)
> cxl_init_cci(cci, payload_max);
> }
>
> +static const struct cxl_cmd cxl_cmd_set_t3_mctp[256][256] = {
> + [INFOSTAT][IS_IDENTIFY] = { "IDENTIFY", cmd_infostat_identify, 0, 0 },
> + [INFOSTAT][GET_RESPONSE_MSG_LIMIT] = { "GET_RESPONSE_MSG_LIMIT",
> + cmd_get_response_msg_limit, 0, 0 },
> + [INFOSTAT][SET_RESPONSE_MSG_LIMIT] = { "SET_RESPONSE_MSG_LIMIT",
> + cmd_set_response_msg_limit, 1, 0 },
> + [TIMESTAMP][GET] = { "TIMESTAMP_GET", cmd_timestamp_get, 0, 0 },
> + [LOGS][GET_SUPPORTED] = { "LOGS_GET_SUPPORTED", cmd_logs_get_supported, 0,
> + 0 },
> + [LOGS][GET_LOG] = { "LOGS_GET_LOG", cmd_logs_get_log, 0x18, 0 },
> + [TUNNEL][MANAGEMENT_COMMAND] = { "TUNNEL_MANAGEMENT_COMMAND",
> + cmd_tunnel_management_cmd, ~0, 0 },
> +};
> +
> +void cxl_initialize_t3_mctpcci(CXLCCI *cci, DeviceState *d, DeviceState *intf,
> + size_t payload_max)
> +{
> + cxl_copy_cci_commands(cci, cxl_cmd_set_t3_mctp);
> + cci->d = d;
> + cci->intf = intf;
> + cxl_init_cci(cci, payload_max);
> +}
> +
At some point a while back, when adding tunneling we decided to pretend
we have an MLD (because it's more general) and as such introduced the fm owned
mctpcci. That's the one one that is used for the landing point of mctp
links to a type 3 device. So this code is unused.
next prev parent reply other threads:[~2025-06-10 16:39 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-06-09 16:33 [RFC PATCH qemu 0/5] hw/cxl/mctp/i2c/usb: MCTP for OoB control of CXL devices Jonathan Cameron
2025-06-09 16:33 ` [RFC PATCH qemu 1/5] hw/i2c: add smbus pec utility function Jonathan Cameron
2025-06-09 16:33 ` [RFC PATCH qemu 2/5] hw/i2c: add mctp core Jonathan Cameron
2025-06-09 16:33 ` [RFC PATCH qemu 3/5] hw/cxl/i2c_mctp_cxl: Initial device emulation Jonathan Cameron
2025-06-10 16:39 ` Jonathan Cameron [this message]
2025-06-09 16:33 ` [RFC PATCH qemu 4/5] docs: cxl: Add example commandline for MCTP CXL CCIs Jonathan Cameron
2025-06-09 16:33 ` [RFC PATCH qemu 5/5] usb/mctp/cxl: CXL FMAPI interface via MCTP over usb Jonathan Cameron
2025-06-24 19:47 ` [RFC PATCH qemu 0/5] hw/cxl/mctp/i2c/usb: MCTP for OoB control of CXL devices 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=20250610170104.00001392@huawei.com \
--to=jonathan.cameron@huawei.com \
--cc=anisa.su@samsung.com \
--cc=cminyard@mvista.com \
--cc=fan.ni@samsung.com \
--cc=k.jensen@samsung.com \
--cc=linux-cxl@vger.kernel.org \
--cc=linuxarm@huawei.com \
--cc=mst@redhat.com \
--cc=philmd@linaro.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