Karl Meakin | 8e58ddc | 2024-11-08 23:19:34 +0000 | [diff] [blame] | 1 | /* |
| 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/api.h" |
| 10 | #include "hf/check.h" |
| 11 | #include "hf/vm.h" |
| 12 | |
Karl Meakin | 117c808 | 2024-12-04 16:03:28 +0000 | [diff] [blame] | 13 | void ffa_interrupts_handle_secure_interrupt(struct vcpu *current, |
| 14 | struct vcpu **next) |
Karl Meakin | 8e58ddc | 2024-11-08 23:19:34 +0000 | [diff] [blame] | 15 | { |
| 16 | (void)current; |
| 17 | (void)next; |
| 18 | |
| 19 | /* |
| 20 | * SPMD uses FFA_INTERRUPT ABI to convey secure interrupt to |
| 21 | * SPMC. Execution should not reach hypervisor with this ABI. |
| 22 | */ |
| 23 | CHECK(false); |
| 24 | } |
| 25 | |
Karl Meakin | 117c808 | 2024-12-04 16:03:28 +0000 | [diff] [blame] | 26 | bool ffa_interrupts_inject_notification_pending_interrupt( |
Karl Meakin | 8e58ddc | 2024-11-08 23:19:34 +0000 | [diff] [blame] | 27 | struct vcpu_locked target_locked, struct vcpu_locked current_locked, |
| 28 | struct vm_locked receiver_locked) |
| 29 | { |
| 30 | (void)target_locked; |
| 31 | (void)current_locked; |
| 32 | (void)receiver_locked; |
| 33 | |
| 34 | return false; |
| 35 | } |
| 36 | |
| 37 | /** |
| 38 | * Enable relevant virtual interrupts for VMs. |
| 39 | */ |
Karl Meakin | 117c808 | 2024-12-04 16:03:28 +0000 | [diff] [blame] | 40 | void ffa_interrupts_enable_virtual_interrupts(struct vcpu_locked current_locked, |
| 41 | struct vm_locked vm_locked) |
Karl Meakin | 8e58ddc | 2024-11-08 23:19:34 +0000 | [diff] [blame] | 42 | { |
| 43 | struct vcpu *current; |
| 44 | struct interrupts *interrupts; |
| 45 | |
| 46 | current = current_locked.vcpu; |
| 47 | interrupts = ¤t->interrupts; |
| 48 | |
| 49 | if (vm_locked.vm->notifications.enabled) { |
| 50 | vcpu_virt_interrupt_set_enabled(interrupts, |
| 51 | HF_NOTIFICATION_PENDING_INTID); |
| 52 | } |
| 53 | } |
| 54 | |
Karl Meakin | 117c808 | 2024-12-04 16:03:28 +0000 | [diff] [blame] | 55 | uint32_t ffa_interrupts_get(struct vcpu_locked current_locked) |
Karl Meakin | 8e58ddc | 2024-11-08 23:19:34 +0000 | [diff] [blame] | 56 | { |
| 57 | return api_interrupt_get(current_locked); |
| 58 | } |
Karl Meakin | 8d24554 | 2025-01-31 13:19:25 +0000 | [diff] [blame] | 59 | |
| 60 | bool ffa_interrupts_intercept_call(struct vcpu_locked current_locked, |
| 61 | struct vcpu_locked next_locked, |
| 62 | struct ffa_value *signal_interrupt) |
| 63 | { |
| 64 | (void)current_locked; |
| 65 | (void)next_locked; |
| 66 | (void)signal_interrupt; |
| 67 | |
| 68 | return false; |
| 69 | } |