blob: 5f3fbc939161fc707373811d77511d8f6b088d64 [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
Karl Meakinfa1dcb82025-02-10 16:47:50 +000021void ffa_init_log(void)
Olivier Deprez55a189e2021-06-09 15:45:27 +020022{
23}
24
Karl Meakin117c8082024-12-04 16:03:28 +000025bool ffa_memory_is_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
Karl Meakin117c8082024-12-04 16:03:28 +000036bool ffa_direct_msg_is_direct_request_valid(struct vcpu *current,
37 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
Karl Meakin117c8082024-12-04 16:03:28 +000047bool ffa_direct_msg_is_direct_request_supported(struct vm *sender_vm,
48 struct vm *receiver_vm,
49 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
Karl Meakin117c8082024-12-04 16:03:28 +000058bool ffa_direct_msg_is_direct_response_valid(struct vcpu *current,
59 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
Karl Meakin117c8082024-12-04 16:03:28 +000069bool ffa_cpu_cycles_run_forward(ffa_id_t vm_id, ffa_vcpu_index_t vcpu_idx,
70 struct ffa_value *ret)
Raghu Krishnamurthy62f97a72021-07-27 02:14:59 -070071{
72 (void)vm_id;
73 (void)vcpu_idx;
74 (void)ret;
75
76 return false;
77}
78
Karl Meakin117c8082024-12-04 16:03:28 +000079void ffa_vm_destroy(struct vm_locked to_destroy_locked)
Federico Recanati10bd06c2022-02-23 17:32:59 +010080{
81 (void)to_destroy_locked;
82}
83
Karl Meakin117c8082024-12-04 16:03:28 +000084void ffa_setup_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
Karl Meakin117c8082024-12-04 16:03:28 +000089bool ffa_direct_msg_direct_request_forward(ffa_id_t receiver_vm_id,
90 struct ffa_value args,
91 struct ffa_value *ret)
Olivier Deprez55a189e2021-06-09 15:45:27 +020092{
93 (void)receiver_vm_id;
94 (void)args;
95 (void)ret;
96 return false;
97}
98
Karl Meakin117c8082024-12-04 16:03:28 +000099bool ffa_setup_rx_release_forward(struct vm_locked vm_locked,
100 struct ffa_value *ret)
Federico Recanati7bef0b92022-03-17 14:56:22 +0100101{
102 (void)vm_locked;
103 (void)ret;
104
105 return false;
106}
107
Karl Meakin117c8082024-12-04 16:03:28 +0000108bool ffa_setup_acquire_receiver_rx(struct vm_locked to_locked,
109 struct ffa_value *ret)
Federico Recanati644f0462022-03-17 12:04:00 +0100110{
111 (void)to_locked;
112 (void)ret;
113
114 return false;
115}
116
Karl Meakin117c8082024-12-04 16:03:28 +0000117bool ffa_indirect_msg_is_supported(struct vm_locked sender_locked,
118 struct vm_locked receiver_locked)
Federico Recanati25053ee2022-03-14 15:01:53 +0100119{
120 (void)sender_locked;
121 (void)receiver_locked;
122
123 return false;
124}
125
Karl Meakin117c8082024-12-04 16:03:28 +0000126bool ffa_indirect_msg_send2_forward(ffa_id_t receiver_vm_id,
127 ffa_id_t sender_vm_id,
128 struct ffa_value *ret)
Federico Recanati25053ee2022-03-14 15:01:53 +0100129{
130 (void)receiver_vm_id;
131 (void)sender_vm_id;
132 (void)ret;
133
134 return false;
135}
136
Karl Meakin117c8082024-12-04 16:03:28 +0000137uint32_t ffa_memory_get_other_world_mode(void)
J-Alves7db32002021-12-14 14:44:50 +0000138{
139 return 0U;
140}
141
Karl Meakin117c8082024-12-04 16:03:28 +0000142bool ffa_notifications_is_bind_valid(struct vcpu *current, ffa_id_t sender_id,
143 ffa_id_t receiver_id)
J-Alvesc003a7a2021-03-18 13:06:53 +0000144{
145 (void)current;
146 (void)sender_id;
147 (void)receiver_id;
148 return false;
149}
150
Karl Meakin117c8082024-12-04 16:03:28 +0000151bool ffa_notifications_update_bindings_forward(
Karl Meakinf9c73ce2024-07-30 17:37:13 +0100152 ffa_id_t receiver_id, ffa_id_t sender_id,
153 ffa_notification_flags_t flags, ffa_notifications_bitmap_t bitmap,
154 bool is_bind, struct ffa_value *ret)
J-Alvesb15e9402021-09-08 11:44:42 +0100155{
156 (void)ret;
157 (void)receiver_id;
158 (void)sender_id;
159 (void)flags;
160 (void)bitmap;
161 (void)is_bind;
162 (void)ret;
163
164 return false;
165}
166
Karl Meakin117c8082024-12-04 16:03:28 +0000167void ffa_setup_rxtx_map_forward(struct vm_locked vm_locked)
Federico Recanati8d8b1cf2022-04-14 13:16:00 +0200168{
169 (void)vm_locked;
170}
171
Karl Meakin117c8082024-12-04 16:03:28 +0000172ffa_partition_properties_t ffa_setup_partition_properties(
J-Alves7fb0fdb2024-10-09 11:28:07 +0100173 ffa_id_t caller_id, const struct vm *target)
Maksims Svecovsb596eab2021-04-27 00:52:27 +0100174{
J-Alves7fb0fdb2024-10-09 11:28:07 +0100175 (void)caller_id;
Maksims Svecovsb596eab2021-04-27 00:52:27 +0100176 (void)target;
177 return 0;
178}
Maksims Svecovs9ddf86a2021-05-06 17:17:21 +0100179
Karl Meakin117c8082024-12-04 16:03:28 +0000180bool ffa_vm_managed_exit_supported(struct vm *vm)
Maksims Svecovs9ddf86a2021-05-06 17:17:21 +0100181{
182 (void)vm;
183 return false;
184}
J-Alvesa0f317d2021-06-09 13:31:59 +0100185
J-Alves7ccaccf2024-02-01 14:25:23 +0000186/**
187 * Check validity of the calls:
188 * FFA_NOTIFICATION_BITMAP_CREATE/FFA_NOTIFICATION_BITMAP_DESTROY.
189 */
Karl Meakin117c8082024-12-04 16:03:28 +0000190struct ffa_value ffa_notifications_is_bitmap_access_valid(struct vcpu *current,
191 ffa_id_t vm_id)
J-Alvesa0f317d2021-06-09 13:31:59 +0100192{
J-Alves7ccaccf2024-02-01 14:25:23 +0000193 /*
194 * Call should only be used by the Hypervisor, so any attempt of
195 * invocation from NWd FF-A endpoints should fail.
196 */
J-Alvesa0f317d2021-06-09 13:31:59 +0100197 (void)current;
198 (void)vm_id;
199
J-Alves7ccaccf2024-02-01 14:25:23 +0000200 return ffa_error(FFA_NOT_SUPPORTED);
J-Alvesa0f317d2021-06-09 13:31:59 +0100201}
202
Karl Meakin117c8082024-12-04 16:03:28 +0000203bool ffa_notifications_is_set_valid(struct vcpu *current, 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
Karl Meakin117c8082024-12-04 16:03:28 +0000212bool ffa_notifications_is_get_valid(struct vcpu *current, ffa_id_t receiver_id,
213 ffa_notification_flags_t flags)
J-Alvesaa79c012021-07-09 14:29:45 +0100214{
J-Alvesfc95a302022-04-22 14:18:23 +0100215 (void)flags;
J-Alvesaa79c012021-07-09 14:29:45 +0100216 (void)current;
217 (void)receiver_id;
218 return false;
219}
220
Karl Meakin117c8082024-12-04 16:03:28 +0000221struct ffa_value ffa_notifications_get_from_sp(
J-Alves98ff9562021-09-09 14:39:41 +0100222 struct vm_locked receiver_locked, ffa_vcpu_index_t vcpu_id,
Karl Meakinf9c73ce2024-07-30 17:37:13 +0100223 ffa_notifications_bitmap_t *from_sp) // NOLINT
J-Alves98ff9562021-09-09 14:39:41 +0100224{
225 (void)receiver_locked;
226 (void)vcpu_id;
227 (void)from_sp;
J-Alves98ff9562021-09-09 14:39:41 +0100228
Karl Meakinf9c73ce2024-07-30 17:37:13 +0100229 return ffa_error(FFA_NOT_SUPPORTED);
J-Alves98ff9562021-09-09 14:39:41 +0100230}
231
Karl Meakin117c8082024-12-04 16:03:28 +0000232struct ffa_value ffa_notifications_get_framework_notifications(
J-Alvesd605a092022-03-28 14:20:48 +0100233 struct vm_locked receiver_locked,
234 ffa_notifications_bitmap_t *from_fwk, // NOLINT
Karl Meakinf9c73ce2024-07-30 17:37:13 +0100235 ffa_notification_flags_t flags, ffa_vcpu_index_t vcpu_id)
J-Alvesd605a092022-03-28 14:20:48 +0100236{
237 (void)receiver_locked;
238 (void)from_fwk;
239 (void)flags;
240 (void)vcpu_id;
J-Alvesd605a092022-03-28 14:20:48 +0100241
Karl Meakinf9c73ce2024-07-30 17:37:13 +0100242 return ffa_error(FFA_NOT_SUPPORTED);
J-Alvesd605a092022-03-28 14:20:48 +0100243}
244
Karl Meakin117c8082024-12-04 16:03:28 +0000245bool ffa_notifications_set_forward(ffa_id_t sender_vm_id,
246 ffa_id_t receiver_vm_id,
247 ffa_notification_flags_t flags,
248 ffa_notifications_bitmap_t bitmap,
249 struct ffa_value *ret)
J-Alvesde7bd2f2021-09-09 19:54:35 +0100250{
251 (void)sender_vm_id;
252 (void)receiver_vm_id;
253 (void)flags;
254 (void)bitmap;
255 (void)ret;
256
257 return false;
258}
259
Karl Meakin117c8082024-12-04 16:03:28 +0000260struct ffa_value ffa_notifications_bitmap_create(ffa_id_t vm_id,
261 ffa_vcpu_count_t vcpu_count)
J-Alvesa0f317d2021-06-09 13:31:59 +0100262{
263 (void)vm_id;
264 (void)vcpu_count;
265
266 return ffa_error(FFA_NOT_SUPPORTED);
267}
268
Karl Meakin117c8082024-12-04 16:03:28 +0000269struct ffa_value ffa_notifications_bitmap_destroy(ffa_id_t vm_id)
J-Alvesa0f317d2021-06-09 13:31:59 +0100270{
271 (void)vm_id;
272
273 return ffa_error(FFA_NOT_SUPPORTED);
274}
J-Alvesc003a7a2021-03-18 13:06:53 +0000275
Karl Meakin117c8082024-12-04 16:03:28 +0000276struct vm_locked ffa_vm_find_locked(ffa_id_t vm_id)
J-Alvesc003a7a2021-03-18 13:06:53 +0000277{
278 (void)vm_id;
279 return (struct vm_locked){.vm = NULL};
280}
281
Karl Meakin117c8082024-12-04 16:03:28 +0000282struct vm_locked ffa_vm_find_locked_create(ffa_id_t vm_id)
Federico Recanati8d8b1cf2022-04-14 13:16:00 +0200283{
284 (void)vm_id;
285 return (struct vm_locked){.vm = NULL};
286}
287
Karl Meakin117c8082024-12-04 16:03:28 +0000288bool ffa_vm_notifications_info_get( // NOLINTNEXTLINE
J-Alvesfa782092021-10-13 16:02:16 +0100289 uint16_t *ids, uint32_t *ids_count, // NOLINTNEXTLINE
290 uint32_t *lists_sizes, // NOLINTNEXTLINE
291 uint32_t *lists_count, const uint32_t ids_count_max)
J-Alvesc8e8a222021-06-08 17:33:52 +0100292{
293 (void)ids;
294 (void)ids_count;
295 (void)lists_sizes;
296 (void)lists_count;
297 (void)ids_count_max;
298
299 return false;
300}
Raghu Krishnamurthyea6d25f2021-09-14 15:27:06 -0700301
Karl Meakin117c8082024-12-04 16:03:28 +0000302bool ffa_memory_is_mem_perm_get_valid(const struct vcpu *current)
Raghu Krishnamurthyea6d25f2021-09-14 15:27:06 -0700303{
304 (void)current;
305 return false;
306}
307
Karl Meakin117c8082024-12-04 16:03:28 +0000308bool ffa_memory_is_mem_perm_set_valid(const struct vcpu *current)
Raghu Krishnamurthyea6d25f2021-09-14 15:27:06 -0700309{
310 (void)current;
311 return false;
312}
Madhukar Pappireddyb11e0d12021-08-02 19:44:35 -0500313
314/**
315 * Check if current VM can resume target VM/SP using FFA_RUN ABI.
316 */
Karl Meakin117c8082024-12-04 16:03:28 +0000317bool ffa_cpu_cycles_run_checks(struct vcpu_locked current_locked,
318 ffa_id_t target_vm_id, ffa_vcpu_index_t vcpu_idx,
319 struct ffa_value *run_ret, struct vcpu **next)
Madhukar Pappireddyb11e0d12021-08-02 19:44:35 -0500320{
Madhukar Pappireddybd10e572023-03-06 16:39:49 -0600321 (void)current_locked;
Madhukar Pappireddyb11e0d12021-08-02 19:44:35 -0500322 (void)target_vm_id;
323 (void)run_ret;
324 (void)next;
Raghu Krishnamurthy048d63f2021-12-11 12:45:41 -0800325 (void)vcpu_idx;
Madhukar Pappireddyb11e0d12021-08-02 19:44:35 -0500326 return true;
327}
J-Alvesca058c22021-09-10 14:02:07 +0100328
Karl Meakin117c8082024-12-04 16:03:28 +0000329void ffa_notifications_info_get_forward( // NOLINTNEXTLINE
330 uint16_t *ids, uint32_t *ids_count, // NOLINTNEXTLINE
J-Alvesca058c22021-09-10 14:02:07 +0100331 uint32_t *lists_sizes, uint32_t *lists_count,
332 const uint32_t ids_count_max)
333{
334 (void)ids;
335 (void)ids_count;
336 (void)lists_sizes;
337 (void)lists_count;
338 (void)ids_count_max;
339}
J-Alves13394022021-06-30 13:48:49 +0100340
Karl Meakin117c8082024-12-04 16:03:28 +0000341void ffa_notifications_sri_trigger_if_delayed(struct cpu *cpu)
J-Alves13394022021-06-30 13:48:49 +0100342{
343 (void)cpu;
344}
345
Karl Meakin117c8082024-12-04 16:03:28 +0000346void ffa_notifications_sri_trigger_not_delayed(struct cpu *cpu)
J-Alves13394022021-06-30 13:48:49 +0100347{
348 (void)cpu;
349}
350
Karl Meakin117c8082024-12-04 16:03:28 +0000351void ffa_notifications_sri_set_delayed(struct cpu *cpu)
J-Alvesea8ccfe2024-10-09 11:47:24 +0100352{
Daniel Boulby7a2e9ba2024-09-27 15:24:51 +0100353 cpu->is_sri_delayed = true;
J-Alvesea8ccfe2024-10-09 11:47:24 +0100354}
355
Karl Meakin117c8082024-12-04 16:03:28 +0000356bool ffa_interrupts_inject_notification_pending_interrupt(
Daniel Boulbyd49d0772025-01-15 11:19:36 +0000357 struct vcpu_locked target_locked, struct vm_locked receiver_locked)
J-Alves7461ef22021-10-18 17:21:33 +0100358{
J-Alves6e2abc62021-12-02 14:58:56 +0000359 (void)target_locked;
J-Alves6e2abc62021-12-02 14:58:56 +0000360 (void)receiver_locked;
361
362 return false;
J-Alves7461ef22021-10-18 17:21:33 +0100363}
Olivier Depreze562e542020-06-11 17:31:54 +0200364
Raghu Krishnamurthyef432cb2022-12-29 06:56:32 -0800365bool plat_ffa_partition_info_get_regs_forward( // NOLINTNEXTLINE
366 const struct ffa_uuid *uuid,
367 const uint16_t start_index, // NOLINTNEXTLINE
368 const uint16_t tag,
369 struct ffa_partition_info *partitions, // NOLINTNEXTLINE
370 uint16_t partitions_len, ffa_vm_count_t *ret_count)
371{
372 (void)uuid;
373 (void)start_index;
374 (void)tag;
375 (void)partitions;
376 (void)partitions_len;
377 (void)ret_count;
378 return true;
379}
380
Karl Meakin117c8082024-12-04 16:03:28 +0000381ffa_vm_count_t ffa_setup_partition_info_get_forward( // NOLINTNEXTLINE
382 const struct ffa_uuid *uuid, // NOLINTNEXTLINE
383 uint32_t flags, // NOLINTNEXTLINE
Karl Meakin86c80272024-07-26 15:13:23 +0100384 struct ffa_partition_info *partitions, ffa_vm_count_t vm_count)
Olivier Depreze562e542020-06-11 17:31:54 +0200385{
386 (void)uuid;
Daniel Boulbyb46cad12021-12-13 17:47:21 +0000387 (void)flags;
Olivier Depreze562e542020-06-11 17:31:54 +0200388 (void)partitions;
Karl Meakin86c80272024-07-26 15:13:23 +0100389
390 return vm_count;
Olivier Depreze562e542020-06-11 17:31:54 +0200391}
Olivier Deprezd614d322021-06-18 15:21:00 +0200392
Karl Meakin117c8082024-12-04 16:03:28 +0000393bool ffa_setup_is_secondary_ep_register_supported(void)
Olivier Deprezd614d322021-06-18 15:21:00 +0200394{
395 return false;
396}
Madhukar Pappireddydd883202022-10-24 16:49:28 -0500397
Karl Meakin117c8082024-12-04 16:03:28 +0000398struct ffa_value ffa_cpu_cycles_msg_wait_prepare(
399 struct vcpu_locked current_locked, struct vcpu **next)
Madhukar Pappireddy5522c672021-12-17 16:35:51 -0600400{
Madhukar Pappireddybd10e572023-03-06 16:39:49 -0600401 (void)current_locked;
Madhukar Pappireddy5522c672021-12-17 16:35:51 -0600402 (void)next;
Madhukar Pappireddy5522c672021-12-17 16:35:51 -0600403
Madhukar Pappireddydd883202022-10-24 16:49:28 -0500404 return (struct ffa_value){.func = FFA_INTERRUPT_32};
Madhukar Pappireddy5522c672021-12-17 16:35:51 -0600405}
Madhukar Pappireddy0ea239a2022-06-21 17:26:57 -0500406
Karl Meakin117c8082024-12-04 16:03:28 +0000407bool ffa_cpu_cycles_check_runtime_state_transition(
408 struct vcpu_locked current_locked, ffa_id_t vm_id,
409 ffa_id_t receiver_vm_id, struct vcpu_locked receiver_locked,
410 uint32_t func, // NOLINTNEXTLINE
411 enum vcpu_state *next_state)
Madhukar Pappireddy0ea239a2022-06-21 17:26:57 -0500412{
413 /* Perform state transition checks only for Secure Partitions. */
Madhukar Pappireddybd10e572023-03-06 16:39:49 -0600414 (void)current_locked;
Madhukar Pappireddy0ea239a2022-06-21 17:26:57 -0500415 (void)vm_id;
416 (void)receiver_vm_id;
Madhukar Pappireddybd10e572023-03-06 16:39:49 -0600417 (void)receiver_locked;
Madhukar Pappireddy0ea239a2022-06-21 17:26:57 -0500418 (void)func;
419 (void)next_state;
420
421 return true;
422}
Madhukar Pappireddy49fe6702022-06-21 17:52:23 -0500423
J-Alves5d65fe72025-02-18 16:02:32 +0000424void ffa_cpu_cycles_init_schedule_mode_ffa_run(
Karl Meakin117c8082024-12-04 16:03:28 +0000425 struct vcpu_locked current_locked, struct vcpu_locked target_locked)
Madhukar Pappireddy1480fce2022-06-21 18:09:25 -0500426{
427 /* Scheduling mode not supported in the Hypervisor/VMs. */
Madhukar Pappireddybd10e572023-03-06 16:39:49 -0600428 (void)current_locked;
Madhukar Pappireddy1480fce2022-06-21 18:09:25 -0500429 (void)target_locked;
430}
431
Karl Meakin117c8082024-12-04 16:03:28 +0000432void ffa_direct_msg_wind_call_chain_ffa_direct_req(
Madhukar Pappireddy49fe6702022-06-21 17:52:23 -0500433 struct vcpu_locked current_locked,
J-Alves19e20cf2023-08-02 12:48:55 +0100434 struct vcpu_locked receiver_vcpu_locked, ffa_id_t sender_vm_id)
Madhukar Pappireddy49fe6702022-06-21 17:52:23 -0500435{
436 /* Calls chains not supported in the Hypervisor/VMs. */
437 (void)current_locked;
438 (void)receiver_vcpu_locked;
Raghu Krishnamurthya9ccf122023-03-27 20:42:01 -0700439 (void)sender_vm_id;
Madhukar Pappireddy49fe6702022-06-21 17:52:23 -0500440}
Madhukar Pappireddyc0fb87e2022-06-21 17:59:15 -0500441
Karl Meakin117c8082024-12-04 16:03:28 +0000442void ffa_direct_msg_unwind_call_chain_ffa_direct_resp(
Madhukar Pappireddybd10e572023-03-06 16:39:49 -0600443 struct vcpu_locked current_locked, struct vcpu_locked next_locked)
Madhukar Pappireddyc0fb87e2022-06-21 17:59:15 -0500444{
445 /* Calls chains not supported in the Hypervisor/VMs. */
Madhukar Pappireddybd10e572023-03-06 16:39:49 -0600446 (void)current_locked;
447 (void)next_locked;
Madhukar Pappireddyc0fb87e2022-06-21 17:59:15 -0500448}
Madhukar Pappireddy046dad02022-06-21 18:43:33 -0500449
Karl Meakinfa1dcb82025-02-10 16:47:50 +0000450bool ffa_direct_msg_is_spmd_lp_id(ffa_id_t vm_id)
Raghu Krishnamurthya9ccf122023-03-27 20:42:01 -0700451{
452 (void)vm_id;
453 return false;
454}
455
Karl Meakin117c8082024-12-04 16:03:28 +0000456void ffa_interrupts_enable_virtual_interrupts(struct vcpu_locked current_locked,
457 struct vm_locked vm_locked)
Madhukar Pappireddy046dad02022-06-21 18:43:33 -0500458{
459 (void)current_locked;
Madhukar Pappireddy486360d2022-09-06 15:32:24 -0500460 (void)vm_locked;
Madhukar Pappireddy046dad02022-06-21 18:43:33 -0500461}
J-Alves66652252022-07-06 09:49:51 +0100462
Karl Meakin117c8082024-12-04 16:03:28 +0000463struct ffa_value ffa_memory_other_world_mem_send(
J-Alves66652252022-07-06 09:49:51 +0100464 struct vm *from, uint32_t share_func,
465 struct ffa_memory_region **memory_region, uint32_t length,
466 uint32_t fragment_length, struct mpool *page_pool)
467{
468 (void)from;
469 (void)memory_region;
470 (void)length;
471 (void)fragment_length;
472 (void)page_pool;
473 (void)share_func;
474
475 return (struct ffa_value){0};
476}
J-Alvesfc19b372022-07-06 12:17:35 +0100477
Karl Meakin117c8082024-12-04 16:03:28 +0000478struct ffa_value ffa_memory_other_world_mem_reclaim(
J-Alvesfc19b372022-07-06 12:17:35 +0100479 struct vm *to, ffa_memory_handle_t handle,
480 ffa_memory_region_flags_t flags, struct mpool *page_pool)
481{
482 (void)handle;
483 (void)flags;
484 (void)page_pool;
485 (void)to;
486
487 return ffa_error(FFA_INVALID_PARAMETERS);
488}
J-Alvesb5084cf2022-07-06 14:20:12 +0100489
Karl Meakin117c8082024-12-04 16:03:28 +0000490struct ffa_value ffa_memory_other_world_mem_send_continue(
J-Alvesfdd29272022-07-19 13:16:31 +0100491 struct vm *from, void *fragment, uint32_t fragment_length,
492 ffa_memory_handle_t handle, struct mpool *page_pool)
493{
494 (void)from;
495 (void)fragment;
496 (void)fragment_length;
497 (void)handle;
498 (void)page_pool;
499
500 return ffa_error(FFA_INVALID_PARAMETERS);
501}
J-Alves27b71962022-12-12 15:29:58 +0000502
Karl Meakin117c8082024-12-04 16:03:28 +0000503struct ffa_value ffa_indirect_msg_send(ffa_id_t sender_vm_id,
504 ffa_id_t receiver_vm_id, uint32_t size,
505 struct vcpu *current, struct vcpu **next)
J-Alves27b71962022-12-12 15:29:58 +0000506{
507 (void)sender_vm_id;
508 (void)receiver_vm_id;
509 (void)size;
510 (void)current;
511 (void)next;
512
513 return ffa_error(FFA_NOT_SUPPORTED);
514}
Madhukar Pappireddy1f2f2132023-02-14 17:48:44 -0600515
Karl Meakin117c8082024-12-04 16:03:28 +0000516struct ffa_value ffa_cpu_cycles_yield_prepare(struct vcpu_locked current_locked,
517 struct vcpu **next,
518 uint32_t timeout_low,
519 uint32_t timeout_high)
Madhukar Pappireddy1f2f2132023-02-14 17:48:44 -0600520{
Madhukar Pappireddybd10e572023-03-06 16:39:49 -0600521 (void)current_locked;
Madhukar Pappireddyb3fb8712023-05-23 17:10:34 -0500522 (void)next;
Madhukar Pappireddy184501c2023-05-23 17:24:06 -0500523 (void)timeout_low;
524 (void)timeout_high;
Madhukar Pappireddyb3fb8712023-05-23 17:10:34 -0500525
526 return ffa_error(FFA_NOT_SUPPORTED);
Madhukar Pappireddy1f2f2132023-02-14 17:48:44 -0600527}
Olivier Deprezd9d409f2023-03-17 11:47:57 +0100528
529bool arch_vm_init_mm(struct vm *vm, struct mpool *ppool)
530{
531 (void)vm;
532 (void)ppool;
533
534 return true;
535}
536
Madhukar Pappireddy070f49e2024-01-12 13:02:27 -0600537bool arch_vm_iommu_init_mm(struct vm *vm, struct mpool *ppool)
538{
539 (void)vm;
540 (void)ppool;
541
542 return true;
543}
544
Olivier Deprezd9d409f2023-03-17 11:47:57 +0100545bool arch_vm_identity_prepare(struct vm_locked vm_locked, paddr_t begin,
Karl Meakin07a69ab2025-02-07 14:53:19 +0000546 paddr_t end, mm_mode_t mode, struct mpool *ppool)
Olivier Deprezd9d409f2023-03-17 11:47:57 +0100547{
548 (void)vm_locked;
549 (void)begin;
550 (void)end;
551 (void)mode;
552 (void)ppool;
553
554 return true;
555}
556
557void arch_vm_identity_commit(struct vm_locked vm_locked, paddr_t begin,
Karl Meakin07a69ab2025-02-07 14:53:19 +0000558 paddr_t end, mm_mode_t mode, struct mpool *ppool,
Olivier Deprezd9d409f2023-03-17 11:47:57 +0100559 ipaddr_t *ipa)
560{
561 (void)vm_locked;
562 (void)begin;
563 (void)end;
564 (void)mode;
565 (void)ppool;
566 (void)ipa;
567}
568
569bool arch_vm_unmap(struct vm_locked vm_locked, paddr_t begin, paddr_t end,
570 struct mpool *ppool)
571{
572 (void)vm_locked;
573 (void)begin;
574 (void)end;
575 (void)ppool;
576
577 return true;
578}
579
580void arch_vm_ptable_defrag(struct vm_locked vm_locked, struct mpool *ppool)
581{
582 (void)vm_locked;
583 (void)ppool;
584}
585
586bool arch_vm_mem_get_mode(struct vm_locked vm_locked, ipaddr_t begin,
Karl Meakin07a69ab2025-02-07 14:53:19 +0000587 ipaddr_t end, mm_mode_t *mode) // NOLINT
Olivier Deprezd9d409f2023-03-17 11:47:57 +0100588{
589 (void)vm_locked;
590 (void)begin;
591 (void)end;
592 (void)mode;
593
594 return true;
595}
Olivier Deprez878bd5b2021-04-15 19:05:10 +0200596
Karl Meakin117c8082024-12-04 16:03:28 +0000597ffa_memory_attributes_t ffa_memory_add_security_bit_from_mode(
Karl Meakin07a69ab2025-02-07 14:53:19 +0000598 ffa_memory_attributes_t attributes, mm_mode_t mode)
Olivier Deprez878bd5b2021-04-15 19:05:10 +0200599{
600 (void)mode;
601
602 return attributes;
603}
Kathleen Capella6ab05132023-05-10 12:27:35 -0400604
Karl Meakinfa1dcb82025-02-10 16:47:50 +0000605struct ffa_value ffa_cpu_cycles_error_32(struct vcpu *current,
606 struct vcpu **next,
607 enum ffa_error error_code)
Kathleen Capella6ab05132023-05-10 12:27:35 -0400608{
609 (void)current;
610 (void)next;
611 (void)error_code;
J-Alves2ced1672022-12-12 14:35:38 +0000612
613 return ffa_error(FFA_NOT_SUPPORTED);
614}
615
Karl Meakin117c8082024-12-04 16:03:28 +0000616bool ffa_setup_partition_info_get_regs_forward_allowed(void)
Raghu Krishnamurthye74d6532023-06-07 12:21:54 -0700617{
618 return false;
619}
Madhukar Pappireddy9e09d7a2023-08-08 14:53:49 -0500620
Karl Meakin117c8082024-12-04 16:03:28 +0000621void ffa_vm_free_resources(struct vm_locked vm_locked)
Madhukar Pappireddy9e09d7a2023-08-08 14:53:49 -0500622{
623 (void)vm_locked;
624}
Madhukar Pappireddy0e57d3d2023-10-11 15:49:05 -0500625
626bool arch_vm_iommu_mm_identity_map(struct vm_locked vm_locked, paddr_t begin,
Karl Meakin07a69ab2025-02-07 14:53:19 +0000627 paddr_t end, mm_mode_t mode,
Madhukar Pappireddy0e57d3d2023-10-11 15:49:05 -0500628 struct mpool *ppool, ipaddr_t *ipa,
629 struct dma_device_properties *dma_prop)
630{
631 (void)vm_locked;
632 (void)begin;
633 (void)end;
634 (void)mode;
635 (void)ppool;
636 (void)ipa;
637 (void)dma_prop;
638
639 return true;
640}
Madhukar Pappireddyc64d0642024-08-07 16:55:46 -0500641
Karl Meakinfa1dcb82025-02-10 16:47:50 +0000642bool ffa_direct_msg_handle_framework_msg(struct ffa_value args,
643 struct ffa_value *ret)
Karl Meakin06e8b732024-09-20 18:26:49 +0100644{
645 (void)args;
646 (void)ret;
647
648 return false;
649}