Skip to contentSkip to conversation

cxl/mbox: Add Get Log Capabilities, Clear Log and Get Supported Logs Sub-List commands

PATCH Superseded [email protected] 2 participants 8 messages Feb 7, 2024 – Feb 19, 2024

Subsystems (2)

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 cxl/mbox: Add Get Log Capabilities, Clear Log and Get Supported Logs Sub-List commands

From: Srinivasulu Thanneeru <[email protected]>

Adding UAPI support for
1. CXL r3.1 8.2.9.5.3 Get Log Capabilities.
2. CXL r3.1 8.2.9.5.4 Clear Log commands.
3. CXL r3.1 8.2.9.5.6 Get Supported Logs Sub-List.

---
 drivers/cxl/core/mbox.c      | 3 +++
 drivers/cxl/cxlmem.h         | 3 +++
 include/uapi/linux/cxl_mem.h | 3 +++
 3 files changed, 9 insertions(+)
drivers/cxl/core/mbox.c +3 -0
index 27166a411705..64a44e286488 100644
@@ -64,6 +64,9 @@ static struct cxl_mem_command cxl_mem_commands[CXL_MEM_COMMAND_ID_MAX] = {
 	CXL_CMD(SET_SHUTDOWN_STATE, 0x1, 0, 0),
 	CXL_CMD(GET_SCAN_MEDIA_CAPS, 0x10, 0x4, 0),
 	CXL_CMD(GET_TIMESTAMP, 0, 0x8, 0),
+	CXL_CMD(GET_LOG_CAPS, 0x10, 0x4, 0),
+	CXL_CMD(CLEAR_LOG, 0x10, 0, 0),
+	CXL_CMD(GET_LOG_SUBLIST, 0x2, CXL_VARIABLE_PAYLOAD, 0),
 };
 
 /*
drivers/cxl/cxlmem.h +3 -0
index 5303d6942b88..4128c810051c 100644
@@ -529,6 +529,9 @@ enum cxl_opcode {
 	CXL_MBOX_OP_SET_TIMESTAMP	= 0x0301,
 	CXL_MBOX_OP_GET_SUPPORTED_LOGS	= 0x0400,
 	CXL_MBOX_OP_GET_LOG		= 0x0401,
+	CXL_MBOX_OP_GET_LOG_CAPS	= 0x0402,
+	CXL_MBOX_OP_CLEAR_LOG		= 0x0403,
+	CXL_MBOX_OP_GET_LOG_SUBLIST     = 0x0405,
 	CXL_MBOX_OP_IDENTIFY		= 0x4000,
 	CXL_MBOX_OP_GET_PARTITION_INFO	= 0x4100,
 	CXL_MBOX_OP_SET_PARTITION_INFO	= 0x4101,
include/uapi/linux/cxl_mem.h +3 -0
index 42066f4eb890..d2df9782a5ef 100644
@@ -47,6 +47,9 @@
 	___DEPRECATED(SCAN_MEDIA, "Scan Media"),                          \
 	___DEPRECATED(GET_SCAN_MEDIA, "Get Scan Media Results"),          \
 	___C(GET_TIMESTAMP, "Get Timestamp"),                             \
+	___C(GET_LOG_CAPS, "Get Log Capabilities"),			  \
+	___C(CLEAR_LOG, "Clear Log"),					  \
+	___C(GET_LOG_SUBLIST, "Get Log Sublist"),			  \
 	___C(MAX, "invalid / last command")
 
 #define ___C(a, b) CXL_MEM_COMMAND_ID_##a
Signature · 1 line
2.43.0
#1 lore raw
Quoted 8 lines · On Wed, 7 Feb 2024 16:06:34 +0530 <[email protected]> wrote:

From: Srinivasulu Thanneeru <[email protected]>

Adding UAPI support for
1. CXL r3.1 8.2.9.5.3 Get Log Capabilities.
2. CXL r3.1 8.2.9.5.4 Clear Log commands.
3. CXL r3.1 8.2.9.5.6 Get Supported Logs Sub-List.

Hi Srinivasulu,

Whilst I can conjecture some valid reasons to expose these to userspace, can you add some examples to this patch description?

We might want to filter the clear in particular to avoid a clash with the driver log handling. That is only allow it for vendor logs.

Perhaps split the patch into 2 parts. The less controversial GET_LOG_CAPS and GET_LOG_SUBLIST, followed by a patch for the destructive clear log.

The memory scrub handling might well
access the ECS log for example (I don't think the current proposal yet does this).

Jonathan

Quoted 25 lines
---
 drivers/cxl/core/mbox.c      | 3 +++
 drivers/cxl/cxlmem.h         | 3 +++
 include/uapi/linux/cxl_mem.h | 3 +++
 3 files changed, 9 insertions(+)
drivers/cxl/core/mbox.c +3 -0
index 27166a411705..64a44e286488 100644
@@ -64,6 +64,9 @@ static struct cxl_mem_command cxl_mem_commands[CXL_MEM_COMMAND_ID_MAX] = {
 	CXL_CMD(SET_SHUTDOWN_STATE, 0x1, 0, 0),
 	CXL_CMD(GET_SCAN_MEDIA_CAPS, 0x10, 0x4, 0),
 	CXL_CMD(GET_TIMESTAMP, 0, 0x8, 0),
+	CXL_CMD(GET_LOG_CAPS, 0x10, 0x4, 0),
+	CXL_CMD(CLEAR_LOG, 0x10, 0, 0),
+	CXL_CMD(GET_LOG_SUBLIST, 0x2, CXL_VARIABLE_PAYLOAD, 0),
 };
 
 /*
drivers/cxl/cxlmem.h +0 -0
index 5303d6942b88..4128c810051c 100644

drivers/cxl/cxlmem.h enum cxl_opcode { · line 534

Quoted 6 lines
drivers/cxl/cxlmem.h +3 -0
@@ -529,6 +529,9 @@ enum cxl_opcode {
 	CXL_MBOX_OP_SET_TIMESTAMP	= 0x0301,
 	CXL_MBOX_OP_GET_SUPPORTED_LOGS	= 0x0400,
 	CXL_MBOX_OP_GET_LOG		= 0x0401,
+	CXL_MBOX_OP_GET_LOG_CAPS	= 0x0402,
+	CXL_MBOX_OP_CLEAR_LOG		= 0x0403,
+	CXL_MBOX_OP_GET_LOG_SUBLIST     = 0x0405,

Name should include something to make it clear this is getting sublist of 'supported' logs. Not the log.

Quoted 8 lines
drivers/cxl/cxlmem.h +0 -0
 	CXL_MBOX_OP_IDENTIFY		= 0x4000,
 	CXL_MBOX_OP_GET_PARTITION_INFO	= 0x4100,
 	CXL_MBOX_OP_SET_PARTITION_INFO	= 0x4101,
include/uapi/linux/cxl_mem.h +0 -0
index 42066f4eb890..d2df9782a5ef 100644

include/uapi/linux/cxl_mem.h line 52

Quoted 6 lines
include/uapi/linux/cxl_mem.h +3 -0
@@ -47,6 +47,9 @@
 	___DEPRECATED(SCAN_MEDIA, "Scan Media"),                          \
 	___DEPRECATED(GET_SCAN_MEDIA, "Get Scan Media Results"),          \
 	___C(GET_TIMESTAMP, "Get Timestamp"),                             \
+	___C(GET_LOG_CAPS, "Get Log Capabilities"),			  \
+	___C(CLEAR_LOG, "Clear Log"),					  \
+	___C(GET_LOG_SUBLIST, "Get Log Sublist"),			  \

Likewise, mention it's list of supported logs.

Quoted 3 lines
include/uapi/linux/cxl_mem.h +0 -0
 	___C(MAX, "invalid / last command")
 
 #define ___C(a, b) CXL_MEM_COMMAND_ID_##a
#2 lore raw

Hi Jonathan,

Thank you, for the inputs, please find comments inline.

Regards,
Srini

Quoted 26 lines

-----Original Message-----
From: Jonathan Cameron <[email protected]>
Sent: Thursday, February 8, 2024 6:27 PM
To: Srinivasulu Opensrc <[email protected]>
Cc: [email protected]; [email protected]; [email protected]; [email protected]; Eishan Mirakhur <[email protected]>; Ajay Joshi <[email protected]>; Ravis OpenSrc <[email protected]>; Srinivasulu Thanneeru <[email protected]>; [email protected]
Subject: [EXT] Re: [PATCH] cxl/mbox: Add Get Log Capabilities, Clear Log and Get Supported Logs Sub-List commands

CAUTION: EXTERNAL EMAIL. Do not click links or open attachments unless you recognize the sender and were expecting this message.

Quoted 7 lines · On Wed, 7 Feb 2024 16:06:34 +0530 <[email protected]> wrote:

From: Srinivasulu Thanneeru <[email protected]>

Adding UAPI support for
1. CXL r3.1 8.2.9.5.3 Get Log Capabilities.
2. CXL r3.1 8.2.9.5.4 Clear Log commands.
3. CXL r3.1 8.2.9.5.6 Get Supported Logs Sub-List.

Quoted 7 lines
Quoted 1 line

Hi Srinivasulu,

Whilst I can conjecture some valid reasons to expose these to userspace, can you add some examples to this patch description?

Sure, I will add description and send V2.

Quoted 4 lines

We might want to filter the clear in particular to avoid a clash with the driver log handling. That is only allow it for vendor logs.

Allowing for both of the following.
* 5e1819d9-11a9-400c-811f-d60719403d86 - Vendor Debug Log
* b3fab4cf-01b6-4332-943e-5e9962f23567 - Component State Dump Log

Quoted 3 lines

Perhaps split the patch into 2 parts. The less controversial GET_LOG_CAPS and GET_LOG_SUBLIST, followed by a patch for the destructive clear log.

Sure, I will split the patches as suggested.

Quoted 44 lines

The memory scrub handling might well
access the ECS log for example (I don't think the current proposal yet does this).

Jonathan

drivers/cxl/core/mbox.c static struct cxl_mem_command

Quoted 11 lines
---
 drivers/cxl/core/mbox.c      | 3 +++
 drivers/cxl/cxlmem.h         | 3 +++
 include/uapi/linux/cxl_mem.h | 3 +++
 3 files changed, 9 insertions(+)
drivers/cxl/core/mbox.c +0 -0
index 27166a411705..64a44e286488 100644
@@ -64,6 +64,9 @@ static struct cxl_mem_command

cxl_mem_commands[CXL_MEM_COMMAND_ID_MAX] = {

Quoted 14 lines
drivers/cxl/core/mbox.c +3 -0
      CXL_CMD(SET_SHUTDOWN_STATE, 0x1, 0, 0),
      CXL_CMD(GET_SCAN_MEDIA_CAPS, 0x10, 0x4, 0),
      CXL_CMD(GET_TIMESTAMP, 0, 0x8, 0),
+     CXL_CMD(GET_LOG_CAPS, 0x10, 0x4, 0),
+     CXL_CMD(CLEAR_LOG, 0x10, 0, 0),
+     CXL_CMD(GET_LOG_SUBLIST, 0x2, CXL_VARIABLE_PAYLOAD, 0),
 };
 
 /*
drivers/cxl/cxlmem.h +0 -0
index 5303d6942b88..4128c810051c 100644

drivers/cxl/cxlmem.h enum cxl_opcode { · line 534

Quoted 6 lines
drivers/cxl/cxlmem.h +3 -0
@@ -529,6 +529,9 @@ enum cxl_opcode {
      CXL_MBOX_OP_SET_TIMESTAMP       = 0x0301,
      CXL_MBOX_OP_GET_SUPPORTED_LOGS  = 0x0400,
      CXL_MBOX_OP_GET_LOG             = 0x0401,
+     CXL_MBOX_OP_GET_LOG_CAPS        = 0x0402,
+     CXL_MBOX_OP_CLEAR_LOG           = 0x0403,
+     CXL_MBOX_OP_GET_LOG_SUBLIST     = 0x0405,

Name should include something to make it clear this is getting sublist of 'supported' logs. Not the log.

Quoted 16 lines
Quoted 8 lines
drivers/cxl/cxlmem.h +0 -0
      CXL_MBOX_OP_IDENTIFY            = 0x4000,
      CXL_MBOX_OP_GET_PARTITION_INFO  = 0x4100,
      CXL_MBOX_OP_SET_PARTITION_INFO  = 0x4101,
include/uapi/linux/cxl_mem.h +0 -0
index 42066f4eb890..d2df9782a5ef 100644

include/uapi/linux/cxl_mem.h line 52

Quoted 6 lines
include/uapi/linux/cxl_mem.h +3 -0
@@ -47,6 +47,9 @@
      ___DEPRECATED(SCAN_MEDIA, "Scan Media"),                          \
      ___DEPRECATED(GET_SCAN_MEDIA, "Get Scan Media Results"),          \
      ___C(GET_TIMESTAMP, "Get Timestamp"),                             \
+     ___C(GET_LOG_CAPS, "Get Log Capabilities"),                       \
+     ___C(CLEAR_LOG, "Clear Log"),                                     \
+     ___C(GET_LOG_SUBLIST, "Get Log Sublist"),                         \

Likewise, mention it's list of supported logs.

Sure, will update "supported log" in all places in the next version V2.

--
Srini

Quoted 4 lines
Quoted 4 lines
include/uapi/linux/cxl_mem.h +0 -0
      ___C(MAX, "invalid / last command")
 
 #define ___C(a, b) CXL_MEM_COMMAND_ID_##a
#3 lore raw
In reply to Jonathan Cameron
Quoted 30 lines

-----Original Message-----
From: Jonathan Cameron <[email protected]>
Sent: Thursday, February 8, 2024 6:27 PM
To: Srinivasulu Opensrc <[email protected]>
Cc: [email protected]; [email protected]; [email protected]; [email protected]; Eishan Mirakhur <[email protected]>; Ajay Joshi <[email protected]>; Ravis OpenSrc <[email protected]>; Srinivasulu Thanneeru <[email protected]>; [email protected]
Subject: [EXT] Re: [PATCH] cxl/mbox: Add Get Log Capabilities, Clear Log and Get Supported Logs Sub-List commands

CAUTION: EXTERNAL EMAIL. Do not click links or open attachments unless you recognize the sender and were expecting this message.

Quoted 8 lines · On Wed, 7 Feb 2024 16:06:34 +0530 <[email protected]> wrote:

From: Srinivasulu Thanneeru <[email protected]>

Adding UAPI support for
1. CXL r3.1 8.2.9.5.3 Get Log Capabilities.
2. CXL r3.1 8.2.9.5.4 Clear Log commands.
3. CXL r3.1 8.2.9.5.6 Get Supported Logs Sub-List.

Quoted 8 lines

Hi Srinivasulu,

Whilst I can conjecture some valid reasons to expose these to userspace, can you add some examples to this patch description?

We might want to filter the clear in particular to avoid a clash with the driver log handling. That is only allow it for vendor logs.

Are you suggesting that I should restrict the "Vendor Debug Log" functionality to only apply to Vendor logs.? Why not include Component State Dumps logs that support the clear log feature?

I might be overlooking something; please enlighten me.

For example, following both supports Clear log in our setups.
* 5e1819d9-11a9-400c-811f-d60719403d86 - Vendor Debug Log
* b3fab4cf-01b6-4332-943e-5e9962f23567 - Component State Dump Log

Quoted 68 lines

Perhaps split the patch into 2 parts. The less controversial GET_LOG_CAPS and GET_LOG_SUBLIST, followed by a patch for the destructive clear log.

The memory scrub handling might well
access the ECS log for example (I don't think the current proposal yet does this).

Jonathan

drivers/cxl/core/mbox.c static struct cxl_mem_command

Quoted 11 lines
---
 drivers/cxl/core/mbox.c      | 3 +++
 drivers/cxl/cxlmem.h         | 3 +++
 include/uapi/linux/cxl_mem.h | 3 +++
 3 files changed, 9 insertions(+)
drivers/cxl/core/mbox.c +0 -0
index 27166a411705..64a44e286488 100644
@@ -64,6 +64,9 @@ static struct cxl_mem_command

cxl_mem_commands[CXL_MEM_COMMAND_ID_MAX] = {

Quoted 14 lines
drivers/cxl/core/mbox.c +3 -0
      CXL_CMD(SET_SHUTDOWN_STATE, 0x1, 0, 0),
      CXL_CMD(GET_SCAN_MEDIA_CAPS, 0x10, 0x4, 0),
      CXL_CMD(GET_TIMESTAMP, 0, 0x8, 0),
+     CXL_CMD(GET_LOG_CAPS, 0x10, 0x4, 0),
+     CXL_CMD(CLEAR_LOG, 0x10, 0, 0),
+     CXL_CMD(GET_LOG_SUBLIST, 0x2, CXL_VARIABLE_PAYLOAD, 0),
 };
 
 /*
drivers/cxl/cxlmem.h +0 -0
index 5303d6942b88..4128c810051c 100644

drivers/cxl/cxlmem.h enum cxl_opcode { · line 534

Quoted 6 lines
drivers/cxl/cxlmem.h +3 -0
@@ -529,6 +529,9 @@ enum cxl_opcode {
      CXL_MBOX_OP_SET_TIMESTAMP       = 0x0301,
      CXL_MBOX_OP_GET_SUPPORTED_LOGS  = 0x0400,
      CXL_MBOX_OP_GET_LOG             = 0x0401,
+     CXL_MBOX_OP_GET_LOG_CAPS        = 0x0402,
+     CXL_MBOX_OP_CLEAR_LOG           = 0x0403,
+     CXL_MBOX_OP_GET_LOG_SUBLIST     = 0x0405,

Name should include something to make it clear this is getting sublist of 'supported' logs. Not the log.

Quoted 8 lines
drivers/cxl/cxlmem.h +0 -0
      CXL_MBOX_OP_IDENTIFY            = 0x4000,
      CXL_MBOX_OP_GET_PARTITION_INFO  = 0x4100,
      CXL_MBOX_OP_SET_PARTITION_INFO  = 0x4101,
include/uapi/linux/cxl_mem.h +0 -0
index 42066f4eb890..d2df9782a5ef 100644

include/uapi/linux/cxl_mem.h line 52

Quoted 6 lines
include/uapi/linux/cxl_mem.h +3 -0
@@ -47,6 +47,9 @@
      ___DEPRECATED(SCAN_MEDIA, "Scan Media"),                          \
      ___DEPRECATED(GET_SCAN_MEDIA, "Get Scan Media Results"),          \
      ___C(GET_TIMESTAMP, "Get Timestamp"),                             \
+     ___C(GET_LOG_CAPS, "Get Log Capabilities"),                       \
+     ___C(CLEAR_LOG, "Clear Log"),                                     \
+     ___C(GET_LOG_SUBLIST, "Get Log Sublist"),                         \

Likewise, mention it's list of supported logs.

Quoted 3 lines
include/uapi/linux/cxl_mem.h +0 -0
      ___C(MAX, "invalid / last command")
 
 #define ___C(a, b) CXL_MEM_COMMAND_ID_##a
#4 lore raw
Quoted 53 lines

-----Original Message-----
From: Srinivasulu Opensrc <[email protected]>
Sent: Wednesday, February 14, 2024 9:39 PM
To: Jonathan Cameron <[email protected]>
Cc: [email protected]; [email protected]; [email protected]; [email protected]; Eishan Mirakhur <[email protected]>; Ajay Joshi <[email protected]>; Ravis OpenSrc <[email protected]>; Srinivasulu Thanneeru <[email protected]>; [email protected]
Subject: RE: [EXT] Re: [PATCH] cxl/mbox: Add Get Log Capabilities, Clear Log and Get Supported Logs Sub-List commands

Quoted 28 lines

-----Original Message-----
From: Jonathan Cameron <[email protected]>
Sent: Thursday, February 8, 2024 6:27 PM
To: Srinivasulu Opensrc <[email protected]>
Cc: [email protected]; [email protected]; [email protected]; [email protected]; Eishan Mirakhur <[email protected]>; Ajay Joshi <[email protected]>; Ravis OpenSrc <[email protected]>; Srinivasulu Thanneeru <[email protected]>; [email protected]
Subject: [EXT] Re: [PATCH] cxl/mbox: Add Get Log Capabilities, Clear Log and Get Supported Logs Sub-List commands

CAUTION: EXTERNAL EMAIL. Do not click links or open attachments unless you recognize the sender and were expecting this message.

Quoted 8 lines · On Wed, 7 Feb 2024 16:06:34 +0530 <[email protected]> wrote:

From: Srinivasulu Thanneeru <[email protected]>

Adding UAPI support for
1. CXL r3.1 8.2.9.5.3 Get Log Capabilities.
2. CXL r3.1 8.2.9.5.4 Clear Log commands.
3. CXL r3.1 8.2.9.5.6 Get Supported Logs Sub-List.

Quoted 8 lines

Hi Srinivasulu,

Whilst I can conjecture some valid reasons to expose these to userspace, can you add some examples to this patch description?

We might want to filter the clear in particular to avoid a clash with the driver log handling. That is only allow it for vendor logs.

Quoted 5 lines

Are you suggesting that I should restrict the "Vendor Debug Log" functionality to
only apply to Vendor logs.? Why not include Component State Dumps logs that
support the clear log feature?

Sorry for the typo.

Are you suggesting that I should restrict the "Clear log command" functionality from user space to only apply to "Vendor Debug Log".?
Why not include Component State Dumps logs that support the clear log feature?

Quoted 76 lines

I might be overlooking something; please enlighten me.

For example, following both supports Clear log in our setups.
* 5e1819d9-11a9-400c-811f-d60719403d86 - Vendor Debug Log
* b3fab4cf-01b6-4332-943e-5e9962f23567 - Component State Dump Log

Quoted 68 lines

Perhaps split the patch into 2 parts. The less controversial GET_LOG_CAPS and GET_LOG_SUBLIST, followed by a patch for the destructive clear log.

The memory scrub handling might well
access the ECS log for example (I don't think the current proposal yet does this).

Jonathan

drivers/cxl/core/mbox.c static struct cxl_mem_command

Quoted 11 lines
---
 drivers/cxl/core/mbox.c      | 3 +++
 drivers/cxl/cxlmem.h         | 3 +++
 include/uapi/linux/cxl_mem.h | 3 +++
 3 files changed, 9 insertions(+)
drivers/cxl/core/mbox.c +0 -0
index 27166a411705..64a44e286488 100644
@@ -64,6 +64,9 @@ static struct cxl_mem_command

cxl_mem_commands[CXL_MEM_COMMAND_ID_MAX] = {

Quoted 14 lines
drivers/cxl/core/mbox.c +3 -0
      CXL_CMD(SET_SHUTDOWN_STATE, 0x1, 0, 0),
      CXL_CMD(GET_SCAN_MEDIA_CAPS, 0x10, 0x4, 0),
      CXL_CMD(GET_TIMESTAMP, 0, 0x8, 0),
+     CXL_CMD(GET_LOG_CAPS, 0x10, 0x4, 0),
+     CXL_CMD(CLEAR_LOG, 0x10, 0, 0),
+     CXL_CMD(GET_LOG_SUBLIST, 0x2, CXL_VARIABLE_PAYLOAD, 0),
 };
 
 /*
drivers/cxl/cxlmem.h +0 -0
index 5303d6942b88..4128c810051c 100644

drivers/cxl/cxlmem.h enum cxl_opcode { · line 534

Quoted 6 lines
drivers/cxl/cxlmem.h +3 -0
@@ -529,6 +529,9 @@ enum cxl_opcode {
      CXL_MBOX_OP_SET_TIMESTAMP       = 0x0301,
      CXL_MBOX_OP_GET_SUPPORTED_LOGS  = 0x0400,
      CXL_MBOX_OP_GET_LOG             = 0x0401,
+     CXL_MBOX_OP_GET_LOG_CAPS        = 0x0402,
+     CXL_MBOX_OP_CLEAR_LOG           = 0x0403,
+     CXL_MBOX_OP_GET_LOG_SUBLIST     = 0x0405,

Name should include something to make it clear this is getting sublist of 'supported' logs. Not the log.

Quoted 8 lines
drivers/cxl/cxlmem.h +0 -0
      CXL_MBOX_OP_IDENTIFY            = 0x4000,
      CXL_MBOX_OP_GET_PARTITION_INFO  = 0x4100,
      CXL_MBOX_OP_SET_PARTITION_INFO  = 0x4101,
include/uapi/linux/cxl_mem.h +0 -0
index 42066f4eb890..d2df9782a5ef 100644

include/uapi/linux/cxl_mem.h line 52

Quoted 6 lines
include/uapi/linux/cxl_mem.h +3 -0
@@ -47,6 +47,9 @@
      ___DEPRECATED(SCAN_MEDIA, "Scan Media"),                          \
      ___DEPRECATED(GET_SCAN_MEDIA, "Get Scan Media Results"),          \
      ___C(GET_TIMESTAMP, "Get Timestamp"),                             \
+     ___C(GET_LOG_CAPS, "Get Log Capabilities"),                       \
+     ___C(CLEAR_LOG, "Clear Log"),                                     \
+     ___C(GET_LOG_SUBLIST, "Get Log Sublist"),                         \

Likewise, mention it's list of supported logs.

Quoted 3 lines
include/uapi/linux/cxl_mem.h +0 -0
      ___C(MAX, "invalid / last command")
 
 #define ___C(a, b) CXL_MEM_COMMAND_ID_##a
#5 lore raw
In reply to Srinivasulu Opensrc
Quoted 37 lines · On Wed, 14 Feb 2024 16:09:01 +0000 Srinivasulu Opensrc…
Quoted 28 lines

-----Original Message-----
From: Jonathan Cameron <[email protected]>
Sent: Thursday, February 8, 2024 6:27 PM
To: Srinivasulu Opensrc <[email protected]>
Cc: [email protected]; [email protected]; [email protected]; [email protected]; Eishan Mirakhur <[email protected]>; Ajay Joshi <[email protected]>; Ravis OpenSrc <[email protected]>; Srinivasulu Thanneeru <[email protected]>; [email protected]
Subject: [EXT] Re: [PATCH] cxl/mbox: Add Get Log Capabilities, Clear Log and Get Supported Logs Sub-List commands

CAUTION: EXTERNAL EMAIL. Do not click links or open attachments unless you recognize the sender and were expecting this message.

Quoted 8 lines · On Wed, 7 Feb 2024 16:06:34 +0530 <[email protected]> wrote:

From: Srinivasulu Thanneeru <[email protected]>

Adding UAPI support for
1. CXL r3.1 8.2.9.5.3 Get Log Capabilities.
2. CXL r3.1 8.2.9.5.4 Clear Log commands.
3. CXL r3.1 8.2.9.5.6 Get Supported Logs Sub-List.

Quoted 8 lines

Hi Srinivasulu,

Whilst I can conjecture some valid reasons to expose these to userspace, can you add some examples to this patch description?

We might want to filter the clear in particular to avoid a clash with the driver log handling. That is only allow it for vendor logs.

Quoted 5 lines

Are you suggesting that I should restrict the "Vendor Debug Log" functionality to only apply to Vendor logs.? Why not include Component State Dumps logs that support the clear log feature?

I might be overlooking something; please enlighten me.

I had an old copy of the spec open. Indeed component state dumps should be safe to expose as well.

Quoted 74 lines

For example, following both supports Clear log in our setups.
* 5e1819d9-11a9-400c-811f-d60719403d86 - Vendor Debug Log
* b3fab4cf-01b6-4332-943e-5e9962f23567 - Component State Dump Log

Quoted 68 lines

Perhaps split the patch into 2 parts. The less controversial GET_LOG_CAPS and GET_LOG_SUBLIST, followed by a patch for the destructive clear log.

The memory scrub handling might well
access the ECS log for example (I don't think the current proposal yet does this).

Jonathan

drivers/cxl/core/mbox.c static struct cxl_mem_command

Quoted 11 lines
---
 drivers/cxl/core/mbox.c      | 3 +++
 drivers/cxl/cxlmem.h         | 3 +++
 include/uapi/linux/cxl_mem.h | 3 +++
 3 files changed, 9 insertions(+)
drivers/cxl/core/mbox.c +0 -0
index 27166a411705..64a44e286488 100644
@@ -64,6 +64,9 @@ static struct cxl_mem_command  

cxl_mem_commands[CXL_MEM_COMMAND_ID_MAX] = {

Quoted 14 lines
drivers/cxl/core/mbox.c +3 -0
      CXL_CMD(SET_SHUTDOWN_STATE, 0x1, 0, 0),
      CXL_CMD(GET_SCAN_MEDIA_CAPS, 0x10, 0x4, 0),
      CXL_CMD(GET_TIMESTAMP, 0, 0x8, 0),
+     CXL_CMD(GET_LOG_CAPS, 0x10, 0x4, 0),
+     CXL_CMD(CLEAR_LOG, 0x10, 0, 0),
+     CXL_CMD(GET_LOG_SUBLIST, 0x2, CXL_VARIABLE_PAYLOAD, 0),
 };
 
 /*
drivers/cxl/cxlmem.h +0 -0
index 5303d6942b88..4128c810051c 100644

drivers/cxl/cxlmem.h enum cxl_opcode { · line 534

Quoted 6 lines
drivers/cxl/cxlmem.h +3 -0
@@ -529,6 +529,9 @@ enum cxl_opcode {
      CXL_MBOX_OP_SET_TIMESTAMP       = 0x0301,
      CXL_MBOX_OP_GET_SUPPORTED_LOGS  = 0x0400,
      CXL_MBOX_OP_GET_LOG             = 0x0401,
+     CXL_MBOX_OP_GET_LOG_CAPS        = 0x0402,
+     CXL_MBOX_OP_CLEAR_LOG           = 0x0403,
+     CXL_MBOX_OP_GET_LOG_SUBLIST     = 0x0405,  

Name should include something to make it clear this is getting sublist of 'supported' logs. Not the log.

Quoted 8 lines
drivers/cxl/cxlmem.h +0 -0
      CXL_MBOX_OP_IDENTIFY            = 0x4000,
      CXL_MBOX_OP_GET_PARTITION_INFO  = 0x4100,
      CXL_MBOX_OP_SET_PARTITION_INFO  = 0x4101,
include/uapi/linux/cxl_mem.h +0 -0
index 42066f4eb890..d2df9782a5ef 100644

include/uapi/linux/cxl_mem.h line 52

Quoted 6 lines
include/uapi/linux/cxl_mem.h +3 -0
@@ -47,6 +47,9 @@
      ___DEPRECATED(SCAN_MEDIA, "Scan Media"),                          \
      ___DEPRECATED(GET_SCAN_MEDIA, "Get Scan Media Results"),          \
      ___C(GET_TIMESTAMP, "Get Timestamp"),                             \
+     ___C(GET_LOG_CAPS, "Get Log Capabilities"),                       \
+     ___C(CLEAR_LOG, "Clear Log"),                                     \
+     ___C(GET_LOG_SUBLIST, "Get Log Sublist"),                         \  

Likewise, mention it's list of supported logs.

Quoted 3 lines
include/uapi/linux/cxl_mem.h +0 -0
      ___C(MAX, "invalid / last command")
 
 #define ___C(a, b) CXL_MEM_COMMAND_ID_##a  
#6 lore raw
Quoted 62 lines

-----Original Message-----
From: Jonathan Cameron <[email protected]>
Sent: Thursday, February 15, 2024 5:57 PM
To: Srinivasulu Opensrc <[email protected]>
Cc: [email protected]; [email protected]; [email protected]; [email protected]; Eishan Mirakhur <[email protected]>; Ajay Joshi <[email protected]>; Ravis OpenSrc <[email protected]>; Srinivasulu Thanneeru <[email protected]>; [email protected]
Subject: Re: [EXT] Re: [PATCH] cxl/mbox: Add Get Log Capabilities, Clear Log and Get Supported Logs Sub-List commands

CAUTION: EXTERNAL EMAIL. Do not click links or open attachments unless you recognize the sender and were expecting this message.

Quoted 10 lines · On Wed, 14 Feb 2024 16:09:01 +0000 Srinivasulu Opensrc…
Quoted 10 lines

-----Original Message-----
From: Jonathan Cameron <[email protected]>
Sent: Thursday, February 8, 2024 6:27 PM
To: Srinivasulu Opensrc <[email protected]>
Cc: [email protected]; [email protected]; [email protected]; [email protected]; Eishan Mirakhur <[email protected]>; Ajay Joshi <[email protected]>; Ravis OpenSrc <[email protected]>; Srinivasulu Thanneeru <[email protected]>; [email protected]
Subject: [EXT] Re: [PATCH] cxl/mbox: Add Get Log Capabilities, Clear Log

and

Quoted 9 lines
Quoted 9 lines

Get Supported Logs Sub-List commands

CAUTION: EXTERNAL EMAIL. Do not click links or open attachments unless you recognize the sender and were expecting this message.

On Wed, 7 Feb 2024 16:06:34 +0530
<[email protected]> wrote:

Quoted 8 lines
Quoted 8 lines
Quoted 8 lines

From: Srinivasulu Thanneeru <[email protected]>

Adding UAPI support for
1. CXL r3.1 8.2.9.5.3 Get Log Capabilities.
2. CXL r3.1 8.2.9.5.4 Clear Log commands.
3. CXL r3.1 8.2.9.5.6 Get Supported Logs Sub-List.

Signed-off-by Srinivasulu Thanneeru

<[email protected]>

Quoted 11 lines
Quoted 9 lines

Hi Srinivasulu,

Whilst I can conjecture some valid reasons to expose these to userspace, can you add some examples to this patch description?

We might want to filter the clear in particular to avoid a clash with the driver log handling. That is only allow it for vendor logs.

Are you suggesting that I should restrict the "Vendor Debug Log"

functionality to

Quoted 8 lines
Quoted 1 line

only apply to Vendor logs.? Why not include Component State Dumps logs

that

Quoted 3 lines

support the clear log feature?

I might be overlooking something; please enlighten me.

I had an old copy of the spec open. Indeed component state dumps should be safe to expose as well.

Thank you, Jonathan.
I'm considering adding the following snippet to the V2 patch for "clear log" filtering. Any initial feedback would be appreciated.

--------------
--- a/drivers/cxl/core/mbox.c
+++ b/drivers/cxl/core/mbox.c
enum {
CEL_UUID,
VENDOR_DEBUG_UUID,
+ COMPONENT_STATE_DUMP_UUID,
};

/* See CXL 2.0 Table 170. Get Log Input Payload */ static const uuid_t log_uuid[] = {
[CEL_UUID] = DEFINE_CXL_CEL_UUID, [VENDOR_DEBUG_UUID] = DEFINE_CXL_VENDOR_DEBUG_UUID,
+ [COMPONENT_STATE_DUMP_UUID] = DEFINE_CXL_COMPONENT_STATE_DUMP_UUID,
};

