blob: 79fd9eb500bc83468131ee571d0b6910d3cb462d [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"
12
J-Alvesa0f317d2021-06-09 13:31:59 +010013#include "hf/ffa_internal.h"
Olivier Deprez55a189e2021-06-09 15:45:27 +020014#include "hf/vcpu.h"
J-Alvesc003a7a2021-03-18 13:06:53 +000015#include "hf/vm.h"
Daniel Boulbyb2fb80e2021-02-03 15:09:23 +000016
Daniel Boulby87b2dc82021-08-04 14:07:43 +010017struct ffa_value arch_ffa_features(uint32_t function_id)
18{
19 (void)function_id;
20 return ffa_error(FFA_NOT_SUPPORTED);
21}
22
J-Alves19e20cf2023-08-02 12:48:55 +010023ffa_id_t arch_ffa_spmc_id_get(void)
Daniel Boulbyb2fb80e2021-02-03 15:09:23 +000024{
25 return HF_SPMC_VM_ID;
26}
Olivier Deprez55a189e2021-06-09 15:45:27 +020027
28void plat_ffa_log_init(void)
29{
30}
31
J-Alves19e20cf2023-08-02 12:48:55 +010032bool plat_ffa_is_memory_send_valid(ffa_id_t receiver_vm_id, uint32_t share_func)
Maksims Svecovsa3d570c2021-12-08 11:16:32 +000033{
34 (void)receiver_vm_id;
35 (void)share_func;
36
37 return true;
38}
39
Olivier Deprez55a189e2021-06-09 15:45:27 +020040bool plat_ffa_is_direct_request_valid(struct vcpu *current,
J-Alves19e20cf2023-08-02 12:48:55 +010041 ffa_id_t sender_vm_id,
42 ffa_id_t receiver_vm_id)
Olivier Deprez55a189e2021-06-09 15:45:27 +020043{
44 (void)current;
45 (void)sender_vm_id;
46 (void)receiver_vm_id;
47
48 return true;
49}
50
J-Alves439ac972021-11-18 17:32:03 +000051bool plat_ffa_is_direct_request_supported(struct vm *sender_vm,
Kathleen Capella41fea932023-06-23 17:39:28 -040052 struct vm *receiver_vm, uint32_t func)
J-Alves439ac972021-11-18 17:32:03 +000053{
54 (void)sender_vm;
55 (void)receiver_vm;
Kathleen Capella41fea932023-06-23 17:39:28 -040056 (void)func;
J-Alves439ac972021-11-18 17:32:03 +000057
58 return false;
59}
60
Olivier Deprez55a189e2021-06-09 15:45:27 +020061bool plat_ffa_is_direct_response_valid(struct vcpu *current,
J-Alves19e20cf2023-08-02 12:48:55 +010062 ffa_id_t sender_vm_id,
63 ffa_id_t receiver_vm_id)
Olivier Deprez55a189e2021-06-09 15:45:27 +020064{
65 (void)current;
66 (void)sender_vm_id;
67 (void)receiver_vm_id;
68
69 return true;
70}
71
J-Alves19e20cf2023-08-02 12:48:55 +010072bool plat_ffa_run_forward(ffa_id_t vm_id, ffa_vcpu_index_t vcpu_idx,
Raghu Krishnamurthy62f97a72021-07-27 02:14:59 -070073 struct ffa_value *ret)
74{
75 (void)vm_id;
76 (void)vcpu_idx;
77 (void)ret;
78
79 return false;
80}
81
Federico Recanati10bd06c2022-02-23 17:32:59 +010082void plat_ffa_vm_destroy(struct vm_locked to_destroy_locked)
83{
84 (void)to_destroy_locked;
85}
86
J-Alves70079932022-12-07 17:32:20 +000087void plat_ffa_rxtx_unmap_forward(struct vm_locked vm_locked)
Federico Recanati8da9e332022-02-10 11:00:17 +010088{
J-Alves70079932022-12-07 17:32:20 +000089 (void)vm_locked;
Federico Recanati8da9e332022-02-10 11:00:17 +010090}
91
J-Alves19e20cf2023-08-02 12:48:55 +010092bool plat_ffa_direct_request_forward(ffa_id_t receiver_vm_id,
Olivier Deprez55a189e2021-06-09 15:45:27 +020093 struct ffa_value args,
94 struct ffa_value *ret)
95{
96 (void)receiver_vm_id;
97 (void)args;
98 (void)ret;
99 return false;
100}
101
Federico Recanati7bef0b92022-03-17 14:56:22 +0100102bool plat_ffa_rx_release_forward(struct vm_locked vm_locked,
103 struct ffa_value *ret)
104{
105 (void)vm_locked;
106 (void)ret;
107
108 return false;
109}
110
Federico Recanati644f0462022-03-17 12:04:00 +0100111bool plat_ffa_acquire_receiver_rx(struct vm_locked to_locked,
112 struct ffa_value *ret)
113{
114 (void)to_locked;
115 (void)ret;
116
117 return false;
118}
119
Federico Recanati25053ee2022-03-14 15:01:53 +0100120bool plat_ffa_is_indirect_msg_supported(struct vm_locked sender_locked,
121 struct vm_locked receiver_locked)
122{
123 (void)sender_locked;
124 (void)receiver_locked;
125
126 return false;
127}
128
J-Alves19e20cf2023-08-02 12:48:55 +0100129bool plat_ffa_msg_send2_forward(ffa_id_t receiver_vm_id, ffa_id_t sender_vm_id,
130 struct ffa_value *ret)
Federico Recanati25053ee2022-03-14 15:01:53 +0100131{
132 (void)receiver_vm_id;
133 (void)sender_vm_id;
134 (void)ret;
135
136 return false;
137}
138
Olivier Deprez55a189e2021-06-09 15:45:27 +0200139ffa_memory_handle_t plat_ffa_memory_handle_make(uint64_t index)
140{
141 return index;
142}
143
144bool plat_ffa_memory_handle_allocated_by_current_world(
145 ffa_memory_handle_t handle)
146{
147 (void)handle;
148 return false;
149}
Maksims Svecovsb596eab2021-04-27 00:52:27 +0100150
J-Alves7db32002021-12-14 14:44:50 +0000151uint32_t plat_ffa_other_world_mode(void)
152{
153 return 0U;
154}
155
J-Alvesc003a7a2021-03-18 13:06:53 +0000156bool plat_ffa_is_notifications_bind_valid(struct vcpu *current,
J-Alves19e20cf2023-08-02 12:48:55 +0100157 ffa_id_t sender_id,
158 ffa_id_t receiver_id)
J-Alvesc003a7a2021-03-18 13:06:53 +0000159{
160 (void)current;
161 (void)sender_id;
162 (void)receiver_id;
163 return false;
164}
165
J-Alvesb15e9402021-09-08 11:44:42 +0100166bool plat_ffa_notifications_update_bindings_forward(
J-Alves19e20cf2023-08-02 12:48:55 +0100167 ffa_id_t receiver_id, ffa_id_t sender_id, uint32_t flags,
J-Alvesb15e9402021-09-08 11:44:42 +0100168 ffa_notifications_bitmap_t bitmap, bool is_bind, struct ffa_value *ret)
169{
170 (void)ret;
171 (void)receiver_id;
172 (void)sender_id;
173 (void)flags;
174 (void)bitmap;
175 (void)is_bind;
176 (void)ret;
177
178 return false;
179}
180
Federico Recanati8d8b1cf2022-04-14 13:16:00 +0200181void plat_ffa_rxtx_map_forward(struct vm_locked vm_locked)
182{
183 (void)vm_locked;
184}
185
Maksims Svecovsb596eab2021-04-27 00:52:27 +0100186ffa_partition_properties_t plat_ffa_partition_properties(
J-Alves19e20cf2023-08-02 12:48:55 +0100187 ffa_id_t vm_id, const struct vm *target)
Maksims Svecovsb596eab2021-04-27 00:52:27 +0100188{
J-Alvesfa782092021-10-13 16:02:16 +0100189 (void)vm_id;
Maksims Svecovsb596eab2021-04-27 00:52:27 +0100190 (void)target;
191 return 0;
192}
Maksims Svecovs9ddf86a2021-05-06 17:17:21 +0100193
194bool plat_ffa_vm_managed_exit_supported(struct vm *vm)
195{
196 (void)vm;
197 return false;
198}
J-Alvesa0f317d2021-06-09 13:31:59 +0100199
200bool plat_ffa_is_notifications_create_valid(struct vcpu *current,
J-Alves19e20cf2023-08-02 12:48:55 +0100201 ffa_id_t vm_id)
J-Alvesa0f317d2021-06-09 13:31:59 +0100202{
203 (void)current;
204 (void)vm_id;
205
206 return false;
207}
208
J-Alvesaa79c012021-07-09 14:29:45 +0100209bool plat_ffa_is_notification_set_valid(struct vcpu *current,
J-Alves19e20cf2023-08-02 12:48:55 +0100210 ffa_id_t sender_id,
211 ffa_id_t receiver_id)
J-Alvesaa79c012021-07-09 14:29:45 +0100212{
213 (void)current;
214 (void)sender_id;
215 (void)receiver_id;
216 return false;
217}
218
219bool plat_ffa_is_notification_get_valid(struct vcpu *current,
J-Alves19e20cf2023-08-02 12:48:55 +0100220 ffa_id_t receiver_id, uint32_t flags)
J-Alvesaa79c012021-07-09 14:29:45 +0100221{
J-Alvesfc95a302022-04-22 14:18:23 +0100222 (void)flags;
J-Alvesaa79c012021-07-09 14:29:45 +0100223 (void)current;
224 (void)receiver_id;
225 return false;
226}
227
J-Alves98ff9562021-09-09 14:39:41 +0100228bool plat_ffa_notifications_get_from_sp(
229 struct vm_locked receiver_locked, ffa_vcpu_index_t vcpu_id,
J-Alvesfa782092021-10-13 16:02:16 +0100230 ffa_notifications_bitmap_t *from_sp, // NOLINT
231 struct ffa_value *ret) // NOLINT
J-Alves98ff9562021-09-09 14:39:41 +0100232{
233 (void)receiver_locked;
234 (void)vcpu_id;
235 (void)from_sp;
236 (void)ret;
237
238 return false;
239}
240
J-Alvesd605a092022-03-28 14:20:48 +0100241bool plat_ffa_notifications_get_framework_notifications(
242 struct vm_locked receiver_locked,
243 ffa_notifications_bitmap_t *from_fwk, // NOLINT
244 uint32_t flags, ffa_vcpu_index_t vcpu_id, struct ffa_value *ret)
245{
246 (void)receiver_locked;
247 (void)from_fwk;
248 (void)flags;
249 (void)vcpu_id;
250 (void)ret;
251
252 return false;
253}
254
J-Alves19e20cf2023-08-02 12:48:55 +0100255bool plat_ffa_notification_set_forward(ffa_id_t sender_vm_id,
256 ffa_id_t receiver_vm_id, uint32_t flags,
J-Alvesde7bd2f2021-09-09 19:54:35 +0100257 ffa_notifications_bitmap_t bitmap,
258 struct ffa_value *ret)
259{
260 (void)sender_vm_id;
261 (void)receiver_vm_id;
262 (void)flags;
263 (void)bitmap;
264 (void)ret;
265
266 return false;
267}
268
J-Alvesa0f317d2021-06-09 13:31:59 +0100269struct ffa_value plat_ffa_notifications_bitmap_create(
J-Alves19e20cf2023-08-02 12:48:55 +0100270 ffa_id_t vm_id, ffa_vcpu_count_t vcpu_count)
J-Alvesa0f317d2021-06-09 13:31:59 +0100271{
272 (void)vm_id;
273 (void)vcpu_count;
274
275 return ffa_error(FFA_NOT_SUPPORTED);
276}
277
J-Alves19e20cf2023-08-02 12:48:55 +0100278struct ffa_value plat_ffa_notifications_bitmap_destroy(ffa_id_t vm_id)
J-Alvesa0f317d2021-06-09 13:31:59 +0100279{
280 (void)vm_id;
281
282 return ffa_error(FFA_NOT_SUPPORTED);
283}
J-Alvesc003a7a2021-03-18 13:06:53 +0000284
J-Alves19e20cf2023-08-02 12:48:55 +0100285struct vm_locked plat_ffa_vm_find_locked(ffa_id_t vm_id)
J-Alvesc003a7a2021-03-18 13:06:53 +0000286{
287 (void)vm_id;
288 return (struct vm_locked){.vm = NULL};
289}
290
J-Alves19e20cf2023-08-02 12:48:55 +0100291struct vm_locked plat_ffa_vm_find_locked_create(ffa_id_t vm_id)
Federico Recanati8d8b1cf2022-04-14 13:16:00 +0200292{
293 (void)vm_id;
294 return (struct vm_locked){.vm = NULL};
295}
296
J-Alvesfa782092021-10-13 16:02:16 +0100297bool plat_ffa_vm_notifications_info_get( // NOLINTNEXTLINE
298 uint16_t *ids, uint32_t *ids_count, // NOLINTNEXTLINE
299 uint32_t *lists_sizes, // NOLINTNEXTLINE
300 uint32_t *lists_count, const uint32_t ids_count_max)
J-Alvesc8e8a222021-06-08 17:33:52 +0100301{
302 (void)ids;
303 (void)ids_count;
304 (void)lists_sizes;
305 (void)lists_count;
306 (void)ids_count_max;
307
308 return false;
309}
Raghu Krishnamurthyea6d25f2021-09-14 15:27:06 -0700310
311bool plat_ffa_is_mem_perm_get_valid(const struct vcpu *current)
312{
313 (void)current;
314 return false;
315}
316
317bool plat_ffa_is_mem_perm_set_valid(const struct vcpu *current)
318{
319 (void)current;
320 return false;
321}
Madhukar Pappireddyb11e0d12021-08-02 19:44:35 -0500322
323/**
324 * Check if current VM can resume target VM/SP using FFA_RUN ABI.
325 */
Madhukar Pappireddybd10e572023-03-06 16:39:49 -0600326bool plat_ffa_run_checks(struct vcpu_locked current_locked,
J-Alves19e20cf2023-08-02 12:48:55 +0100327 ffa_id_t target_vm_id, ffa_vcpu_index_t vcpu_idx,
Madhukar Pappireddybd10e572023-03-06 16:39:49 -0600328 struct ffa_value *run_ret, struct vcpu **next)
Madhukar Pappireddyb11e0d12021-08-02 19:44:35 -0500329{
Madhukar Pappireddybd10e572023-03-06 16:39:49 -0600330 (void)current_locked;
Madhukar Pappireddyb11e0d12021-08-02 19:44:35 -0500331 (void)target_vm_id;
332 (void)run_ret;
333 (void)next;
Raghu Krishnamurthy048d63f2021-12-11 12:45:41 -0800334 (void)vcpu_idx;
Madhukar Pappireddyb11e0d12021-08-02 19:44:35 -0500335 return true;
336}
J-Alvesca058c22021-09-10 14:02:07 +0100337
338void plat_ffa_notification_info_get_forward( // NOLINTNEXTLINE
339 uint16_t *ids, uint32_t *ids_count, // NOLINTNEXTLINE
340 uint32_t *lists_sizes, uint32_t *lists_count,
341 const uint32_t ids_count_max)
342{
343 (void)ids;
344 (void)ids_count;
345 (void)lists_sizes;
346 (void)lists_count;
347 (void)ids_count_max;
348}
J-Alves13394022021-06-30 13:48:49 +0100349
350void plat_ffa_sri_state_set(enum plat_ffa_sri_state state)
351{
352 (void)state;
353}
354
355void plat_ffa_sri_trigger_if_delayed(struct cpu *cpu)
356{
357 (void)cpu;
358}
359
360void plat_ffa_sri_trigger_not_delayed(struct cpu *cpu)
361{
362 (void)cpu;
363}
364
J-Alves6e2abc62021-12-02 14:58:56 +0000365bool plat_ffa_inject_notification_pending_interrupt(
Madhukar Pappireddybd10e572023-03-06 16:39:49 -0600366 struct vcpu_locked target_locked, struct vcpu_locked current_locked,
J-Alves6e2abc62021-12-02 14:58:56 +0000367 struct vm_locked receiver_locked)
J-Alves7461ef22021-10-18 17:21:33 +0100368{
J-Alves6e2abc62021-12-02 14:58:56 +0000369 (void)target_locked;
Madhukar Pappireddybd10e572023-03-06 16:39:49 -0600370 (void)current_locked;
J-Alves6e2abc62021-12-02 14:58:56 +0000371 (void)receiver_locked;
372
373 return false;
J-Alves7461ef22021-10-18 17:21:33 +0100374}
Olivier Depreze562e542020-06-11 17:31:54 +0200375
Raghu Krishnamurthyef432cb2022-12-29 06:56:32 -0800376bool plat_ffa_partition_info_get_regs_forward( // NOLINTNEXTLINE
377 const struct ffa_uuid *uuid,
378 const uint16_t start_index, // NOLINTNEXTLINE
379 const uint16_t tag,
380 struct ffa_partition_info *partitions, // NOLINTNEXTLINE
381 uint16_t partitions_len, ffa_vm_count_t *ret_count)
382{
383 (void)uuid;
384 (void)start_index;
385 (void)tag;
386 (void)partitions;
387 (void)partitions_len;
388 (void)ret_count;
389 return true;
390}
391
Olivier Depreze562e542020-06-11 17:31:54 +0200392void plat_ffa_partition_info_get_forward( // NOLINTNEXTLINE
393 const struct ffa_uuid *uuid, // NOLINTNEXTLINE
Daniel Boulbyb46cad12021-12-13 17:47:21 +0000394 const uint32_t flags, // NOLINTNEXTLINE
Olivier Depreze562e542020-06-11 17:31:54 +0200395 struct ffa_partition_info *partitions, ffa_vm_count_t *ret_count)
396{
397 (void)uuid;
Daniel Boulbyb46cad12021-12-13 17:47:21 +0000398 (void)flags;
Olivier Depreze562e542020-06-11 17:31:54 +0200399 (void)partitions;
400 (void)ret_count;
401}
Olivier Deprezd614d322021-06-18 15:21:00 +0200402
403bool plat_ffa_is_secondary_ep_register_supported(void)
404{
405 return false;
406}
Madhukar Pappireddydd883202022-10-24 16:49:28 -0500407
Madhukar Pappireddybd10e572023-03-06 16:39:49 -0600408struct ffa_value plat_ffa_msg_wait_prepare(struct vcpu_locked current_locked,
Madhukar Pappireddydd883202022-10-24 16:49:28 -0500409 struct vcpu **next)
Madhukar Pappireddy5522c672021-12-17 16:35:51 -0600410{
Madhukar Pappireddybd10e572023-03-06 16:39:49 -0600411 (void)current_locked;
Madhukar Pappireddy5522c672021-12-17 16:35:51 -0600412 (void)next;
Madhukar Pappireddy5522c672021-12-17 16:35:51 -0600413
Madhukar Pappireddydd883202022-10-24 16:49:28 -0500414 return (struct ffa_value){.func = FFA_INTERRUPT_32};
Madhukar Pappireddy5522c672021-12-17 16:35:51 -0600415}
Madhukar Pappireddy0ea239a2022-06-21 17:26:57 -0500416
Madhukar Pappireddybd10e572023-03-06 16:39:49 -0600417bool plat_ffa_check_runtime_state_transition(struct vcpu_locked current_locked,
J-Alves19e20cf2023-08-02 12:48:55 +0100418 ffa_id_t vm_id,
419 ffa_id_t receiver_vm_id,
Madhukar Pappireddybd10e572023-03-06 16:39:49 -0600420 struct vcpu_locked receiver_locked,
Madhukar Pappireddy0ea239a2022-06-21 17:26:57 -0500421 uint32_t func, // NOLINTNEXTLINE
422 enum vcpu_state *next_state)
423{
424 /* Perform state transition checks only for Secure Partitions. */
Madhukar Pappireddybd10e572023-03-06 16:39:49 -0600425 (void)current_locked;
Madhukar Pappireddy0ea239a2022-06-21 17:26:57 -0500426 (void)vm_id;
427 (void)receiver_vm_id;
Madhukar Pappireddybd10e572023-03-06 16:39:49 -0600428 (void)receiver_locked;
Madhukar Pappireddy0ea239a2022-06-21 17:26:57 -0500429 (void)func;
430 (void)next_state;
431
432 return true;
433}
Madhukar Pappireddy49fe6702022-06-21 17:52:23 -0500434
Madhukar Pappireddybd10e572023-03-06 16:39:49 -0600435void plat_ffa_init_schedule_mode_ffa_run(struct vcpu_locked current_locked,
Madhukar Pappireddy1480fce2022-06-21 18:09:25 -0500436 struct vcpu_locked target_locked)
437{
438 /* Scheduling mode not supported in the Hypervisor/VMs. */
Madhukar Pappireddybd10e572023-03-06 16:39:49 -0600439 (void)current_locked;
Madhukar Pappireddy1480fce2022-06-21 18:09:25 -0500440 (void)target_locked;
441}
442
Madhukar Pappireddy49fe6702022-06-21 17:52:23 -0500443void plat_ffa_wind_call_chain_ffa_direct_req(
444 struct vcpu_locked current_locked,
J-Alves19e20cf2023-08-02 12:48:55 +0100445 struct vcpu_locked receiver_vcpu_locked, ffa_id_t sender_vm_id)
Madhukar Pappireddy49fe6702022-06-21 17:52:23 -0500446{
447 /* Calls chains not supported in the Hypervisor/VMs. */
448 (void)current_locked;
449 (void)receiver_vcpu_locked;
Raghu Krishnamurthya9ccf122023-03-27 20:42:01 -0700450 (void)sender_vm_id;
Madhukar Pappireddy49fe6702022-06-21 17:52:23 -0500451}
Madhukar Pappireddyc0fb87e2022-06-21 17:59:15 -0500452
Madhukar Pappireddybd10e572023-03-06 16:39:49 -0600453void plat_ffa_unwind_call_chain_ffa_direct_resp(
454 struct vcpu_locked current_locked, struct vcpu_locked next_locked)
Madhukar Pappireddyc0fb87e2022-06-21 17:59:15 -0500455{
456 /* Calls chains not supported in the Hypervisor/VMs. */
Madhukar Pappireddybd10e572023-03-06 16:39:49 -0600457 (void)current_locked;
458 (void)next_locked;
Madhukar Pappireddyc0fb87e2022-06-21 17:59:15 -0500459}
Madhukar Pappireddy046dad02022-06-21 18:43:33 -0500460
J-Alves19e20cf2023-08-02 12:48:55 +0100461bool plat_ffa_is_spmd_lp_id(ffa_id_t vm_id)
Raghu Krishnamurthya9ccf122023-03-27 20:42:01 -0700462{
463 (void)vm_id;
464 return false;
465}
466
Madhukar Pappireddy2f76e492022-09-06 15:21:59 -0500467bool plat_ffa_intercept_direct_response(struct vcpu_locked current_locked,
468 struct vcpu **next,
469 struct ffa_value to_ret,
470 struct ffa_value *signal_interrupt)
471{
472 /*
473 * Only applicable to SPMC as it signals virtual secure interrupt to
474 * S-EL0 partitions.
475 */
476 (void)current_locked;
477 (void)next;
478 (void)to_ret;
479 (void)signal_interrupt;
480
481 return false;
482}
483
Madhukar Pappireddy486360d2022-09-06 15:32:24 -0500484void plat_ffa_enable_virtual_interrupts(struct vcpu_locked current_locked,
485 struct vm_locked vm_locked)
Madhukar Pappireddy046dad02022-06-21 18:43:33 -0500486{
487 (void)current_locked;
Madhukar Pappireddy486360d2022-09-06 15:32:24 -0500488 (void)vm_locked;
Madhukar Pappireddy046dad02022-06-21 18:43:33 -0500489}
J-Alves66652252022-07-06 09:49:51 +0100490
491struct ffa_value plat_ffa_other_world_mem_send(
492 struct vm *from, uint32_t share_func,
493 struct ffa_memory_region **memory_region, uint32_t length,
494 uint32_t fragment_length, struct mpool *page_pool)
495{
496 (void)from;
497 (void)memory_region;
498 (void)length;
499 (void)fragment_length;
500 (void)page_pool;
501 (void)share_func;
502
503 return (struct ffa_value){0};
504}
J-Alvesfc19b372022-07-06 12:17:35 +0100505
506struct ffa_value plat_ffa_other_world_mem_reclaim(
507 struct vm *to, ffa_memory_handle_t handle,
508 ffa_memory_region_flags_t flags, struct mpool *page_pool)
509{
510 (void)handle;
511 (void)flags;
512 (void)page_pool;
513 (void)to;
514
515 return ffa_error(FFA_INVALID_PARAMETERS);
516}
J-Alvesb5084cf2022-07-06 14:20:12 +0100517
J-Alvesfdd29272022-07-19 13:16:31 +0100518struct ffa_value plat_ffa_other_world_mem_send_continue(
519 struct vm *from, void *fragment, uint32_t fragment_length,
520 ffa_memory_handle_t handle, struct mpool *page_pool)
521{
522 (void)from;
523 (void)fragment;
524 (void)fragment_length;
525 (void)handle;
526 (void)page_pool;
527
528 return ffa_error(FFA_INVALID_PARAMETERS);
529}
J-Alves27b71962022-12-12 15:29:58 +0000530
J-Alves19e20cf2023-08-02 12:48:55 +0100531struct ffa_value plat_ffa_msg_send(ffa_id_t sender_vm_id,
532 ffa_id_t receiver_vm_id, uint32_t size,
J-Alves27b71962022-12-12 15:29:58 +0000533 struct vcpu *current, struct vcpu **next)
534{
535 (void)sender_vm_id;
536 (void)receiver_vm_id;
537 (void)size;
538 (void)current;
539 (void)next;
540
541 return ffa_error(FFA_NOT_SUPPORTED);
542}
Madhukar Pappireddy1f2f2132023-02-14 17:48:44 -0600543
Madhukar Pappireddybd10e572023-03-06 16:39:49 -0600544struct ffa_value plat_ffa_yield_prepare(struct vcpu_locked current_locked,
Madhukar Pappireddy184501c2023-05-23 17:24:06 -0500545 struct vcpu **next,
546 uint32_t timeout_low,
547 uint32_t timeout_high)
Madhukar Pappireddy1f2f2132023-02-14 17:48:44 -0600548{
Madhukar Pappireddybd10e572023-03-06 16:39:49 -0600549 (void)current_locked;
Madhukar Pappireddyb3fb8712023-05-23 17:10:34 -0500550 (void)next;
Madhukar Pappireddy184501c2023-05-23 17:24:06 -0500551 (void)timeout_low;
552 (void)timeout_high;
Madhukar Pappireddyb3fb8712023-05-23 17:10:34 -0500553
554 return ffa_error(FFA_NOT_SUPPORTED);
Madhukar Pappireddy1f2f2132023-02-14 17:48:44 -0600555}
Olivier Deprezd9d409f2023-03-17 11:47:57 +0100556
557bool arch_vm_init_mm(struct vm *vm, struct mpool *ppool)
558{
559 (void)vm;
560 (void)ppool;
561
562 return true;
563}
564
Madhukar Pappireddy070f49e2024-01-12 13:02:27 -0600565bool arch_vm_iommu_init_mm(struct vm *vm, struct mpool *ppool)
566{
567 (void)vm;
568 (void)ppool;
569
570 return true;
571}
572
Olivier Deprezd9d409f2023-03-17 11:47:57 +0100573bool arch_vm_identity_prepare(struct vm_locked vm_locked, paddr_t begin,
574 paddr_t end, uint32_t mode, struct mpool *ppool)
575{
576 (void)vm_locked;
577 (void)begin;
578 (void)end;
579 (void)mode;
580 (void)ppool;
581
582 return true;
583}
584
585void arch_vm_identity_commit(struct vm_locked vm_locked, paddr_t begin,
586 paddr_t end, uint32_t mode, struct mpool *ppool,
587 ipaddr_t *ipa)
588{
589 (void)vm_locked;
590 (void)begin;
591 (void)end;
592 (void)mode;
593 (void)ppool;
594 (void)ipa;
595}
596
597bool arch_vm_unmap(struct vm_locked vm_locked, paddr_t begin, paddr_t end,
598 struct mpool *ppool)
599{
600 (void)vm_locked;
601 (void)begin;
602 (void)end;
603 (void)ppool;
604
605 return true;
606}
607
608void arch_vm_ptable_defrag(struct vm_locked vm_locked, struct mpool *ppool)
609{
610 (void)vm_locked;
611 (void)ppool;
612}
613
614bool arch_vm_mem_get_mode(struct vm_locked vm_locked, ipaddr_t begin,
615 ipaddr_t end, uint32_t *mode) // NOLINT
616{
617 (void)vm_locked;
618 (void)begin;
619 (void)end;
620 (void)mode;
621
622 return true;
623}
Olivier Deprez878bd5b2021-04-15 19:05:10 +0200624
625ffa_memory_attributes_t plat_ffa_memory_security_mode(
626 ffa_memory_attributes_t attributes, uint32_t mode)
627{
628 (void)mode;
629
630 return attributes;
631}
Kathleen Capella6ab05132023-05-10 12:27:35 -0400632
633struct ffa_value plat_ffa_error_32(struct vcpu *current, struct vcpu **next,
634 uint32_t error_code)
635{
636 (void)current;
637 (void)next;
638 (void)error_code;
J-Alves2ced1672022-12-12 14:35:38 +0000639
640 return ffa_error(FFA_NOT_SUPPORTED);
641}
642
J-Alves19e20cf2023-08-02 12:48:55 +0100643int64_t plat_ffa_mailbox_waiter_get(ffa_id_t vm_id, const struct vcpu *current)
J-Alves2ced1672022-12-12 14:35:38 +0000644{
J-Alvesbc7ab4f2022-12-13 12:09:25 +0000645 (void)vm_id;
646 (void)current;
J-Alves2ced1672022-12-12 14:35:38 +0000647
J-Alvesbc7ab4f2022-12-13 12:09:25 +0000648 return -1;
649}
650
651int64_t plat_ffa_mailbox_writable_get(const struct vcpu *current)
652{
653 (void)current;
654
655 return -1;
Kathleen Capella6ab05132023-05-10 12:27:35 -0400656}
Raghu Krishnamurthye74d6532023-06-07 12:21:54 -0700657
658bool plat_ffa_partition_info_get_regs_forward_allowed(void)
659{
660 return false;
661}
Madhukar Pappireddy9e09d7a2023-08-08 14:53:49 -0500662
663void plat_ffa_free_vm_resources(struct vm_locked vm_locked)
664{
665 (void)vm_locked;
666}