chore: drop hf_interrupt_inject
This is a legacy interface no longer required in the
context of the SPMC.
Signed-off-by: J-Alves <joao.alves@arm.com>
Change-Id: Ib56f66d0872ed2e01c609c9591531dd483ab7987
diff --git a/src/api.c b/src/api.c
index ccd0021..a0ac96f 100644
--- a/src/api.c
+++ b/src/api.c
@@ -2389,92 +2389,6 @@
}
/**
- * Returns whether the current vCPU is allowed to inject an interrupt into the
- * given VM and vCPU.
- */
-static inline bool is_injection_allowed(uint32_t target_vm_id,
- struct vcpu *current)
-{
- uint32_t current_vm_id = current->vm->id;
-
- /*
- * The primary VM is allowed to inject interrupts into any VM. Secondary
- * VMs are only allowed to inject interrupts into their own vCPUs.
- */
- return current_vm_id == HF_PRIMARY_VM_ID ||
- current_vm_id == target_vm_id;
-}
-
-/**
- * Injects a virtual interrupt of the given ID into the given target vCPU.
- * This doesn't cause the vCPU to actually be run immediately; it will be taken
- * when the vCPU is next run, which is up to the scheduler.
- *
- * Returns:
- * - -1 on failure because the target VM or vCPU doesn't exist, the interrupt
- * ID is invalid, or the current VM is not allowed to inject interrupts to
- * the target VM.
- * - 0 on success if no further action is needed.
- * - 1 if it was called by the primary VM and the primary VM now needs to wake
- * up or kick the target vCPU.
- */
-int64_t api_interrupt_inject(ffa_id_t target_vm_id,
- ffa_vcpu_index_t target_vcpu_idx, uint32_t intid,
- struct vcpu *current, struct vcpu **next)
-{
- struct vcpu *target_vcpu;
- struct vm *target_vm = vm_find(target_vm_id);
- struct vcpu_locked current_locked;
- struct vcpu_locked target_locked;
- struct two_vcpu_locked vcpus_locked;
- int64_t ret;
-
- if (intid >= HF_NUM_INTIDS) {
- return -1;
- }
-
- if (target_vm == NULL) {
- return -1;
- }
-
- if (target_vcpu_idx >= target_vm->vcpu_count) {
- /* The requested vCPU must exist. */
- return -1;
- }
-
- if (!is_injection_allowed(target_vm_id, current)) {
- return -1;
- }
-
- target_vcpu = vm_get_vcpu(target_vm, target_vcpu_idx);
-
- /* A VM could inject an interrupt for itself. */
- if (target_vcpu != current) {
- /* Lock both vCPUs at once to avoid deadlock. */
- vcpus_locked = vcpu_lock_both(current, target_vcpu);
- current_locked = vcpus_locked.vcpu1;
- target_locked = vcpus_locked.vcpu2;
- } else {
- current_locked = vcpu_lock(current);
- target_locked = current_locked;
- }
-
- dlog_verbose(
- "Injecting interrupt %u for VM %#x vCPU %u from VM %#x vCPU "
- "%u\n",
- intid, target_vm_id, target_vcpu_idx, current->vm->id,
- vcpu_index(current));
- ret = api_interrupt_inject_locked(target_locked, intid, current_locked,
- next);
- if (target_vcpu != current) {
- vcpu_unlock(&target_locked);
- }
-
- vcpu_unlock(¤t_locked);
- return ret;
-}
-
-/**
* Negotiate the FF-A version to be used for this FF-A instance.
* See section 13.2 of the FF-A v1.2 ALP1 spec.
*
diff --git a/src/arch/aarch64/hypervisor/handler.c b/src/arch/aarch64/hypervisor/handler.c
index 6c1fa0f..0244eae 100644
--- a/src/arch/aarch64/hypervisor/handler.c
+++ b/src/arch/aarch64/hypervisor/handler.c
@@ -1076,12 +1076,7 @@
}
switch (args.func) {
-#if SECURE_WORLD == 0
- case HF_INTERRUPT_INJECT:
- vcpu->regs.r[0] = api_interrupt_inject(args.arg1, args.arg2,
- args.arg3, vcpu, &next);
- break;
-#else
+#if SECURE_WORLD == 1
case HF_INTERRUPT_DEACTIVATE:
vcpu->regs.r[0] = plat_ffa_interrupt_deactivate(
args.arg1, args.arg2, vcpu);