blob: 13c67e6aca401008f370223549c9e6184853911b [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
Daniel Boulbyb2fb80e2021-02-03 15:09:23 +000023ffa_vm_id_t arch_ffa_spmc_id_get(void)
24{
25 return HF_SPMC_VM_ID;
26}
Olivier Deprez55a189e2021-06-09 15:45:27 +020027
28void plat_ffa_log_init(void)
29{
30}
31
32bool plat_ffa_is_direct_request_valid(struct vcpu *current,
33 ffa_vm_id_t sender_vm_id,
34 ffa_vm_id_t receiver_vm_id)
35{
36 (void)current;
37 (void)sender_vm_id;
38 (void)receiver_vm_id;
39
40 return true;
41}
42
43bool plat_ffa_is_direct_response_valid(struct vcpu *current,
44 ffa_vm_id_t sender_vm_id,
45 ffa_vm_id_t receiver_vm_id)
46{
47 (void)current;
48 (void)sender_vm_id;
49 (void)receiver_vm_id;
50
51 return true;
52}
53
Raghu Krishnamurthy62f97a72021-07-27 02:14:59 -070054bool plat_ffa_run_forward(ffa_vm_id_t vm_id, ffa_vcpu_index_t vcpu_idx,
55 struct ffa_value *ret)
56{
57 (void)vm_id;
58 (void)vcpu_idx;
59 (void)ret;
60
61 return false;
62}
63
Olivier Deprez55a189e2021-06-09 15:45:27 +020064bool plat_ffa_direct_request_forward(ffa_vm_id_t receiver_vm_id,
65 struct ffa_value args,
66 struct ffa_value *ret)
67{
68 (void)receiver_vm_id;
69 (void)args;
70 (void)ret;
71 return false;
72}
73
74ffa_memory_handle_t plat_ffa_memory_handle_make(uint64_t index)
75{
76 return index;
77}
78
79bool plat_ffa_memory_handle_allocated_by_current_world(
80 ffa_memory_handle_t handle)
81{
82 (void)handle;
83 return false;
84}
Maksims Svecovsb596eab2021-04-27 00:52:27 +010085
J-Alvesc003a7a2021-03-18 13:06:53 +000086bool plat_ffa_is_notifications_bind_valid(struct vcpu *current,
87 ffa_vm_id_t sender_id,
88 ffa_vm_id_t receiver_id)
89{
90 (void)current;
91 (void)sender_id;
92 (void)receiver_id;
93 return false;
94}
95
J-Alvesb15e9402021-09-08 11:44:42 +010096bool plat_ffa_notifications_update_bindings_forward(
97 ffa_vm_id_t receiver_id, ffa_vm_id_t sender_id, uint32_t flags,
98 ffa_notifications_bitmap_t bitmap, bool is_bind, struct ffa_value *ret)
99{
100 (void)ret;
101 (void)receiver_id;
102 (void)sender_id;
103 (void)flags;
104 (void)bitmap;
105 (void)is_bind;
106 (void)ret;
107
108 return false;
109}
110
Maksims Svecovsb596eab2021-04-27 00:52:27 +0100111ffa_partition_properties_t plat_ffa_partition_properties(
J-Alvesfa782092021-10-13 16:02:16 +0100112 ffa_vm_id_t vm_id, const struct vm *target)
Maksims Svecovsb596eab2021-04-27 00:52:27 +0100113{
J-Alvesfa782092021-10-13 16:02:16 +0100114 (void)vm_id;
Maksims Svecovsb596eab2021-04-27 00:52:27 +0100115 (void)target;
116 return 0;
117}
Maksims Svecovs9ddf86a2021-05-06 17:17:21 +0100118
119bool plat_ffa_vm_managed_exit_supported(struct vm *vm)
120{
121 (void)vm;
122 return false;
123}
J-Alvesa0f317d2021-06-09 13:31:59 +0100124
125bool plat_ffa_is_notifications_create_valid(struct vcpu *current,
126 ffa_vm_id_t vm_id)
127{
128 (void)current;
129 (void)vm_id;
130
131 return false;
132}
133
J-Alvesaa79c012021-07-09 14:29:45 +0100134bool plat_ffa_is_notification_set_valid(struct vcpu *current,
135 ffa_vm_id_t sender_id,
136 ffa_vm_id_t receiver_id)
137{
138 (void)current;
139 (void)sender_id;
140 (void)receiver_id;
141 return false;
142}
143
144bool plat_ffa_is_notification_get_valid(struct vcpu *current,
145 ffa_vm_id_t receiver_id)
146{
147 (void)current;
148 (void)receiver_id;
149 return false;
150}
151
J-Alves98ff9562021-09-09 14:39:41 +0100152bool plat_ffa_notifications_get_from_sp(
153 struct vm_locked receiver_locked, ffa_vcpu_index_t vcpu_id,
J-Alvesfa782092021-10-13 16:02:16 +0100154 ffa_notifications_bitmap_t *from_sp, // NOLINT
155 struct ffa_value *ret) // NOLINT
J-Alves98ff9562021-09-09 14:39:41 +0100156{
157 (void)receiver_locked;
158 (void)vcpu_id;
159 (void)from_sp;
160 (void)ret;
161
162 return false;
163}
164
J-Alvesde7bd2f2021-09-09 19:54:35 +0100165bool plat_ffa_notification_set_forward(ffa_vm_id_t sender_vm_id,
166 ffa_vm_id_t receiver_vm_id,
167 uint32_t flags,
168 ffa_notifications_bitmap_t bitmap,
169 struct ffa_value *ret)
170{
171 (void)sender_vm_id;
172 (void)receiver_vm_id;
173 (void)flags;
174 (void)bitmap;
175 (void)ret;
176
177 return false;
178}
179
J-Alvesa0f317d2021-06-09 13:31:59 +0100180struct ffa_value plat_ffa_notifications_bitmap_create(
181 ffa_vm_id_t vm_id, ffa_vcpu_count_t vcpu_count)
182{
183 (void)vm_id;
184 (void)vcpu_count;
185
186 return ffa_error(FFA_NOT_SUPPORTED);
187}
188
189struct ffa_value plat_ffa_notifications_bitmap_destroy(ffa_vm_id_t vm_id)
190{
191 (void)vm_id;
192
193 return ffa_error(FFA_NOT_SUPPORTED);
194}
J-Alvesc003a7a2021-03-18 13:06:53 +0000195
196struct vm_locked plat_ffa_vm_find_locked(ffa_vm_id_t vm_id)
197{
198 (void)vm_id;
199 return (struct vm_locked){.vm = NULL};
200}
201
202bool plat_ffa_is_vm_id(ffa_vm_id_t vm_id)
203{
204 (void)vm_id;
205 return false;
206}
J-Alvesc8e8a222021-06-08 17:33:52 +0100207
J-Alvesfa782092021-10-13 16:02:16 +0100208bool plat_ffa_vm_notifications_info_get( // NOLINTNEXTLINE
209 uint16_t *ids, uint32_t *ids_count, // NOLINTNEXTLINE
210 uint32_t *lists_sizes, // NOLINTNEXTLINE
211 uint32_t *lists_count, const uint32_t ids_count_max)
J-Alvesc8e8a222021-06-08 17:33:52 +0100212{
213 (void)ids;
214 (void)ids_count;
215 (void)lists_sizes;
216 (void)lists_count;
217 (void)ids_count_max;
218
219 return false;
220}
Raghu Krishnamurthyea6d25f2021-09-14 15:27:06 -0700221
222bool plat_ffa_is_mem_perm_get_valid(const struct vcpu *current)
223{
224 (void)current;
225 return false;
226}
227
228bool plat_ffa_is_mem_perm_set_valid(const struct vcpu *current)
229{
230 (void)current;
231 return false;
232}
Madhukar Pappireddyb11e0d12021-08-02 19:44:35 -0500233
234/**
235 * Check if current VM can resume target VM/SP using FFA_RUN ABI.
236 */
237bool plat_ffa_run_checks(struct vcpu *current, ffa_vm_id_t target_vm_id,
238 struct ffa_value *run_ret, struct vcpu **next)
239{
240 (void)current;
241 (void)target_vm_id;
242 (void)run_ret;
243 (void)next;
244
245 return true;
246}
J-Alvesca058c22021-09-10 14:02:07 +0100247
248void plat_ffa_notification_info_get_forward( // NOLINTNEXTLINE
249 uint16_t *ids, uint32_t *ids_count, // NOLINTNEXTLINE
250 uint32_t *lists_sizes, uint32_t *lists_count,
251 const uint32_t ids_count_max)
252{
253 (void)ids;
254 (void)ids_count;
255 (void)lists_sizes;
256 (void)lists_count;
257 (void)ids_count_max;
258}
J-Alves13394022021-06-30 13:48:49 +0100259
260void plat_ffa_sri_state_set(enum plat_ffa_sri_state state)
261{
262 (void)state;
263}
264
265void plat_ffa_sri_trigger_if_delayed(struct cpu *cpu)
266{
267 (void)cpu;
268}
269
270void plat_ffa_sri_trigger_not_delayed(struct cpu *cpu)
271{
272 (void)cpu;
273}
274
275void plat_ffa_sri_init(struct cpu *cpu)
276{
277 (void)cpu;
278}
J-Alves7461ef22021-10-18 17:21:33 +0100279
280void plat_ffa_inject_notification_pending_interrupt_context_switch(
281 struct vcpu *next, struct vcpu *current)
282{
283 (void)next;
284 (void)current;
285}
Olivier Depreze562e542020-06-11 17:31:54 +0200286
287void plat_ffa_partition_info_get_forward( // NOLINTNEXTLINE
288 const struct ffa_uuid *uuid, // NOLINTNEXTLINE
Daniel Boulbyb46cad12021-12-13 17:47:21 +0000289 const uint32_t flags, // NOLINTNEXTLINE
Olivier Depreze562e542020-06-11 17:31:54 +0200290 struct ffa_partition_info *partitions, ffa_vm_count_t *ret_count)
291{
292 (void)uuid;
Daniel Boulbyb46cad12021-12-13 17:47:21 +0000293 (void)flags;
Olivier Depreze562e542020-06-11 17:31:54 +0200294 (void)partitions;
295 (void)ret_count;
296}