blob: 512cc5718460ad607eedf0ed55e653d1349673a2 [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
13void plat_ffa_handle_secure_interrupt(struct vcpu *current, struct vcpu **next)
14{
15 (void)current;
16 (void)next;
17
18 /*
19 * SPMD uses FFA_INTERRUPT ABI to convey secure interrupt to
20 * SPMC. Execution should not reach hypervisor with this ABI.
21 */
22 CHECK(false);
23}
24
25bool plat_ffa_inject_notification_pending_interrupt(
26 struct vcpu_locked target_locked, struct vcpu_locked current_locked,
27 struct vm_locked receiver_locked)
28{
29 (void)target_locked;
30 (void)current_locked;
31 (void)receiver_locked;
32
33 return false;
34}
35
36/**
37 * Enable relevant virtual interrupts for VMs.
38 */
39void plat_ffa_enable_virtual_interrupts(struct vcpu_locked current_locked,
40 struct vm_locked vm_locked)
41{
42 struct vcpu *current;
43 struct interrupts *interrupts;
44
45 current = current_locked.vcpu;
46 interrupts = &current->interrupts;
47
48 if (vm_locked.vm->notifications.enabled) {
49 vcpu_virt_interrupt_set_enabled(interrupts,
50 HF_NOTIFICATION_PENDING_INTID);
51 }
52}
53
54uint32_t plat_ffa_interrupt_get(struct vcpu_locked current_locked)
55{
56 return api_interrupt_get(current_locked);
57}