refactor: rename helpers for legacy abort behavior

No functional change. Since the FF-A v1.3 ALP2 spec introduces a new
ABI i.e., FFA_ABORT, and introduces additional guidance for aborting the
execution context of a partition, the existing function has been
renamed to avoid confusion.

Change-Id: I4f0e6cd886b33976b084ec3100371f5d46b5ce50
Signed-off-by: Madhukar Pappireddy <madhukar.pappireddy@arm.com>
diff --git a/src/api.c b/src/api.c
index 9a183a8..816bf16 100644
--- a/src/api.c
+++ b/src/api.c
@@ -350,25 +350,18 @@
 }
 
 /**
- * Aborts the vCPU and triggers its VM to abort fully.
+ * Aborts the vCPU and triggers its VM to terminate fully.
  */
-struct vcpu *api_abort(struct vcpu *current)
+struct vcpu *api_terminate_vm(struct vcpu *current)
 {
 	struct ffa_value ret = ffa_error(FFA_ABORTED);
 	struct vcpu_locked current_locked;
 	struct vcpu *next;
 	struct vm_locked vm_locked;
 
-	dlog_notice("Aborting VM %#x vCPU %u\n", current->vm->id,
+	dlog_notice("Terminating VM %#x vCPU %u\n", current->vm->id,
 		    vcpu_index(current));
 
-	if (vm_is_primary(current->vm)) {
-		/* TODO: what to do when the primary aborts? */
-		for (;;) {
-			/* Do nothing. */
-		}
-	}
-
 	atomic_store_explicit(&current->vm->aborting, true,
 			      memory_order_relaxed);
 
diff --git a/src/arch/aarch64/hypervisor/handler.c b/src/arch/aarch64/hypervisor/handler.c
index 7bacd2e..56ca9e0 100644
--- a/src/arch/aarch64/hypervisor/handler.c
+++ b/src/arch/aarch64/hypervisor/handler.c
@@ -1165,7 +1165,7 @@
 			 * page.
 			 */
 			if (!resume || ((esr & 0x3f) == 0x21)) {
-				return api_abort(vcpu);
+				return api_terminate_vm(vcpu);
 			}
 		}
 
@@ -1188,7 +1188,7 @@
 
 		if (is_el0_partition) {
 			dlog_warning("Instruction abort on EL0 partition\n");
-			return api_abort(vcpu);
+			return api_terminate_vm(vcpu);
 		}
 
 		/* Inform the EL1 of the instruction abort. */
@@ -1202,7 +1202,7 @@
 	case EC_HVC:
 		if (is_el0_partition) {
 			dlog_warning("Unexpected HVC Trap on EL0 partition\n");
-			return api_abort(vcpu);
+			return api_terminate_vm(vcpu);
 		}
 		return hvc_handler(vcpu);
 
@@ -1232,7 +1232,7 @@
 	}
 
 	if (is_el0_partition) {
-		return api_abort(vcpu);
+		return api_terminate_vm(vcpu);
 	}
 
 	/*
@@ -1286,7 +1286,7 @@
 			dlog_warning(
 				"Unexpected system register access by EL0 "
 				"partition\n");
-			return api_abort(vcpu);
+			return api_terminate_vm(vcpu);
 		}
 
 		inject_el1_sysreg_trap_exception(vcpu, esr_el2);