blob: 555bcf0430baaee6489075f5cd23c16c2259ff98 [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
Karl Meakin902af082024-11-28 14:58:38 +000011#include "hf/ffa/notifications.h"
J-Alvesa0f317d2021-06-09 13:31:59 +010012#include "hf/ffa_internal.h"
Olivier Deprez55a189e2021-06-09 15:45:27 +020013#include "hf/vcpu.h"
J-Alvesc003a7a2021-03-18 13:06:53 +000014#include "hf/vm.h"
Daniel Boulbyb2fb80e2021-02-03 15:09:23 +000015
J-Alves19e20cf2023-08-02 12:48:55 +010016ffa_id_t arch_ffa_spmc_id_get(void)
Daniel Boulbyb2fb80e2021-02-03 15:09:23 +000017{
18 return HF_SPMC_VM_ID;
19}
Olivier Deprez55a189e2021-06-09 15:45:27 +020020
21void plat_ffa_log_init(void)
22{
23}
24
J-Alvesc9227c82024-04-24 21:00:58 +010025bool plat_ffa_is_memory_send_valid(ffa_id_t receiver, ffa_id_t sender,
26 uint32_t share_func, bool multiple_borrower)
Maksims Svecovsa3d570c2021-12-08 11:16:32 +000027{
Maksims Svecovsa3d570c2021-12-08 11:16:32 +000028 (void)share_func;
J-Alvesc9227c82024-04-24 21:00:58 +010029 (void)receiver;
30 (void)sender;
31 (void)multiple_borrower;
Maksims Svecovsa3d570c2021-12-08 11:16:32 +000032
33 return true;
34}
35
Olivier Deprez55a189e2021-06-09 15:45:27 +020036bool plat_ffa_is_direct_request_valid(struct vcpu *current,
J-Alves19e20cf2023-08-02 12:48:55 +010037 ffa_id_t sender_vm_id,
38 ffa_id_t receiver_vm_id)
Olivier Deprez55a189e2021-06-09 15:45:27 +020039{
40 (void)current;
41 (void)sender_vm_id;
42 (void)receiver_vm_id;
43
44 return true;
45}
46
J-Alves439ac972021-11-18 17:32:03 +000047bool plat_ffa_is_direct_request_supported(struct vm *sender_vm,
Kathleen Capella41fea932023-06-23 17:39:28 -040048 struct vm *receiver_vm, uint32_t func)
J-Alves439ac972021-11-18 17:32:03 +000049{
50 (void)sender_vm;
51 (void)receiver_vm;
Kathleen Capella41fea932023-06-23 17:39:28 -040052 (void)func;
J-Alves439ac972021-11-18 17:32:03 +000053
54 return false;
55}
56
Olivier Deprez55a189e2021-06-09 15:45:27 +020057bool plat_ffa_is_direct_response_valid(struct vcpu *current,
J-Alves19e20cf2023-08-02 12:48:55 +010058 ffa_id_t sender_vm_id,
59 ffa_id_t receiver_vm_id)
Olivier Deprez55a189e2021-06-09 15:45:27 +020060{
61 (void)current;
62 (void)sender_vm_id;
63 (void)receiver_vm_id;
64
65 return true;
66}
67
J-Alves19e20cf2023-08-02 12:48:55 +010068bool plat_ffa_run_forward(ffa_id_t vm_id, ffa_vcpu_index_t vcpu_idx,
Raghu Krishnamurthy62f97a72021-07-27 02:14:59 -070069 struct ffa_value *ret)
70{
71 (void)vm_id;
72 (void)vcpu_idx;
73 (void)ret;
74
75 return false;
76}
77
Federico Recanati10bd06c2022-02-23 17:32:59 +010078void plat_ffa_vm_destroy(struct vm_locked to_destroy_locked)
79{
80 (void)to_destroy_locked;
81}
82
J-Alves70079932022-12-07 17:32:20 +000083void plat_ffa_rxtx_unmap_forward(struct vm_locked vm_locked)
Federico Recanati8da9e332022-02-10 11:00:17 +010084{
J-Alves70079932022-12-07 17:32:20 +000085 (void)vm_locked;
Federico Recanati8da9e332022-02-10 11:00:17 +010086}
87
J-Alves19e20cf2023-08-02 12:48:55 +010088bool plat_ffa_direct_request_forward(ffa_id_t receiver_vm_id,
Olivier Deprez55a189e2021-06-09 15:45:27 +020089 struct ffa_value args,
90 struct ffa_value *ret)
91{
92 (void)receiver_vm_id;
93 (void)args;
94 (void)ret;
95 return false;
96}
97
Federico Recanati7bef0b92022-03-17 14:56:22 +010098bool plat_ffa_rx_release_forward(struct vm_locked vm_locked,
99 struct ffa_value *ret)
100{
101 (void)vm_locked;
102 (void)ret;
103
104 return false;
105}
106
Federico Recanati644f0462022-03-17 12:04:00 +0100107bool plat_ffa_acquire_receiver_rx(struct vm_locked to_locked,
108 struct ffa_value *ret)
109{
110 (void)to_locked;
111 (void)ret;
112
113 return false;
114}
115
Federico Recanati25053ee2022-03-14 15:01:53 +0100116bool plat_ffa_is_indirect_msg_supported(struct vm_locked sender_locked,
117 struct vm_locked receiver_locked)
118{
119 (void)sender_locked;
120 (void)receiver_locked;
121
122 return false;
123}
124
J-Alves19e20cf2023-08-02 12:48:55 +0100125bool plat_ffa_msg_send2_forward(ffa_id_t receiver_vm_id, ffa_id_t sender_vm_id,
126 struct ffa_value *ret)
Federico Recanati25053ee2022-03-14 15:01:53 +0100127{
128 (void)receiver_vm_id;
129 (void)sender_vm_id;
130 (void)ret;
131
132 return false;
133}
134
J-Alves7db32002021-12-14 14:44:50 +0000135uint32_t plat_ffa_other_world_mode(void)
136{
137 return 0U;
138}
139
J-Alvesc003a7a2021-03-18 13:06:53 +0000140bool plat_ffa_is_notifications_bind_valid(struct vcpu *current,
J-Alves19e20cf2023-08-02 12:48:55 +0100141 ffa_id_t sender_id,
142 ffa_id_t receiver_id)
J-Alvesc003a7a2021-03-18 13:06:53 +0000143{
144 (void)current;
145 (void)sender_id;
146 (void)receiver_id;
147 return false;
148}
149
J-Alvesb15e9402021-09-08 11:44:42 +0100150bool plat_ffa_notifications_update_bindings_forward(
Karl Meakinf9c73ce2024-07-30 17:37:13 +0100151 ffa_id_t receiver_id, ffa_id_t sender_id,
152 ffa_notification_flags_t flags, ffa_notifications_bitmap_t bitmap,
153 bool is_bind, struct ffa_value *ret)
J-Alvesb15e9402021-09-08 11:44:42 +0100154{
155 (void)ret;
156 (void)receiver_id;
157 (void)sender_id;
158 (void)flags;
159 (void)bitmap;
160 (void)is_bind;
161 (void)ret;
162
163 return false;
164}
165
Federico Recanati8d8b1cf2022-04-14 13:16:00 +0200166void plat_ffa_rxtx_map_forward(struct vm_locked vm_locked)
167{
168 (void)vm_locked;
169}
170
Maksims Svecovsb596eab2021-04-27 00:52:27 +0100171ffa_partition_properties_t plat_ffa_partition_properties(
J-Alves7fb0fdb2024-10-09 11:28:07 +0100172 ffa_id_t caller_id, const struct vm *target)
Maksims Svecovsb596eab2021-04-27 00:52:27 +0100173{
J-Alves7fb0fdb2024-10-09 11:28:07 +0100174 (void)caller_id;
Maksims Svecovsb596eab2021-04-27 00:52:27 +0100175 (void)target;
176 return 0;
177}
Maksims Svecovs9ddf86a2021-05-06 17:17:21 +0100178
179bool plat_ffa_vm_managed_exit_supported(struct vm *vm)
180{
181 (void)vm;
182 return false;
183}
J-Alvesa0f317d2021-06-09 13:31:59 +0100184
J-Alves7ccaccf2024-02-01 14:25:23 +0000185/**
186 * Check validity of the calls:
187 * FFA_NOTIFICATION_BITMAP_CREATE/FFA_NOTIFICATION_BITMAP_DESTROY.
188 */
189struct ffa_value plat_ffa_is_notifications_bitmap_access_valid(
190 struct vcpu *current, ffa_id_t vm_id)
J-Alvesa0f317d2021-06-09 13:31:59 +0100191{
J-Alves7ccaccf2024-02-01 14:25:23 +0000192 /*
193 * Call should only be used by the Hypervisor, so any attempt of
194 * invocation from NWd FF-A endpoints should fail.
195 */
J-Alvesa0f317d2021-06-09 13:31:59 +0100196 (void)current;
197 (void)vm_id;
198
J-Alves7ccaccf2024-02-01 14:25:23 +0000199 return ffa_error(FFA_NOT_SUPPORTED);
J-Alvesa0f317d2021-06-09 13:31:59 +0100200}
201
J-Alvesaa79c012021-07-09 14:29:45 +0100202bool plat_ffa_is_notification_set_valid(struct vcpu *current,
J-Alves19e20cf2023-08-02 12:48:55 +0100203 ffa_id_t sender_id,
204 ffa_id_t receiver_id)
J-Alvesaa79c012021-07-09 14:29:45 +0100205{
206 (void)current;
207 (void)sender_id;
208 (void)receiver_id;
209 return false;
210}
211
212bool plat_ffa_is_notification_get_valid(struct vcpu *current,
Karl Meakinf9c73ce2024-07-30 17:37:13 +0100213 ffa_id_t receiver_id,
214 ffa_notification_flags_t flags)
J-Alvesaa79c012021-07-09 14:29:45 +0100215{
J-Alvesfc95a302022-04-22 14:18:23 +0100216 (void)flags;
J-Alvesaa79c012021-07-09 14:29:45 +0100217 (void)current;
218 (void)receiver_id;
219 return false;
220}
221
Karl Meakinf9c73ce2024-07-30 17:37:13 +0100222struct ffa_value plat_ffa_notifications_get_from_sp(
J-Alves98ff9562021-09-09 14:39:41 +0100223 struct vm_locked receiver_locked, ffa_vcpu_index_t vcpu_id,
Karl Meakinf9c73ce2024-07-30 17:37:13 +0100224 ffa_notifications_bitmap_t *from_sp) // NOLINT
J-Alves98ff9562021-09-09 14:39:41 +0100225{
226 (void)receiver_locked;
227 (void)vcpu_id;
228 (void)from_sp;
J-Alves98ff9562021-09-09 14:39:41 +0100229
Karl Meakinf9c73ce2024-07-30 17:37:13 +0100230 return ffa_error(FFA_NOT_SUPPORTED);
J-Alves98ff9562021-09-09 14:39:41 +0100231}
232
Karl Meakinf9c73ce2024-07-30 17:37:13 +0100233struct ffa_value plat_ffa_notifications_get_framework_notifications(
J-Alvesd605a092022-03-28 14:20:48 +0100234 struct vm_locked receiver_locked,
235 ffa_notifications_bitmap_t *from_fwk, // NOLINT
Karl Meakinf9c73ce2024-07-30 17:37:13 +0100236 ffa_notification_flags_t flags, ffa_vcpu_index_t vcpu_id)
J-Alvesd605a092022-03-28 14:20:48 +0100237{
238 (void)receiver_locked;
239 (void)from_fwk;
240 (void)flags;
241 (void)vcpu_id;
J-Alvesd605a092022-03-28 14:20:48 +0100242
Karl Meakinf9c73ce2024-07-30 17:37:13 +0100243 return ffa_error(FFA_NOT_SUPPORTED);
J-Alvesd605a092022-03-28 14:20:48 +0100244}
245
J-Alves19e20cf2023-08-02 12:48:55 +0100246bool plat_ffa_notification_set_forward(ffa_id_t sender_vm_id,
Karl Meakinf9c73ce2024-07-30 17:37:13 +0100247 ffa_id_t receiver_vm_id,
248 ffa_notification_flags_t flags,
J-Alvesde7bd2f2021-09-09 19:54:35 +0100249 ffa_notifications_bitmap_t bitmap,
250 struct ffa_value *ret)
251{
252 (void)sender_vm_id;
253 (void)receiver_vm_id;
254 (void)flags;
255 (void)bitmap;
256 (void)ret;
257
258 return false;
259}
260
J-Alvesa0f317d2021-06-09 13:31:59 +0100261struct ffa_value plat_ffa_notifications_bitmap_create(
J-Alves19e20cf2023-08-02 12:48:55 +0100262 ffa_id_t vm_id, ffa_vcpu_count_t vcpu_count)
J-Alvesa0f317d2021-06-09 13:31:59 +0100263{
264 (void)vm_id;
265 (void)vcpu_count;
266
267 return ffa_error(FFA_NOT_SUPPORTED);
268}
269
J-Alves19e20cf2023-08-02 12:48:55 +0100270struct ffa_value plat_ffa_notifications_bitmap_destroy(ffa_id_t vm_id)
J-Alvesa0f317d2021-06-09 13:31:59 +0100271{
272 (void)vm_id;
273
274 return ffa_error(FFA_NOT_SUPPORTED);
275}
J-Alvesc003a7a2021-03-18 13:06:53 +0000276
J-Alves19e20cf2023-08-02 12:48:55 +0100277struct vm_locked plat_ffa_vm_find_locked(ffa_id_t vm_id)
J-Alvesc003a7a2021-03-18 13:06:53 +0000278{
279 (void)vm_id;
280 return (struct vm_locked){.vm = NULL};
281}
282
J-Alves19e20cf2023-08-02 12:48:55 +0100283struct vm_locked plat_ffa_vm_find_locked_create(ffa_id_t vm_id)
Federico Recanati8d8b1cf2022-04-14 13:16:00 +0200284{
285 (void)vm_id;
286 return (struct vm_locked){.vm = NULL};
287}
288
J-Alvesfa782092021-10-13 16:02:16 +0100289bool plat_ffa_vm_notifications_info_get( // NOLINTNEXTLINE
290 uint16_t *ids, uint32_t *ids_count, // NOLINTNEXTLINE
291 uint32_t *lists_sizes, // NOLINTNEXTLINE
292 uint32_t *lists_count, const uint32_t ids_count_max)
J-Alvesc8e8a222021-06-08 17:33:52 +0100293{
294 (void)ids;
295 (void)ids_count;
296 (void)lists_sizes;
297 (void)lists_count;
298 (void)ids_count_max;
299
300 return false;
301}
Raghu Krishnamurthyea6d25f2021-09-14 15:27:06 -0700302
303bool plat_ffa_is_mem_perm_get_valid(const struct vcpu *current)
304{
305 (void)current;
306 return false;
307}
308
309bool plat_ffa_is_mem_perm_set_valid(const struct vcpu *current)
310{
311 (void)current;
312 return false;
313}
Madhukar Pappireddyb11e0d12021-08-02 19:44:35 -0500314
315/**
316 * Check if current VM can resume target VM/SP using FFA_RUN ABI.
317 */
Madhukar Pappireddybd10e572023-03-06 16:39:49 -0600318bool plat_ffa_run_checks(struct vcpu_locked current_locked,
J-Alves19e20cf2023-08-02 12:48:55 +0100319 ffa_id_t target_vm_id, ffa_vcpu_index_t vcpu_idx,
Madhukar Pappireddybd10e572023-03-06 16:39:49 -0600320 struct ffa_value *run_ret, struct vcpu **next)
Madhukar Pappireddyb11e0d12021-08-02 19:44:35 -0500321{
Madhukar Pappireddybd10e572023-03-06 16:39:49 -0600322 (void)current_locked;
Madhukar Pappireddyb11e0d12021-08-02 19:44:35 -0500323 (void)target_vm_id;
324 (void)run_ret;
325 (void)next;
Raghu Krishnamurthy048d63f2021-12-11 12:45:41 -0800326 (void)vcpu_idx;
Madhukar Pappireddyb11e0d12021-08-02 19:44:35 -0500327 return true;
328}
J-Alvesca058c22021-09-10 14:02:07 +0100329
330void plat_ffa_notification_info_get_forward( // NOLINTNEXTLINE
331 uint16_t *ids, uint32_t *ids_count, // NOLINTNEXTLINE
332 uint32_t *lists_sizes, uint32_t *lists_count,
333 const uint32_t ids_count_max)
334{
335 (void)ids;
336 (void)ids_count;
337 (void)lists_sizes;
338 (void)lists_count;
339 (void)ids_count_max;
340}
J-Alves13394022021-06-30 13:48:49 +0100341
J-Alves13394022021-06-30 13:48:49 +0100342void plat_ffa_sri_trigger_if_delayed(struct cpu *cpu)
343{
344 (void)cpu;
345}
346
347void plat_ffa_sri_trigger_not_delayed(struct cpu *cpu)
348{
349 (void)cpu;
350}
351
J-Alvesea8ccfe2024-10-09 11:47:24 +0100352void plat_ffa_sri_set_delayed(struct cpu *cpu)
353{
354 (void)cpu;
355}
356
J-Alves6e2abc62021-12-02 14:58:56 +0000357bool plat_ffa_inject_notification_pending_interrupt(
Madhukar Pappireddybd10e572023-03-06 16:39:49 -0600358 struct vcpu_locked target_locked, struct vcpu_locked current_locked,
J-Alves6e2abc62021-12-02 14:58:56 +0000359 struct vm_locked receiver_locked)
J-Alves7461ef22021-10-18 17:21:33 +0100360{
J-Alves6e2abc62021-12-02 14:58:56 +0000361 (void)target_locked;
Madhukar Pappireddybd10e572023-03-06 16:39:49 -0600362 (void)current_locked;
J-Alves6e2abc62021-12-02 14:58:56 +0000363 (void)receiver_locked;
364
365 return false;
J-Alves7461ef22021-10-18 17:21:33 +0100366}
Olivier Depreze562e542020-06-11 17:31:54 +0200367
Raghu Krishnamurthyef432cb2022-12-29 06:56:32 -0800368bool plat_ffa_partition_info_get_regs_forward( // NOLINTNEXTLINE
369 const struct ffa_uuid *uuid,
370 const uint16_t start_index, // NOLINTNEXTLINE
371 const uint16_t tag,
372 struct ffa_partition_info *partitions, // NOLINTNEXTLINE
373 uint16_t partitions_len, ffa_vm_count_t *ret_count)
374{
375 (void)uuid;
376 (void)start_index;
377 (void)tag;
378 (void)partitions;
379 (void)partitions_len;
380 (void)ret_count;
381 return true;
382}
383
Karl Meakin86c80272024-07-26 15:13:23 +0100384ffa_vm_count_t plat_ffa_partition_info_get_forward( // NOLINTNEXTLINE
385 const struct ffa_uuid *uuid, // NOLINTNEXTLINE
386 uint32_t flags, // NOLINTNEXTLINE
387 struct ffa_partition_info *partitions, ffa_vm_count_t vm_count)
Olivier Depreze562e542020-06-11 17:31:54 +0200388{
389 (void)uuid;
Daniel Boulbyb46cad12021-12-13 17:47:21 +0000390 (void)flags;
Olivier Depreze562e542020-06-11 17:31:54 +0200391 (void)partitions;
Karl Meakin86c80272024-07-26 15:13:23 +0100392
393 return vm_count;
Olivier Depreze562e542020-06-11 17:31:54 +0200394}
Olivier Deprezd614d322021-06-18 15:21:00 +0200395
396bool plat_ffa_is_secondary_ep_register_supported(void)
397{
398 return false;
399}
Madhukar Pappireddydd883202022-10-24 16:49:28 -0500400
Madhukar Pappireddybd10e572023-03-06 16:39:49 -0600401struct ffa_value plat_ffa_msg_wait_prepare(struct vcpu_locked current_locked,
Madhukar Pappireddydd883202022-10-24 16:49:28 -0500402 struct vcpu **next)
Madhukar Pappireddy5522c672021-12-17 16:35:51 -0600403{
Madhukar Pappireddybd10e572023-03-06 16:39:49 -0600404 (void)current_locked;
Madhukar Pappireddy5522c672021-12-17 16:35:51 -0600405 (void)next;
Madhukar Pappireddy5522c672021-12-17 16:35:51 -0600406
Madhukar Pappireddydd883202022-10-24 16:49:28 -0500407 return (struct ffa_value){.func = FFA_INTERRUPT_32};
Madhukar Pappireddy5522c672021-12-17 16:35:51 -0600408}
Madhukar Pappireddy0ea239a2022-06-21 17:26:57 -0500409
Madhukar Pappireddybd10e572023-03-06 16:39:49 -0600410bool plat_ffa_check_runtime_state_transition(struct vcpu_locked current_locked,
J-Alves19e20cf2023-08-02 12:48:55 +0100411 ffa_id_t vm_id,
412 ffa_id_t receiver_vm_id,
Madhukar Pappireddybd10e572023-03-06 16:39:49 -0600413 struct vcpu_locked receiver_locked,
Madhukar Pappireddy0ea239a2022-06-21 17:26:57 -0500414 uint32_t func, // NOLINTNEXTLINE
415 enum vcpu_state *next_state)
416{
417 /* Perform state transition checks only for Secure Partitions. */
Madhukar Pappireddybd10e572023-03-06 16:39:49 -0600418 (void)current_locked;
Madhukar Pappireddy0ea239a2022-06-21 17:26:57 -0500419 (void)vm_id;
420 (void)receiver_vm_id;
Madhukar Pappireddybd10e572023-03-06 16:39:49 -0600421 (void)receiver_locked;
Madhukar Pappireddy0ea239a2022-06-21 17:26:57 -0500422 (void)func;
423 (void)next_state;
424
425 return true;
426}
Madhukar Pappireddy49fe6702022-06-21 17:52:23 -0500427
Madhukar Pappireddybd10e572023-03-06 16:39:49 -0600428void plat_ffa_init_schedule_mode_ffa_run(struct vcpu_locked current_locked,
Madhukar Pappireddy1480fce2022-06-21 18:09:25 -0500429 struct vcpu_locked target_locked)
430{
431 /* Scheduling mode not supported in the Hypervisor/VMs. */
Madhukar Pappireddybd10e572023-03-06 16:39:49 -0600432 (void)current_locked;
Madhukar Pappireddy1480fce2022-06-21 18:09:25 -0500433 (void)target_locked;
434}
435
Madhukar Pappireddy49fe6702022-06-21 17:52:23 -0500436void plat_ffa_wind_call_chain_ffa_direct_req(
437 struct vcpu_locked current_locked,
J-Alves19e20cf2023-08-02 12:48:55 +0100438 struct vcpu_locked receiver_vcpu_locked, ffa_id_t sender_vm_id)
Madhukar Pappireddy49fe6702022-06-21 17:52:23 -0500439{
440 /* Calls chains not supported in the Hypervisor/VMs. */
441 (void)current_locked;
442 (void)receiver_vcpu_locked;
Raghu Krishnamurthya9ccf122023-03-27 20:42:01 -0700443 (void)sender_vm_id;
Madhukar Pappireddy49fe6702022-06-21 17:52:23 -0500444}
Madhukar Pappireddyc0fb87e2022-06-21 17:59:15 -0500445
Madhukar Pappireddybd10e572023-03-06 16:39:49 -0600446void plat_ffa_unwind_call_chain_ffa_direct_resp(
447 struct vcpu_locked current_locked, struct vcpu_locked next_locked)
Madhukar Pappireddyc0fb87e2022-06-21 17:59:15 -0500448{
449 /* Calls chains not supported in the Hypervisor/VMs. */
Madhukar Pappireddybd10e572023-03-06 16:39:49 -0600450 (void)current_locked;
451 (void)next_locked;
Madhukar Pappireddyc0fb87e2022-06-21 17:59:15 -0500452}
Madhukar Pappireddy046dad02022-06-21 18:43:33 -0500453
J-Alves19e20cf2023-08-02 12:48:55 +0100454bool plat_ffa_is_spmd_lp_id(ffa_id_t vm_id)
Raghu Krishnamurthya9ccf122023-03-27 20:42:01 -0700455{
456 (void)vm_id;
457 return false;
458}
459
Madhukar Pappireddy486360d2022-09-06 15:32:24 -0500460void plat_ffa_enable_virtual_interrupts(struct vcpu_locked current_locked,
461 struct vm_locked vm_locked)
Madhukar Pappireddy046dad02022-06-21 18:43:33 -0500462{
463 (void)current_locked;
Madhukar Pappireddy486360d2022-09-06 15:32:24 -0500464 (void)vm_locked;
Madhukar Pappireddy046dad02022-06-21 18:43:33 -0500465}
J-Alves66652252022-07-06 09:49:51 +0100466
467struct ffa_value plat_ffa_other_world_mem_send(
468 struct vm *from, uint32_t share_func,
469 struct ffa_memory_region **memory_region, uint32_t length,
470 uint32_t fragment_length, struct mpool *page_pool)
471{
472 (void)from;
473 (void)memory_region;
474 (void)length;
475 (void)fragment_length;
476 (void)page_pool;
477 (void)share_func;
478
479 return (struct ffa_value){0};
480}
J-Alvesfc19b372022-07-06 12:17:35 +0100481
482struct ffa_value plat_ffa_other_world_mem_reclaim(
483 struct vm *to, ffa_memory_handle_t handle,
484 ffa_memory_region_flags_t flags, struct mpool *page_pool)
485{
486 (void)handle;
487 (void)flags;
488 (void)page_pool;
489 (void)to;
490
491 return ffa_error(FFA_INVALID_PARAMETERS);
492}
J-Alvesb5084cf2022-07-06 14:20:12 +0100493
J-Alvesfdd29272022-07-19 13:16:31 +0100494struct ffa_value plat_ffa_other_world_mem_send_continue(
495 struct vm *from, void *fragment, uint32_t fragment_length,
496 ffa_memory_handle_t handle, struct mpool *page_pool)
497{
498 (void)from;
499 (void)fragment;
500 (void)fragment_length;
501 (void)handle;
502 (void)page_pool;
503
504 return ffa_error(FFA_INVALID_PARAMETERS);
505}
J-Alves27b71962022-12-12 15:29:58 +0000506
J-Alves19e20cf2023-08-02 12:48:55 +0100507struct ffa_value plat_ffa_msg_send(ffa_id_t sender_vm_id,
508 ffa_id_t receiver_vm_id, uint32_t size,
J-Alves27b71962022-12-12 15:29:58 +0000509 struct vcpu *current, struct vcpu **next)
510{
511 (void)sender_vm_id;
512 (void)receiver_vm_id;
513 (void)size;
514 (void)current;
515 (void)next;
516
517 return ffa_error(FFA_NOT_SUPPORTED);
518}
Madhukar Pappireddy1f2f2132023-02-14 17:48:44 -0600519
Madhukar Pappireddybd10e572023-03-06 16:39:49 -0600520struct ffa_value plat_ffa_yield_prepare(struct vcpu_locked current_locked,
Madhukar Pappireddy184501c2023-05-23 17:24:06 -0500521 struct vcpu **next,
522 uint32_t timeout_low,
523 uint32_t timeout_high)
Madhukar Pappireddy1f2f2132023-02-14 17:48:44 -0600524{
Madhukar Pappireddybd10e572023-03-06 16:39:49 -0600525 (void)current_locked;
Madhukar Pappireddyb3fb8712023-05-23 17:10:34 -0500526 (void)next;
Madhukar Pappireddy184501c2023-05-23 17:24:06 -0500527 (void)timeout_low;
528 (void)timeout_high;
Madhukar Pappireddyb3fb8712023-05-23 17:10:34 -0500529
530 return ffa_error(FFA_NOT_SUPPORTED);
Madhukar Pappireddy1f2f2132023-02-14 17:48:44 -0600531}
Olivier Deprezd9d409f2023-03-17 11:47:57 +0100532
533bool arch_vm_init_mm(struct vm *vm, struct mpool *ppool)
534{
535 (void)vm;
536 (void)ppool;
537
538 return true;
539}
540
Madhukar Pappireddy070f49e2024-01-12 13:02:27 -0600541bool arch_vm_iommu_init_mm(struct vm *vm, struct mpool *ppool)
542{
543 (void)vm;
544 (void)ppool;
545
546 return true;
547}
548
Olivier Deprezd9d409f2023-03-17 11:47:57 +0100549bool arch_vm_identity_prepare(struct vm_locked vm_locked, paddr_t begin,
550 paddr_t end, uint32_t mode, struct mpool *ppool)
551{
552 (void)vm_locked;
553 (void)begin;
554 (void)end;
555 (void)mode;
556 (void)ppool;
557
558 return true;
559}
560
561void arch_vm_identity_commit(struct vm_locked vm_locked, paddr_t begin,
562 paddr_t end, uint32_t mode, struct mpool *ppool,
563 ipaddr_t *ipa)
564{
565 (void)vm_locked;
566 (void)begin;
567 (void)end;
568 (void)mode;
569 (void)ppool;
570 (void)ipa;
571}
572
573bool arch_vm_unmap(struct vm_locked vm_locked, paddr_t begin, paddr_t end,
574 struct mpool *ppool)
575{
576 (void)vm_locked;
577 (void)begin;
578 (void)end;
579 (void)ppool;
580
581 return true;
582}
583
584void arch_vm_ptable_defrag(struct vm_locked vm_locked, struct mpool *ppool)
585{
586 (void)vm_locked;
587 (void)ppool;
588}
589
590bool arch_vm_mem_get_mode(struct vm_locked vm_locked, ipaddr_t begin,
591 ipaddr_t end, uint32_t *mode) // NOLINT
592{
593 (void)vm_locked;
594 (void)begin;
595 (void)end;
596 (void)mode;
597
598 return true;
599}
Olivier Deprez878bd5b2021-04-15 19:05:10 +0200600
Karl Meakin3d32eef2024-11-25 16:40:09 +0000601ffa_memory_attributes_t plat_ffa_memory_add_security_bit_from_mode(
Olivier Deprez878bd5b2021-04-15 19:05:10 +0200602 ffa_memory_attributes_t attributes, uint32_t mode)
603{
604 (void)mode;
605
606 return attributes;
607}
Kathleen Capella6ab05132023-05-10 12:27:35 -0400608
609struct ffa_value plat_ffa_error_32(struct vcpu *current, struct vcpu **next,
Karl Meakin1064a9c2024-06-04 17:20:43 +0100610 enum ffa_error error_code)
Kathleen Capella6ab05132023-05-10 12:27:35 -0400611{
612 (void)current;
613 (void)next;
614 (void)error_code;
J-Alves2ced1672022-12-12 14:35:38 +0000615
616 return ffa_error(FFA_NOT_SUPPORTED);
617}
618
Raghu Krishnamurthye74d6532023-06-07 12:21:54 -0700619bool plat_ffa_partition_info_get_regs_forward_allowed(void)
620{
621 return false;
622}
Madhukar Pappireddy9e09d7a2023-08-08 14:53:49 -0500623
624void plat_ffa_free_vm_resources(struct vm_locked vm_locked)
625{
626 (void)vm_locked;
627}
Madhukar Pappireddy0e57d3d2023-10-11 15:49:05 -0500628
629bool arch_vm_iommu_mm_identity_map(struct vm_locked vm_locked, paddr_t begin,
630 paddr_t end, uint32_t mode,
631 struct mpool *ppool, ipaddr_t *ipa,
632 struct dma_device_properties *dma_prop)
633{
634 (void)vm_locked;
635 (void)begin;
636 (void)end;
637 (void)mode;
638 (void)ppool;
639 (void)ipa;
640 (void)dma_prop;
641
642 return true;
643}
Madhukar Pappireddyc64d0642024-08-07 16:55:46 -0500644
645uint32_t plat_ffa_interrupt_get(struct vcpu_locked current_locked)
646{
647 (void)current_locked;
648
649 return 0;
650}
Karl Meakin06e8b732024-09-20 18:26:49 +0100651
652bool plat_ffa_handle_framework_msg(struct ffa_value args, struct ffa_value *ret)
653{
654 (void)args;
655 (void)ret;
656
657 return false;
658}