Lines Matching full:cmd

105 static inline void its_fixup_cmd(struct its_cmd_block *cmd)  in its_fixup_cmd()  argument
108 cmd->raw_cmd_le[0] = cpu_to_le64(cmd->raw_cmd[0]); in its_fixup_cmd()
109 cmd->raw_cmd_le[1] = cpu_to_le64(cmd->raw_cmd[1]); in its_fixup_cmd()
110 cmd->raw_cmd_le[2] = cpu_to_le64(cmd->raw_cmd[2]); in its_fixup_cmd()
111 cmd->raw_cmd_le[3] = cpu_to_le64(cmd->raw_cmd[3]); in its_fixup_cmd()
121 static void its_encode_cmd(struct its_cmd_block *cmd, u8 cmd_nr) in its_encode_cmd() argument
123 its_mask_encode(&cmd->raw_cmd[0], cmd_nr, 7, 0); in its_encode_cmd()
126 static void its_encode_devid(struct its_cmd_block *cmd, u32 devid) in its_encode_devid() argument
128 its_mask_encode(&cmd->raw_cmd[0], devid, 63, 32); in its_encode_devid()
131 static void its_encode_event_id(struct its_cmd_block *cmd, u32 id) in its_encode_event_id() argument
133 its_mask_encode(&cmd->raw_cmd[1], id, 31, 0); in its_encode_event_id()
136 static void its_encode_phys_id(struct its_cmd_block *cmd, u32 phys_id) in its_encode_phys_id() argument
138 its_mask_encode(&cmd->raw_cmd[1], phys_id, 63, 32); in its_encode_phys_id()
141 static void its_encode_size(struct its_cmd_block *cmd, u8 size) in its_encode_size() argument
143 its_mask_encode(&cmd->raw_cmd[1], size, 4, 0); in its_encode_size()
146 static void its_encode_itt(struct its_cmd_block *cmd, u64 itt_addr) in its_encode_itt() argument
148 its_mask_encode(&cmd->raw_cmd[2], itt_addr >> 8, 51, 8); in its_encode_itt()
151 static void its_encode_valid(struct its_cmd_block *cmd, int valid) in its_encode_valid() argument
153 its_mask_encode(&cmd->raw_cmd[2], !!valid, 63, 63); in its_encode_valid()
156 static void its_encode_target(struct its_cmd_block *cmd, u64 target_addr) in its_encode_target() argument
158 its_mask_encode(&cmd->raw_cmd[2], target_addr >> 16, 51, 16); in its_encode_target()
161 static void its_encode_collection(struct its_cmd_block *cmd, u16 col) in its_encode_collection() argument
163 its_mask_encode(&cmd->raw_cmd[2], col, 15, 0); in its_encode_collection()
168 static void its_send_cmd(void *cmdq_base, struct its_cmd_block *cmd) in its_send_cmd() argument
179 its_fixup_cmd(cmd); in its_send_cmd()
181 WRITE_ONCE(*dst, *cmd); in its_send_cmd()
183 next = (cwriter + sizeof(*cmd)) % cmdq_size; in its_send_cmd()
203 struct its_cmd_block cmd = {}; in its_send_mapd_cmd() local
205 its_encode_cmd(&cmd, GITS_CMD_MAPD); in its_send_mapd_cmd()
206 its_encode_devid(&cmd, device_id); in its_send_mapd_cmd()
207 its_encode_size(&cmd, ilog2(itt_size) - 1); in its_send_mapd_cmd()
208 its_encode_itt(&cmd, itt_base); in its_send_mapd_cmd()
209 its_encode_valid(&cmd, valid); in its_send_mapd_cmd()
211 its_send_cmd(cmdq_base, &cmd); in its_send_mapd_cmd()
216 struct its_cmd_block cmd = {}; in its_send_mapc_cmd() local
218 its_encode_cmd(&cmd, GITS_CMD_MAPC); in its_send_mapc_cmd()
219 its_encode_collection(&cmd, collection_id); in its_send_mapc_cmd()
220 its_encode_target(&cmd, vcpu_id); in its_send_mapc_cmd()
221 its_encode_valid(&cmd, valid); in its_send_mapc_cmd()
223 its_send_cmd(cmdq_base, &cmd); in its_send_mapc_cmd()
229 struct its_cmd_block cmd = {}; in its_send_mapti_cmd() local
231 its_encode_cmd(&cmd, GITS_CMD_MAPTI); in its_send_mapti_cmd()
232 its_encode_devid(&cmd, device_id); in its_send_mapti_cmd()
233 its_encode_event_id(&cmd, event_id); in its_send_mapti_cmd()
234 its_encode_phys_id(&cmd, intid); in its_send_mapti_cmd()
235 its_encode_collection(&cmd, collection_id); in its_send_mapti_cmd()
237 its_send_cmd(cmdq_base, &cmd); in its_send_mapti_cmd()
242 struct its_cmd_block cmd = {}; in its_send_invall_cmd() local
244 its_encode_cmd(&cmd, GITS_CMD_INVALL); in its_send_invall_cmd()
245 its_encode_collection(&cmd, collection_id); in its_send_invall_cmd()
247 its_send_cmd(cmdq_base, &cmd); in its_send_invall_cmd()