From: Jonathan Cameron <Jonathan.Cameron@huawei.com>
To: Arpit Kumar <arpit1.kumar@samsung.com>
Cc: <qemu-devel@nongnu.org>, <gost.dev@samsung.com>,
<linux-cxl@vger.kernel.org>, <nifan.cxl@gmail.com>,
<dave@stgolabs.net>, <vishak.g@samsung.com>,
<krish.reddy@samsung.com>, <a.manzanares@samsung.com>,
<alok.rathore@samsung.com>
Subject: Re: [PATCH 2/3] hw/cxl/cxl-mailbox-utils.c: Added support for Clear Log (Opcode 0403h)
Date: Tue, 4 Feb 2025 10:53:42 +0000 [thread overview]
Message-ID: <20250204105342.00000c31@huawei.com> (raw)
In-Reply-To: <20250203055950.2126627-3-arpit1.kumar@samsung.com>
On Mon, 3 Feb 2025 11:29:49 +0530
Arpit Kumar <arpit1.kumar@samsung.com> wrote:
Add some description of what is being added here.
Key issue in here is that clearing the CEL doesn't make
sense. It is a description of what the device supports, there
is no state to clear in it. To add this command you need
to pick a different log.
Jonathan
> Signed-off-by: Arpit Kumar <arpit1.kumar@samsung.com>
> Reviewed-by: Alok Rathore <alok.rathore@samsung.com>
> Reviewed-by: Krishna Kanth Reddy <krish.reddy@samsung.com>
> ---
> hw/cxl/cxl-mailbox-utils.c | 36 ++++++++++++++++++++++++++++++++++++
> 1 file changed, 36 insertions(+)
>
> diff --git a/hw/cxl/cxl-mailbox-utils.c b/hw/cxl/cxl-mailbox-utils.c
> index 3d66a425a9..5fd7f850c4 100644
> --- a/hw/cxl/cxl-mailbox-utils.c
> +++ b/hw/cxl/cxl-mailbox-utils.c
> @@ -77,6 +77,7 @@ enum {
> #define GET_SUPPORTED 0x0
> #define GET_LOG 0x1
> #define GET_LOG_CAPABILITIES 0x2
> + #define CLEAR_LOG 0x3
> FEATURES = 0x05,
> #define GET_SUPPORTED 0x0
> #define GET_FEATURE 0x1
> @@ -1115,6 +1116,39 @@ static CXLRetCode cmd_logs_get_log_capabilities(const struct cxl_cmd *cmd,
> return CXL_MBOX_SUCCESS;
> }
>
> +/* CXL r3.1 Section 8.2.9.5.4: Clear Log (Opcode 0403h) */
> +static CXLRetCode cmd_logs_clear_log(const struct cxl_cmd *cmd,
> + uint8_t *payload_in,
> + size_t len_in,
> + uint8_t *payload_out,
> + size_t *len_out,
> + CXLCCI *cci)
> +{
> + int32_t cap_id;
> + struct {
> + QemuUUID uuid;
> + } QEMU_PACKED QEMU_ALIGNED(8) * clear_log = (void *)payload_in;
> +
> + cap_id = valid_log_check(&clear_log->uuid, cci);
> + if (cap_id == -1) {
> + return CXL_MBOX_INVALID_LOG;
> + }
Follow on from previous patch, if this returns the cap pointer,
the following code wont have to index the array and should end up simpler.
> +
> + if (cci->supported_log_cap[cap_id].param_flags.clear_log_supported) {
I would flip this.
if (!(cap->param_flags & PARAM_FLAG_CLEAR_LOG_SUPPORTED)) {
return CXL_MBOX_UNSUPPORTED;
}
> + switch (cap_id) {
> + case CEL:
So if we return the cap as suggested, it will have to reference what it is
or provide a callback (which might be cleaner as this grows).
However, what does clearly the command effects log mean?
This makes no sense. So if you want to implement clear_log you
need to implement a different log to clear.
> + memset(cci->cel_log, 0, (1 << 16) * sizeof(struct cel_log));
> + cci->cel_size = 0;
> + break;
> + default:
> + return CXL_MBOX_UNSUPPORTED;
> + }
> + } else {
> + return CXL_MBOX_UNSUPPORTED;
> + }
> + return CXL_MBOX_SUCCESS;
> +}
> +
> /* CXL r3.1 section 8.2.9.6: Features */
> /*
> * Get Supported Features output payload
> @@ -2882,6 +2916,8 @@ static const struct cxl_cmd cxl_cmd_set[256][256] = {
> [LOGS][GET_LOG] = { "LOGS_GET_LOG", cmd_logs_get_log, 0x18, 0 },
> [LOGS][GET_LOG_CAPABILITIES] = { "LOGS_GET_LOG_CAPABILITIES",
> cmd_logs_get_log_capabilities, 0x10, 0 },
> + [LOGS][CLEAR_LOG] = { "LOGS_CLEAR_LOG", cmd_logs_clear_log, 0x10,
> + CXL_MBOX_IMMEDIATE_LOG_CHANGE},
> [FEATURES][GET_SUPPORTED] = { "FEATURES_GET_SUPPORTED",
> cmd_features_get_supported, 0x8, 0 },
> [FEATURES][GET_FEATURE] = { "FEATURES_GET_FEATURE",
WARNING: multiple messages have this Message-ID (diff)
From: Jonathan Cameron via <qemu-devel@nongnu.org>
To: Arpit Kumar <arpit1.kumar@samsung.com>
Cc: <qemu-devel@nongnu.org>, <gost.dev@samsung.com>,
<linux-cxl@vger.kernel.org>, <nifan.cxl@gmail.com>,
<dave@stgolabs.net>, <vishak.g@samsung.com>,
<krish.reddy@samsung.com>, <a.manzanares@samsung.com>,
<alok.rathore@samsung.com>
Subject: Re: [PATCH 2/3] hw/cxl/cxl-mailbox-utils.c: Added support for Clear Log (Opcode 0403h)
Date: Tue, 4 Feb 2025 10:53:42 +0000 [thread overview]
Message-ID: <20250204105342.00000c31@huawei.com> (raw)
In-Reply-To: <20250203055950.2126627-3-arpit1.kumar@samsung.com>
On Mon, 3 Feb 2025 11:29:49 +0530
Arpit Kumar <arpit1.kumar@samsung.com> wrote:
Add some description of what is being added here.
Key issue in here is that clearing the CEL doesn't make
sense. It is a description of what the device supports, there
is no state to clear in it. To add this command you need
to pick a different log.
Jonathan
> Signed-off-by: Arpit Kumar <arpit1.kumar@samsung.com>
> Reviewed-by: Alok Rathore <alok.rathore@samsung.com>
> Reviewed-by: Krishna Kanth Reddy <krish.reddy@samsung.com>
> ---
> hw/cxl/cxl-mailbox-utils.c | 36 ++++++++++++++++++++++++++++++++++++
> 1 file changed, 36 insertions(+)
>
> diff --git a/hw/cxl/cxl-mailbox-utils.c b/hw/cxl/cxl-mailbox-utils.c
> index 3d66a425a9..5fd7f850c4 100644
> --- a/hw/cxl/cxl-mailbox-utils.c
> +++ b/hw/cxl/cxl-mailbox-utils.c
> @@ -77,6 +77,7 @@ enum {
> #define GET_SUPPORTED 0x0
> #define GET_LOG 0x1
> #define GET_LOG_CAPABILITIES 0x2
> + #define CLEAR_LOG 0x3
> FEATURES = 0x05,
> #define GET_SUPPORTED 0x0
> #define GET_FEATURE 0x1
> @@ -1115,6 +1116,39 @@ static CXLRetCode cmd_logs_get_log_capabilities(const struct cxl_cmd *cmd,
> return CXL_MBOX_SUCCESS;
> }
>
> +/* CXL r3.1 Section 8.2.9.5.4: Clear Log (Opcode 0403h) */
> +static CXLRetCode cmd_logs_clear_log(const struct cxl_cmd *cmd,
> + uint8_t *payload_in,
> + size_t len_in,
> + uint8_t *payload_out,
> + size_t *len_out,
> + CXLCCI *cci)
> +{
> + int32_t cap_id;
> + struct {
> + QemuUUID uuid;
> + } QEMU_PACKED QEMU_ALIGNED(8) * clear_log = (void *)payload_in;
> +
> + cap_id = valid_log_check(&clear_log->uuid, cci);
> + if (cap_id == -1) {
> + return CXL_MBOX_INVALID_LOG;
> + }
Follow on from previous patch, if this returns the cap pointer,
the following code wont have to index the array and should end up simpler.
> +
> + if (cci->supported_log_cap[cap_id].param_flags.clear_log_supported) {
I would flip this.
if (!(cap->param_flags & PARAM_FLAG_CLEAR_LOG_SUPPORTED)) {
return CXL_MBOX_UNSUPPORTED;
}
> + switch (cap_id) {
> + case CEL:
So if we return the cap as suggested, it will have to reference what it is
or provide a callback (which might be cleaner as this grows).
However, what does clearly the command effects log mean?
This makes no sense. So if you want to implement clear_log you
need to implement a different log to clear.
> + memset(cci->cel_log, 0, (1 << 16) * sizeof(struct cel_log));
> + cci->cel_size = 0;
> + break;
> + default:
> + return CXL_MBOX_UNSUPPORTED;
> + }
> + } else {
> + return CXL_MBOX_UNSUPPORTED;
> + }
> + return CXL_MBOX_SUCCESS;
> +}
> +
> /* CXL r3.1 section 8.2.9.6: Features */
> /*
> * Get Supported Features output payload
> @@ -2882,6 +2916,8 @@ static const struct cxl_cmd cxl_cmd_set[256][256] = {
> [LOGS][GET_LOG] = { "LOGS_GET_LOG", cmd_logs_get_log, 0x18, 0 },
> [LOGS][GET_LOG_CAPABILITIES] = { "LOGS_GET_LOG_CAPABILITIES",
> cmd_logs_get_log_capabilities, 0x10, 0 },
> + [LOGS][CLEAR_LOG] = { "LOGS_CLEAR_LOG", cmd_logs_clear_log, 0x10,
> + CXL_MBOX_IMMEDIATE_LOG_CHANGE},
> [FEATURES][GET_SUPPORTED] = { "FEATURES_GET_SUPPORTED",
> cmd_features_get_supported, 0x8, 0 },
> [FEATURES][GET_FEATURE] = { "FEATURES_GET_FEATURE",
next prev parent reply other threads:[~2025-02-04 10:53 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <CGME20250203060050epcas5p38f556047edbdedd98b6ac2d1d496a3dc@epcas5p3.samsung.com>
2025-02-03 5:59 ` [PATCH 0/3] CXL CCI Log Commands implementation Arpit Kumar
2025-02-03 5:59 ` [PATCH 1/3] hw/cxl/cxl-mailbox-utils.c: Added support for Get Log Capabilities (Opcode 0402h) Arpit Kumar
2025-02-04 10:28 ` Jonathan Cameron
2025-02-04 10:28 ` Jonathan Cameron via
2025-02-12 11:30 ` Arpit Kumar
2025-02-12 17:15 ` Jonathan Cameron
2025-02-12 17:15 ` Jonathan Cameron via
2025-02-03 5:59 ` [PATCH 2/3] hw/cxl/cxl-mailbox-utils.c: Added support for Clear Log (Opcode 0403h) Arpit Kumar
2025-02-04 10:53 ` Jonathan Cameron [this message]
2025-02-04 10:53 ` Jonathan Cameron via
2025-02-12 11:37 ` Arpit Kumar
2025-02-03 5:59 ` [PATCH 3/3] hw/cxl/cxl-mailbox-utils.c: Added support for Populate Log (Opcode 0404h) as background operation Arpit Kumar
2025-02-04 10:58 ` Jonathan Cameron
2025-02-04 10:58 ` Jonathan Cameron via
2025-02-12 11:45 ` Arpit Kumar
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=20250204105342.00000c31@huawei.com \
--to=jonathan.cameron@huawei.com \
--cc=a.manzanares@samsung.com \
--cc=alok.rathore@samsung.com \
--cc=arpit1.kumar@samsung.com \
--cc=dave@stgolabs.net \
--cc=gost.dev@samsung.com \
--cc=krish.reddy@samsung.com \
--cc=linux-cxl@vger.kernel.org \
--cc=nifan.cxl@gmail.com \
--cc=qemu-devel@nongnu.org \
--cc=vishak.g@samsung.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.