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