blob: d0563827ab932ce5b3538feded7a846ebac65b57 [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(
Daniel Boulbyd49d0772025-01-15 11:19:36 +000027 struct vcpu_locked target_locked, struct vm_locked receiver_locked)
Karl Meakin8e58ddc2024-11-08 23:19:34 +000028{
29 (void)target_locked;
Karl Meakin8e58ddc2024-11-08 23:19:34 +000030 (void)receiver_locked;
31
32 return false;
33}
34
35/**
36 * Enable relevant virtual interrupts for VMs.
37 */
Karl Meakin117c8082024-12-04 16:03:28 +000038void ffa_interrupts_enable_virtual_interrupts(struct vcpu_locked current_locked,
39 struct vm_locked vm_locked)
Karl Meakin8e58ddc2024-11-08 23:19:34 +000040{
41 struct vcpu *current;
42 struct interrupts *interrupts;
43
44 current = current_locked.vcpu;
45 interrupts = &current->interrupts;
46
47 if (vm_locked.vm->notifications.enabled) {
48 vcpu_virt_interrupt_set_enabled(interrupts,
49 HF_NOTIFICATION_PENDING_INTID);
50 }
51}
52
Karl Meakin8d245542025-01-31 13:19:25 +000053bool ffa_interrupts_intercept_call(struct vcpu_locked current_locked,
54 struct vcpu_locked next_locked,
55 struct ffa_value *signal_interrupt)
56{
57 (void)current_locked;
58 (void)next_locked;
59 (void)signal_interrupt;
Karl Meakin8d245542025-01-31 13:19:25 +000060 return false;
61}