fix: restrict HF_INTERRUPT_INJECT to Hypervisor
The HF_INTERRUPT_INJECT is only necessary to the PVM for injecting
virtual interrupts to secondary VMs, in context of Hafnium built
as an Hypervisor. There is no usage in context of the SPMC hence
mask out this API in this configuration.
Signed-off-by: Olivier Deprez <olivier.deprez@arm.com>
Change-Id: I58d75fc39dc925e1878a6c7e5722db5c8fe611e2
diff --git a/src/arch/aarch64/hypervisor/handler.c b/src/arch/aarch64/hypervisor/handler.c
index ab7f9a1..592b384 100644
--- a/src/arch/aarch64/hypervisor/handler.c
+++ b/src/arch/aarch64/hypervisor/handler.c
@@ -1045,22 +1045,12 @@
case HF_MAILBOX_WAITER_GET:
vcpu->regs.r[0] = plat_ffa_mailbox_waiter_get(args.arg1, vcpu);
break;
-#endif
- case HF_INTERRUPT_ENABLE:
- vcpu->regs.r[0] = api_interrupt_enable(args.arg1, args.arg2,
- args.arg3, vcpu);
- break;
-
- case HF_INTERRUPT_GET:
- vcpu->regs.r[0] = api_interrupt_get(vcpu);
- break;
case HF_INTERRUPT_INJECT:
vcpu->regs.r[0] = api_interrupt_inject(args.arg1, args.arg2,
args.arg3, vcpu, &next);
break;
-
-#if SECURE_WORLD == 1
+#else
case HF_INTERRUPT_DEACTIVATE:
vcpu->regs.r[0] = plat_ffa_interrupt_deactivate(
args.arg1, args.arg2, vcpu);
@@ -1071,6 +1061,14 @@
args.arg1, args.arg2, args.arg3, vcpu);
break;
#endif
+ case HF_INTERRUPT_ENABLE:
+ vcpu->regs.r[0] = api_interrupt_enable(args.arg1, args.arg2,
+ args.arg3, vcpu);
+ break;
+
+ case HF_INTERRUPT_GET:
+ vcpu->regs.r[0] = api_interrupt_get(vcpu);
+ break;
default:
vcpu->regs.r[0] = SMCCC_ERROR_UNKNOWN;