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