blob: 54f4203d06aeaca14c4617267a4522b2176159a9 [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,
52 struct vm *receiver_vm)
53{
54 (void)sender_vm;
55 (void)receiver_vm;
56
57 return false;
58}
59
Olivier Deprez55a189e2021-06-09 15:45:27 +020060bool plat_ffa_is_direct_response_valid(struct vcpu *current,
J-Alves19e20cf2023-08-02 12:48:55 +010061 ffa_id_t sender_vm_id,
62 ffa_id_t receiver_vm_id)
Olivier Deprez55a189e2021-06-09 15:45:27 +020063{
64 (void)current;
65 (void)sender_vm_id;
66 (void)receiver_vm_id;
67
68 return true;
69}
70
J-Alves19e20cf2023-08-02 12:48:55 +010071bool plat_ffa_run_forward(ffa_id_t vm_id, ffa_vcpu_index_t vcpu_idx,
Raghu Krishnamurthy62f97a72021-07-27 02:14:59 -070072 struct ffa_value *ret)
73{
74 (void)vm_id;
75 (void)vcpu_idx;
76 (void)ret;
77
78 return false;
79}
80
Federico Recanati10bd06c2022-02-23 17:32:59 +010081void plat_ffa_vm_destroy(struct vm_locked to_destroy_locked)
82{
83 (void)to_destroy_locked;
84}
85
J-Alves70079932022-12-07 17:32:20 +000086void plat_ffa_rxtx_unmap_forward(struct vm_locked vm_locked)
Federico Recanati8da9e332022-02-10 11:00:17 +010087{
J-Alves70079932022-12-07 17:32:20 +000088 (void)vm_locked;
Federico Recanati8da9e332022-02-10 11:00:17 +010089}
90
J-Alves19e20cf2023-08-02 12:48:55 +010091bool plat_ffa_direct_request_forward(ffa_id_t receiver_vm_id,
Olivier Deprez55a189e2021-06-09 15:45:27 +020092 struct ffa_value args,
93 struct ffa_value *ret)
94{
95 (void)receiver_vm_id;
96 (void)args;
97 (void)ret;
98 return false;
99}
100
Federico Recanati7bef0b92022-03-17 14:56:22 +0100101bool plat_ffa_rx_release_forward(struct vm_locked vm_locked,
102 struct ffa_value *ret)
103{
104 (void)vm_locked;
105 (void)ret;
106
107 return false;
108}
109
Federico Recanati644f0462022-03-17 12:04:00 +0100110bool plat_ffa_acquire_receiver_rx(struct vm_locked to_locked,
111 struct ffa_value *ret)
112{
113 (void)to_locked;
114 (void)ret;
115
116 return false;
117}
118
Federico Recanati25053ee2022-03-14 15:01:53 +0100119bool plat_ffa_is_indirect_msg_supported(struct vm_locked sender_locked,
120 struct vm_locked receiver_locked)
121{
122 (void)sender_locked;
123 (void)receiver_locked;
124
125 return false;
126}
127
J-Alves19e20cf2023-08-02 12:48:55 +0100128bool plat_ffa_msg_send2_forward(ffa_id_t receiver_vm_id, ffa_id_t sender_vm_id,
129 struct ffa_value *ret)
Federico Recanati25053ee2022-03-14 15:01:53 +0100130{
131 (void)receiver_vm_id;
132 (void)sender_vm_id;
133 (void)ret;
134
135 return false;
136}
137
Olivier Deprez55a189e2021-06-09 15:45:27 +0200138ffa_memory_handle_t plat_ffa_memory_handle_make(uint64_t index)
139{
140 return index;
141}
142
143bool plat_ffa_memory_handle_allocated_by_current_world(
144 ffa_memory_handle_t handle)
145{
146 (void)handle;
147 return false;
148}
Maksims Svecovsb596eab2021-04-27 00:52:27 +0100149
J-Alves7db32002021-12-14 14:44:50 +0000150uint32_t plat_ffa_other_world_mode(void)
151{
152 return 0U;
153}
154
J-Alves19e20cf2023-08-02 12:48:55 +0100155uint32_t plat_ffa_owner_world_mode(ffa_id_t owner_id)
J-Alves7db32002021-12-14 14:44:50 +0000156{
157 (void)owner_id;
158 return 0U;
159}
160
J-Alvesc003a7a2021-03-18 13:06:53 +0000161bool plat_ffa_is_notifications_bind_valid(struct vcpu *current,
J-Alves19e20cf2023-08-02 12:48:55 +0100162 ffa_id_t sender_id,
163 ffa_id_t receiver_id)
J-Alvesc003a7a2021-03-18 13:06:53 +0000164{
165 (void)current;
166 (void)sender_id;
167 (void)receiver_id;
168 return false;
169}
170
J-Alvesb15e9402021-09-08 11:44:42 +0100171bool plat_ffa_notifications_update_bindings_forward(
J-Alves19e20cf2023-08-02 12:48:55 +0100172 ffa_id_t receiver_id, ffa_id_t sender_id, uint32_t flags,
J-Alvesb15e9402021-09-08 11:44:42 +0100173 ffa_notifications_bitmap_t bitmap, bool is_bind, struct ffa_value *ret)
174{
175 (void)ret;
176 (void)receiver_id;
177 (void)sender_id;
178 (void)flags;
179 (void)bitmap;
180 (void)is_bind;
181 (void)ret;
182
183 return false;
184}
185
Federico Recanati8d8b1cf2022-04-14 13:16:00 +0200186void plat_ffa_rxtx_map_forward(struct vm_locked vm_locked)
187{
188 (void)vm_locked;
189}
190
Maksims Svecovsb596eab2021-04-27 00:52:27 +0100191ffa_partition_properties_t plat_ffa_partition_properties(
J-Alves19e20cf2023-08-02 12:48:55 +0100192 ffa_id_t vm_id, const struct vm *target)
Maksims Svecovsb596eab2021-04-27 00:52:27 +0100193{
J-Alvesfa782092021-10-13 16:02:16 +0100194 (void)vm_id;
Maksims Svecovsb596eab2021-04-27 00:52:27 +0100195 (void)target;
196 return 0;
197}
Maksims Svecovs9ddf86a2021-05-06 17:17:21 +0100198
199bool plat_ffa_vm_managed_exit_supported(struct vm *vm)
200{
201 (void)vm;
202 return false;
203}
J-Alvesa0f317d2021-06-09 13:31:59 +0100204
205bool plat_ffa_is_notifications_create_valid(struct vcpu *current,
J-Alves19e20cf2023-08-02 12:48:55 +0100206 ffa_id_t vm_id)
J-Alvesa0f317d2021-06-09 13:31:59 +0100207{
208 (void)current;
209 (void)vm_id;
210
211 return false;
212}
213
J-Alvesaa79c012021-07-09 14:29:45 +0100214bool plat_ffa_is_notification_set_valid(struct vcpu *current,
J-Alves19e20cf2023-08-02 12:48:55 +0100215 ffa_id_t sender_id,
216 ffa_id_t receiver_id)
J-Alvesaa79c012021-07-09 14:29:45 +0100217{
218 (void)current;
219 (void)sender_id;
220 (void)receiver_id;
221 return false;
222}
223
224bool plat_ffa_is_notification_get_valid(struct vcpu *current,
J-Alves19e20cf2023-08-02 12:48:55 +0100225 ffa_id_t receiver_id, uint32_t flags)
J-Alvesaa79c012021-07-09 14:29:45 +0100226{
J-Alvesfc95a302022-04-22 14:18:23 +0100227 (void)flags;
J-Alvesaa79c012021-07-09 14:29:45 +0100228 (void)current;
229 (void)receiver_id;
230 return false;
231}
232
J-Alves98ff9562021-09-09 14:39:41 +0100233bool plat_ffa_notifications_get_from_sp(
234 struct vm_locked receiver_locked, ffa_vcpu_index_t vcpu_id,
J-Alvesfa782092021-10-13 16:02:16 +0100235 ffa_notifications_bitmap_t *from_sp, // NOLINT
236 struct ffa_value *ret) // NOLINT
J-Alves98ff9562021-09-09 14:39:41 +0100237{
238 (void)receiver_locked;
239 (void)vcpu_id;
240 (void)from_sp;
241 (void)ret;
242
243 return false;
244}
245
J-Alvesd605a092022-03-28 14:20:48 +0100246bool plat_ffa_notifications_get_framework_notifications(
247 struct vm_locked receiver_locked,
248 ffa_notifications_bitmap_t *from_fwk, // NOLINT
249 uint32_t flags, ffa_vcpu_index_t vcpu_id, struct ffa_value *ret)
250{
251 (void)receiver_locked;
252 (void)from_fwk;
253 (void)flags;
254 (void)vcpu_id;
255 (void)ret;
256
257 return false;
258}
259
J-Alves19e20cf2023-08-02 12:48:55 +0100260bool plat_ffa_notification_set_forward(ffa_id_t sender_vm_id,
261 ffa_id_t receiver_vm_id, uint32_t flags,
J-Alvesde7bd2f2021-09-09 19:54:35 +0100262 ffa_notifications_bitmap_t bitmap,
263 struct ffa_value *ret)
264{
265 (void)sender_vm_id;
266 (void)receiver_vm_id;
267 (void)flags;
268 (void)bitmap;
269 (void)ret;
270
271 return false;
272}
273
J-Alvesa0f317d2021-06-09 13:31:59 +0100274struct ffa_value plat_ffa_notifications_bitmap_create(
J-Alves19e20cf2023-08-02 12:48:55 +0100275 ffa_id_t vm_id, ffa_vcpu_count_t vcpu_count)
J-Alvesa0f317d2021-06-09 13:31:59 +0100276{
277 (void)vm_id;
278 (void)vcpu_count;
279
280 return ffa_error(FFA_NOT_SUPPORTED);
281}
282
J-Alves19e20cf2023-08-02 12:48:55 +0100283struct ffa_value plat_ffa_notifications_bitmap_destroy(ffa_id_t vm_id)
J-Alvesa0f317d2021-06-09 13:31:59 +0100284{
285 (void)vm_id;
286
287 return ffa_error(FFA_NOT_SUPPORTED);
288}
J-Alvesc003a7a2021-03-18 13:06:53 +0000289
J-Alves19e20cf2023-08-02 12:48:55 +0100290struct vm_locked plat_ffa_vm_find_locked(ffa_id_t vm_id)
J-Alvesc003a7a2021-03-18 13:06:53 +0000291{
292 (void)vm_id;
293 return (struct vm_locked){.vm = NULL};
294}
295
J-Alves19e20cf2023-08-02 12:48:55 +0100296struct vm_locked plat_ffa_vm_find_locked_create(ffa_id_t vm_id)
Federico Recanati8d8b1cf2022-04-14 13:16:00 +0200297{
298 (void)vm_id;
299 return (struct vm_locked){.vm = NULL};
300}
301
J-Alves19e20cf2023-08-02 12:48:55 +0100302bool plat_ffa_is_vm_id(ffa_id_t vm_id)
J-Alvesc003a7a2021-03-18 13:06:53 +0000303{
304 (void)vm_id;
305 return false;
306}
J-Alvesc8e8a222021-06-08 17:33:52 +0100307
J-Alvesfa782092021-10-13 16:02:16 +0100308bool plat_ffa_vm_notifications_info_get( // NOLINTNEXTLINE
309 uint16_t *ids, uint32_t *ids_count, // NOLINTNEXTLINE
310 uint32_t *lists_sizes, // NOLINTNEXTLINE
311 uint32_t *lists_count, const uint32_t ids_count_max)
J-Alvesc8e8a222021-06-08 17:33:52 +0100312{
313 (void)ids;
314 (void)ids_count;
315 (void)lists_sizes;
316 (void)lists_count;
317 (void)ids_count_max;
318
319 return false;
320}
Raghu Krishnamurthyea6d25f2021-09-14 15:27:06 -0700321
322bool plat_ffa_is_mem_perm_get_valid(const struct vcpu *current)
323{
324 (void)current;
325 return false;
326}
327
328bool plat_ffa_is_mem_perm_set_valid(const struct vcpu *current)
329{
330 (void)current;
331 return false;
332}
Madhukar Pappireddyb11e0d12021-08-02 19:44:35 -0500333
334/**
335 * Check if current VM can resume target VM/SP using FFA_RUN ABI.
336 */
Madhukar Pappireddybd10e572023-03-06 16:39:49 -0600337bool plat_ffa_run_checks(struct vcpu_locked current_locked,
J-Alves19e20cf2023-08-02 12:48:55 +0100338 ffa_id_t target_vm_id, ffa_vcpu_index_t vcpu_idx,
Madhukar Pappireddybd10e572023-03-06 16:39:49 -0600339 struct ffa_value *run_ret, struct vcpu **next)
Madhukar Pappireddyb11e0d12021-08-02 19:44:35 -0500340{
Madhukar Pappireddybd10e572023-03-06 16:39:49 -0600341 (void)current_locked;
Madhukar Pappireddyb11e0d12021-08-02 19:44:35 -0500342 (void)target_vm_id;
343 (void)run_ret;
344 (void)next;
Raghu Krishnamurthy048d63f2021-12-11 12:45:41 -0800345 (void)vcpu_idx;
Madhukar Pappireddyb11e0d12021-08-02 19:44:35 -0500346 return true;
347}
J-Alvesca058c22021-09-10 14:02:07 +0100348
349void plat_ffa_notification_info_get_forward( // NOLINTNEXTLINE
350 uint16_t *ids, uint32_t *ids_count, // NOLINTNEXTLINE
351 uint32_t *lists_sizes, uint32_t *lists_count,
352 const uint32_t ids_count_max)
353{
354 (void)ids;
355 (void)ids_count;
356 (void)lists_sizes;
357 (void)lists_count;
358 (void)ids_count_max;
359}
J-Alves13394022021-06-30 13:48:49 +0100360
361void plat_ffa_sri_state_set(enum plat_ffa_sri_state state)
362{
363 (void)state;
364}
365
366void plat_ffa_sri_trigger_if_delayed(struct cpu *cpu)
367{
368 (void)cpu;
369}
370
371void plat_ffa_sri_trigger_not_delayed(struct cpu *cpu)
372{
373 (void)cpu;
374}
375
J-Alves6e2abc62021-12-02 14:58:56 +0000376bool plat_ffa_inject_notification_pending_interrupt(
Madhukar Pappireddybd10e572023-03-06 16:39:49 -0600377 struct vcpu_locked target_locked, struct vcpu_locked current_locked,
J-Alves6e2abc62021-12-02 14:58:56 +0000378 struct vm_locked receiver_locked)
J-Alves7461ef22021-10-18 17:21:33 +0100379{
J-Alves6e2abc62021-12-02 14:58:56 +0000380 (void)target_locked;
Madhukar Pappireddybd10e572023-03-06 16:39:49 -0600381 (void)current_locked;
J-Alves6e2abc62021-12-02 14:58:56 +0000382 (void)receiver_locked;
383
384 return false;
J-Alves7461ef22021-10-18 17:21:33 +0100385}
Olivier Depreze562e542020-06-11 17:31:54 +0200386
Raghu Krishnamurthyef432cb2022-12-29 06:56:32 -0800387bool plat_ffa_partition_info_get_regs_forward( // NOLINTNEXTLINE
388 const struct ffa_uuid *uuid,
389 const uint16_t start_index, // NOLINTNEXTLINE
390 const uint16_t tag,
391 struct ffa_partition_info *partitions, // NOLINTNEXTLINE
392 uint16_t partitions_len, ffa_vm_count_t *ret_count)
393{
394 (void)uuid;
395 (void)start_index;
396 (void)tag;
397 (void)partitions;
398 (void)partitions_len;
399 (void)ret_count;
400 return true;
401}
402
Olivier Depreze562e542020-06-11 17:31:54 +0200403void plat_ffa_partition_info_get_forward( // NOLINTNEXTLINE
404 const struct ffa_uuid *uuid, // NOLINTNEXTLINE
Daniel Boulbyb46cad12021-12-13 17:47:21 +0000405 const uint32_t flags, // NOLINTNEXTLINE
Olivier Depreze562e542020-06-11 17:31:54 +0200406 struct ffa_partition_info *partitions, ffa_vm_count_t *ret_count)
407{
408 (void)uuid;
Daniel Boulbyb46cad12021-12-13 17:47:21 +0000409 (void)flags;
Olivier Depreze562e542020-06-11 17:31:54 +0200410 (void)partitions;
411 (void)ret_count;
412}
Olivier Deprezd614d322021-06-18 15:21:00 +0200413
414bool plat_ffa_is_secondary_ep_register_supported(void)
415{
416 return false;
417}
Madhukar Pappireddydd883202022-10-24 16:49:28 -0500418
Madhukar Pappireddybd10e572023-03-06 16:39:49 -0600419struct ffa_value plat_ffa_msg_wait_prepare(struct vcpu_locked current_locked,
Madhukar Pappireddydd883202022-10-24 16:49:28 -0500420 struct vcpu **next)
Madhukar Pappireddy5522c672021-12-17 16:35:51 -0600421{
Madhukar Pappireddybd10e572023-03-06 16:39:49 -0600422 (void)current_locked;
Madhukar Pappireddy5522c672021-12-17 16:35:51 -0600423 (void)next;
Madhukar Pappireddy5522c672021-12-17 16:35:51 -0600424
Madhukar Pappireddydd883202022-10-24 16:49:28 -0500425 return (struct ffa_value){.func = FFA_INTERRUPT_32};
Madhukar Pappireddy5522c672021-12-17 16:35:51 -0600426}
Madhukar Pappireddy0ea239a2022-06-21 17:26:57 -0500427
Madhukar Pappireddybd10e572023-03-06 16:39:49 -0600428bool plat_ffa_check_runtime_state_transition(struct vcpu_locked current_locked,
J-Alves19e20cf2023-08-02 12:48:55 +0100429 ffa_id_t vm_id,
430 ffa_id_t receiver_vm_id,
Madhukar Pappireddybd10e572023-03-06 16:39:49 -0600431 struct vcpu_locked receiver_locked,
Madhukar Pappireddy0ea239a2022-06-21 17:26:57 -0500432 uint32_t func, // NOLINTNEXTLINE
433 enum vcpu_state *next_state)
434{
435 /* Perform state transition checks only for Secure Partitions. */
Madhukar Pappireddybd10e572023-03-06 16:39:49 -0600436 (void)current_locked;
Madhukar Pappireddy0ea239a2022-06-21 17:26:57 -0500437 (void)vm_id;
438 (void)receiver_vm_id;
Madhukar Pappireddybd10e572023-03-06 16:39:49 -0600439 (void)receiver_locked;
Madhukar Pappireddy0ea239a2022-06-21 17:26:57 -0500440 (void)func;
441 (void)next_state;
442
443 return true;
444}
Madhukar Pappireddy49fe6702022-06-21 17:52:23 -0500445
Madhukar Pappireddybd10e572023-03-06 16:39:49 -0600446void plat_ffa_init_schedule_mode_ffa_run(struct vcpu_locked current_locked,
Madhukar Pappireddy1480fce2022-06-21 18:09:25 -0500447 struct vcpu_locked target_locked)
448{
449 /* Scheduling mode not supported in the Hypervisor/VMs. */
Madhukar Pappireddybd10e572023-03-06 16:39:49 -0600450 (void)current_locked;
Madhukar Pappireddy1480fce2022-06-21 18:09:25 -0500451 (void)target_locked;
452}
453
Madhukar Pappireddy49fe6702022-06-21 17:52:23 -0500454void plat_ffa_wind_call_chain_ffa_direct_req(
455 struct vcpu_locked current_locked,
J-Alves19e20cf2023-08-02 12:48:55 +0100456 struct vcpu_locked receiver_vcpu_locked, ffa_id_t sender_vm_id)
Madhukar Pappireddy49fe6702022-06-21 17:52:23 -0500457{
458 /* Calls chains not supported in the Hypervisor/VMs. */
459 (void)current_locked;
460 (void)receiver_vcpu_locked;
Raghu Krishnamurthya9ccf122023-03-27 20:42:01 -0700461 (void)sender_vm_id;
Madhukar Pappireddy49fe6702022-06-21 17:52:23 -0500462}
Madhukar Pappireddyc0fb87e2022-06-21 17:59:15 -0500463
Madhukar Pappireddybd10e572023-03-06 16:39:49 -0600464void plat_ffa_unwind_call_chain_ffa_direct_resp(
465 struct vcpu_locked current_locked, struct vcpu_locked next_locked)
Madhukar Pappireddyc0fb87e2022-06-21 17:59:15 -0500466{
467 /* Calls chains not supported in the Hypervisor/VMs. */
Madhukar Pappireddybd10e572023-03-06 16:39:49 -0600468 (void)current_locked;
469 (void)next_locked;
Madhukar Pappireddyc0fb87e2022-06-21 17:59:15 -0500470}
Madhukar Pappireddy046dad02022-06-21 18:43:33 -0500471
J-Alves19e20cf2023-08-02 12:48:55 +0100472bool plat_ffa_is_spmd_lp_id(ffa_id_t vm_id)
Raghu Krishnamurthya9ccf122023-03-27 20:42:01 -0700473{
474 (void)vm_id;
475 return false;
476}
477
Madhukar Pappireddy2f76e492022-09-06 15:21:59 -0500478bool plat_ffa_intercept_direct_response(struct vcpu_locked current_locked,
479 struct vcpu **next,
480 struct ffa_value to_ret,
481 struct ffa_value *signal_interrupt)
482{
483 /*
484 * Only applicable to SPMC as it signals virtual secure interrupt to
485 * S-EL0 partitions.
486 */
487 (void)current_locked;
488 (void)next;
489 (void)to_ret;
490 (void)signal_interrupt;
491
492 return false;
493}
494
Madhukar Pappireddy486360d2022-09-06 15:32:24 -0500495void plat_ffa_enable_virtual_interrupts(struct vcpu_locked current_locked,
496 struct vm_locked vm_locked)
Madhukar Pappireddy046dad02022-06-21 18:43:33 -0500497{
498 (void)current_locked;
Madhukar Pappireddy486360d2022-09-06 15:32:24 -0500499 (void)vm_locked;
Madhukar Pappireddy046dad02022-06-21 18:43:33 -0500500}
J-Alves66652252022-07-06 09:49:51 +0100501
Madhukar Pappireddybd10e572023-03-06 16:39:49 -0600502bool plat_ffa_is_direct_response_interrupted(struct vcpu_locked current_locked)
Madhukar Pappireddy5fd32482022-01-07 14:53:26 -0600503{
Madhukar Pappireddybd10e572023-03-06 16:39:49 -0600504 (void)current_locked;
Madhukar Pappireddy5fd32482022-01-07 14:53:26 -0600505 return false;
506}
507
J-Alves66652252022-07-06 09:49:51 +0100508struct ffa_value plat_ffa_other_world_mem_send(
509 struct vm *from, uint32_t share_func,
510 struct ffa_memory_region **memory_region, uint32_t length,
511 uint32_t fragment_length, struct mpool *page_pool)
512{
513 (void)from;
514 (void)memory_region;
515 (void)length;
516 (void)fragment_length;
517 (void)page_pool;
518 (void)share_func;
519
520 return (struct ffa_value){0};
521}
J-Alvesfc19b372022-07-06 12:17:35 +0100522
523struct ffa_value plat_ffa_other_world_mem_reclaim(
524 struct vm *to, ffa_memory_handle_t handle,
525 ffa_memory_region_flags_t flags, struct mpool *page_pool)
526{
527 (void)handle;
528 (void)flags;
529 (void)page_pool;
530 (void)to;
531
532 return ffa_error(FFA_INVALID_PARAMETERS);
533}
J-Alvesb5084cf2022-07-06 14:20:12 +0100534
535struct ffa_value plat_ffa_other_world_mem_retrieve(
536 struct vm_locked to_locked, struct ffa_memory_region *retrieve_request,
537 uint32_t length, struct mpool *page_pool)
538{
539 (void)to_locked;
540 (void)retrieve_request;
541 (void)length;
542 (void)page_pool;
543
544 return ffa_error(FFA_INVALID_PARAMETERS);
545}
J-Alvesfdd29272022-07-19 13:16:31 +0100546
547struct ffa_value plat_ffa_other_world_mem_send_continue(
548 struct vm *from, void *fragment, uint32_t fragment_length,
549 ffa_memory_handle_t handle, struct mpool *page_pool)
550{
551 (void)from;
552 (void)fragment;
553 (void)fragment_length;
554 (void)handle;
555 (void)page_pool;
556
557 return ffa_error(FFA_INVALID_PARAMETERS);
558}
J-Alves27b71962022-12-12 15:29:58 +0000559
J-Alves19e20cf2023-08-02 12:48:55 +0100560struct ffa_value plat_ffa_msg_send(ffa_id_t sender_vm_id,
561 ffa_id_t receiver_vm_id, uint32_t size,
J-Alves27b71962022-12-12 15:29:58 +0000562 struct vcpu *current, struct vcpu **next)
563{
564 (void)sender_vm_id;
565 (void)receiver_vm_id;
566 (void)size;
567 (void)current;
568 (void)next;
569
570 return ffa_error(FFA_NOT_SUPPORTED);
571}
Madhukar Pappireddy1f2f2132023-02-14 17:48:44 -0600572
Madhukar Pappireddybd10e572023-03-06 16:39:49 -0600573struct ffa_value plat_ffa_yield_prepare(struct vcpu_locked current_locked,
Madhukar Pappireddy184501c2023-05-23 17:24:06 -0500574 struct vcpu **next,
575 uint32_t timeout_low,
576 uint32_t timeout_high)
Madhukar Pappireddy1f2f2132023-02-14 17:48:44 -0600577{
Madhukar Pappireddybd10e572023-03-06 16:39:49 -0600578 (void)current_locked;
Madhukar Pappireddyb3fb8712023-05-23 17:10:34 -0500579 (void)next;
Madhukar Pappireddy184501c2023-05-23 17:24:06 -0500580 (void)timeout_low;
581 (void)timeout_high;
Madhukar Pappireddyb3fb8712023-05-23 17:10:34 -0500582
583 return ffa_error(FFA_NOT_SUPPORTED);
Madhukar Pappireddy1f2f2132023-02-14 17:48:44 -0600584}
Olivier Deprezd9d409f2023-03-17 11:47:57 +0100585
586bool arch_vm_init_mm(struct vm *vm, struct mpool *ppool)
587{
588 (void)vm;
589 (void)ppool;
590
591 return true;
592}
593
594bool arch_vm_identity_prepare(struct vm_locked vm_locked, paddr_t begin,
595 paddr_t end, uint32_t mode, struct mpool *ppool)
596{
597 (void)vm_locked;
598 (void)begin;
599 (void)end;
600 (void)mode;
601 (void)ppool;
602
603 return true;
604}
605
606void arch_vm_identity_commit(struct vm_locked vm_locked, paddr_t begin,
607 paddr_t end, uint32_t mode, struct mpool *ppool,
608 ipaddr_t *ipa)
609{
610 (void)vm_locked;
611 (void)begin;
612 (void)end;
613 (void)mode;
614 (void)ppool;
615 (void)ipa;
616}
617
618bool arch_vm_unmap(struct vm_locked vm_locked, paddr_t begin, paddr_t end,
619 struct mpool *ppool)
620{
621 (void)vm_locked;
622 (void)begin;
623 (void)end;
624 (void)ppool;
625
626 return true;
627}
628
629void arch_vm_ptable_defrag(struct vm_locked vm_locked, struct mpool *ppool)
630{
631 (void)vm_locked;
632 (void)ppool;
633}
634
635bool arch_vm_mem_get_mode(struct vm_locked vm_locked, ipaddr_t begin,
636 ipaddr_t end, uint32_t *mode) // NOLINT
637{
638 (void)vm_locked;
639 (void)begin;
640 (void)end;
641 (void)mode;
642
643 return true;
644}
Olivier Deprez878bd5b2021-04-15 19:05:10 +0200645
646ffa_memory_attributes_t plat_ffa_memory_security_mode(
647 ffa_memory_attributes_t attributes, uint32_t mode)
648{
649 (void)mode;
650
651 return attributes;
652}
Kathleen Capella6ab05132023-05-10 12:27:35 -0400653
654struct ffa_value plat_ffa_error_32(struct vcpu *current, struct vcpu **next,
655 uint32_t error_code)
656{
657 (void)current;
658 (void)next;
659 (void)error_code;
J-Alves2ced1672022-12-12 14:35:38 +0000660
661 return ffa_error(FFA_NOT_SUPPORTED);
662}
663
J-Alves19e20cf2023-08-02 12:48:55 +0100664int64_t plat_ffa_mailbox_waiter_get(ffa_id_t vm_id, const struct vcpu *current)
J-Alves2ced1672022-12-12 14:35:38 +0000665{
J-Alvesbc7ab4f2022-12-13 12:09:25 +0000666 (void)vm_id;
667 (void)current;
J-Alves2ced1672022-12-12 14:35:38 +0000668
J-Alvesbc7ab4f2022-12-13 12:09:25 +0000669 return -1;
670}
671
672int64_t plat_ffa_mailbox_writable_get(const struct vcpu *current)
673{
674 (void)current;
675
676 return -1;
Kathleen Capella6ab05132023-05-10 12:27:35 -0400677}
Raghu Krishnamurthye74d6532023-06-07 12:21:54 -0700678
679bool plat_ffa_partition_info_get_regs_forward_allowed(void)
680{
681 return false;
682}