blob: 1877983b148481cdbc9ac782508a25c82f8de935 [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{
Karl Meakin8e58ddc2024-11-08 23:19:34 +000041 if (vm_locked.vm->notifications.enabled) {
Daniel Boulbyd633a612025-03-07 18:08:04 +000042 vcpu_virt_interrupt_enable(current_locked,
43 HF_NOTIFICATION_PENDING_INTID, true);
Karl Meakin8e58ddc2024-11-08 23:19:34 +000044 }
45}
46
Karl Meakin8d245542025-01-31 13:19:25 +000047bool ffa_interrupts_intercept_call(struct vcpu_locked current_locked,
48 struct vcpu_locked next_locked,
49 struct ffa_value *signal_interrupt)
50{
51 (void)current_locked;
52 (void)next_locked;
53 (void)signal_interrupt;
Karl Meakin8d245542025-01-31 13:19:25 +000054 return false;
55}