blob: 69effef2b7aa745782e868e9496d9dbf55e98841 [file] [log] [blame]
Daniel Boulbyb2fb80e2021-02-03 15:09:23 +00001/*
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-Alvesfa782092021-10-13 16:02:16 +010011#include "hf/arch/plat/ffa.h"
Karl Meakin7a664f62024-07-24 17:20:29 +010012#include "hf/arch/plat/ffa/notifications.h"
J-Alvesfa782092021-10-13 16:02:16 +010013
J-Alvesa0f317d2021-06-09 13:31:59 +010014#include "hf/ffa_internal.h"
Olivier Deprez55a189e2021-06-09 15:45:27 +020015#include "hf/vcpu.h"
J-Alvesc003a7a2021-03-18 13:06:53 +000016#include "hf/vm.h"
Daniel Boulbyb2fb80e2021-02-03 15:09:23 +000017
J-Alves19e20cf2023-08-02 12:48:55 +010018ffa_id_t arch_ffa_spmc_id_get(void)
Daniel Boulbyb2fb80e2021-02-03 15:09:23 +000019{
20 return HF_SPMC_VM_ID;
21}
Olivier Deprez55a189e2021-06-09 15:45:27 +020022
23void plat_ffa_log_init(void)
24{
25}
26
J-Alvesc9227c82024-04-24 21:00:58 +010027bool plat_ffa_is_memory_send_valid(ffa_id_t receiver, ffa_id_t sender,
28 uint32_t share_func, bool multiple_borrower)
Maksims Svecovsa3d570c2021-12-08 11:16:32 +000029{
Maksims Svecovsa3d570c2021-12-08 11:16:32 +000030 (void)share_func;
J-Alvesc9227c82024-04-24 21:00:58 +010031 (void)receiver;
32 (void)sender;
33 (void)multiple_borrower;
Maksims Svecovsa3d570c2021-12-08 11:16:32 +000034
35 return true;
36}
37
Olivier Deprez55a189e2021-06-09 15:45:27 +020038bool plat_ffa_is_direct_request_valid(struct vcpu *current,
J-Alves19e20cf2023-08-02 12:48:55 +010039 ffa_id_t sender_vm_id,
40 ffa_id_t receiver_vm_id)
Olivier Deprez55a189e2021-06-09 15:45:27 +020041{
42 (void)current;
43 (void)sender_vm_id;
44 (void)receiver_vm_id;
45
46 return true;
47}
48
J-Alves439ac972021-11-18 17:32:03 +000049bool plat_ffa_is_direct_request_supported(struct vm *sender_vm,
Kathleen Capella41fea932023-06-23 17:39:28 -040050 struct vm *receiver_vm, uint32_t func)
J-Alves439ac972021-11-18 17:32:03 +000051{
52 (void)sender_vm;
53 (void)receiver_vm;
Kathleen Capella41fea932023-06-23 17:39:28 -040054 (void)func;
J-Alves439ac972021-11-18 17:32:03 +000055
56 return false;
57}
58
Olivier Deprez55a189e2021-06-09 15:45:27 +020059bool plat_ffa_is_direct_response_valid(struct vcpu *current,
J-Alves19e20cf2023-08-02 12:48:55 +010060 ffa_id_t sender_vm_id,
61 ffa_id_t receiver_vm_id)
Olivier Deprez55a189e2021-06-09 15:45:27 +020062{
63 (void)current;
64 (void)sender_vm_id;
65 (void)receiver_vm_id;
66
67 return true;
68}
69
J-Alves19e20cf2023-08-02 12:48:55 +010070bool plat_ffa_run_forward(ffa_id_t vm_id, ffa_vcpu_index_t vcpu_idx,
Raghu Krishnamurthy62f97a72021-07-27 02:14:59 -070071 struct ffa_value *ret)
72{
73 (void)vm_id;
74 (void)vcpu_idx;
75 (void)ret;
76
77 return false;
78}
79
Federico Recanati10bd06c2022-02-23 17:32:59 +010080void plat_ffa_vm_destroy(struct vm_locked to_destroy_locked)
81{
82 (void)to_destroy_locked;
83}
84
J-Alves70079932022-12-07 17:32:20 +000085void plat_ffa_rxtx_unmap_forward(struct vm_locked vm_locked)
Federico Recanati8da9e332022-02-10 11:00:17 +010086{
J-Alves70079932022-12-07 17:32:20 +000087 (void)vm_locked;
Federico Recanati8da9e332022-02-10 11:00:17 +010088}
89
J-Alves19e20cf2023-08-02 12:48:55 +010090bool plat_ffa_direct_request_forward(ffa_id_t receiver_vm_id,
Olivier Deprez55a189e2021-06-09 15:45:27 +020091 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 Recanati7bef0b92022-03-17 14:56:22 +0100100bool 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 Recanati644f0462022-03-17 12:04:00 +0100109bool 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 Recanati25053ee2022-03-14 15:01:53 +0100118bool 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-Alves19e20cf2023-08-02 12:48:55 +0100127bool plat_ffa_msg_send2_forward(ffa_id_t receiver_vm_id, ffa_id_t sender_vm_id,
128 struct ffa_value *ret)
Federico Recanati25053ee2022-03-14 15:01:53 +0100129{
130 (void)receiver_vm_id;
131 (void)sender_vm_id;
132 (void)ret;
133
134 return false;
135}
136
Olivier Deprez55a189e2021-06-09 15:45:27 +0200137ffa_memory_handle_t plat_ffa_memory_handle_make(uint64_t index)
138{
139 return index;
140}
141
142bool plat_ffa_memory_handle_allocated_by_current_world(
143 ffa_memory_handle_t handle)
144{
145 (void)handle;
146 return false;
147}
Maksims Svecovsb596eab2021-04-27 00:52:27 +0100148
J-Alves7db32002021-12-14 14:44:50 +0000149uint32_t plat_ffa_other_world_mode(void)
150{
151 return 0U;
152}
153
J-Alvesc003a7a2021-03-18 13:06:53 +0000154bool plat_ffa_is_notifications_bind_valid(struct vcpu *current,
J-Alves19e20cf2023-08-02 12:48:55 +0100155 ffa_id_t sender_id,
156 ffa_id_t receiver_id)
J-Alvesc003a7a2021-03-18 13:06:53 +0000157{
158 (void)current;
159 (void)sender_id;
160 (void)receiver_id;
161 return false;
162}
163
J-Alvesb15e9402021-09-08 11:44:42 +0100164bool plat_ffa_notifications_update_bindings_forward(
Karl Meakinf9c73ce2024-07-30 17:37:13 +0100165 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-Alvesb15e9402021-09-08 11:44:42 +0100168{
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 Recanati8d8b1cf2022-04-14 13:16:00 +0200180void plat_ffa_rxtx_map_forward(struct vm_locked vm_locked)
181{
182 (void)vm_locked;
183}
184
Maksims Svecovsb596eab2021-04-27 00:52:27 +0100185ffa_partition_properties_t plat_ffa_partition_properties(
J-Alves7fb0fdb2024-10-09 11:28:07 +0100186 ffa_id_t caller_id, const struct vm *target)
Maksims Svecovsb596eab2021-04-27 00:52:27 +0100187{
J-Alves7fb0fdb2024-10-09 11:28:07 +0100188 (void)caller_id;
Maksims Svecovsb596eab2021-04-27 00:52:27 +0100189 (void)target;
190 return 0;
191}
Maksims Svecovs9ddf86a2021-05-06 17:17:21 +0100192
193bool plat_ffa_vm_managed_exit_supported(struct vm *vm)
194{
195 (void)vm;
196 return false;
197}
J-Alvesa0f317d2021-06-09 13:31:59 +0100198
J-Alves7ccaccf2024-02-01 14:25:23 +0000199/**
200 * Check validity of the calls:
201 * FFA_NOTIFICATION_BITMAP_CREATE/FFA_NOTIFICATION_BITMAP_DESTROY.
202 */
203struct ffa_value plat_ffa_is_notifications_bitmap_access_valid(
204 struct vcpu *current, ffa_id_t vm_id)
J-Alvesa0f317d2021-06-09 13:31:59 +0100205{
J-Alves7ccaccf2024-02-01 14:25:23 +0000206 /*
207 * Call should only be used by the Hypervisor, so any attempt of
208 * invocation from NWd FF-A endpoints should fail.
209 */
J-Alvesa0f317d2021-06-09 13:31:59 +0100210 (void)current;
211 (void)vm_id;
212
J-Alves7ccaccf2024-02-01 14:25:23 +0000213 return ffa_error(FFA_NOT_SUPPORTED);
J-Alvesa0f317d2021-06-09 13:31:59 +0100214}
215
J-Alvesaa79c012021-07-09 14:29:45 +0100216bool plat_ffa_is_notification_set_valid(struct vcpu *current,
J-Alves19e20cf2023-08-02 12:48:55 +0100217 ffa_id_t sender_id,
218 ffa_id_t receiver_id)
J-Alvesaa79c012021-07-09 14:29:45 +0100219{
220 (void)current;
221 (void)sender_id;
222 (void)receiver_id;
223 return false;
224}
225
226bool plat_ffa_is_notification_get_valid(struct vcpu *current,
Karl Meakinf9c73ce2024-07-30 17:37:13 +0100227 ffa_id_t receiver_id,
228 ffa_notification_flags_t flags)
J-Alvesaa79c012021-07-09 14:29:45 +0100229{
J-Alvesfc95a302022-04-22 14:18:23 +0100230 (void)flags;
J-Alvesaa79c012021-07-09 14:29:45 +0100231 (void)current;
232 (void)receiver_id;
233 return false;
234}
235
Karl Meakinf9c73ce2024-07-30 17:37:13 +0100236struct ffa_value plat_ffa_notifications_get_from_sp(
J-Alves98ff9562021-09-09 14:39:41 +0100237 struct vm_locked receiver_locked, ffa_vcpu_index_t vcpu_id,
Karl Meakinf9c73ce2024-07-30 17:37:13 +0100238 ffa_notifications_bitmap_t *from_sp) // NOLINT
J-Alves98ff9562021-09-09 14:39:41 +0100239{
240 (void)receiver_locked;
241 (void)vcpu_id;
242 (void)from_sp;
J-Alves98ff9562021-09-09 14:39:41 +0100243
Karl Meakinf9c73ce2024-07-30 17:37:13 +0100244 return ffa_error(FFA_NOT_SUPPORTED);
J-Alves98ff9562021-09-09 14:39:41 +0100245}
246
Karl Meakinf9c73ce2024-07-30 17:37:13 +0100247struct ffa_value plat_ffa_notifications_get_framework_notifications(
J-Alvesd605a092022-03-28 14:20:48 +0100248 struct vm_locked receiver_locked,
249 ffa_notifications_bitmap_t *from_fwk, // NOLINT
Karl Meakinf9c73ce2024-07-30 17:37:13 +0100250 ffa_notification_flags_t flags, ffa_vcpu_index_t vcpu_id)
J-Alvesd605a092022-03-28 14:20:48 +0100251{
252 (void)receiver_locked;
253 (void)from_fwk;
254 (void)flags;
255 (void)vcpu_id;
J-Alvesd605a092022-03-28 14:20:48 +0100256
Karl Meakinf9c73ce2024-07-30 17:37:13 +0100257 return ffa_error(FFA_NOT_SUPPORTED);
J-Alvesd605a092022-03-28 14:20:48 +0100258}
259
J-Alves19e20cf2023-08-02 12:48:55 +0100260bool plat_ffa_notification_set_forward(ffa_id_t sender_vm_id,
Karl Meakinf9c73ce2024-07-30 17:37:13 +0100261 ffa_id_t receiver_vm_id,
262 ffa_notification_flags_t flags,
J-Alvesde7bd2f2021-09-09 19:54:35 +0100263 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-Alvesa0f317d2021-06-09 13:31:59 +0100275struct ffa_value plat_ffa_notifications_bitmap_create(
J-Alves19e20cf2023-08-02 12:48:55 +0100276 ffa_id_t vm_id, ffa_vcpu_count_t vcpu_count)
J-Alvesa0f317d2021-06-09 13:31:59 +0100277{
278 (void)vm_id;
279 (void)vcpu_count;
280
281 return ffa_error(FFA_NOT_SUPPORTED);
282}
283
J-Alves19e20cf2023-08-02 12:48:55 +0100284struct ffa_value plat_ffa_notifications_bitmap_destroy(ffa_id_t vm_id)
J-Alvesa0f317d2021-06-09 13:31:59 +0100285{
286 (void)vm_id;
287
288 return ffa_error(FFA_NOT_SUPPORTED);
289}
J-Alvesc003a7a2021-03-18 13:06:53 +0000290
J-Alves19e20cf2023-08-02 12:48:55 +0100291struct vm_locked plat_ffa_vm_find_locked(ffa_id_t vm_id)
J-Alvesc003a7a2021-03-18 13:06:53 +0000292{
293 (void)vm_id;
294 return (struct vm_locked){.vm = NULL};
295}
296
J-Alves19e20cf2023-08-02 12:48:55 +0100297struct vm_locked plat_ffa_vm_find_locked_create(ffa_id_t vm_id)
Federico Recanati8d8b1cf2022-04-14 13:16:00 +0200298{
299 (void)vm_id;
300 return (struct vm_locked){.vm = NULL};
301}
302
J-Alvesfa782092021-10-13 16:02:16 +0100303bool 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-Alvesc8e8a222021-06-08 17:33:52 +0100307{
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 Krishnamurthyea6d25f2021-09-14 15:27:06 -0700316
317bool plat_ffa_is_mem_perm_get_valid(const struct vcpu *current)
318{
319 (void)current;
320 return false;
321}
322
323bool plat_ffa_is_mem_perm_set_valid(const struct vcpu *current)
324{
325 (void)current;
326 return false;
327}
Madhukar Pappireddyb11e0d12021-08-02 19:44:35 -0500328
329/**
330 * Check if current VM can resume target VM/SP using FFA_RUN ABI.
331 */
Madhukar Pappireddybd10e572023-03-06 16:39:49 -0600332bool plat_ffa_run_checks(struct vcpu_locked current_locked,
J-Alves19e20cf2023-08-02 12:48:55 +0100333 ffa_id_t target_vm_id, ffa_vcpu_index_t vcpu_idx,
Madhukar Pappireddybd10e572023-03-06 16:39:49 -0600334 struct ffa_value *run_ret, struct vcpu **next)
Madhukar Pappireddyb11e0d12021-08-02 19:44:35 -0500335{
Madhukar Pappireddybd10e572023-03-06 16:39:49 -0600336 (void)current_locked;
Madhukar Pappireddyb11e0d12021-08-02 19:44:35 -0500337 (void)target_vm_id;
338 (void)run_ret;
339 (void)next;
Raghu Krishnamurthy048d63f2021-12-11 12:45:41 -0800340 (void)vcpu_idx;
Madhukar Pappireddyb11e0d12021-08-02 19:44:35 -0500341 return true;
342}
J-Alvesca058c22021-09-10 14:02:07 +0100343
344void 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-Alves13394022021-06-30 13:48:49 +0100355
J-Alves13394022021-06-30 13:48:49 +0100356void plat_ffa_sri_trigger_if_delayed(struct cpu *cpu)
357{
358 (void)cpu;
359}
360
361void plat_ffa_sri_trigger_not_delayed(struct cpu *cpu)
362{
363 (void)cpu;
364}
365
J-Alvesea8ccfe2024-10-09 11:47:24 +0100366void plat_ffa_sri_set_delayed(struct cpu *cpu)
367{
368 (void)cpu;
369}
370
J-Alves6e2abc62021-12-02 14:58:56 +0000371bool plat_ffa_inject_notification_pending_interrupt(
Madhukar Pappireddybd10e572023-03-06 16:39:49 -0600372 struct vcpu_locked target_locked, struct vcpu_locked current_locked,
J-Alves6e2abc62021-12-02 14:58:56 +0000373 struct vm_locked receiver_locked)
J-Alves7461ef22021-10-18 17:21:33 +0100374{
J-Alves6e2abc62021-12-02 14:58:56 +0000375 (void)target_locked;
Madhukar Pappireddybd10e572023-03-06 16:39:49 -0600376 (void)current_locked;
J-Alves6e2abc62021-12-02 14:58:56 +0000377 (void)receiver_locked;
378
379 return false;
J-Alves7461ef22021-10-18 17:21:33 +0100380}
Olivier Depreze562e542020-06-11 17:31:54 +0200381
Raghu Krishnamurthyef432cb2022-12-29 06:56:32 -0800382bool 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
Karl Meakin86c80272024-07-26 15:13:23 +0100398ffa_vm_count_t plat_ffa_partition_info_get_forward( // NOLINTNEXTLINE
399 const struct ffa_uuid *uuid, // NOLINTNEXTLINE
400 uint32_t flags, // NOLINTNEXTLINE
401 struct ffa_partition_info *partitions, ffa_vm_count_t vm_count)
Olivier Depreze562e542020-06-11 17:31:54 +0200402{
403 (void)uuid;
Daniel Boulbyb46cad12021-12-13 17:47:21 +0000404 (void)flags;
Olivier Depreze562e542020-06-11 17:31:54 +0200405 (void)partitions;
Karl Meakin86c80272024-07-26 15:13:23 +0100406
407 return vm_count;
Olivier Depreze562e542020-06-11 17:31:54 +0200408}
Olivier Deprezd614d322021-06-18 15:21:00 +0200409
410bool plat_ffa_is_secondary_ep_register_supported(void)
411{
412 return false;
413}
Madhukar Pappireddydd883202022-10-24 16:49:28 -0500414
Madhukar Pappireddybd10e572023-03-06 16:39:49 -0600415struct ffa_value plat_ffa_msg_wait_prepare(struct vcpu_locked current_locked,
Madhukar Pappireddydd883202022-10-24 16:49:28 -0500416 struct vcpu **next)
Madhukar Pappireddy5522c672021-12-17 16:35:51 -0600417{
Madhukar Pappireddybd10e572023-03-06 16:39:49 -0600418 (void)current_locked;
Madhukar Pappireddy5522c672021-12-17 16:35:51 -0600419 (void)next;
Madhukar Pappireddy5522c672021-12-17 16:35:51 -0600420
Madhukar Pappireddydd883202022-10-24 16:49:28 -0500421 return (struct ffa_value){.func = FFA_INTERRUPT_32};
Madhukar Pappireddy5522c672021-12-17 16:35:51 -0600422}
Madhukar Pappireddy0ea239a2022-06-21 17:26:57 -0500423
Madhukar Pappireddybd10e572023-03-06 16:39:49 -0600424bool plat_ffa_check_runtime_state_transition(struct vcpu_locked current_locked,
J-Alves19e20cf2023-08-02 12:48:55 +0100425 ffa_id_t vm_id,
426 ffa_id_t receiver_vm_id,
Madhukar Pappireddybd10e572023-03-06 16:39:49 -0600427 struct vcpu_locked receiver_locked,
Madhukar Pappireddy0ea239a2022-06-21 17:26:57 -0500428 uint32_t func, // NOLINTNEXTLINE
429 enum vcpu_state *next_state)
430{
431 /* Perform state transition checks only for Secure Partitions. */
Madhukar Pappireddybd10e572023-03-06 16:39:49 -0600432 (void)current_locked;
Madhukar Pappireddy0ea239a2022-06-21 17:26:57 -0500433 (void)vm_id;
434 (void)receiver_vm_id;
Madhukar Pappireddybd10e572023-03-06 16:39:49 -0600435 (void)receiver_locked;
Madhukar Pappireddy0ea239a2022-06-21 17:26:57 -0500436 (void)func;
437 (void)next_state;
438
439 return true;
440}
Madhukar Pappireddy49fe6702022-06-21 17:52:23 -0500441
Madhukar Pappireddybd10e572023-03-06 16:39:49 -0600442void plat_ffa_init_schedule_mode_ffa_run(struct vcpu_locked current_locked,
Madhukar Pappireddy1480fce2022-06-21 18:09:25 -0500443 struct vcpu_locked target_locked)
444{
445 /* Scheduling mode not supported in the Hypervisor/VMs. */
Madhukar Pappireddybd10e572023-03-06 16:39:49 -0600446 (void)current_locked;
Madhukar Pappireddy1480fce2022-06-21 18:09:25 -0500447 (void)target_locked;
448}
449
Madhukar Pappireddy49fe6702022-06-21 17:52:23 -0500450void plat_ffa_wind_call_chain_ffa_direct_req(
451 struct vcpu_locked current_locked,
J-Alves19e20cf2023-08-02 12:48:55 +0100452 struct vcpu_locked receiver_vcpu_locked, ffa_id_t sender_vm_id)
Madhukar Pappireddy49fe6702022-06-21 17:52:23 -0500453{
454 /* Calls chains not supported in the Hypervisor/VMs. */
455 (void)current_locked;
456 (void)receiver_vcpu_locked;
Raghu Krishnamurthya9ccf122023-03-27 20:42:01 -0700457 (void)sender_vm_id;
Madhukar Pappireddy49fe6702022-06-21 17:52:23 -0500458}
Madhukar Pappireddyc0fb87e2022-06-21 17:59:15 -0500459
Madhukar Pappireddybd10e572023-03-06 16:39:49 -0600460void plat_ffa_unwind_call_chain_ffa_direct_resp(
461 struct vcpu_locked current_locked, struct vcpu_locked next_locked)
Madhukar Pappireddyc0fb87e2022-06-21 17:59:15 -0500462{
463 /* Calls chains not supported in the Hypervisor/VMs. */
Madhukar Pappireddybd10e572023-03-06 16:39:49 -0600464 (void)current_locked;
465 (void)next_locked;
Madhukar Pappireddyc0fb87e2022-06-21 17:59:15 -0500466}
Madhukar Pappireddy046dad02022-06-21 18:43:33 -0500467
J-Alves19e20cf2023-08-02 12:48:55 +0100468bool plat_ffa_is_spmd_lp_id(ffa_id_t vm_id)
Raghu Krishnamurthya9ccf122023-03-27 20:42:01 -0700469{
470 (void)vm_id;
471 return false;
472}
473
Madhukar Pappireddy486360d2022-09-06 15:32:24 -0500474void plat_ffa_enable_virtual_interrupts(struct vcpu_locked current_locked,
475 struct vm_locked vm_locked)
Madhukar Pappireddy046dad02022-06-21 18:43:33 -0500476{
477 (void)current_locked;
Madhukar Pappireddy486360d2022-09-06 15:32:24 -0500478 (void)vm_locked;
Madhukar Pappireddy046dad02022-06-21 18:43:33 -0500479}
J-Alves66652252022-07-06 09:49:51 +0100480
481struct ffa_value plat_ffa_other_world_mem_send(
482 struct vm *from, uint32_t share_func,
483 struct ffa_memory_region **memory_region, uint32_t length,
484 uint32_t fragment_length, struct mpool *page_pool)
485{
486 (void)from;
487 (void)memory_region;
488 (void)length;
489 (void)fragment_length;
490 (void)page_pool;
491 (void)share_func;
492
493 return (struct ffa_value){0};
494}
J-Alvesfc19b372022-07-06 12:17:35 +0100495
496struct ffa_value plat_ffa_other_world_mem_reclaim(
497 struct vm *to, ffa_memory_handle_t handle,
498 ffa_memory_region_flags_t flags, struct mpool *page_pool)
499{
500 (void)handle;
501 (void)flags;
502 (void)page_pool;
503 (void)to;
504
505 return ffa_error(FFA_INVALID_PARAMETERS);
506}
J-Alvesb5084cf2022-07-06 14:20:12 +0100507
J-Alvesfdd29272022-07-19 13:16:31 +0100508struct ffa_value plat_ffa_other_world_mem_send_continue(
509 struct vm *from, void *fragment, uint32_t fragment_length,
510 ffa_memory_handle_t handle, struct mpool *page_pool)
511{
512 (void)from;
513 (void)fragment;
514 (void)fragment_length;
515 (void)handle;
516 (void)page_pool;
517
518 return ffa_error(FFA_INVALID_PARAMETERS);
519}
J-Alves27b71962022-12-12 15:29:58 +0000520
J-Alves19e20cf2023-08-02 12:48:55 +0100521struct ffa_value plat_ffa_msg_send(ffa_id_t sender_vm_id,
522 ffa_id_t receiver_vm_id, uint32_t size,
J-Alves27b71962022-12-12 15:29:58 +0000523 struct vcpu *current, struct vcpu **next)
524{
525 (void)sender_vm_id;
526 (void)receiver_vm_id;
527 (void)size;
528 (void)current;
529 (void)next;
530
531 return ffa_error(FFA_NOT_SUPPORTED);
532}
Madhukar Pappireddy1f2f2132023-02-14 17:48:44 -0600533
Madhukar Pappireddybd10e572023-03-06 16:39:49 -0600534struct ffa_value plat_ffa_yield_prepare(struct vcpu_locked current_locked,
Madhukar Pappireddy184501c2023-05-23 17:24:06 -0500535 struct vcpu **next,
536 uint32_t timeout_low,
537 uint32_t timeout_high)
Madhukar Pappireddy1f2f2132023-02-14 17:48:44 -0600538{
Madhukar Pappireddybd10e572023-03-06 16:39:49 -0600539 (void)current_locked;
Madhukar Pappireddyb3fb8712023-05-23 17:10:34 -0500540 (void)next;
Madhukar Pappireddy184501c2023-05-23 17:24:06 -0500541 (void)timeout_low;
542 (void)timeout_high;
Madhukar Pappireddyb3fb8712023-05-23 17:10:34 -0500543
544 return ffa_error(FFA_NOT_SUPPORTED);
Madhukar Pappireddy1f2f2132023-02-14 17:48:44 -0600545}
Olivier Deprezd9d409f2023-03-17 11:47:57 +0100546
547bool arch_vm_init_mm(struct vm *vm, struct mpool *ppool)
548{
549 (void)vm;
550 (void)ppool;
551
552 return true;
553}
554
Madhukar Pappireddy070f49e2024-01-12 13:02:27 -0600555bool arch_vm_iommu_init_mm(struct vm *vm, struct mpool *ppool)
556{
557 (void)vm;
558 (void)ppool;
559
560 return true;
561}
562
Olivier Deprezd9d409f2023-03-17 11:47:57 +0100563bool arch_vm_identity_prepare(struct vm_locked vm_locked, paddr_t begin,
564 paddr_t end, uint32_t mode, struct mpool *ppool)
565{
566 (void)vm_locked;
567 (void)begin;
568 (void)end;
569 (void)mode;
570 (void)ppool;
571
572 return true;
573}
574
575void arch_vm_identity_commit(struct vm_locked vm_locked, paddr_t begin,
576 paddr_t end, uint32_t mode, struct mpool *ppool,
577 ipaddr_t *ipa)
578{
579 (void)vm_locked;
580 (void)begin;
581 (void)end;
582 (void)mode;
583 (void)ppool;
584 (void)ipa;
585}
586
587bool arch_vm_unmap(struct vm_locked vm_locked, paddr_t begin, paddr_t end,
588 struct mpool *ppool)
589{
590 (void)vm_locked;
591 (void)begin;
592 (void)end;
593 (void)ppool;
594
595 return true;
596}
597
598void arch_vm_ptable_defrag(struct vm_locked vm_locked, struct mpool *ppool)
599{
600 (void)vm_locked;
601 (void)ppool;
602}
603
604bool arch_vm_mem_get_mode(struct vm_locked vm_locked, ipaddr_t begin,
605 ipaddr_t end, uint32_t *mode) // NOLINT
606{
607 (void)vm_locked;
608 (void)begin;
609 (void)end;
610 (void)mode;
611
612 return true;
613}
Olivier Deprez878bd5b2021-04-15 19:05:10 +0200614
Karl Meakin3d32eef2024-11-25 16:40:09 +0000615ffa_memory_attributes_t plat_ffa_memory_add_security_bit_from_mode(
Olivier Deprez878bd5b2021-04-15 19:05:10 +0200616 ffa_memory_attributes_t attributes, uint32_t mode)
617{
618 (void)mode;
619
620 return attributes;
621}
Kathleen Capella6ab05132023-05-10 12:27:35 -0400622
623struct ffa_value plat_ffa_error_32(struct vcpu *current, struct vcpu **next,
Karl Meakin1064a9c2024-06-04 17:20:43 +0100624 enum ffa_error error_code)
Kathleen Capella6ab05132023-05-10 12:27:35 -0400625{
626 (void)current;
627 (void)next;
628 (void)error_code;
J-Alves2ced1672022-12-12 14:35:38 +0000629
630 return ffa_error(FFA_NOT_SUPPORTED);
631}
632
Raghu Krishnamurthye74d6532023-06-07 12:21:54 -0700633bool plat_ffa_partition_info_get_regs_forward_allowed(void)
634{
635 return false;
636}
Madhukar Pappireddy9e09d7a2023-08-08 14:53:49 -0500637
638void plat_ffa_free_vm_resources(struct vm_locked vm_locked)
639{
640 (void)vm_locked;
641}
Madhukar Pappireddy0e57d3d2023-10-11 15:49:05 -0500642
643bool arch_vm_iommu_mm_identity_map(struct vm_locked vm_locked, paddr_t begin,
644 paddr_t end, uint32_t mode,
645 struct mpool *ppool, ipaddr_t *ipa,
646 struct dma_device_properties *dma_prop)
647{
648 (void)vm_locked;
649 (void)begin;
650 (void)end;
651 (void)mode;
652 (void)ppool;
653 (void)ipa;
654 (void)dma_prop;
655
656 return true;
657}
Madhukar Pappireddyc64d0642024-08-07 16:55:46 -0500658
659uint32_t plat_ffa_interrupt_get(struct vcpu_locked current_locked)
660{
661 (void)current_locked;
662
663 return 0;
664}
Karl Meakin06e8b732024-09-20 18:26:49 +0100665
666bool plat_ffa_handle_framework_msg(struct ffa_value args, struct ffa_value *ret)
667{
668 (void)args;
669 (void)ret;
670
671 return false;
672}