History

cxl: Add support for fwctl RPC command to enable CXL feature commands

fwctl provides a fwctl_ops->fw_rpc() callback in order to issue ioctls to a device. The cxl fwctl driver will start by supporting the CXL Feature commands: Get Supported Features, Get Feature, and Set Feature. The fw_rpc() callback provides 'enum fwctl_rpc_scope' parameter where it indicates the security scope of the call. The Get Supported Features and Get Feature calls can be executed with the scope of FWCTL_RPC_CONFIGRATION. The Set Feature call is gated by the effects of the Feature reported by Get Supported Features call for the specific Feature. Only "Get Supported Features" is supported in this patch. Additional commands will be added in follow on patches. "Get Supported Features" will filter the Features that are exclusive to the kernel. The flag field of the Feature details will be cleared of the "Changeable" field and the "set feat size" will be set to 0 to indicate that the feature is not changeable.

Dave Jiang committed 1 year ago

Commit 4d1c09c1 parent 9b8e73c3 files · +166 −2Browse files

Showing the changes to include/uapi (2 of 3 files). Show all

Unified · Split

2 files
  1. include/uapi/cxl/features.h +1 −0
  2. include/uapi/fwctl/cxl.h +46 −0
include/uapi/cxl/features.h+1−0
@@ -42,6 +42,7 @@ struct cxl_mbox_get_sup_feats_in { · 41 unmodified lines
42#define CXL_CMD_EFFECTS_VALID BIT(9)42#define CXL_CMD_EFFECTS_VALID BIT(9)
43#define CXL_CMD_CONFIG_CHANGE_CONV_RESET BIT(10)43#define CXL_CMD_CONFIG_CHANGE_CONV_RESET BIT(10)
44#define CXL_CMD_CONFIG_CHANGE_CXL_RESET BIT(11)44#define CXL_CMD_CONFIG_CHANGE_CXL_RESET BIT(11)
45#define CXL_CMD_EFFECTS_RESERVED GENMASK(15, 12)
45 46
46/*47/*
47 * struct cxl_feat_entry - Supported Feature Entry48 * struct cxl_feat_entry - Supported Feature Entry
include/uapi/fwctl/cxl.h+46−0
@@ -0,0 +1,46 @@
1/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2/*
3 * Copyright (c) 2024-2025 Intel Corporation
4 *
5 * These are definitions for the mailbox command interface of CXL subsystem.
6 */
7#ifndef _UAPI_FWCTL_CXL_H_
8#define _UAPI_FWCTL_CXL_H_
9
10#include <linux/types.h>
11#include <linux/stddef.h>
12#include <cxl/features.h>
13
14/**
15 * struct fwctl_rpc_cxl - ioctl(FWCTL_RPC) input for CXL
16 * @opcode: CXL mailbox command opcode
17 * @flags: Flags for the command (input).
18 * @op_size: Size of input payload.
19 * @reserved1: Reserved. Must be 0s.
20 * @get_sup_feats_in: Get Supported Features input
21 */
22struct fwctl_rpc_cxl {
23 __struct_group(fwctl_rpc_cxl_hdr, hdr, /* no attrs */,
24 __u32 opcode;
25 __u32 flags;
26 __u32 op_size;
27 __u32 reserved1;
28 );
29 struct cxl_mbox_get_sup_feats_in get_sup_feats_in;
30};
31
32/**
33 * struct fwctl_rpc_cxl_out - ioctl(FWCTL_RPC) output for CXL
34 * @size: Size of the output payload
35 * @retval: Return value from device
36 * @get_sup_feats_out: Get Supported Features output
37 */
38struct fwctl_rpc_cxl_out {
39 __struct_group(fwctl_rpc_cxl_out_hdr, hdr, /* no attrs */,
40 __u32 size;
41 __u32 retval;
42 );
43 struct cxl_mbox_get_sup_feats_out get_sup_feats_out;
44};
45
46#endif

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t