Generate VM IDs with an offset of 1

The SMCCC reserves VM ID 0 for the hypervisor itself, therefore, other VM IDs
should start after that (at least, but not necessarily at 1).

- Generate VM IDs with an offset defined by HF_VM_ID_OFFSET (currently 1)
- Fix hardcoded IDs and other code that assumes VM IDs start at 0.

Bug: 132421503
Change-Id: I47cff8734ac153dcb1a1a435285153d6caf2877e
diff --git a/inc/vmapi/hf/spci.h b/inc/vmapi/hf/spci.h
index cad5e35..99664ed 100644
--- a/inc/vmapi/hf/spci.h
+++ b/inc/vmapi/hf/spci.h
@@ -67,7 +67,7 @@
 
 /* clang-format on */
 
-/** The ID of a VM. These are assigned sequentially. */
+/** The ID of a VM. These are assigned sequentially starting with an offset. */
 typedef uint16_t spci_vm_id_t;
 typedef uint32_t spci_memory_handle_t;
 
diff --git a/inc/vmapi/hf/types.h b/inc/vmapi/hf/types.h
index 0479012..f54d7d7 100644
--- a/inc/vmapi/hf/types.h
+++ b/inc/vmapi/hf/types.h
@@ -33,10 +33,21 @@
 
 #endif
 
-/** The ID of the primary VM which is responsible for scheduling. */
-#define HF_PRIMARY_VM_ID 0
+/**
+ * An offset to use when assigning VM IDs.
+ * The offset is needed because VM ID 0 is reserved.
+ */
+#define HF_VM_ID_OFFSET 1
 
-/* Sleep value for an indefinite period of time. */
+/**
+ * The ID of the primary VM, which is responsible for scheduling.
+ *
+ * Starts at the offset because ID 0 is reserved for the hypervisor itself.
+ * All other VM IDs come after the primary.
+ */
+#define HF_PRIMARY_VM_ID HF_VM_ID_OFFSET
+
+/** Sleep value for an indefinite period of time. */
 #define HF_SLEEP_INDEFINITE 0xffffffffffffff
 
 /** The amount of data that can be sent to a mailbox. */