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