Introduce typedef for vCPU index.

Change-Id: I51194706edb86811487f2a22b3bda5405e605b5e
diff --git a/src/cpu.c b/src/cpu.c
index affba4a..eeea904 100644
--- a/src/cpu.c
+++ b/src/cpu.c
@@ -22,6 +22,7 @@
 
 #include "hf/api.h"
 #include "hf/dlog.h"
+#include "hf/spci.h"
 #include "hf/std.h"
 #include "hf/vm.h"
 
@@ -203,9 +204,12 @@
 	vcpu.vcpu->state = VCPU_STATE_READY;
 }
 
-size_t vcpu_index(const struct vcpu *vcpu)
+spci_vcpu_index_t vcpu_index(const struct vcpu *vcpu)
 {
-	return vcpu - vcpu->vm->vcpus;
+	size_t index = vcpu - vcpu->vm->vcpus;
+
+	assert(index < UINT16_MAX);
+	return index;
 }
 
 /**