Add helper functions for VM/vCPU IDs in SPCI calls.

This also changes all calls to encode VM IDs in high bits, vCPU index in
low bits. This is inconsistent with the current spec but is what we
expect it to be corrected to in the next draft.

Change-Id: I3da130b9070c6c43856509ba80b532e7e8c263e0
diff --git a/inc/vmapi/hf/spci.h b/inc/vmapi/hf/spci.h
index d5d55ff..fe8e7df 100644
--- a/inc/vmapi/hf/spci.h
+++ b/inc/vmapi/hf/spci.h
@@ -207,6 +207,22 @@
 	return args.arg4;
 }
 
+static inline spci_vm_id_t spci_vm_id(struct spci_value args)
+{
+	return (args.arg1 >> 16) & 0xffff;
+}
+
+static inline spci_vcpu_index_t spci_vcpu_index(struct spci_value args)
+{
+	return args.arg1 & 0xffff;
+}
+
+static inline uint64_t spci_vm_vcpu(spci_vm_id_t vm_id,
+				    spci_vcpu_index_t vcpu_index)
+{
+	return ((uint32_t)vm_id << 16) | vcpu_index;
+}
+
 struct spci_architected_message_header {
 	uint16_t type;