Daniel Boulby | b2fb80e | 2021-02-03 15:09:23 +0000 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2021 The Hafnium Authors. |
| 3 | * |
| 4 | * Use of this source code is governed by a BSD-style |
| 5 | * license that can be found in the LICENSE file or at |
| 6 | * https://opensource.org/licenses/BSD-3-Clause. |
| 7 | */ |
| 8 | |
| 9 | #include "hf/ffa.h" |
| 10 | |
J-Alves | fa78209 | 2021-10-13 16:02:16 +0100 | [diff] [blame] | 11 | #include "hf/arch/plat/ffa.h" |
| 12 | |
J-Alves | a0f317d | 2021-06-09 13:31:59 +0100 | [diff] [blame] | 13 | #include "hf/ffa_internal.h" |
Olivier Deprez | 55a189e | 2021-06-09 15:45:27 +0200 | [diff] [blame] | 14 | #include "hf/vcpu.h" |
J-Alves | c003a7a | 2021-03-18 13:06:53 +0000 | [diff] [blame] | 15 | #include "hf/vm.h" |
Daniel Boulby | b2fb80e | 2021-02-03 15:09:23 +0000 | [diff] [blame] | 16 | |
Daniel Boulby | 87b2dc8 | 2021-08-04 14:07:43 +0100 | [diff] [blame] | 17 | struct ffa_value arch_ffa_features(uint32_t function_id) |
| 18 | { |
| 19 | (void)function_id; |
| 20 | return ffa_error(FFA_NOT_SUPPORTED); |
| 21 | } |
| 22 | |
J-Alves | 19e20cf | 2023-08-02 12:48:55 +0100 | [diff] [blame] | 23 | ffa_id_t arch_ffa_spmc_id_get(void) |
Daniel Boulby | b2fb80e | 2021-02-03 15:09:23 +0000 | [diff] [blame] | 24 | { |
| 25 | return HF_SPMC_VM_ID; |
| 26 | } |
Olivier Deprez | 55a189e | 2021-06-09 15:45:27 +0200 | [diff] [blame] | 27 | |
| 28 | void plat_ffa_log_init(void) |
| 29 | { |
| 30 | } |
| 31 | |
J-Alves | 19e20cf | 2023-08-02 12:48:55 +0100 | [diff] [blame] | 32 | bool plat_ffa_is_memory_send_valid(ffa_id_t receiver_vm_id, uint32_t share_func) |
Maksims Svecovs | a3d570c | 2021-12-08 11:16:32 +0000 | [diff] [blame] | 33 | { |
| 34 | (void)receiver_vm_id; |
| 35 | (void)share_func; |
| 36 | |
| 37 | return true; |
| 38 | } |
| 39 | |
Olivier Deprez | 55a189e | 2021-06-09 15:45:27 +0200 | [diff] [blame] | 40 | bool plat_ffa_is_direct_request_valid(struct vcpu *current, |
J-Alves | 19e20cf | 2023-08-02 12:48:55 +0100 | [diff] [blame] | 41 | ffa_id_t sender_vm_id, |
| 42 | ffa_id_t receiver_vm_id) |
Olivier Deprez | 55a189e | 2021-06-09 15:45:27 +0200 | [diff] [blame] | 43 | { |
| 44 | (void)current; |
| 45 | (void)sender_vm_id; |
| 46 | (void)receiver_vm_id; |
| 47 | |
| 48 | return true; |
| 49 | } |
| 50 | |
J-Alves | 439ac97 | 2021-11-18 17:32:03 +0000 | [diff] [blame] | 51 | bool plat_ffa_is_direct_request_supported(struct vm *sender_vm, |
| 52 | struct vm *receiver_vm) |
| 53 | { |
| 54 | (void)sender_vm; |
| 55 | (void)receiver_vm; |
| 56 | |
| 57 | return false; |
| 58 | } |
| 59 | |
Olivier Deprez | 55a189e | 2021-06-09 15:45:27 +0200 | [diff] [blame] | 60 | bool plat_ffa_is_direct_response_valid(struct vcpu *current, |
J-Alves | 19e20cf | 2023-08-02 12:48:55 +0100 | [diff] [blame] | 61 | ffa_id_t sender_vm_id, |
| 62 | ffa_id_t receiver_vm_id) |
Olivier Deprez | 55a189e | 2021-06-09 15:45:27 +0200 | [diff] [blame] | 63 | { |
| 64 | (void)current; |
| 65 | (void)sender_vm_id; |
| 66 | (void)receiver_vm_id; |
| 67 | |
| 68 | return true; |
| 69 | } |
| 70 | |
J-Alves | 19e20cf | 2023-08-02 12:48:55 +0100 | [diff] [blame] | 71 | bool plat_ffa_run_forward(ffa_id_t vm_id, ffa_vcpu_index_t vcpu_idx, |
Raghu Krishnamurthy | 62f97a7 | 2021-07-27 02:14:59 -0700 | [diff] [blame] | 72 | struct ffa_value *ret) |
| 73 | { |
| 74 | (void)vm_id; |
| 75 | (void)vcpu_idx; |
| 76 | (void)ret; |
| 77 | |
| 78 | return false; |
| 79 | } |
| 80 | |
Federico Recanati | 10bd06c | 2022-02-23 17:32:59 +0100 | [diff] [blame] | 81 | void plat_ffa_vm_destroy(struct vm_locked to_destroy_locked) |
| 82 | { |
| 83 | (void)to_destroy_locked; |
| 84 | } |
| 85 | |
J-Alves | 7007993 | 2022-12-07 17:32:20 +0000 | [diff] [blame] | 86 | void plat_ffa_rxtx_unmap_forward(struct vm_locked vm_locked) |
Federico Recanati | 8da9e33 | 2022-02-10 11:00:17 +0100 | [diff] [blame] | 87 | { |
J-Alves | 7007993 | 2022-12-07 17:32:20 +0000 | [diff] [blame] | 88 | (void)vm_locked; |
Federico Recanati | 8da9e33 | 2022-02-10 11:00:17 +0100 | [diff] [blame] | 89 | } |
| 90 | |
J-Alves | 19e20cf | 2023-08-02 12:48:55 +0100 | [diff] [blame] | 91 | bool plat_ffa_direct_request_forward(ffa_id_t receiver_vm_id, |
Olivier Deprez | 55a189e | 2021-06-09 15:45:27 +0200 | [diff] [blame] | 92 | struct ffa_value args, |
| 93 | struct ffa_value *ret) |
| 94 | { |
| 95 | (void)receiver_vm_id; |
| 96 | (void)args; |
| 97 | (void)ret; |
| 98 | return false; |
| 99 | } |
| 100 | |
Federico Recanati | 7bef0b9 | 2022-03-17 14:56:22 +0100 | [diff] [blame] | 101 | bool plat_ffa_rx_release_forward(struct vm_locked vm_locked, |
| 102 | struct ffa_value *ret) |
| 103 | { |
| 104 | (void)vm_locked; |
| 105 | (void)ret; |
| 106 | |
| 107 | return false; |
| 108 | } |
| 109 | |
Federico Recanati | 644f046 | 2022-03-17 12:04:00 +0100 | [diff] [blame] | 110 | bool plat_ffa_acquire_receiver_rx(struct vm_locked to_locked, |
| 111 | struct ffa_value *ret) |
| 112 | { |
| 113 | (void)to_locked; |
| 114 | (void)ret; |
| 115 | |
| 116 | return false; |
| 117 | } |
| 118 | |
Federico Recanati | 25053ee | 2022-03-14 15:01:53 +0100 | [diff] [blame] | 119 | bool plat_ffa_is_indirect_msg_supported(struct vm_locked sender_locked, |
| 120 | struct vm_locked receiver_locked) |
| 121 | { |
| 122 | (void)sender_locked; |
| 123 | (void)receiver_locked; |
| 124 | |
| 125 | return false; |
| 126 | } |
| 127 | |
J-Alves | 19e20cf | 2023-08-02 12:48:55 +0100 | [diff] [blame] | 128 | bool plat_ffa_msg_send2_forward(ffa_id_t receiver_vm_id, ffa_id_t sender_vm_id, |
| 129 | struct ffa_value *ret) |
Federico Recanati | 25053ee | 2022-03-14 15:01:53 +0100 | [diff] [blame] | 130 | { |
| 131 | (void)receiver_vm_id; |
| 132 | (void)sender_vm_id; |
| 133 | (void)ret; |
| 134 | |
| 135 | return false; |
| 136 | } |
| 137 | |
Olivier Deprez | 55a189e | 2021-06-09 15:45:27 +0200 | [diff] [blame] | 138 | ffa_memory_handle_t plat_ffa_memory_handle_make(uint64_t index) |
| 139 | { |
| 140 | return index; |
| 141 | } |
| 142 | |
| 143 | bool plat_ffa_memory_handle_allocated_by_current_world( |
| 144 | ffa_memory_handle_t handle) |
| 145 | { |
| 146 | (void)handle; |
| 147 | return false; |
| 148 | } |
Maksims Svecovs | b596eab | 2021-04-27 00:52:27 +0100 | [diff] [blame] | 149 | |
J-Alves | 7db3200 | 2021-12-14 14:44:50 +0000 | [diff] [blame] | 150 | uint32_t plat_ffa_other_world_mode(void) |
| 151 | { |
| 152 | return 0U; |
| 153 | } |
| 154 | |
J-Alves | c003a7a | 2021-03-18 13:06:53 +0000 | [diff] [blame] | 155 | bool plat_ffa_is_notifications_bind_valid(struct vcpu *current, |
J-Alves | 19e20cf | 2023-08-02 12:48:55 +0100 | [diff] [blame] | 156 | ffa_id_t sender_id, |
| 157 | ffa_id_t receiver_id) |
J-Alves | c003a7a | 2021-03-18 13:06:53 +0000 | [diff] [blame] | 158 | { |
| 159 | (void)current; |
| 160 | (void)sender_id; |
| 161 | (void)receiver_id; |
| 162 | return false; |
| 163 | } |
| 164 | |
J-Alves | b15e940 | 2021-09-08 11:44:42 +0100 | [diff] [blame] | 165 | bool plat_ffa_notifications_update_bindings_forward( |
J-Alves | 19e20cf | 2023-08-02 12:48:55 +0100 | [diff] [blame] | 166 | ffa_id_t receiver_id, ffa_id_t sender_id, uint32_t flags, |
J-Alves | b15e940 | 2021-09-08 11:44:42 +0100 | [diff] [blame] | 167 | ffa_notifications_bitmap_t bitmap, bool is_bind, struct ffa_value *ret) |
| 168 | { |
| 169 | (void)ret; |
| 170 | (void)receiver_id; |
| 171 | (void)sender_id; |
| 172 | (void)flags; |
| 173 | (void)bitmap; |
| 174 | (void)is_bind; |
| 175 | (void)ret; |
| 176 | |
| 177 | return false; |
| 178 | } |
| 179 | |
Federico Recanati | 8d8b1cf | 2022-04-14 13:16:00 +0200 | [diff] [blame] | 180 | void plat_ffa_rxtx_map_forward(struct vm_locked vm_locked) |
| 181 | { |
| 182 | (void)vm_locked; |
| 183 | } |
| 184 | |
Maksims Svecovs | b596eab | 2021-04-27 00:52:27 +0100 | [diff] [blame] | 185 | ffa_partition_properties_t plat_ffa_partition_properties( |
J-Alves | 19e20cf | 2023-08-02 12:48:55 +0100 | [diff] [blame] | 186 | ffa_id_t vm_id, const struct vm *target) |
Maksims Svecovs | b596eab | 2021-04-27 00:52:27 +0100 | [diff] [blame] | 187 | { |
J-Alves | fa78209 | 2021-10-13 16:02:16 +0100 | [diff] [blame] | 188 | (void)vm_id; |
Maksims Svecovs | b596eab | 2021-04-27 00:52:27 +0100 | [diff] [blame] | 189 | (void)target; |
| 190 | return 0; |
| 191 | } |
Maksims Svecovs | 9ddf86a | 2021-05-06 17:17:21 +0100 | [diff] [blame] | 192 | |
| 193 | bool plat_ffa_vm_managed_exit_supported(struct vm *vm) |
| 194 | { |
| 195 | (void)vm; |
| 196 | return false; |
| 197 | } |
J-Alves | a0f317d | 2021-06-09 13:31:59 +0100 | [diff] [blame] | 198 | |
| 199 | bool plat_ffa_is_notifications_create_valid(struct vcpu *current, |
J-Alves | 19e20cf | 2023-08-02 12:48:55 +0100 | [diff] [blame] | 200 | ffa_id_t vm_id) |
J-Alves | a0f317d | 2021-06-09 13:31:59 +0100 | [diff] [blame] | 201 | { |
| 202 | (void)current; |
| 203 | (void)vm_id; |
| 204 | |
| 205 | return false; |
| 206 | } |
| 207 | |
J-Alves | aa79c01 | 2021-07-09 14:29:45 +0100 | [diff] [blame] | 208 | bool plat_ffa_is_notification_set_valid(struct vcpu *current, |
J-Alves | 19e20cf | 2023-08-02 12:48:55 +0100 | [diff] [blame] | 209 | ffa_id_t sender_id, |
| 210 | ffa_id_t receiver_id) |
J-Alves | aa79c01 | 2021-07-09 14:29:45 +0100 | [diff] [blame] | 211 | { |
| 212 | (void)current; |
| 213 | (void)sender_id; |
| 214 | (void)receiver_id; |
| 215 | return false; |
| 216 | } |
| 217 | |
| 218 | bool plat_ffa_is_notification_get_valid(struct vcpu *current, |
J-Alves | 19e20cf | 2023-08-02 12:48:55 +0100 | [diff] [blame] | 219 | ffa_id_t receiver_id, uint32_t flags) |
J-Alves | aa79c01 | 2021-07-09 14:29:45 +0100 | [diff] [blame] | 220 | { |
J-Alves | fc95a30 | 2022-04-22 14:18:23 +0100 | [diff] [blame] | 221 | (void)flags; |
J-Alves | aa79c01 | 2021-07-09 14:29:45 +0100 | [diff] [blame] | 222 | (void)current; |
| 223 | (void)receiver_id; |
| 224 | return false; |
| 225 | } |
| 226 | |
J-Alves | 98ff956 | 2021-09-09 14:39:41 +0100 | [diff] [blame] | 227 | bool plat_ffa_notifications_get_from_sp( |
| 228 | struct vm_locked receiver_locked, ffa_vcpu_index_t vcpu_id, |
J-Alves | fa78209 | 2021-10-13 16:02:16 +0100 | [diff] [blame] | 229 | ffa_notifications_bitmap_t *from_sp, // NOLINT |
| 230 | struct ffa_value *ret) // NOLINT |
J-Alves | 98ff956 | 2021-09-09 14:39:41 +0100 | [diff] [blame] | 231 | { |
| 232 | (void)receiver_locked; |
| 233 | (void)vcpu_id; |
| 234 | (void)from_sp; |
| 235 | (void)ret; |
| 236 | |
| 237 | return false; |
| 238 | } |
| 239 | |
J-Alves | d605a09 | 2022-03-28 14:20:48 +0100 | [diff] [blame] | 240 | bool plat_ffa_notifications_get_framework_notifications( |
| 241 | struct vm_locked receiver_locked, |
| 242 | ffa_notifications_bitmap_t *from_fwk, // NOLINT |
| 243 | uint32_t flags, ffa_vcpu_index_t vcpu_id, struct ffa_value *ret) |
| 244 | { |
| 245 | (void)receiver_locked; |
| 246 | (void)from_fwk; |
| 247 | (void)flags; |
| 248 | (void)vcpu_id; |
| 249 | (void)ret; |
| 250 | |
| 251 | return false; |
| 252 | } |
| 253 | |
J-Alves | 19e20cf | 2023-08-02 12:48:55 +0100 | [diff] [blame] | 254 | bool plat_ffa_notification_set_forward(ffa_id_t sender_vm_id, |
| 255 | ffa_id_t receiver_vm_id, uint32_t flags, |
J-Alves | de7bd2f | 2021-09-09 19:54:35 +0100 | [diff] [blame] | 256 | ffa_notifications_bitmap_t bitmap, |
| 257 | struct ffa_value *ret) |
| 258 | { |
| 259 | (void)sender_vm_id; |
| 260 | (void)receiver_vm_id; |
| 261 | (void)flags; |
| 262 | (void)bitmap; |
| 263 | (void)ret; |
| 264 | |
| 265 | return false; |
| 266 | } |
| 267 | |
J-Alves | a0f317d | 2021-06-09 13:31:59 +0100 | [diff] [blame] | 268 | struct ffa_value plat_ffa_notifications_bitmap_create( |
J-Alves | 19e20cf | 2023-08-02 12:48:55 +0100 | [diff] [blame] | 269 | ffa_id_t vm_id, ffa_vcpu_count_t vcpu_count) |
J-Alves | a0f317d | 2021-06-09 13:31:59 +0100 | [diff] [blame] | 270 | { |
| 271 | (void)vm_id; |
| 272 | (void)vcpu_count; |
| 273 | |
| 274 | return ffa_error(FFA_NOT_SUPPORTED); |
| 275 | } |
| 276 | |
J-Alves | 19e20cf | 2023-08-02 12:48:55 +0100 | [diff] [blame] | 277 | struct ffa_value plat_ffa_notifications_bitmap_destroy(ffa_id_t vm_id) |
J-Alves | a0f317d | 2021-06-09 13:31:59 +0100 | [diff] [blame] | 278 | { |
| 279 | (void)vm_id; |
| 280 | |
| 281 | return ffa_error(FFA_NOT_SUPPORTED); |
| 282 | } |
J-Alves | c003a7a | 2021-03-18 13:06:53 +0000 | [diff] [blame] | 283 | |
J-Alves | 19e20cf | 2023-08-02 12:48:55 +0100 | [diff] [blame] | 284 | struct vm_locked plat_ffa_vm_find_locked(ffa_id_t vm_id) |
J-Alves | c003a7a | 2021-03-18 13:06:53 +0000 | [diff] [blame] | 285 | { |
| 286 | (void)vm_id; |
| 287 | return (struct vm_locked){.vm = NULL}; |
| 288 | } |
| 289 | |
J-Alves | 19e20cf | 2023-08-02 12:48:55 +0100 | [diff] [blame] | 290 | struct vm_locked plat_ffa_vm_find_locked_create(ffa_id_t vm_id) |
Federico Recanati | 8d8b1cf | 2022-04-14 13:16:00 +0200 | [diff] [blame] | 291 | { |
| 292 | (void)vm_id; |
| 293 | return (struct vm_locked){.vm = NULL}; |
| 294 | } |
| 295 | |
J-Alves | fa78209 | 2021-10-13 16:02:16 +0100 | [diff] [blame] | 296 | bool plat_ffa_vm_notifications_info_get( // NOLINTNEXTLINE |
| 297 | uint16_t *ids, uint32_t *ids_count, // NOLINTNEXTLINE |
| 298 | uint32_t *lists_sizes, // NOLINTNEXTLINE |
| 299 | uint32_t *lists_count, const uint32_t ids_count_max) |
J-Alves | c8e8a22 | 2021-06-08 17:33:52 +0100 | [diff] [blame] | 300 | { |
| 301 | (void)ids; |
| 302 | (void)ids_count; |
| 303 | (void)lists_sizes; |
| 304 | (void)lists_count; |
| 305 | (void)ids_count_max; |
| 306 | |
| 307 | return false; |
| 308 | } |
Raghu Krishnamurthy | ea6d25f | 2021-09-14 15:27:06 -0700 | [diff] [blame] | 309 | |
| 310 | bool plat_ffa_is_mem_perm_get_valid(const struct vcpu *current) |
| 311 | { |
| 312 | (void)current; |
| 313 | return false; |
| 314 | } |
| 315 | |
| 316 | bool plat_ffa_is_mem_perm_set_valid(const struct vcpu *current) |
| 317 | { |
| 318 | (void)current; |
| 319 | return false; |
| 320 | } |
Madhukar Pappireddy | b11e0d1 | 2021-08-02 19:44:35 -0500 | [diff] [blame] | 321 | |
| 322 | /** |
| 323 | * Check if current VM can resume target VM/SP using FFA_RUN ABI. |
| 324 | */ |
Madhukar Pappireddy | bd10e57 | 2023-03-06 16:39:49 -0600 | [diff] [blame] | 325 | bool plat_ffa_run_checks(struct vcpu_locked current_locked, |
J-Alves | 19e20cf | 2023-08-02 12:48:55 +0100 | [diff] [blame] | 326 | ffa_id_t target_vm_id, ffa_vcpu_index_t vcpu_idx, |
Madhukar Pappireddy | bd10e57 | 2023-03-06 16:39:49 -0600 | [diff] [blame] | 327 | struct ffa_value *run_ret, struct vcpu **next) |
Madhukar Pappireddy | b11e0d1 | 2021-08-02 19:44:35 -0500 | [diff] [blame] | 328 | { |
Madhukar Pappireddy | bd10e57 | 2023-03-06 16:39:49 -0600 | [diff] [blame] | 329 | (void)current_locked; |
Madhukar Pappireddy | b11e0d1 | 2021-08-02 19:44:35 -0500 | [diff] [blame] | 330 | (void)target_vm_id; |
| 331 | (void)run_ret; |
| 332 | (void)next; |
Raghu Krishnamurthy | 048d63f | 2021-12-11 12:45:41 -0800 | [diff] [blame] | 333 | (void)vcpu_idx; |
Madhukar Pappireddy | b11e0d1 | 2021-08-02 19:44:35 -0500 | [diff] [blame] | 334 | return true; |
| 335 | } |
J-Alves | ca058c2 | 2021-09-10 14:02:07 +0100 | [diff] [blame] | 336 | |
| 337 | void plat_ffa_notification_info_get_forward( // NOLINTNEXTLINE |
| 338 | uint16_t *ids, uint32_t *ids_count, // NOLINTNEXTLINE |
| 339 | uint32_t *lists_sizes, uint32_t *lists_count, |
| 340 | const uint32_t ids_count_max) |
| 341 | { |
| 342 | (void)ids; |
| 343 | (void)ids_count; |
| 344 | (void)lists_sizes; |
| 345 | (void)lists_count; |
| 346 | (void)ids_count_max; |
| 347 | } |
J-Alves | 1339402 | 2021-06-30 13:48:49 +0100 | [diff] [blame] | 348 | |
| 349 | void plat_ffa_sri_state_set(enum plat_ffa_sri_state state) |
| 350 | { |
| 351 | (void)state; |
| 352 | } |
| 353 | |
| 354 | void plat_ffa_sri_trigger_if_delayed(struct cpu *cpu) |
| 355 | { |
| 356 | (void)cpu; |
| 357 | } |
| 358 | |
| 359 | void plat_ffa_sri_trigger_not_delayed(struct cpu *cpu) |
| 360 | { |
| 361 | (void)cpu; |
| 362 | } |
| 363 | |
J-Alves | 6e2abc6 | 2021-12-02 14:58:56 +0000 | [diff] [blame] | 364 | bool plat_ffa_inject_notification_pending_interrupt( |
Madhukar Pappireddy | bd10e57 | 2023-03-06 16:39:49 -0600 | [diff] [blame] | 365 | struct vcpu_locked target_locked, struct vcpu_locked current_locked, |
J-Alves | 6e2abc6 | 2021-12-02 14:58:56 +0000 | [diff] [blame] | 366 | struct vm_locked receiver_locked) |
J-Alves | 7461ef2 | 2021-10-18 17:21:33 +0100 | [diff] [blame] | 367 | { |
J-Alves | 6e2abc6 | 2021-12-02 14:58:56 +0000 | [diff] [blame] | 368 | (void)target_locked; |
Madhukar Pappireddy | bd10e57 | 2023-03-06 16:39:49 -0600 | [diff] [blame] | 369 | (void)current_locked; |
J-Alves | 6e2abc6 | 2021-12-02 14:58:56 +0000 | [diff] [blame] | 370 | (void)receiver_locked; |
| 371 | |
| 372 | return false; |
J-Alves | 7461ef2 | 2021-10-18 17:21:33 +0100 | [diff] [blame] | 373 | } |
Olivier Deprez | e562e54 | 2020-06-11 17:31:54 +0200 | [diff] [blame] | 374 | |
Raghu Krishnamurthy | ef432cb | 2022-12-29 06:56:32 -0800 | [diff] [blame] | 375 | bool plat_ffa_partition_info_get_regs_forward( // NOLINTNEXTLINE |
| 376 | const struct ffa_uuid *uuid, |
| 377 | const uint16_t start_index, // NOLINTNEXTLINE |
| 378 | const uint16_t tag, |
| 379 | struct ffa_partition_info *partitions, // NOLINTNEXTLINE |
| 380 | uint16_t partitions_len, ffa_vm_count_t *ret_count) |
| 381 | { |
| 382 | (void)uuid; |
| 383 | (void)start_index; |
| 384 | (void)tag; |
| 385 | (void)partitions; |
| 386 | (void)partitions_len; |
| 387 | (void)ret_count; |
| 388 | return true; |
| 389 | } |
| 390 | |
Olivier Deprez | e562e54 | 2020-06-11 17:31:54 +0200 | [diff] [blame] | 391 | void plat_ffa_partition_info_get_forward( // NOLINTNEXTLINE |
| 392 | const struct ffa_uuid *uuid, // NOLINTNEXTLINE |
Daniel Boulby | b46cad1 | 2021-12-13 17:47:21 +0000 | [diff] [blame] | 393 | const uint32_t flags, // NOLINTNEXTLINE |
Olivier Deprez | e562e54 | 2020-06-11 17:31:54 +0200 | [diff] [blame] | 394 | struct ffa_partition_info *partitions, ffa_vm_count_t *ret_count) |
| 395 | { |
| 396 | (void)uuid; |
Daniel Boulby | b46cad1 | 2021-12-13 17:47:21 +0000 | [diff] [blame] | 397 | (void)flags; |
Olivier Deprez | e562e54 | 2020-06-11 17:31:54 +0200 | [diff] [blame] | 398 | (void)partitions; |
| 399 | (void)ret_count; |
| 400 | } |
Olivier Deprez | d614d32 | 2021-06-18 15:21:00 +0200 | [diff] [blame] | 401 | |
| 402 | bool plat_ffa_is_secondary_ep_register_supported(void) |
| 403 | { |
| 404 | return false; |
| 405 | } |
Madhukar Pappireddy | dd88320 | 2022-10-24 16:49:28 -0500 | [diff] [blame] | 406 | |
Madhukar Pappireddy | bd10e57 | 2023-03-06 16:39:49 -0600 | [diff] [blame] | 407 | struct ffa_value plat_ffa_msg_wait_prepare(struct vcpu_locked current_locked, |
Madhukar Pappireddy | dd88320 | 2022-10-24 16:49:28 -0500 | [diff] [blame] | 408 | struct vcpu **next) |
Madhukar Pappireddy | 5522c67 | 2021-12-17 16:35:51 -0600 | [diff] [blame] | 409 | { |
Madhukar Pappireddy | bd10e57 | 2023-03-06 16:39:49 -0600 | [diff] [blame] | 410 | (void)current_locked; |
Madhukar Pappireddy | 5522c67 | 2021-12-17 16:35:51 -0600 | [diff] [blame] | 411 | (void)next; |
Madhukar Pappireddy | 5522c67 | 2021-12-17 16:35:51 -0600 | [diff] [blame] | 412 | |
Madhukar Pappireddy | dd88320 | 2022-10-24 16:49:28 -0500 | [diff] [blame] | 413 | return (struct ffa_value){.func = FFA_INTERRUPT_32}; |
Madhukar Pappireddy | 5522c67 | 2021-12-17 16:35:51 -0600 | [diff] [blame] | 414 | } |
Madhukar Pappireddy | 0ea239a | 2022-06-21 17:26:57 -0500 | [diff] [blame] | 415 | |
Madhukar Pappireddy | bd10e57 | 2023-03-06 16:39:49 -0600 | [diff] [blame] | 416 | bool plat_ffa_check_runtime_state_transition(struct vcpu_locked current_locked, |
J-Alves | 19e20cf | 2023-08-02 12:48:55 +0100 | [diff] [blame] | 417 | ffa_id_t vm_id, |
| 418 | ffa_id_t receiver_vm_id, |
Madhukar Pappireddy | bd10e57 | 2023-03-06 16:39:49 -0600 | [diff] [blame] | 419 | struct vcpu_locked receiver_locked, |
Madhukar Pappireddy | 0ea239a | 2022-06-21 17:26:57 -0500 | [diff] [blame] | 420 | uint32_t func, // NOLINTNEXTLINE |
| 421 | enum vcpu_state *next_state) |
| 422 | { |
| 423 | /* Perform state transition checks only for Secure Partitions. */ |
Madhukar Pappireddy | bd10e57 | 2023-03-06 16:39:49 -0600 | [diff] [blame] | 424 | (void)current_locked; |
Madhukar Pappireddy | 0ea239a | 2022-06-21 17:26:57 -0500 | [diff] [blame] | 425 | (void)vm_id; |
| 426 | (void)receiver_vm_id; |
Madhukar Pappireddy | bd10e57 | 2023-03-06 16:39:49 -0600 | [diff] [blame] | 427 | (void)receiver_locked; |
Madhukar Pappireddy | 0ea239a | 2022-06-21 17:26:57 -0500 | [diff] [blame] | 428 | (void)func; |
| 429 | (void)next_state; |
| 430 | |
| 431 | return true; |
| 432 | } |
Madhukar Pappireddy | 49fe670 | 2022-06-21 17:52:23 -0500 | [diff] [blame] | 433 | |
Madhukar Pappireddy | bd10e57 | 2023-03-06 16:39:49 -0600 | [diff] [blame] | 434 | void plat_ffa_init_schedule_mode_ffa_run(struct vcpu_locked current_locked, |
Madhukar Pappireddy | 1480fce | 2022-06-21 18:09:25 -0500 | [diff] [blame] | 435 | struct vcpu_locked target_locked) |
| 436 | { |
| 437 | /* Scheduling mode not supported in the Hypervisor/VMs. */ |
Madhukar Pappireddy | bd10e57 | 2023-03-06 16:39:49 -0600 | [diff] [blame] | 438 | (void)current_locked; |
Madhukar Pappireddy | 1480fce | 2022-06-21 18:09:25 -0500 | [diff] [blame] | 439 | (void)target_locked; |
| 440 | } |
| 441 | |
Madhukar Pappireddy | 49fe670 | 2022-06-21 17:52:23 -0500 | [diff] [blame] | 442 | void plat_ffa_wind_call_chain_ffa_direct_req( |
| 443 | struct vcpu_locked current_locked, |
J-Alves | 19e20cf | 2023-08-02 12:48:55 +0100 | [diff] [blame] | 444 | struct vcpu_locked receiver_vcpu_locked, ffa_id_t sender_vm_id) |
Madhukar Pappireddy | 49fe670 | 2022-06-21 17:52:23 -0500 | [diff] [blame] | 445 | { |
| 446 | /* Calls chains not supported in the Hypervisor/VMs. */ |
| 447 | (void)current_locked; |
| 448 | (void)receiver_vcpu_locked; |
Raghu Krishnamurthy | a9ccf12 | 2023-03-27 20:42:01 -0700 | [diff] [blame] | 449 | (void)sender_vm_id; |
Madhukar Pappireddy | 49fe670 | 2022-06-21 17:52:23 -0500 | [diff] [blame] | 450 | } |
Madhukar Pappireddy | c0fb87e | 2022-06-21 17:59:15 -0500 | [diff] [blame] | 451 | |
Madhukar Pappireddy | bd10e57 | 2023-03-06 16:39:49 -0600 | [diff] [blame] | 452 | void plat_ffa_unwind_call_chain_ffa_direct_resp( |
| 453 | struct vcpu_locked current_locked, struct vcpu_locked next_locked) |
Madhukar Pappireddy | c0fb87e | 2022-06-21 17:59:15 -0500 | [diff] [blame] | 454 | { |
| 455 | /* Calls chains not supported in the Hypervisor/VMs. */ |
Madhukar Pappireddy | bd10e57 | 2023-03-06 16:39:49 -0600 | [diff] [blame] | 456 | (void)current_locked; |
| 457 | (void)next_locked; |
Madhukar Pappireddy | c0fb87e | 2022-06-21 17:59:15 -0500 | [diff] [blame] | 458 | } |
Madhukar Pappireddy | 046dad0 | 2022-06-21 18:43:33 -0500 | [diff] [blame] | 459 | |
J-Alves | 19e20cf | 2023-08-02 12:48:55 +0100 | [diff] [blame] | 460 | bool plat_ffa_is_spmd_lp_id(ffa_id_t vm_id) |
Raghu Krishnamurthy | a9ccf12 | 2023-03-27 20:42:01 -0700 | [diff] [blame] | 461 | { |
| 462 | (void)vm_id; |
| 463 | return false; |
| 464 | } |
| 465 | |
Madhukar Pappireddy | 2f76e49 | 2022-09-06 15:21:59 -0500 | [diff] [blame] | 466 | bool plat_ffa_intercept_direct_response(struct vcpu_locked current_locked, |
| 467 | struct vcpu **next, |
| 468 | struct ffa_value to_ret, |
| 469 | struct ffa_value *signal_interrupt) |
| 470 | { |
| 471 | /* |
| 472 | * Only applicable to SPMC as it signals virtual secure interrupt to |
| 473 | * S-EL0 partitions. |
| 474 | */ |
| 475 | (void)current_locked; |
| 476 | (void)next; |
| 477 | (void)to_ret; |
| 478 | (void)signal_interrupt; |
| 479 | |
| 480 | return false; |
| 481 | } |
| 482 | |
Madhukar Pappireddy | 486360d | 2022-09-06 15:32:24 -0500 | [diff] [blame] | 483 | void plat_ffa_enable_virtual_interrupts(struct vcpu_locked current_locked, |
| 484 | struct vm_locked vm_locked) |
Madhukar Pappireddy | 046dad0 | 2022-06-21 18:43:33 -0500 | [diff] [blame] | 485 | { |
| 486 | (void)current_locked; |
Madhukar Pappireddy | 486360d | 2022-09-06 15:32:24 -0500 | [diff] [blame] | 487 | (void)vm_locked; |
Madhukar Pappireddy | 046dad0 | 2022-06-21 18:43:33 -0500 | [diff] [blame] | 488 | } |
J-Alves | 6665225 | 2022-07-06 09:49:51 +0100 | [diff] [blame] | 489 | |
Madhukar Pappireddy | bd10e57 | 2023-03-06 16:39:49 -0600 | [diff] [blame] | 490 | bool plat_ffa_is_direct_response_interrupted(struct vcpu_locked current_locked) |
Madhukar Pappireddy | 5fd3248 | 2022-01-07 14:53:26 -0600 | [diff] [blame] | 491 | { |
Madhukar Pappireddy | bd10e57 | 2023-03-06 16:39:49 -0600 | [diff] [blame] | 492 | (void)current_locked; |
Madhukar Pappireddy | 5fd3248 | 2022-01-07 14:53:26 -0600 | [diff] [blame] | 493 | return false; |
| 494 | } |
| 495 | |
J-Alves | 6665225 | 2022-07-06 09:49:51 +0100 | [diff] [blame] | 496 | struct ffa_value plat_ffa_other_world_mem_send( |
| 497 | struct vm *from, uint32_t share_func, |
| 498 | struct ffa_memory_region **memory_region, uint32_t length, |
| 499 | uint32_t fragment_length, struct mpool *page_pool) |
| 500 | { |
| 501 | (void)from; |
| 502 | (void)memory_region; |
| 503 | (void)length; |
| 504 | (void)fragment_length; |
| 505 | (void)page_pool; |
| 506 | (void)share_func; |
| 507 | |
| 508 | return (struct ffa_value){0}; |
| 509 | } |
J-Alves | fc19b37 | 2022-07-06 12:17:35 +0100 | [diff] [blame] | 510 | |
| 511 | struct ffa_value plat_ffa_other_world_mem_reclaim( |
| 512 | struct vm *to, ffa_memory_handle_t handle, |
| 513 | ffa_memory_region_flags_t flags, struct mpool *page_pool) |
| 514 | { |
| 515 | (void)handle; |
| 516 | (void)flags; |
| 517 | (void)page_pool; |
| 518 | (void)to; |
| 519 | |
| 520 | return ffa_error(FFA_INVALID_PARAMETERS); |
| 521 | } |
J-Alves | b5084cf | 2022-07-06 14:20:12 +0100 | [diff] [blame] | 522 | |
| 523 | struct ffa_value plat_ffa_other_world_mem_retrieve( |
| 524 | struct vm_locked to_locked, struct ffa_memory_region *retrieve_request, |
| 525 | uint32_t length, struct mpool *page_pool) |
| 526 | { |
| 527 | (void)to_locked; |
| 528 | (void)retrieve_request; |
| 529 | (void)length; |
| 530 | (void)page_pool; |
| 531 | |
| 532 | return ffa_error(FFA_INVALID_PARAMETERS); |
| 533 | } |
J-Alves | fdd2927 | 2022-07-19 13:16:31 +0100 | [diff] [blame] | 534 | |
| 535 | struct ffa_value plat_ffa_other_world_mem_send_continue( |
| 536 | struct vm *from, void *fragment, uint32_t fragment_length, |
| 537 | ffa_memory_handle_t handle, struct mpool *page_pool) |
| 538 | { |
| 539 | (void)from; |
| 540 | (void)fragment; |
| 541 | (void)fragment_length; |
| 542 | (void)handle; |
| 543 | (void)page_pool; |
| 544 | |
| 545 | return ffa_error(FFA_INVALID_PARAMETERS); |
| 546 | } |
J-Alves | 27b7196 | 2022-12-12 15:29:58 +0000 | [diff] [blame] | 547 | |
J-Alves | 19e20cf | 2023-08-02 12:48:55 +0100 | [diff] [blame] | 548 | struct ffa_value plat_ffa_msg_send(ffa_id_t sender_vm_id, |
| 549 | ffa_id_t receiver_vm_id, uint32_t size, |
J-Alves | 27b7196 | 2022-12-12 15:29:58 +0000 | [diff] [blame] | 550 | struct vcpu *current, struct vcpu **next) |
| 551 | { |
| 552 | (void)sender_vm_id; |
| 553 | (void)receiver_vm_id; |
| 554 | (void)size; |
| 555 | (void)current; |
| 556 | (void)next; |
| 557 | |
| 558 | return ffa_error(FFA_NOT_SUPPORTED); |
| 559 | } |
Madhukar Pappireddy | 1f2f213 | 2023-02-14 17:48:44 -0600 | [diff] [blame] | 560 | |
Madhukar Pappireddy | bd10e57 | 2023-03-06 16:39:49 -0600 | [diff] [blame] | 561 | struct ffa_value plat_ffa_yield_prepare(struct vcpu_locked current_locked, |
Madhukar Pappireddy | 184501c | 2023-05-23 17:24:06 -0500 | [diff] [blame] | 562 | struct vcpu **next, |
| 563 | uint32_t timeout_low, |
| 564 | uint32_t timeout_high) |
Madhukar Pappireddy | 1f2f213 | 2023-02-14 17:48:44 -0600 | [diff] [blame] | 565 | { |
Madhukar Pappireddy | bd10e57 | 2023-03-06 16:39:49 -0600 | [diff] [blame] | 566 | (void)current_locked; |
Madhukar Pappireddy | b3fb871 | 2023-05-23 17:10:34 -0500 | [diff] [blame] | 567 | (void)next; |
Madhukar Pappireddy | 184501c | 2023-05-23 17:24:06 -0500 | [diff] [blame] | 568 | (void)timeout_low; |
| 569 | (void)timeout_high; |
Madhukar Pappireddy | b3fb871 | 2023-05-23 17:10:34 -0500 | [diff] [blame] | 570 | |
| 571 | return ffa_error(FFA_NOT_SUPPORTED); |
Madhukar Pappireddy | 1f2f213 | 2023-02-14 17:48:44 -0600 | [diff] [blame] | 572 | } |
Olivier Deprez | d9d409f | 2023-03-17 11:47:57 +0100 | [diff] [blame] | 573 | |
| 574 | bool arch_vm_init_mm(struct vm *vm, struct mpool *ppool) |
| 575 | { |
| 576 | (void)vm; |
| 577 | (void)ppool; |
| 578 | |
| 579 | return true; |
| 580 | } |
| 581 | |
| 582 | bool arch_vm_identity_prepare(struct vm_locked vm_locked, paddr_t begin, |
| 583 | paddr_t end, uint32_t mode, struct mpool *ppool) |
| 584 | { |
| 585 | (void)vm_locked; |
| 586 | (void)begin; |
| 587 | (void)end; |
| 588 | (void)mode; |
| 589 | (void)ppool; |
| 590 | |
| 591 | return true; |
| 592 | } |
| 593 | |
| 594 | void arch_vm_identity_commit(struct vm_locked vm_locked, paddr_t begin, |
| 595 | paddr_t end, uint32_t mode, struct mpool *ppool, |
| 596 | ipaddr_t *ipa) |
| 597 | { |
| 598 | (void)vm_locked; |
| 599 | (void)begin; |
| 600 | (void)end; |
| 601 | (void)mode; |
| 602 | (void)ppool; |
| 603 | (void)ipa; |
| 604 | } |
| 605 | |
| 606 | bool arch_vm_unmap(struct vm_locked vm_locked, paddr_t begin, paddr_t end, |
| 607 | struct mpool *ppool) |
| 608 | { |
| 609 | (void)vm_locked; |
| 610 | (void)begin; |
| 611 | (void)end; |
| 612 | (void)ppool; |
| 613 | |
| 614 | return true; |
| 615 | } |
| 616 | |
| 617 | void arch_vm_ptable_defrag(struct vm_locked vm_locked, struct mpool *ppool) |
| 618 | { |
| 619 | (void)vm_locked; |
| 620 | (void)ppool; |
| 621 | } |
| 622 | |
| 623 | bool arch_vm_mem_get_mode(struct vm_locked vm_locked, ipaddr_t begin, |
| 624 | ipaddr_t end, uint32_t *mode) // NOLINT |
| 625 | { |
| 626 | (void)vm_locked; |
| 627 | (void)begin; |
| 628 | (void)end; |
| 629 | (void)mode; |
| 630 | |
| 631 | return true; |
| 632 | } |
Olivier Deprez | 878bd5b | 2021-04-15 19:05:10 +0200 | [diff] [blame] | 633 | |
| 634 | ffa_memory_attributes_t plat_ffa_memory_security_mode( |
| 635 | ffa_memory_attributes_t attributes, uint32_t mode) |
| 636 | { |
| 637 | (void)mode; |
| 638 | |
| 639 | return attributes; |
| 640 | } |
Kathleen Capella | 6ab0513 | 2023-05-10 12:27:35 -0400 | [diff] [blame] | 641 | |
| 642 | struct ffa_value plat_ffa_error_32(struct vcpu *current, struct vcpu **next, |
| 643 | uint32_t error_code) |
| 644 | { |
| 645 | (void)current; |
| 646 | (void)next; |
| 647 | (void)error_code; |
J-Alves | 2ced167 | 2022-12-12 14:35:38 +0000 | [diff] [blame] | 648 | |
| 649 | return ffa_error(FFA_NOT_SUPPORTED); |
| 650 | } |
| 651 | |
J-Alves | 19e20cf | 2023-08-02 12:48:55 +0100 | [diff] [blame] | 652 | int64_t plat_ffa_mailbox_waiter_get(ffa_id_t vm_id, const struct vcpu *current) |
J-Alves | 2ced167 | 2022-12-12 14:35:38 +0000 | [diff] [blame] | 653 | { |
J-Alves | bc7ab4f | 2022-12-13 12:09:25 +0000 | [diff] [blame] | 654 | (void)vm_id; |
| 655 | (void)current; |
J-Alves | 2ced167 | 2022-12-12 14:35:38 +0000 | [diff] [blame] | 656 | |
J-Alves | bc7ab4f | 2022-12-13 12:09:25 +0000 | [diff] [blame] | 657 | return -1; |
| 658 | } |
| 659 | |
| 660 | int64_t plat_ffa_mailbox_writable_get(const struct vcpu *current) |
| 661 | { |
| 662 | (void)current; |
| 663 | |
| 664 | return -1; |
Kathleen Capella | 6ab0513 | 2023-05-10 12:27:35 -0400 | [diff] [blame] | 665 | } |
Raghu Krishnamurthy | e74d653 | 2023-06-07 12:21:54 -0700 | [diff] [blame] | 666 | |
| 667 | bool plat_ffa_partition_info_get_regs_forward_allowed(void) |
| 668 | { |
| 669 | return false; |
| 670 | } |
Madhukar Pappireddy | 9e09d7a | 2023-08-08 14:53:49 -0500 | [diff] [blame^] | 671 | |
| 672 | void plat_ffa_free_vm_resources(struct vm_locked vm_locked) |
| 673 | { |
| 674 | (void)vm_locked; |
| 675 | } |