Skip to content

Commit 7fe8980

Browse files
committed
cxl/security: Drop security command ioctl uapi
CXL PMEM security operations are routed through the NVDIMM sysfs interface. For this reason the corresponding commands are marked "exclusive" to preclude collisions between the ioctl ABI and the sysfs ABI. However, a better way to preclude that collision is to simply remove the ioctl ABI (command-id definitions) for those operations. Now that cxl_internal_send_cmd() (formerly cxl_mbox_send_cmd()) no longer needs to talk the cxl_mem_commands array, all of the uapi definitions for the security commands can be dropped. These never appeared in a released kernel, so no regression risk. Reviewed-by: Dave Jiang <dave.jiang@intel.com> Reviewed-by: Ira Weiny <ira.weiny@intel.com> Link: https://lore.kernel.org/r/167030056464.4044561.11486507095384253833.stgit@dwillia2-xfh.jf.intel.com Signed-off-by: Dan Williams <dan.j.williams@intel.com>
1 parent 2aeaf66 commit 7fe8980

2 files changed

Lines changed: 0 additions & 23 deletions

File tree

drivers/cxl/core/mbox.c

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -65,12 +65,6 @@ static struct cxl_mem_command cxl_mem_commands[CXL_MEM_COMMAND_ID_MAX] = {
6565
CXL_CMD(GET_SCAN_MEDIA_CAPS, 0x10, 0x4, 0),
6666
CXL_CMD(SCAN_MEDIA, 0x11, 0, 0),
6767
CXL_CMD(GET_SCAN_MEDIA, 0, CXL_VARIABLE_PAYLOAD, 0),
68-
CXL_CMD(GET_SECURITY_STATE, 0, 0x4, 0),
69-
CXL_CMD(SET_PASSPHRASE, 0x60, 0, 0),
70-
CXL_CMD(DISABLE_PASSPHRASE, 0x40, 0, 0),
71-
CXL_CMD(FREEZE_SECURITY, 0, 0, 0),
72-
CXL_CMD(UNLOCK, 0x20, 0, 0),
73-
CXL_CMD(PASSPHRASE_SECURE_ERASE, 0x40, 0, 0),
7468
};
7569

7670
/*
@@ -717,17 +711,6 @@ int cxl_enumerate_cmds(struct cxl_dev_state *cxlds)
717711
/* Found the required CEL */
718712
rc = 0;
719713
}
720-
721-
/*
722-
* Setup permanently kernel exclusive commands, i.e. the
723-
* mechanism is driven through sysfs, keyctl, etc...
724-
*/
725-
set_bit(CXL_MEM_COMMAND_ID_SET_PASSPHRASE, cxlds->exclusive_cmds);
726-
set_bit(CXL_MEM_COMMAND_ID_DISABLE_PASSPHRASE, cxlds->exclusive_cmds);
727-
set_bit(CXL_MEM_COMMAND_ID_UNLOCK, cxlds->exclusive_cmds);
728-
set_bit(CXL_MEM_COMMAND_ID_PASSPHRASE_SECURE_ERASE,
729-
cxlds->exclusive_cmds);
730-
731714
out:
732715
kvfree(gsl);
733716
return rc;

include/uapi/linux/cxl_mem.h

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -41,12 +41,6 @@
4141
___C(GET_SCAN_MEDIA_CAPS, "Get Scan Media Capabilities"), \
4242
___C(SCAN_MEDIA, "Scan Media"), \
4343
___C(GET_SCAN_MEDIA, "Get Scan Media Results"), \
44-
___C(GET_SECURITY_STATE, "Get Security State"), \
45-
___C(SET_PASSPHRASE, "Set Passphrase"), \
46-
___C(DISABLE_PASSPHRASE, "Disable Passphrase"), \
47-
___C(FREEZE_SECURITY, "Freeze Security"), \
48-
___C(UNLOCK, "Unlock"), \
49-
___C(PASSPHRASE_SECURE_ERASE, "Passphrase Secure Erase"), \
5044
___C(MAX, "invalid / last command")
5145

5246
#define ___C(a, b) CXL_MEM_COMMAND_ID_##a

0 commit comments

Comments
 (0)