/*
@@ -333,6 +346,12 @@ static bool cxl_payload_from_user_allowed(u16 opcode, void *payload_in)

                        return false;
                break;
        }

+
+ case CXL_MBOX_OP_CLEAR_LOG: {
+ const uuid_t *uuid = (uuid_t *)payload_in;
+ return (uuid_equal(uuid, &log_uuid[VENDOR_DEBUG_UUID])) ||
+ (uuid_equal(uuid, &log_uuid[COMPONENT_STATE_DUMP_UUID]))
+ }
}

drivers/cxl/cxlmem.h +3 -1
@@ -565,6 +565,9 @@ enum cxl_opcode {
 #define DEFINE_CXL_VENDOR_DEBUG_UUID                                           \
        UUID_INIT(0xe1819d9, 0x11a9, 0x400c, 0x81, 0x1f, 0xd6, 0x07, 0x19,     \
                  0x40, 0x3d, 0x86)
+#define DEFINE_CXL_COMPONENT_STATE_DUMP_UUID
+       UUID_INIT(0x3fab4cf, 0x01b6, 0x4332, 0x94, 0x3e, 0x5e, 0x99, 0x62,       \
+                 0xf2, 0x35, 0x67)
--------------
Quoted 76 lines
Quoted 53 lines

For example, following both supports Clear log in our setups.
* 5e1819d9-11a9-400c-811f-d60719403d86 - Vendor Debug Log
* b3fab4cf-01b6-4332-943e-5e9962f23567 - Component State Dump Log

Quoted 48 lines

Perhaps split the patch into 2 parts. The less controversial GET_LOG_CAPS and GET_LOG_SUBLIST, followed by a patch for the destructive clear log.

The memory scrub handling might well
access the ECS log for example (I don't think the current proposal yet does this).

Jonathan

drivers/cxl/core/mbox.c static struct cxl_mem_command

Quoted 11 lines
---
 drivers/cxl/core/mbox.c      | 3 +++
 drivers/cxl/cxlmem.h         | 3 +++
 include/uapi/linux/cxl_mem.h | 3 +++
 3 files changed, 9 insertions(+)
drivers/cxl/core/mbox.c +0 -0
index 27166a411705..64a44e286488 100644
@@ -64,6 +64,9 @@ static struct cxl_mem_command

cxl_mem_commands[CXL_MEM_COMMAND_ID_MAX] = {

Quoted 14 lines
drivers/cxl/core/mbox.c +3 -0
      CXL_CMD(SET_SHUTDOWN_STATE, 0x1, 0, 0),
      CXL_CMD(GET_SCAN_MEDIA_CAPS, 0x10, 0x4, 0),
      CXL_CMD(GET_TIMESTAMP, 0, 0x8, 0),
+     CXL_CMD(GET_LOG_CAPS, 0x10, 0x4, 0),
+     CXL_CMD(CLEAR_LOG, 0x10, 0, 0),
+     CXL_CMD(GET_LOG_SUBLIST, 0x2, CXL_VARIABLE_PAYLOAD, 0),
 };
 
 /*
drivers/cxl/cxlmem.h +0 -0
index 5303d6942b88..4128c810051c 100644

drivers/cxl/cxlmem.h enum cxl_opcode { · line 534

Quoted 6 lines
drivers/cxl/cxlmem.h +3 -0
@@ -529,6 +529,9 @@ enum cxl_opcode {
      CXL_MBOX_OP_SET_TIMESTAMP       = 0x0301,
      CXL_MBOX_OP_GET_SUPPORTED_LOGS  = 0x0400,
      CXL_MBOX_OP_GET_LOG             = 0x0401,
+     CXL_MBOX_OP_GET_LOG_CAPS        = 0x0402,
+     CXL_MBOX_OP_CLEAR_LOG           = 0x0403,
+     CXL_MBOX_OP_GET_LOG_SUBLIST     = 0x0405,

Name should include something to make it clear this is getting sublist of 'supported' logs. Not the log.

Quoted 4 lines
Quoted 4 lines

Review

Quoted 4 lines
drivers/cxl/cxlmem.h +0 -0
      CXL_MBOX_OP_IDENTIFY            = 0x4000,
      CXL_MBOX_OP_GET_PARTITION_INFO  = 0x4100,
      CXL_MBOX_OP_SET_PARTITION_INFO  = 0x4101,
(quoted diff) +0 -0

b/include/uapi/linux/cxl_mem.h

Quoted 6 lines
Quoted 6 lines

include/uapi/linux/cxl_mem.h line 48

Quoted 6 lines

index 42066f4eb890..d2df9782a5ef 100644

include/uapi/linux/cxl_mem.h +0 -0
@@ -47,6 +47,9 @@
      ___DEPRECATED(SCAN_MEDIA, "Scan Media"),                          \
      ___DEPRECATED(GET_SCAN_MEDIA, "Get Scan Media Results"),

\

Quoted 11 lines
Quoted 10 lines

include/uapi/linux/cxl_mem.h line 52

Quoted 4 lines
include/uapi/linux/cxl_mem.h +3 -0
      ___C(GET_TIMESTAMP, "Get Timestamp"),                             \
+     ___C(GET_LOG_CAPS, "Get Log Capabilities"),                       \
+     ___C(CLEAR_LOG, "Clear Log"),                                     \
+     ___C(GET_LOG_SUBLIST, "Get Log Sublist"),                         \

Likewise, mention it's list of supported logs.

Quoted 3 lines
include/uapi/linux/cxl_mem.h +0 -0
      ___C(MAX, "invalid / last command")
 
 #define ___C(a, b) CXL_MEM_COMMAND_ID_##a
#7 lore raw
Quoted 64 lines · On Mon, 19 Feb 2024 17:32:25 +0000 Srinivasulu Opensrc…
Quoted 64 lines

-----Original Message-----
From: Jonathan Cameron <[email protected]>
Sent: Thursday, February 15, 2024 5:57 PM
To: Srinivasulu Opensrc <[email protected]>
Cc: [email protected]; [email protected]; [email protected]; [email protected]; Eishan Mirakhur <[email protected]>; Ajay Joshi <[email protected]>; Ravis OpenSrc <[email protected]>; Srinivasulu Thanneeru <[email protected]>; [email protected]
Subject: Re: [EXT] Re: [PATCH] cxl/mbox: Add Get Log Capabilities, Clear Log and Get Supported Logs Sub-List commands

CAUTION: EXTERNAL EMAIL. Do not click links or open attachments unless you recognize the sender and were expecting this message.

Quoted 10 lines · On Wed, 14 Feb 2024 16:09:01 +0000 Srinivasulu Opensrc…
Quoted 10 lines

-----Original Message-----
From: Jonathan Cameron <[email protected]>
Sent: Thursday, February 8, 2024 6:27 PM
To: Srinivasulu Opensrc <[email protected]>
Cc: [email protected]; [email protected]; [email protected]; [email protected]; Eishan Mirakhur <[email protected]>; Ajay Joshi <[email protected]>; Ravis OpenSrc <[email protected]>; Srinivasulu Thanneeru <[email protected]>; [email protected]
Subject: [EXT] Re: [PATCH] cxl/mbox: Add Get Log Capabilities, Clear Log

and

Quoted 9 lines
Quoted 9 lines

Get Supported Logs Sub-List commands

CAUTION: EXTERNAL EMAIL. Do not click links or open attachments unless you recognize the sender and were expecting this message.

On Wed, 7 Feb 2024 16:06:34 +0530
<[email protected]> wrote:

Quoted 8 lines
Quoted 8 lines
Quoted 8 lines

From: Srinivasulu Thanneeru <[email protected]>

Adding UAPI support for
1. CXL r3.1 8.2.9.5.3 Get Log Capabilities.
2. CXL r3.1 8.2.9.5.4 Clear Log commands.
3. CXL r3.1 8.2.9.5.6 Get Supported Logs Sub-List.

Signed-off-by Srinivasulu Thanneeru

<[email protected]>

Quoted 11 lines
Quoted 9 lines

Hi Srinivasulu,

Whilst I can conjecture some valid reasons to expose these to userspace, can you add some examples to this patch description?

We might want to filter the clear in particular to avoid a clash with the driver log handling. That is only allow it for vendor logs.

Are you suggesting that I should restrict the "Vendor Debug Log"

functionality to

Quoted 1 line

only apply to Vendor logs.? Why not include Component State Dumps logs

that

Quoted 2 lines

support the clear log feature?

Quoted 8 lines
Quoted 4 lines
Quoted 1 line

I might be overlooking something; please enlighten me.

I had an old copy of the spec open. Indeed component state dumps should be safe to expose as well.

Thank you, Jonathan.
I'm considering adding the following snippet to the V2 patch for "clear log" filtering. Any initial feedback would be appreciated.

That's definitely an improvement and should let the discussion move forwards.

Jonathan

Quoted 118 lines

--------------

drivers/cxl/core/mbox.c +0 -0

enum {
CEL_UUID,
VENDOR_DEBUG_UUID,
+ COMPONENT_STATE_DUMP_UUID,
};

/* See CXL 2.0 Table 170. Get Log Input Payload */ static const uuid_t log_uuid[] = {
[CEL_UUID] = DEFINE_CXL_CEL_UUID, [VENDOR_DEBUG_UUID] = DEFINE_CXL_VENDOR_DEBUG_UUID,

drivers/cxl/core/mbox.c +7 -0
+       [COMPONENT_STATE_DUMP_UUID] = DEFINE_CXL_COMPONENT_STATE_DUMP_UUID,
 };
 
 /*
@@ -333,6 +346,12 @@ static bool cxl_payload_from_user_allowed(u16 opcode, void *payload_in)
                        return false;
                break;
        }
+
+       case CXL_MBOX_OP_CLEAR_LOG: {
+               const uuid_t *uuid = (uuid_t *)payload_in;
+               return (uuid_equal(uuid, &log_uuid[VENDOR_DEBUG_UUID])) ||
+                      (uuid_equal(uuid, &log_uuid[COMPONENT_STATE_DUMP_UUID]))
+               }
 }
 
drivers/cxl/cxlmem.h +3 -1
@@ -565,6 +565,9 @@ enum cxl_opcode {
 #define DEFINE_CXL_VENDOR_DEBUG_UUID                                           \
        UUID_INIT(0xe1819d9, 0x11a9, 0x400c, 0x81, 0x1f, 0xd6, 0x07, 0x19,     \
                  0x40, 0x3d, 0x86)
+#define DEFINE_CXL_COMPONENT_STATE_DUMP_UUID
+       UUID_INIT(0x3fab4cf, 0x01b6, 0x4332, 0x94, 0x3e, 0x5e, 0x99, 0x62,       \
+                 0xf2, 0x35, 0x67)
--------------
Quoted 76 lines
Quoted 53 lines

For example, following both supports Clear log in our setups.
* 5e1819d9-11a9-400c-811f-d60719403d86 - Vendor Debug Log
* b3fab4cf-01b6-4332-943e-5e9962f23567 - Component State Dump Log

Quoted 48 lines

Perhaps split the patch into 2 parts. The less controversial GET_LOG_CAPS and GET_LOG_SUBLIST, followed by a patch for the destructive clear log.

The memory scrub handling might well
access the ECS log for example (I don't think the current proposal yet does this).

Jonathan

drivers/cxl/core/mbox.c static struct cxl_mem_command

Quoted 11 lines
---
 drivers/cxl/core/mbox.c      | 3 +++
 drivers/cxl/cxlmem.h         | 3 +++
 include/uapi/linux/cxl_mem.h | 3 +++
 3 files changed, 9 insertions(+)
drivers/cxl/core/mbox.c +0 -0
index 27166a411705..64a44e286488 100644
@@ -64,6 +64,9 @@ static struct cxl_mem_command  

cxl_mem_commands[CXL_MEM_COMMAND_ID_MAX] = {

Quoted 14 lines
drivers/cxl/core/mbox.c +3 -0
      CXL_CMD(SET_SHUTDOWN_STATE, 0x1, 0, 0),
      CXL_CMD(GET_SCAN_MEDIA_CAPS, 0x10, 0x4, 0),
      CXL_CMD(GET_TIMESTAMP, 0, 0x8, 0),
+     CXL_CMD(GET_LOG_CAPS, 0x10, 0x4, 0),
+     CXL_CMD(CLEAR_LOG, 0x10, 0, 0),
+     CXL_CMD(GET_LOG_SUBLIST, 0x2, CXL_VARIABLE_PAYLOAD, 0),
 };
 
 /*
drivers/cxl/cxlmem.h +0 -0
index 5303d6942b88..4128c810051c 100644

drivers/cxl/cxlmem.h enum cxl_opcode { · line 534

Quoted 6 lines
drivers/cxl/cxlmem.h +3 -0
@@ -529,6 +529,9 @@ enum cxl_opcode {
      CXL_MBOX_OP_SET_TIMESTAMP       = 0x0301,
      CXL_MBOX_OP_GET_SUPPORTED_LOGS  = 0x0400,
      CXL_MBOX_OP_GET_LOG             = 0x0401,
+     CXL_MBOX_OP_GET_LOG_CAPS        = 0x0402,
+     CXL_MBOX_OP_CLEAR_LOG           = 0x0403,
+     CXL_MBOX_OP_GET_LOG_SUBLIST     = 0x0405,  

Name should include something to make it clear this is getting sublist of 'supported' logs. Not the log.

Quoted 4 lines
Quoted 4 lines

Review

Quoted 4 lines
drivers/cxl/cxlmem.h +0 -0
      CXL_MBOX_OP_IDENTIFY            = 0x4000,
      CXL_MBOX_OP_GET_PARTITION_INFO  = 0x4100,
      CXL_MBOX_OP_SET_PARTITION_INFO  = 0x4101,
(quoted diff) +0 -0

b/include/uapi/linux/cxl_mem.h

Quoted 6 lines
Quoted 6 lines

include/uapi/linux/cxl_mem.h line 48

Quoted 6 lines

index 42066f4eb890..d2df9782a5ef 100644

include/uapi/linux/cxl_mem.h +0 -0
@@ -47,6 +47,9 @@
      ___DEPRECATED(SCAN_MEDIA, "Scan Media"),                          \
      ___DEPRECATED(GET_SCAN_MEDIA, "Get Scan Media Results"),  

\

Quoted 11 lines
Quoted 10 lines

include/uapi/linux/cxl_mem.h line 52

Quoted 4 lines
include/uapi/linux/cxl_mem.h +3 -0
      ___C(GET_TIMESTAMP, "Get Timestamp"),                             \
+     ___C(GET_LOG_CAPS, "Get Log Capabilities"),                       \
+     ___C(CLEAR_LOG, "Clear Log"),                                     \
+     ___C(GET_LOG_SUBLIST, "Get Log Sublist"),                         \  

Likewise, mention it's list of supported logs.

Quoted 3 lines
include/uapi/linux/cxl_mem.h +0 -0
      ___C(MAX, "invalid / last command")
 
 #define ___C(a, b) CXL_MEM_COMMAND_ID_##a