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