While using new non arhitectural features using PUNIT Mailbox and MMIO read/write interface, still there is need to operate using MSRs to control PUNIT. User space could have used user user-space MSR interface for this, but when user space MSR access is disabled, then it can't. Here only limited number of MSRs are allowed using this new interface.
Showing the changes to include/uapi/linux (1 of 2 files). Show all
Unified · Split
| @@ -132,9 +132,41 @@ struct isst_if_mbox_cmds { · 131 unmodified lines | ||
| 132 | 132 | struct isst_if_mbox_cmd mbox_cmd[1]; |
| 133 | 133 | }; |
| 134 | 134 | |
| 135 | +/** | |
| 136 | + * struct isst_if_msr_cmd - Structure to define msr command | |
| 137 | + * @read_write: Value 0: Read, 1: Write | |
| 138 | + * @logical_cpu: Logical CPU number | |
| 139 | + * @msr: MSR number | |
| 140 | + * @data: For write operation, data to write, for read | |
| 141 | + * place holder | |
| 142 | + * | |
| 143 | + * Structure to specify MSR command related to PUNIT. | |
| 144 | + */ | |
| 145 | +struct isst_if_msr_cmd { | |
| 146 | + __u32 read_write; /* Read:0, Write:1 */ | |
| 147 | + __u32 logical_cpu; | |
| 148 | + __u64 msr; | |
| 149 | + __u64 data; | |
| 150 | +}; | |
| 151 | + | |
| 152 | +/** | |
| 153 | + * struct isst_if_msr_cmds - structure for msr commands | |
| 154 | + * @cmd_count: Number of mailbox commands in msr_cmd[] | |
| 155 | + * @msr_cmd[]: Holds one or more msr commands | |
| 156 | + * | |
| 157 | + * This structure used with ioctl ISST_IF_MSR_COMMAND to send | |
| 158 | + * one or more MSR commands. IOCTL return value indicates number of | |
| 159 | + * commands sent or error number if no commands have been sent. | |
| 160 | + */ | |
| 161 | +struct isst_if_msr_cmds { | |
| 162 | + __u32 cmd_count; | |
| 163 | + struct isst_if_msr_cmd msr_cmd[1]; | |
| 164 | +}; | |
| 165 | + | |
| 135 | 166 | #define ISST_IF_MAGIC 0xFE |
| 136 | 167 | #define ISST_IF_GET_PLATFORM_INFO _IOR(ISST_IF_MAGIC, 0, struct isst_if_platform_info *) |
| 137 | 168 | #define ISST_IF_GET_PHY_ID _IOWR(ISST_IF_MAGIC, 1, struct isst_if_cpu_map *) |
| 138 | 169 | #define ISST_IF_IO_CMD _IOW(ISST_IF_MAGIC, 2, struct isst_if_io_regs *) |
| 139 | 170 | #define ISST_IF_MBOX_COMMAND _IOWR(ISST_IF_MAGIC, 3, struct isst_if_mbox_cmds *) |
| 171 | +#define ISST_IF_MSR_COMMAND _IOWR(ISST_IF_MAGIC, 4, struct isst_if_msr_cmds *) | |
| 140 | 172 | #endif |