Daniel Boulby | b2fb80e | 2021-02-03 15:09:23 +0000 | [diff] [blame] | 1 | /* |
| 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-Alves | a0f317d | 2021-06-09 13:31:59 +0100 | [diff] [blame] | 11 | #include "hf/ffa_internal.h" |
Olivier Deprez | 55a189e | 2021-06-09 15:45:27 +0200 | [diff] [blame] | 12 | #include "hf/vcpu.h" |
J-Alves | c003a7a | 2021-03-18 13:06:53 +0000 | [diff] [blame] | 13 | #include "hf/vm.h" |
Daniel Boulby | b2fb80e | 2021-02-03 15:09:23 +0000 | [diff] [blame] | 14 | |
Daniel Boulby | 87b2dc8 | 2021-08-04 14:07:43 +0100 | [diff] [blame^] | 15 | struct ffa_value arch_ffa_features(uint32_t function_id) |
| 16 | { |
| 17 | (void)function_id; |
| 18 | return ffa_error(FFA_NOT_SUPPORTED); |
| 19 | } |
| 20 | |
Daniel Boulby | b2fb80e | 2021-02-03 15:09:23 +0000 | [diff] [blame] | 21 | ffa_vm_id_t arch_ffa_spmc_id_get(void) |
| 22 | { |
| 23 | return HF_SPMC_VM_ID; |
| 24 | } |
Olivier Deprez | 55a189e | 2021-06-09 15:45:27 +0200 | [diff] [blame] | 25 | |
| 26 | void plat_ffa_log_init(void) |
| 27 | { |
| 28 | } |
| 29 | |
| 30 | bool plat_ffa_is_direct_request_valid(struct vcpu *current, |
| 31 | ffa_vm_id_t sender_vm_id, |
| 32 | ffa_vm_id_t receiver_vm_id) |
| 33 | { |
| 34 | (void)current; |
| 35 | (void)sender_vm_id; |
| 36 | (void)receiver_vm_id; |
| 37 | |
| 38 | return true; |
| 39 | } |
| 40 | |
| 41 | bool plat_ffa_is_direct_response_valid(struct vcpu *current, |
| 42 | ffa_vm_id_t sender_vm_id, |
| 43 | ffa_vm_id_t receiver_vm_id) |
| 44 | { |
| 45 | (void)current; |
| 46 | (void)sender_vm_id; |
| 47 | (void)receiver_vm_id; |
| 48 | |
| 49 | return true; |
| 50 | } |
| 51 | |
Raghu Krishnamurthy | 62f97a7 | 2021-07-27 02:14:59 -0700 | [diff] [blame] | 52 | bool plat_ffa_run_forward(ffa_vm_id_t vm_id, ffa_vcpu_index_t vcpu_idx, |
| 53 | struct ffa_value *ret) |
| 54 | { |
| 55 | (void)vm_id; |
| 56 | (void)vcpu_idx; |
| 57 | (void)ret; |
| 58 | |
| 59 | return false; |
| 60 | } |
| 61 | |
Olivier Deprez | 55a189e | 2021-06-09 15:45:27 +0200 | [diff] [blame] | 62 | bool plat_ffa_direct_request_forward(ffa_vm_id_t receiver_vm_id, |
| 63 | struct ffa_value args, |
| 64 | struct ffa_value *ret) |
| 65 | { |
| 66 | (void)receiver_vm_id; |
| 67 | (void)args; |
| 68 | (void)ret; |
| 69 | return false; |
| 70 | } |
| 71 | |
| 72 | ffa_memory_handle_t plat_ffa_memory_handle_make(uint64_t index) |
| 73 | { |
| 74 | return index; |
| 75 | } |
| 76 | |
| 77 | bool plat_ffa_memory_handle_allocated_by_current_world( |
| 78 | ffa_memory_handle_t handle) |
| 79 | { |
| 80 | (void)handle; |
| 81 | return false; |
| 82 | } |
Maksims Svecovs | b596eab | 2021-04-27 00:52:27 +0100 | [diff] [blame] | 83 | |
J-Alves | c003a7a | 2021-03-18 13:06:53 +0000 | [diff] [blame] | 84 | bool plat_ffa_is_notifications_bind_valid(struct vcpu *current, |
| 85 | ffa_vm_id_t sender_id, |
| 86 | ffa_vm_id_t receiver_id) |
| 87 | { |
| 88 | (void)current; |
| 89 | (void)sender_id; |
| 90 | (void)receiver_id; |
| 91 | return false; |
| 92 | } |
| 93 | |
Maksims Svecovs | b596eab | 2021-04-27 00:52:27 +0100 | [diff] [blame] | 94 | ffa_partition_properties_t plat_ffa_partition_properties( |
| 95 | ffa_vm_id_t current_id, const struct vm *target) |
| 96 | { |
| 97 | (void)current_id; |
| 98 | (void)target; |
| 99 | return 0; |
| 100 | } |
Maksims Svecovs | 9ddf86a | 2021-05-06 17:17:21 +0100 | [diff] [blame] | 101 | |
| 102 | bool plat_ffa_vm_managed_exit_supported(struct vm *vm) |
| 103 | { |
| 104 | (void)vm; |
| 105 | return false; |
| 106 | } |
J-Alves | a0f317d | 2021-06-09 13:31:59 +0100 | [diff] [blame] | 107 | |
| 108 | bool plat_ffa_is_notifications_create_valid(struct vcpu *current, |
| 109 | ffa_vm_id_t vm_id) |
| 110 | { |
| 111 | (void)current; |
| 112 | (void)vm_id; |
| 113 | |
| 114 | return false; |
| 115 | } |
| 116 | |
| 117 | struct ffa_value plat_ffa_notifications_bitmap_create( |
| 118 | ffa_vm_id_t vm_id, ffa_vcpu_count_t vcpu_count) |
| 119 | { |
| 120 | (void)vm_id; |
| 121 | (void)vcpu_count; |
| 122 | |
| 123 | return ffa_error(FFA_NOT_SUPPORTED); |
| 124 | } |
| 125 | |
| 126 | struct ffa_value plat_ffa_notifications_bitmap_destroy(ffa_vm_id_t vm_id) |
| 127 | { |
| 128 | (void)vm_id; |
| 129 | |
| 130 | return ffa_error(FFA_NOT_SUPPORTED); |
| 131 | } |
J-Alves | c003a7a | 2021-03-18 13:06:53 +0000 | [diff] [blame] | 132 | |
| 133 | struct vm_locked plat_ffa_vm_find_locked(ffa_vm_id_t vm_id) |
| 134 | { |
| 135 | (void)vm_id; |
| 136 | return (struct vm_locked){.vm = NULL}; |
| 137 | } |
| 138 | |
| 139 | bool plat_ffa_is_vm_id(ffa_vm_id_t vm_id) |
| 140 | { |
| 141 | (void)vm_id; |
| 142 | return false; |
| 143 | } |