blob: 9ddef6df35966d5c17b6360b61d5235dea346f47 [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
J-Alves19e20cf2023-08-02 12:48:55 +010017ffa_id_t arch_ffa_spmc_id_get(void)
Daniel Boulbyb2fb80e2021-02-03 15:09:23 +000018{
19 return HF_SPMC_VM_ID;
20}
Olivier Deprez55a189e2021-06-09 15:45:27 +020021
22void plat_ffa_log_init(void)
23{
24}
25
J-Alvesc9227c82024-04-24 21:00:58 +010026bool plat_ffa_is_memory_send_valid(ffa_id_t receiver, ffa_id_t sender,
27 uint32_t share_func, bool multiple_borrower)
Maksims Svecovsa3d570c2021-12-08 11:16:32 +000028{
Maksims Svecovsa3d570c2021-12-08 11:16:32 +000029 (void)share_func;
J-Alvesc9227c82024-04-24 21:00:58 +010030 (void)receiver;
31 (void)sender;
32 (void)multiple_borrower;
Maksims Svecovsa3d570c2021-12-08 11:16:32 +000033
34 return true;
35}
36
Olivier Deprez55a189e2021-06-09 15:45:27 +020037bool plat_ffa_is_direct_request_valid(struct vcpu *current,
J-Alves19e20cf2023-08-02 12:48:55 +010038 ffa_id_t sender_vm_id,
39 ffa_id_t receiver_vm_id)
Olivier Deprez55a189e2021-06-09 15:45:27 +020040{
41 (void)current;
42 (void)sender_vm_id;
43 (void)receiver_vm_id;
44
45 return true;
46}
47
J-Alves439ac972021-11-18 17:32:03 +000048bool plat_ffa_is_direct_request_supported(struct vm *sender_vm,
Kathleen Capella41fea932023-06-23 17:39:28 -040049 struct vm *receiver_vm, uint32_t func)
J-Alves439ac972021-11-18 17:32:03 +000050{
51 (void)sender_vm;
52 (void)receiver_vm;
Kathleen Capella41fea932023-06-23 17:39:28 -040053 (void)func;
J-Alves439ac972021-11-18 17:32:03 +000054
55 return false;
56}
57
Olivier Deprez55a189e2021-06-09 15:45:27 +020058bool plat_ffa_is_direct_response_valid(struct vcpu *current,
J-Alves19e20cf2023-08-02 12:48:55 +010059 ffa_id_t sender_vm_id,
60 ffa_id_t receiver_vm_id)
Olivier Deprez55a189e2021-06-09 15:45:27 +020061{
62 (void)current;
63 (void)sender_vm_id;
64 (void)receiver_vm_id;
65
66 return true;
67}
68
J-Alves19e20cf2023-08-02 12:48:55 +010069bool plat_ffa_run_forward(ffa_id_t vm_id, ffa_vcpu_index_t vcpu_idx,
Raghu Krishnamurthy62f97a72021-07-27 02:14:59 -070070 struct ffa_value *ret)
71{
72 (void)vm_id;
73 (void)vcpu_idx;
74 (void)ret;
75
76 return false;
77}
78
Federico Recanati10bd06c2022-02-23 17:32:59 +010079void plat_ffa_vm_destroy(struct vm_locked to_destroy_locked)
80{
81 (void)to_destroy_locked;
82}
83
J-Alves70079932022-12-07 17:32:20 +000084void plat_ffa_rxtx_unmap_forward(struct vm_locked vm_locked)
Federico Recanati8da9e332022-02-10 11:00:17 +010085{
J-Alves70079932022-12-07 17:32:20 +000086 (void)vm_locked;
Federico Recanati8da9e332022-02-10 11:00:17 +010087}
88
J-Alves19e20cf2023-08-02 12:48:55 +010089bool plat_ffa_direct_request_forward(ffa_id_t receiver_vm_id,
Olivier Deprez55a189e2021-06-09 15:45:27 +020090 struct ffa_value args,
91 struct ffa_value *ret)
92{
93 (void)receiver_vm_id;
94 (void)args;
95 (void)ret;
96 return false;
97}
98
Federico Recanati7bef0b92022-03-17 14:56:22 +010099bool plat_ffa_rx_release_forward(struct vm_locked vm_locked,
100 struct ffa_value *ret)
101{
102 (void)vm_locked;
103 (void)ret;
104
105 return false;
106}
107
Federico Recanati644f0462022-03-17 12:04:00 +0100108bool plat_ffa_acquire_receiver_rx(struct vm_locked to_locked,
109 struct ffa_value *ret)
110{
111 (void)to_locked;
112 (void)ret;
113
114 return false;
115}
116
Federico Recanati25053ee2022-03-14 15:01:53 +0100117bool plat_ffa_is_indirect_msg_supported(struct vm_locked sender_locked,
118 struct vm_locked receiver_locked)
119{
120 (void)sender_locked;
121 (void)receiver_locked;
122
123 return false;
124}
125
J-Alves19e20cf2023-08-02 12:48:55 +0100126bool plat_ffa_msg_send2_forward(ffa_id_t receiver_vm_id, ffa_id_t sender_vm_id,
127 struct ffa_value *ret)
Federico Recanati25053ee2022-03-14 15:01:53 +0100128{
129 (void)receiver_vm_id;
130 (void)sender_vm_id;
131 (void)ret;
132
133 return false;
134}
135
Olivier Deprez55a189e2021-06-09 15:45:27 +0200136ffa_memory_handle_t plat_ffa_memory_handle_make(uint64_t index)
137{
138 return index;
139}
140
141bool plat_ffa_memory_handle_allocated_by_current_world(
142 ffa_memory_handle_t handle)
143{
144 (void)handle;
145 return false;
146}
Maksims Svecovsb596eab2021-04-27 00:52:27 +0100147
J-Alves7db32002021-12-14 14:44:50 +0000148uint32_t plat_ffa_other_world_mode(void)
149{
150 return 0U;
151}
152
J-Alvesc003a7a2021-03-18 13:06:53 +0000153bool plat_ffa_is_notifications_bind_valid(struct vcpu *current,
J-Alves19e20cf2023-08-02 12:48:55 +0100154 ffa_id_t sender_id,
155 ffa_id_t receiver_id)
J-Alvesc003a7a2021-03-18 13:06:53 +0000156{
157 (void)current;
158 (void)sender_id;
159 (void)receiver_id;
160 return false;
161}
162
J-Alvesb15e9402021-09-08 11:44:42 +0100163bool plat_ffa_notifications_update_bindings_forward(
J-Alves19e20cf2023-08-02 12:48:55 +0100164 ffa_id_t receiver_id, ffa_id_t sender_id, uint32_t flags,
J-Alvesb15e9402021-09-08 11:44:42 +0100165 ffa_notifications_bitmap_t bitmap, bool is_bind, struct ffa_value *ret)
166{
167 (void)ret;
168 (void)receiver_id;
169 (void)sender_id;
170 (void)flags;
171 (void)bitmap;
172 (void)is_bind;
173 (void)ret;
174
175 return false;
176}
177
Federico Recanati8d8b1cf2022-04-14 13:16:00 +0200178void plat_ffa_rxtx_map_forward(struct vm_locked vm_locked)
179{
180 (void)vm_locked;
181}
182
Maksims Svecovsb596eab2021-04-27 00:52:27 +0100183ffa_partition_properties_t plat_ffa_partition_properties(
J-Alves19e20cf2023-08-02 12:48:55 +0100184 ffa_id_t vm_id, const struct vm *target)
Maksims Svecovsb596eab2021-04-27 00:52:27 +0100185{
J-Alvesfa782092021-10-13 16:02:16 +0100186 (void)vm_id;
Maksims Svecovsb596eab2021-04-27 00:52:27 +0100187 (void)target;
188 return 0;
189}
Maksims Svecovs9ddf86a2021-05-06 17:17:21 +0100190
191bool plat_ffa_vm_managed_exit_supported(struct vm *vm)
192{
193 (void)vm;
194 return false;
195}
J-Alvesa0f317d2021-06-09 13:31:59 +0100196
J-Alves7ccaccf2024-02-01 14:25:23 +0000197/**
198 * Check validity of the calls:
199 * FFA_NOTIFICATION_BITMAP_CREATE/FFA_NOTIFICATION_BITMAP_DESTROY.
200 */
201struct ffa_value plat_ffa_is_notifications_bitmap_access_valid(
202 struct vcpu *current, ffa_id_t vm_id)
J-Alvesa0f317d2021-06-09 13:31:59 +0100203{
J-Alves7ccaccf2024-02-01 14:25:23 +0000204 /*
205 * Call should only be used by the Hypervisor, so any attempt of
206 * invocation from NWd FF-A endpoints should fail.
207 */
J-Alvesa0f317d2021-06-09 13:31:59 +0100208 (void)current;
209 (void)vm_id;
210
J-Alves7ccaccf2024-02-01 14:25:23 +0000211 return ffa_error(FFA_NOT_SUPPORTED);
J-Alvesa0f317d2021-06-09 13:31:59 +0100212}
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-Alvesfa782092021-10-13 16:02:16 +0100302bool plat_ffa_vm_notifications_info_get( // NOLINTNEXTLINE
303 uint16_t *ids, uint32_t *ids_count, // NOLINTNEXTLINE
304 uint32_t *lists_sizes, // NOLINTNEXTLINE
305 uint32_t *lists_count, const uint32_t ids_count_max)
J-Alvesc8e8a222021-06-08 17:33:52 +0100306{
307 (void)ids;
308 (void)ids_count;
309 (void)lists_sizes;
310 (void)lists_count;
311 (void)ids_count_max;
312
313 return false;
314}
Raghu Krishnamurthyea6d25f2021-09-14 15:27:06 -0700315
316bool plat_ffa_is_mem_perm_get_valid(const struct vcpu *current)
317{
318 (void)current;
319 return false;
320}
321
322bool plat_ffa_is_mem_perm_set_valid(const struct vcpu *current)
323{
324 (void)current;
325 return false;
326}
Madhukar Pappireddyb11e0d12021-08-02 19:44:35 -0500327
328/**
329 * Check if current VM can resume target VM/SP using FFA_RUN ABI.
330 */
Madhukar Pappireddybd10e572023-03-06 16:39:49 -0600331bool plat_ffa_run_checks(struct vcpu_locked current_locked,
J-Alves19e20cf2023-08-02 12:48:55 +0100332 ffa_id_t target_vm_id, ffa_vcpu_index_t vcpu_idx,
Madhukar Pappireddybd10e572023-03-06 16:39:49 -0600333 struct ffa_value *run_ret, struct vcpu **next)
Madhukar Pappireddyb11e0d12021-08-02 19:44:35 -0500334{
Madhukar Pappireddybd10e572023-03-06 16:39:49 -0600335 (void)current_locked;
Madhukar Pappireddyb11e0d12021-08-02 19:44:35 -0500336 (void)target_vm_id;
337 (void)run_ret;
338 (void)next;
Raghu Krishnamurthy048d63f2021-12-11 12:45:41 -0800339 (void)vcpu_idx;
Madhukar Pappireddyb11e0d12021-08-02 19:44:35 -0500340 return true;
341}
J-Alvesca058c22021-09-10 14:02:07 +0100342
343void plat_ffa_notification_info_get_forward( // NOLINTNEXTLINE
344 uint16_t *ids, uint32_t *ids_count, // NOLINTNEXTLINE
345 uint32_t *lists_sizes, uint32_t *lists_count,
346 const uint32_t ids_count_max)
347{
348 (void)ids;
349 (void)ids_count;
350 (void)lists_sizes;
351 (void)lists_count;
352 (void)ids_count_max;
353}
J-Alves13394022021-06-30 13:48:49 +0100354
J-Alves13394022021-06-30 13:48:49 +0100355void 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-Alvesea8ccfe2024-10-09 11:47:24 +0100365void plat_ffa_sri_set_delayed(struct cpu *cpu)
366{
367 (void)cpu;
368}
369
J-Alves6e2abc62021-12-02 14:58:56 +0000370bool plat_ffa_inject_notification_pending_interrupt(
Madhukar Pappireddybd10e572023-03-06 16:39:49 -0600371 struct vcpu_locked target_locked, struct vcpu_locked current_locked,
J-Alves6e2abc62021-12-02 14:58:56 +0000372 struct vm_locked receiver_locked)
J-Alves7461ef22021-10-18 17:21:33 +0100373{
J-Alves6e2abc62021-12-02 14:58:56 +0000374 (void)target_locked;
Madhukar Pappireddybd10e572023-03-06 16:39:49 -0600375 (void)current_locked;
J-Alves6e2abc62021-12-02 14:58:56 +0000376 (void)receiver_locked;
377
378 return false;
J-Alves7461ef22021-10-18 17:21:33 +0100379}
Olivier Depreze562e542020-06-11 17:31:54 +0200380
Raghu Krishnamurthyef432cb2022-12-29 06:56:32 -0800381bool plat_ffa_partition_info_get_regs_forward( // NOLINTNEXTLINE
382 const struct ffa_uuid *uuid,
383 const uint16_t start_index, // NOLINTNEXTLINE
384 const uint16_t tag,
385 struct ffa_partition_info *partitions, // NOLINTNEXTLINE
386 uint16_t partitions_len, ffa_vm_count_t *ret_count)
387{
388 (void)uuid;
389 (void)start_index;
390 (void)tag;
391 (void)partitions;
392 (void)partitions_len;
393 (void)ret_count;
394 return true;
395}
396
Olivier Depreze562e542020-06-11 17:31:54 +0200397void plat_ffa_partition_info_get_forward( // NOLINTNEXTLINE
398 const struct ffa_uuid *uuid, // NOLINTNEXTLINE
Daniel Boulbyb46cad12021-12-13 17:47:21 +0000399 const uint32_t flags, // NOLINTNEXTLINE
Olivier Depreze562e542020-06-11 17:31:54 +0200400 struct ffa_partition_info *partitions, ffa_vm_count_t *ret_count)
401{
402 (void)uuid;
Daniel Boulbyb46cad12021-12-13 17:47:21 +0000403 (void)flags;
Olivier Depreze562e542020-06-11 17:31:54 +0200404 (void)partitions;
405 (void)ret_count;
406}
Olivier Deprezd614d322021-06-18 15:21:00 +0200407
408bool plat_ffa_is_secondary_ep_register_supported(void)
409{
410 return false;
411}
Madhukar Pappireddydd883202022-10-24 16:49:28 -0500412
Madhukar Pappireddybd10e572023-03-06 16:39:49 -0600413struct ffa_value plat_ffa_msg_wait_prepare(struct vcpu_locked current_locked,
Madhukar Pappireddydd883202022-10-24 16:49:28 -0500414 struct vcpu **next)
Madhukar Pappireddy5522c672021-12-17 16:35:51 -0600415{
Madhukar Pappireddybd10e572023-03-06 16:39:49 -0600416 (void)current_locked;
Madhukar Pappireddy5522c672021-12-17 16:35:51 -0600417 (void)next;
Madhukar Pappireddy5522c672021-12-17 16:35:51 -0600418
Madhukar Pappireddydd883202022-10-24 16:49:28 -0500419 return (struct ffa_value){.func = FFA_INTERRUPT_32};
Madhukar Pappireddy5522c672021-12-17 16:35:51 -0600420}
Madhukar Pappireddy0ea239a2022-06-21 17:26:57 -0500421
Madhukar Pappireddybd10e572023-03-06 16:39:49 -0600422bool plat_ffa_check_runtime_state_transition(struct vcpu_locked current_locked,
J-Alves19e20cf2023-08-02 12:48:55 +0100423 ffa_id_t vm_id,
424 ffa_id_t receiver_vm_id,
Madhukar Pappireddybd10e572023-03-06 16:39:49 -0600425 struct vcpu_locked receiver_locked,
Madhukar Pappireddy0ea239a2022-06-21 17:26:57 -0500426 uint32_t func, // NOLINTNEXTLINE
427 enum vcpu_state *next_state)
428{
429 /* Perform state transition checks only for Secure Partitions. */
Madhukar Pappireddybd10e572023-03-06 16:39:49 -0600430 (void)current_locked;
Madhukar Pappireddy0ea239a2022-06-21 17:26:57 -0500431 (void)vm_id;
432 (void)receiver_vm_id;
Madhukar Pappireddybd10e572023-03-06 16:39:49 -0600433 (void)receiver_locked;
Madhukar Pappireddy0ea239a2022-06-21 17:26:57 -0500434 (void)func;
435 (void)next_state;
436
437 return true;
438}
Madhukar Pappireddy49fe6702022-06-21 17:52:23 -0500439
Madhukar Pappireddybd10e572023-03-06 16:39:49 -0600440void plat_ffa_init_schedule_mode_ffa_run(struct vcpu_locked current_locked,
Madhukar Pappireddy1480fce2022-06-21 18:09:25 -0500441 struct vcpu_locked target_locked)
442{
443 /* Scheduling mode not supported in the Hypervisor/VMs. */
Madhukar Pappireddybd10e572023-03-06 16:39:49 -0600444 (void)current_locked;
Madhukar Pappireddy1480fce2022-06-21 18:09:25 -0500445 (void)target_locked;
446}
447
Madhukar Pappireddy49fe6702022-06-21 17:52:23 -0500448void plat_ffa_wind_call_chain_ffa_direct_req(
449 struct vcpu_locked current_locked,
J-Alves19e20cf2023-08-02 12:48:55 +0100450 struct vcpu_locked receiver_vcpu_locked, ffa_id_t sender_vm_id)
Madhukar Pappireddy49fe6702022-06-21 17:52:23 -0500451{
452 /* Calls chains not supported in the Hypervisor/VMs. */
453 (void)current_locked;
454 (void)receiver_vcpu_locked;
Raghu Krishnamurthya9ccf122023-03-27 20:42:01 -0700455 (void)sender_vm_id;
Madhukar Pappireddy49fe6702022-06-21 17:52:23 -0500456}
Madhukar Pappireddyc0fb87e2022-06-21 17:59:15 -0500457
Madhukar Pappireddybd10e572023-03-06 16:39:49 -0600458void plat_ffa_unwind_call_chain_ffa_direct_resp(
459 struct vcpu_locked current_locked, struct vcpu_locked next_locked)
Madhukar Pappireddyc0fb87e2022-06-21 17:59:15 -0500460{
461 /* Calls chains not supported in the Hypervisor/VMs. */
Madhukar Pappireddybd10e572023-03-06 16:39:49 -0600462 (void)current_locked;
463 (void)next_locked;
Madhukar Pappireddyc0fb87e2022-06-21 17:59:15 -0500464}
Madhukar Pappireddy046dad02022-06-21 18:43:33 -0500465
J-Alves19e20cf2023-08-02 12:48:55 +0100466bool plat_ffa_is_spmd_lp_id(ffa_id_t vm_id)
Raghu Krishnamurthya9ccf122023-03-27 20:42:01 -0700467{
468 (void)vm_id;
469 return false;
470}
471
Madhukar Pappireddy486360d2022-09-06 15:32:24 -0500472void plat_ffa_enable_virtual_interrupts(struct vcpu_locked current_locked,
473 struct vm_locked vm_locked)
Madhukar Pappireddy046dad02022-06-21 18:43:33 -0500474{
475 (void)current_locked;
Madhukar Pappireddy486360d2022-09-06 15:32:24 -0500476 (void)vm_locked;
Madhukar Pappireddy046dad02022-06-21 18:43:33 -0500477}
J-Alves66652252022-07-06 09:49:51 +0100478
479struct ffa_value plat_ffa_other_world_mem_send(
480 struct vm *from, uint32_t share_func,
481 struct ffa_memory_region **memory_region, uint32_t length,
482 uint32_t fragment_length, struct mpool *page_pool)
483{
484 (void)from;
485 (void)memory_region;
486 (void)length;
487 (void)fragment_length;
488 (void)page_pool;
489 (void)share_func;
490
491 return (struct ffa_value){0};
492}
J-Alvesfc19b372022-07-06 12:17:35 +0100493
494struct ffa_value plat_ffa_other_world_mem_reclaim(
495 struct vm *to, ffa_memory_handle_t handle,
496 ffa_memory_region_flags_t flags, struct mpool *page_pool)
497{
498 (void)handle;
499 (void)flags;
500 (void)page_pool;
501 (void)to;
502
503 return ffa_error(FFA_INVALID_PARAMETERS);
504}
J-Alvesb5084cf2022-07-06 14:20:12 +0100505
J-Alvesfdd29272022-07-19 13:16:31 +0100506struct ffa_value plat_ffa_other_world_mem_send_continue(
507 struct vm *from, void *fragment, uint32_t fragment_length,
508 ffa_memory_handle_t handle, struct mpool *page_pool)
509{
510 (void)from;
511 (void)fragment;
512 (void)fragment_length;
513 (void)handle;
514 (void)page_pool;
515
516 return ffa_error(FFA_INVALID_PARAMETERS);
517}
J-Alves27b71962022-12-12 15:29:58 +0000518
J-Alves19e20cf2023-08-02 12:48:55 +0100519struct ffa_value plat_ffa_msg_send(ffa_id_t sender_vm_id,
520 ffa_id_t receiver_vm_id, uint32_t size,
J-Alves27b71962022-12-12 15:29:58 +0000521 struct vcpu *current, struct vcpu **next)
522{
523 (void)sender_vm_id;
524 (void)receiver_vm_id;
525 (void)size;
526 (void)current;
527 (void)next;
528
529 return ffa_error(FFA_NOT_SUPPORTED);
530}
Madhukar Pappireddy1f2f2132023-02-14 17:48:44 -0600531
Madhukar Pappireddybd10e572023-03-06 16:39:49 -0600532struct ffa_value plat_ffa_yield_prepare(struct vcpu_locked current_locked,
Madhukar Pappireddy184501c2023-05-23 17:24:06 -0500533 struct vcpu **next,
534 uint32_t timeout_low,
535 uint32_t timeout_high)
Madhukar Pappireddy1f2f2132023-02-14 17:48:44 -0600536{
Madhukar Pappireddybd10e572023-03-06 16:39:49 -0600537 (void)current_locked;
Madhukar Pappireddyb3fb8712023-05-23 17:10:34 -0500538 (void)next;
Madhukar Pappireddy184501c2023-05-23 17:24:06 -0500539 (void)timeout_low;
540 (void)timeout_high;
Madhukar Pappireddyb3fb8712023-05-23 17:10:34 -0500541
542 return ffa_error(FFA_NOT_SUPPORTED);
Madhukar Pappireddy1f2f2132023-02-14 17:48:44 -0600543}
Olivier Deprezd9d409f2023-03-17 11:47:57 +0100544
545bool arch_vm_init_mm(struct vm *vm, struct mpool *ppool)
546{
547 (void)vm;
548 (void)ppool;
549
550 return true;
551}
552
Madhukar Pappireddy070f49e2024-01-12 13:02:27 -0600553bool arch_vm_iommu_init_mm(struct vm *vm, struct mpool *ppool)
554{
555 (void)vm;
556 (void)ppool;
557
558 return true;
559}
560
Olivier Deprezd9d409f2023-03-17 11:47:57 +0100561bool arch_vm_identity_prepare(struct vm_locked vm_locked, paddr_t begin,
562 paddr_t end, uint32_t mode, struct mpool *ppool)
563{
564 (void)vm_locked;
565 (void)begin;
566 (void)end;
567 (void)mode;
568 (void)ppool;
569
570 return true;
571}
572
573void arch_vm_identity_commit(struct vm_locked vm_locked, paddr_t begin,
574 paddr_t end, uint32_t mode, struct mpool *ppool,
575 ipaddr_t *ipa)
576{
577 (void)vm_locked;
578 (void)begin;
579 (void)end;
580 (void)mode;
581 (void)ppool;
582 (void)ipa;
583}
584
585bool arch_vm_unmap(struct vm_locked vm_locked, paddr_t begin, paddr_t end,
586 struct mpool *ppool)
587{
588 (void)vm_locked;
589 (void)begin;
590 (void)end;
591 (void)ppool;
592
593 return true;
594}
595
596void arch_vm_ptable_defrag(struct vm_locked vm_locked, struct mpool *ppool)
597{
598 (void)vm_locked;
599 (void)ppool;
600}
601
602bool arch_vm_mem_get_mode(struct vm_locked vm_locked, ipaddr_t begin,
603 ipaddr_t end, uint32_t *mode) // NOLINT
604{
605 (void)vm_locked;
606 (void)begin;
607 (void)end;
608 (void)mode;
609
610 return true;
611}
Olivier Deprez878bd5b2021-04-15 19:05:10 +0200612
613ffa_memory_attributes_t plat_ffa_memory_security_mode(
614 ffa_memory_attributes_t attributes, uint32_t mode)
615{
616 (void)mode;
617
618 return attributes;
619}
Kathleen Capella6ab05132023-05-10 12:27:35 -0400620
621struct ffa_value plat_ffa_error_32(struct vcpu *current, struct vcpu **next,
Karl Meakin1064a9c2024-06-04 17:20:43 +0100622 enum ffa_error error_code)
Kathleen Capella6ab05132023-05-10 12:27:35 -0400623{
624 (void)current;
625 (void)next;
626 (void)error_code;
J-Alves2ced1672022-12-12 14:35:38 +0000627
628 return ffa_error(FFA_NOT_SUPPORTED);
629}
630
J-Alves19e20cf2023-08-02 12:48:55 +0100631int64_t plat_ffa_mailbox_waiter_get(ffa_id_t vm_id, const struct vcpu *current)
J-Alves2ced1672022-12-12 14:35:38 +0000632{
J-Alvesbc7ab4f2022-12-13 12:09:25 +0000633 (void)vm_id;
634 (void)current;
J-Alves2ced1672022-12-12 14:35:38 +0000635
J-Alvesbc7ab4f2022-12-13 12:09:25 +0000636 return -1;
637}
638
639int64_t plat_ffa_mailbox_writable_get(const struct vcpu *current)
640{
641 (void)current;
642
643 return -1;
Kathleen Capella6ab05132023-05-10 12:27:35 -0400644}
Raghu Krishnamurthye74d6532023-06-07 12:21:54 -0700645
646bool plat_ffa_partition_info_get_regs_forward_allowed(void)
647{
648 return false;
649}
Madhukar Pappireddy9e09d7a2023-08-08 14:53:49 -0500650
651void plat_ffa_free_vm_resources(struct vm_locked vm_locked)
652{
653 (void)vm_locked;
654}
Madhukar Pappireddy0e57d3d2023-10-11 15:49:05 -0500655
656bool arch_vm_iommu_mm_identity_map(struct vm_locked vm_locked, paddr_t begin,
657 paddr_t end, uint32_t mode,
658 struct mpool *ppool, ipaddr_t *ipa,
659 struct dma_device_properties *dma_prop)
660{
661 (void)vm_locked;
662 (void)begin;
663 (void)end;
664 (void)mode;
665 (void)ppool;
666 (void)ipa;
667 (void)dma_prop;
668
669 return true;
670}
Madhukar Pappireddyc64d0642024-08-07 16:55:46 -0500671
672uint32_t plat_ffa_interrupt_get(struct vcpu_locked current_locked)
673{
674 (void)current_locked;
675
676 return 0;
677}