blob: 08b1cff53554690fc83f0b662617a7d72ff1d211 [file] [log] [blame]
Karl Meakin5b2da502024-11-07 17:13:51 +00001/*
2 * Copyright 2024 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/vm.h"
10
Karl Meakin117c8082024-12-04 16:03:28 +000011bool ffa_vm_supports_indirect_messages(struct vm *vm)
Karl Meakin5b2da502024-11-07 17:13:51 +000012{
13 return vm->ffa_version >= FFA_VERSION_1_1 &&
14 vm_supports_messaging_method(vm, FFA_PARTITION_INDIRECT_MSG);
15}
16
Karl Meakin117c8082024-12-04 16:03:28 +000017bool ffa_vm_managed_exit_supported(struct vm *vm)
Karl Meakin5b2da502024-11-07 17:13:51 +000018{
19 (void)vm;
20
21 return false;
22}
23
Karl Meakin117c8082024-12-04 16:03:28 +000024struct vm_locked ffa_vm_find_locked(ffa_id_t vm_id)
Karl Meakin5b2da502024-11-07 17:13:51 +000025{
26 if (vm_id_is_current_world(vm_id) || vm_id == HF_OTHER_WORLD_ID) {
27 return vm_find_locked(vm_id);
28 }
29
30 return (struct vm_locked){.vm = NULL};
31}
32
Karl Meakin117c8082024-12-04 16:03:28 +000033struct vm_locked ffa_vm_find_locked_create(ffa_id_t vm_id)
Karl Meakin5b2da502024-11-07 17:13:51 +000034{
Karl Meakin117c8082024-12-04 16:03:28 +000035 return ffa_vm_find_locked(vm_id);
Karl Meakin5b2da502024-11-07 17:13:51 +000036}
37
Karl Meakin117c8082024-12-04 16:03:28 +000038bool ffa_vm_notifications_info_get( // NOLINTNEXTLINE
Karl Meakin5b2da502024-11-07 17:13:51 +000039 uint16_t *ids, uint32_t *ids_count, // NOLINTNEXTLINE
40 uint32_t *lists_sizes, // NOLINTNEXTLINE
41 uint32_t *lists_count, const uint32_t ids_count_max)
42{
43 (void)ids;
44 (void)ids_count;
45 (void)lists_sizes;
46 (void)lists_count;
47 (void)ids_count_max;
48
49 return false;
50}
51
Karl Meakin117c8082024-12-04 16:03:28 +000052void ffa_vm_destroy(struct vm_locked to_destroy_locked)
Karl Meakin5b2da502024-11-07 17:13:51 +000053{
54 /* Hypervisor never frees VM structs. */
55 (void)to_destroy_locked;
56}
57
Karl Meakin117c8082024-12-04 16:03:28 +000058void ffa_vm_free_resources(struct vm_locked vm_locked)
Karl Meakin5b2da502024-11-07 17:13:51 +000059{
60 (void)vm_locked;
61}