blob: 4a50097a831a0a926c375d9da223e08696796ebc [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
J-Alves7ccaccf2024-02-01 14:25:23 +0000200/**
201 * Check validity of the calls:
202 * FFA_NOTIFICATION_BITMAP_CREATE/FFA_NOTIFICATION_BITMAP_DESTROY.
203 */
204struct ffa_value plat_ffa_is_notifications_bitmap_access_valid(
205 struct vcpu *current, ffa_id_t vm_id)
J-Alvesa0f317d2021-06-09 13:31:59 +0100206{
J-Alves7ccaccf2024-02-01 14:25:23 +0000207 /*
208 * Call should only be used by the Hypervisor, so any attempt of
209 * invocation from NWd FF-A endpoints should fail.
210 */
J-Alvesa0f317d2021-06-09 13:31:59 +0100211 (void)current;
212 (void)vm_id;
213
J-Alves7ccaccf2024-02-01 14:25:23 +0000214 return ffa_error(FFA_NOT_SUPPORTED);
J-Alvesa0f317d2021-06-09 13:31:59 +0100215}
216
J-Alvesaa79c012021-07-09 14:29:45 +0100217bool plat_ffa_is_notification_set_valid(struct vcpu *current,
J-Alves19e20cf2023-08-02 12:48:55 +0100218 ffa_id_t sender_id,
219 ffa_id_t receiver_id)
J-Alvesaa79c012021-07-09 14:29:45 +0100220{
221 (void)current;
222 (void)sender_id;
223 (void)receiver_id;
224 return false;
225}
226
227bool plat_ffa_is_notification_get_valid(struct vcpu *current,
J-Alves19e20cf2023-08-02 12:48:55 +0100228 ffa_id_t receiver_id, uint32_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
J-Alves98ff9562021-09-09 14:39:41 +0100236bool plat_ffa_notifications_get_from_sp(
237 struct vm_locked receiver_locked, ffa_vcpu_index_t vcpu_id,
J-Alvesfa782092021-10-13 16:02:16 +0100238 ffa_notifications_bitmap_t *from_sp, // NOLINT
239 struct ffa_value *ret) // NOLINT
J-Alves98ff9562021-09-09 14:39:41 +0100240{
241 (void)receiver_locked;
242 (void)vcpu_id;
243 (void)from_sp;
244 (void)ret;
245
246 return false;
247}
248
J-Alvesd605a092022-03-28 14:20:48 +0100249bool plat_ffa_notifications_get_framework_notifications(
250 struct vm_locked receiver_locked,
251 ffa_notifications_bitmap_t *from_fwk, // NOLINT
252 uint32_t flags, ffa_vcpu_index_t vcpu_id, struct ffa_value *ret)
253{
254 (void)receiver_locked;
255 (void)from_fwk;
256 (void)flags;
257 (void)vcpu_id;
258 (void)ret;
259
260 return false;
261}
262
J-Alves19e20cf2023-08-02 12:48:55 +0100263bool plat_ffa_notification_set_forward(ffa_id_t sender_vm_id,
264 ffa_id_t receiver_vm_id, uint32_t flags,
J-Alvesde7bd2f2021-09-09 19:54:35 +0100265 ffa_notifications_bitmap_t bitmap,
266 struct ffa_value *ret)
267{
268 (void)sender_vm_id;
269 (void)receiver_vm_id;
270 (void)flags;
271 (void)bitmap;
272 (void)ret;
273
274 return false;
275}
276
J-Alvesa0f317d2021-06-09 13:31:59 +0100277struct ffa_value plat_ffa_notifications_bitmap_create(
J-Alves19e20cf2023-08-02 12:48:55 +0100278 ffa_id_t vm_id, ffa_vcpu_count_t vcpu_count)
J-Alvesa0f317d2021-06-09 13:31:59 +0100279{
280 (void)vm_id;
281 (void)vcpu_count;
282
283 return ffa_error(FFA_NOT_SUPPORTED);
284}
285
J-Alves19e20cf2023-08-02 12:48:55 +0100286struct ffa_value plat_ffa_notifications_bitmap_destroy(ffa_id_t vm_id)
J-Alvesa0f317d2021-06-09 13:31:59 +0100287{
288 (void)vm_id;
289
290 return ffa_error(FFA_NOT_SUPPORTED);
291}
J-Alvesc003a7a2021-03-18 13:06:53 +0000292
J-Alves19e20cf2023-08-02 12:48:55 +0100293struct vm_locked plat_ffa_vm_find_locked(ffa_id_t vm_id)
J-Alvesc003a7a2021-03-18 13:06:53 +0000294{
295 (void)vm_id;
296 return (struct vm_locked){.vm = NULL};
297}
298
J-Alves19e20cf2023-08-02 12:48:55 +0100299struct vm_locked plat_ffa_vm_find_locked_create(ffa_id_t vm_id)
Federico Recanati8d8b1cf2022-04-14 13:16:00 +0200300{
301 (void)vm_id;
302 return (struct vm_locked){.vm = NULL};
303}
304
J-Alvesfa782092021-10-13 16:02:16 +0100305bool plat_ffa_vm_notifications_info_get( // NOLINTNEXTLINE
306 uint16_t *ids, uint32_t *ids_count, // NOLINTNEXTLINE
307 uint32_t *lists_sizes, // NOLINTNEXTLINE
308 uint32_t *lists_count, const uint32_t ids_count_max)
J-Alvesc8e8a222021-06-08 17:33:52 +0100309{
310 (void)ids;
311 (void)ids_count;
312 (void)lists_sizes;
313 (void)lists_count;
314 (void)ids_count_max;
315
316 return false;
317}
Raghu Krishnamurthyea6d25f2021-09-14 15:27:06 -0700318
319bool plat_ffa_is_mem_perm_get_valid(const struct vcpu *current)
320{
321 (void)current;
322 return false;
323}
324
325bool plat_ffa_is_mem_perm_set_valid(const struct vcpu *current)
326{
327 (void)current;
328 return false;
329}
Madhukar Pappireddyb11e0d12021-08-02 19:44:35 -0500330
331/**
332 * Check if current VM can resume target VM/SP using FFA_RUN ABI.
333 */
Madhukar Pappireddybd10e572023-03-06 16:39:49 -0600334bool plat_ffa_run_checks(struct vcpu_locked current_locked,
J-Alves19e20cf2023-08-02 12:48:55 +0100335 ffa_id_t target_vm_id, ffa_vcpu_index_t vcpu_idx,
Madhukar Pappireddybd10e572023-03-06 16:39:49 -0600336 struct ffa_value *run_ret, struct vcpu **next)
Madhukar Pappireddyb11e0d12021-08-02 19:44:35 -0500337{
Madhukar Pappireddybd10e572023-03-06 16:39:49 -0600338 (void)current_locked;
Madhukar Pappireddyb11e0d12021-08-02 19:44:35 -0500339 (void)target_vm_id;
340 (void)run_ret;
341 (void)next;
Raghu Krishnamurthy048d63f2021-12-11 12:45:41 -0800342 (void)vcpu_idx;
Madhukar Pappireddyb11e0d12021-08-02 19:44:35 -0500343 return true;
344}
J-Alvesca058c22021-09-10 14:02:07 +0100345
346void plat_ffa_notification_info_get_forward( // NOLINTNEXTLINE
347 uint16_t *ids, uint32_t *ids_count, // NOLINTNEXTLINE
348 uint32_t *lists_sizes, uint32_t *lists_count,
349 const uint32_t ids_count_max)
350{
351 (void)ids;
352 (void)ids_count;
353 (void)lists_sizes;
354 (void)lists_count;
355 (void)ids_count_max;
356}
J-Alves13394022021-06-30 13:48:49 +0100357
358void plat_ffa_sri_state_set(enum plat_ffa_sri_state state)
359{
360 (void)state;
361}
362
363void plat_ffa_sri_trigger_if_delayed(struct cpu *cpu)
364{
365 (void)cpu;
366}
367
368void plat_ffa_sri_trigger_not_delayed(struct cpu *cpu)
369{
370 (void)cpu;
371}
372
J-Alves6e2abc62021-12-02 14:58:56 +0000373bool plat_ffa_inject_notification_pending_interrupt(
Madhukar Pappireddybd10e572023-03-06 16:39:49 -0600374 struct vcpu_locked target_locked, struct vcpu_locked current_locked,
J-Alves6e2abc62021-12-02 14:58:56 +0000375 struct vm_locked receiver_locked)
J-Alves7461ef22021-10-18 17:21:33 +0100376{
J-Alves6e2abc62021-12-02 14:58:56 +0000377 (void)target_locked;
Madhukar Pappireddybd10e572023-03-06 16:39:49 -0600378 (void)current_locked;
J-Alves6e2abc62021-12-02 14:58:56 +0000379 (void)receiver_locked;
380
381 return false;
J-Alves7461ef22021-10-18 17:21:33 +0100382}
Olivier Depreze562e542020-06-11 17:31:54 +0200383
Raghu Krishnamurthyef432cb2022-12-29 06:56:32 -0800384bool plat_ffa_partition_info_get_regs_forward( // NOLINTNEXTLINE
385 const struct ffa_uuid *uuid,
386 const uint16_t start_index, // NOLINTNEXTLINE
387 const uint16_t tag,
388 struct ffa_partition_info *partitions, // NOLINTNEXTLINE
389 uint16_t partitions_len, ffa_vm_count_t *ret_count)
390{
391 (void)uuid;
392 (void)start_index;
393 (void)tag;
394 (void)partitions;
395 (void)partitions_len;
396 (void)ret_count;
397 return true;
398}
399
Olivier Depreze562e542020-06-11 17:31:54 +0200400void plat_ffa_partition_info_get_forward( // NOLINTNEXTLINE
401 const struct ffa_uuid *uuid, // NOLINTNEXTLINE
Daniel Boulbyb46cad12021-12-13 17:47:21 +0000402 const uint32_t flags, // NOLINTNEXTLINE
Olivier Depreze562e542020-06-11 17:31:54 +0200403 struct ffa_partition_info *partitions, ffa_vm_count_t *ret_count)
404{
405 (void)uuid;
Daniel Boulbyb46cad12021-12-13 17:47:21 +0000406 (void)flags;
Olivier Depreze562e542020-06-11 17:31:54 +0200407 (void)partitions;
408 (void)ret_count;
409}
Olivier Deprezd614d322021-06-18 15:21:00 +0200410
411bool plat_ffa_is_secondary_ep_register_supported(void)
412{
413 return false;
414}
Madhukar Pappireddydd883202022-10-24 16:49:28 -0500415
Madhukar Pappireddybd10e572023-03-06 16:39:49 -0600416struct ffa_value plat_ffa_msg_wait_prepare(struct vcpu_locked current_locked,
Madhukar Pappireddydd883202022-10-24 16:49:28 -0500417 struct vcpu **next)
Madhukar Pappireddy5522c672021-12-17 16:35:51 -0600418{
Madhukar Pappireddybd10e572023-03-06 16:39:49 -0600419 (void)current_locked;
Madhukar Pappireddy5522c672021-12-17 16:35:51 -0600420 (void)next;
Madhukar Pappireddy5522c672021-12-17 16:35:51 -0600421
Madhukar Pappireddydd883202022-10-24 16:49:28 -0500422 return (struct ffa_value){.func = FFA_INTERRUPT_32};
Madhukar Pappireddy5522c672021-12-17 16:35:51 -0600423}
Madhukar Pappireddy0ea239a2022-06-21 17:26:57 -0500424
Madhukar Pappireddybd10e572023-03-06 16:39:49 -0600425bool plat_ffa_check_runtime_state_transition(struct vcpu_locked current_locked,
J-Alves19e20cf2023-08-02 12:48:55 +0100426 ffa_id_t vm_id,
427 ffa_id_t receiver_vm_id,
Madhukar Pappireddybd10e572023-03-06 16:39:49 -0600428 struct vcpu_locked receiver_locked,
Madhukar Pappireddy0ea239a2022-06-21 17:26:57 -0500429 uint32_t func, // NOLINTNEXTLINE
430 enum vcpu_state *next_state)
431{
432 /* Perform state transition checks only for Secure Partitions. */
Madhukar Pappireddybd10e572023-03-06 16:39:49 -0600433 (void)current_locked;
Madhukar Pappireddy0ea239a2022-06-21 17:26:57 -0500434 (void)vm_id;
435 (void)receiver_vm_id;
Madhukar Pappireddybd10e572023-03-06 16:39:49 -0600436 (void)receiver_locked;
Madhukar Pappireddy0ea239a2022-06-21 17:26:57 -0500437 (void)func;
438 (void)next_state;
439
440 return true;
441}
Madhukar Pappireddy49fe6702022-06-21 17:52:23 -0500442
Madhukar Pappireddybd10e572023-03-06 16:39:49 -0600443void plat_ffa_init_schedule_mode_ffa_run(struct vcpu_locked current_locked,
Madhukar Pappireddy1480fce2022-06-21 18:09:25 -0500444 struct vcpu_locked target_locked)
445{
446 /* Scheduling mode not supported in the Hypervisor/VMs. */
Madhukar Pappireddybd10e572023-03-06 16:39:49 -0600447 (void)current_locked;
Madhukar Pappireddy1480fce2022-06-21 18:09:25 -0500448 (void)target_locked;
449}
450
Madhukar Pappireddy49fe6702022-06-21 17:52:23 -0500451void plat_ffa_wind_call_chain_ffa_direct_req(
452 struct vcpu_locked current_locked,
J-Alves19e20cf2023-08-02 12:48:55 +0100453 struct vcpu_locked receiver_vcpu_locked, ffa_id_t sender_vm_id)
Madhukar Pappireddy49fe6702022-06-21 17:52:23 -0500454{
455 /* Calls chains not supported in the Hypervisor/VMs. */
456 (void)current_locked;
457 (void)receiver_vcpu_locked;
Raghu Krishnamurthya9ccf122023-03-27 20:42:01 -0700458 (void)sender_vm_id;
Madhukar Pappireddy49fe6702022-06-21 17:52:23 -0500459}
Madhukar Pappireddyc0fb87e2022-06-21 17:59:15 -0500460
Madhukar Pappireddybd10e572023-03-06 16:39:49 -0600461void plat_ffa_unwind_call_chain_ffa_direct_resp(
462 struct vcpu_locked current_locked, struct vcpu_locked next_locked)
Madhukar Pappireddyc0fb87e2022-06-21 17:59:15 -0500463{
464 /* Calls chains not supported in the Hypervisor/VMs. */
Madhukar Pappireddybd10e572023-03-06 16:39:49 -0600465 (void)current_locked;
466 (void)next_locked;
Madhukar Pappireddyc0fb87e2022-06-21 17:59:15 -0500467}
Madhukar Pappireddy046dad02022-06-21 18:43:33 -0500468
J-Alves19e20cf2023-08-02 12:48:55 +0100469bool plat_ffa_is_spmd_lp_id(ffa_id_t vm_id)
Raghu Krishnamurthya9ccf122023-03-27 20:42:01 -0700470{
471 (void)vm_id;
472 return false;
473}
474
Madhukar Pappireddy2f76e492022-09-06 15:21:59 -0500475bool plat_ffa_intercept_direct_response(struct vcpu_locked current_locked,
476 struct vcpu **next,
477 struct ffa_value to_ret,
478 struct ffa_value *signal_interrupt)
479{
480 /*
481 * Only applicable to SPMC as it signals virtual secure interrupt to
482 * S-EL0 partitions.
483 */
484 (void)current_locked;
485 (void)next;
486 (void)to_ret;
487 (void)signal_interrupt;
488
489 return false;
490}
491
Madhukar Pappireddy486360d2022-09-06 15:32:24 -0500492void plat_ffa_enable_virtual_interrupts(struct vcpu_locked current_locked,
493 struct vm_locked vm_locked)
Madhukar Pappireddy046dad02022-06-21 18:43:33 -0500494{
495 (void)current_locked;
Madhukar Pappireddy486360d2022-09-06 15:32:24 -0500496 (void)vm_locked;
Madhukar Pappireddy046dad02022-06-21 18:43:33 -0500497}
J-Alves66652252022-07-06 09:49:51 +0100498
499struct ffa_value plat_ffa_other_world_mem_send(
500 struct vm *from, uint32_t share_func,
501 struct ffa_memory_region **memory_region, uint32_t length,
502 uint32_t fragment_length, struct mpool *page_pool)
503{
504 (void)from;
505 (void)memory_region;
506 (void)length;
507 (void)fragment_length;
508 (void)page_pool;
509 (void)share_func;
510
511 return (struct ffa_value){0};
512}
J-Alvesfc19b372022-07-06 12:17:35 +0100513
514struct ffa_value plat_ffa_other_world_mem_reclaim(
515 struct vm *to, ffa_memory_handle_t handle,
516 ffa_memory_region_flags_t flags, struct mpool *page_pool)
517{
518 (void)handle;
519 (void)flags;
520 (void)page_pool;
521 (void)to;
522
523 return ffa_error(FFA_INVALID_PARAMETERS);
524}
J-Alvesb5084cf2022-07-06 14:20:12 +0100525
J-Alvesfdd29272022-07-19 13:16:31 +0100526struct ffa_value plat_ffa_other_world_mem_send_continue(
527 struct vm *from, void *fragment, uint32_t fragment_length,
528 ffa_memory_handle_t handle, struct mpool *page_pool)
529{
530 (void)from;
531 (void)fragment;
532 (void)fragment_length;
533 (void)handle;
534 (void)page_pool;
535
536 return ffa_error(FFA_INVALID_PARAMETERS);
537}
J-Alves27b71962022-12-12 15:29:58 +0000538
J-Alves19e20cf2023-08-02 12:48:55 +0100539struct ffa_value plat_ffa_msg_send(ffa_id_t sender_vm_id,
540 ffa_id_t receiver_vm_id, uint32_t size,
J-Alves27b71962022-12-12 15:29:58 +0000541 struct vcpu *current, struct vcpu **next)
542{
543 (void)sender_vm_id;
544 (void)receiver_vm_id;
545 (void)size;
546 (void)current;
547 (void)next;
548
549 return ffa_error(FFA_NOT_SUPPORTED);
550}
Madhukar Pappireddy1f2f2132023-02-14 17:48:44 -0600551
Madhukar Pappireddybd10e572023-03-06 16:39:49 -0600552struct ffa_value plat_ffa_yield_prepare(struct vcpu_locked current_locked,
Madhukar Pappireddy184501c2023-05-23 17:24:06 -0500553 struct vcpu **next,
554 uint32_t timeout_low,
555 uint32_t timeout_high)
Madhukar Pappireddy1f2f2132023-02-14 17:48:44 -0600556{
Madhukar Pappireddybd10e572023-03-06 16:39:49 -0600557 (void)current_locked;
Madhukar Pappireddyb3fb8712023-05-23 17:10:34 -0500558 (void)next;
Madhukar Pappireddy184501c2023-05-23 17:24:06 -0500559 (void)timeout_low;
560 (void)timeout_high;
Madhukar Pappireddyb3fb8712023-05-23 17:10:34 -0500561
562 return ffa_error(FFA_NOT_SUPPORTED);
Madhukar Pappireddy1f2f2132023-02-14 17:48:44 -0600563}
Olivier Deprezd9d409f2023-03-17 11:47:57 +0100564
565bool arch_vm_init_mm(struct vm *vm, struct mpool *ppool)
566{
567 (void)vm;
568 (void)ppool;
569
570 return true;
571}
572
Madhukar Pappireddy070f49e2024-01-12 13:02:27 -0600573bool arch_vm_iommu_init_mm(struct vm *vm, struct mpool *ppool)
574{
575 (void)vm;
576 (void)ppool;
577
578 return true;
579}
580
Olivier Deprezd9d409f2023-03-17 11:47:57 +0100581bool arch_vm_identity_prepare(struct vm_locked vm_locked, paddr_t begin,
582 paddr_t end, uint32_t mode, struct mpool *ppool)
583{
584 (void)vm_locked;
585 (void)begin;
586 (void)end;
587 (void)mode;
588 (void)ppool;
589
590 return true;
591}
592
593void arch_vm_identity_commit(struct vm_locked vm_locked, paddr_t begin,
594 paddr_t end, uint32_t mode, struct mpool *ppool,
595 ipaddr_t *ipa)
596{
597 (void)vm_locked;
598 (void)begin;
599 (void)end;
600 (void)mode;
601 (void)ppool;
602 (void)ipa;
603}
604
605bool arch_vm_unmap(struct vm_locked vm_locked, paddr_t begin, paddr_t end,
606 struct mpool *ppool)
607{
608 (void)vm_locked;
609 (void)begin;
610 (void)end;
611 (void)ppool;
612
613 return true;
614}
615
616void arch_vm_ptable_defrag(struct vm_locked vm_locked, struct mpool *ppool)
617{
618 (void)vm_locked;
619 (void)ppool;
620}
621
622bool arch_vm_mem_get_mode(struct vm_locked vm_locked, ipaddr_t begin,
623 ipaddr_t end, uint32_t *mode) // NOLINT
624{
625 (void)vm_locked;
626 (void)begin;
627 (void)end;
628 (void)mode;
629
630 return true;
631}
Olivier Deprez878bd5b2021-04-15 19:05:10 +0200632
633ffa_memory_attributes_t plat_ffa_memory_security_mode(
634 ffa_memory_attributes_t attributes, uint32_t mode)
635{
636 (void)mode;
637
638 return attributes;
639}
Kathleen Capella6ab05132023-05-10 12:27:35 -0400640
641struct ffa_value plat_ffa_error_32(struct vcpu *current, struct vcpu **next,
Karl Meakin1064a9c2024-06-04 17:20:43 +0100642 enum ffa_error error_code)
Kathleen Capella6ab05132023-05-10 12:27:35 -0400643{
644 (void)current;
645 (void)next;
646 (void)error_code;
J-Alves2ced1672022-12-12 14:35:38 +0000647
648 return ffa_error(FFA_NOT_SUPPORTED);
649}
650
J-Alves19e20cf2023-08-02 12:48:55 +0100651int64_t plat_ffa_mailbox_waiter_get(ffa_id_t vm_id, const struct vcpu *current)
J-Alves2ced1672022-12-12 14:35:38 +0000652{
J-Alvesbc7ab4f2022-12-13 12:09:25 +0000653 (void)vm_id;
654 (void)current;
J-Alves2ced1672022-12-12 14:35:38 +0000655
J-Alvesbc7ab4f2022-12-13 12:09:25 +0000656 return -1;
657}
658
659int64_t plat_ffa_mailbox_writable_get(const struct vcpu *current)
660{
661 (void)current;
662
663 return -1;
Kathleen Capella6ab05132023-05-10 12:27:35 -0400664}
Raghu Krishnamurthye74d6532023-06-07 12:21:54 -0700665
666bool plat_ffa_partition_info_get_regs_forward_allowed(void)
667{
668 return false;
669}
Madhukar Pappireddy9e09d7a2023-08-08 14:53:49 -0500670
671void plat_ffa_free_vm_resources(struct vm_locked vm_locked)
672{
673 (void)vm_locked;
674}
Madhukar Pappireddy0e57d3d2023-10-11 15:49:05 -0500675
676bool arch_vm_iommu_mm_identity_map(struct vm_locked vm_locked, paddr_t begin,
677 paddr_t end, uint32_t mode,
678 struct mpool *ppool, ipaddr_t *ipa,
679 struct dma_device_properties *dma_prop)
680{
681 (void)vm_locked;
682 (void)begin;
683 (void)end;
684 (void)mode;
685 (void)ppool;
686 (void)ipa;
687 (void)dma_prop;
688
689 return true;
690}