blob: 9bae658f1eb2d5359354e8e07a4a12a5b0631d20 [file] [log] [blame]
Karl Meakin8e58ddc2024-11-08 23:19:34 +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/api.h"
10#include "hf/check.h"
11#include "hf/vm.h"
12
Karl Meakin117c8082024-12-04 16:03:28 +000013void ffa_interrupts_handle_secure_interrupt(struct vcpu *current,
14 struct vcpu **next)
Karl Meakin8e58ddc2024-11-08 23:19:34 +000015{
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 Meakin117c8082024-12-04 16:03:28 +000026bool ffa_interrupts_inject_notification_pending_interrupt(
Karl Meakin8e58ddc2024-11-08 23:19:34 +000027 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 Meakin117c8082024-12-04 16:03:28 +000040void ffa_interrupts_enable_virtual_interrupts(struct vcpu_locked current_locked,
41 struct vm_locked vm_locked)
Karl Meakin8e58ddc2024-11-08 23:19:34 +000042{
43 struct vcpu *current;
44 struct interrupts *interrupts;
45
46 current = current_locked.vcpu;
47 interrupts = &current->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 Meakin117c8082024-12-04 16:03:28 +000055uint32_t ffa_interrupts_get(struct vcpu_locked current_locked)
Karl Meakin8e58ddc2024-11-08 23:19:34 +000056{
57 return api_interrupt_get(current_locked);
58}
Karl Meakin8d245542025-01-31 13:19:25 +000059
60bool 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}