feat(ipi): introduce IPI paravirtualised interface

Interprocessor Interrupts (IPIs) allow an SP to send an interrupt to
itself on another CPU. This patch starts the implementation of this
feature and enables it for the case where the SP is in the RUNNING
state on the target_vcpu.

Signed-off-by: Daniel Boulby <daniel.boulby@arm.com>
Change-Id: Idd0e1a5863730ae0f169bd0f56ac3abcd2916870
diff --git a/inc/vmapi/hf/abi.h b/inc/vmapi/hf/abi.h
index ee700a0..ad3d5f1 100644
--- a/inc/vmapi/hf/abi.h
+++ b/inc/vmapi/hf/abi.h
@@ -19,6 +19,7 @@
 #define HF_INTERRUPT_GET               0xff04
 #define HF_INTERRUPT_DEACTIVATE	       0xff08
 #define HF_INTERRUPT_RECONFIGURE       0xff09
+#define HF_INTERRUPT_SEND_IPI	       0xff0a
 
 /* Custom FF-A-like calls returned from FFA_RUN. */
 #define HF_FFA_RUN_WAIT_FOR_INTERRUPT 0xff06
diff --git a/inc/vmapi/hf/call.h b/inc/vmapi/hf/call.h
index 52c2cef..5fceae6 100644
--- a/inc/vmapi/hf/call.h
+++ b/inc/vmapi/hf/call.h
@@ -407,6 +407,14 @@
 					(uint32_t)target_cpu_index);
 }
 
+/**
+ * Trigger an IPI to target vcpu.
+ */
+static inline int64_t hf_interrupt_send_ipi(ffa_vcpu_index_t target_vcpu_id)
+{
+	return hf_call(HF_INTERRUPT_SEND_IPI, (uint32_t)target_vcpu_id, 0, 0);
+}
+
 /** Obtains the Hafnium's version of the implemented FF-A specification. */
 static inline enum ffa_version ffa_version(enum ffa_version requested_version)
 {
diff --git a/inc/vmapi/hf/types.h b/inc/vmapi/hf/types.h
index 4c2d5da..8191a78 100644
--- a/inc/vmapi/hf/types.h
+++ b/inc/vmapi/hf/types.h
@@ -61,5 +61,11 @@
 /** The virtual interrupt ID used for notification pending interrupt. */
 #define HF_NOTIFICATION_PENDING_INTID 5
 
+/**
+ * The interrupt ID (for both physical and virtual) used for
+ * the inter-processor interrupt.
+ */
+#define HF_IPI_INTID 9
+
 /** The physical interrupt ID use for the schedule receiver interrupt. */
 #define HF_SCHEDULE_RECEIVER_INTID 8