UPSTREAM: commonlib: Add timestamp IDs for Chrome OS hypervisor

Chrome OS is experimenting with a hypervisor layer that boots after
firmware, but before the OS. From the OS' perspective, it can be
considered an extension of firmware, and hence it makes sense to emit
timestamp to track hypervisor boot latency. This change adds
timestamp IDs in the 1200-1300 range for this purpose.

BUG=b:217638034
BRANCH=none
TEST=Manual: cbmem -a TS_CRHV_BOOT to add a timestamp, cbmem -t to
verify that it got added to the timestamp table.

Signed-off-by: Mattias Nissler <mnissler@chromium.org>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/64226
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Julius Werner <jwerner@chromium.org>
Original-Change-Id: If70447eea2c2edf42b43e0198b827c1348b935ea
GitOrigin-RevId: c8c6185d8eda1a58a1c7084812e93fb3d2c8f254
Change-Id: Ifa10aafa6e22c84668239338d41790b91ab1dc34
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/coreboot/+/3644035
Reviewed-by: Peter Marheine <pmarheine@chromium.org>
Commit-Queue: Peter Marheine <pmarheine@chromium.org>
Tested-by: CopyBot Service Account <copybot.service@gmail.com>
diff --git a/src/commonlib/include/commonlib/timestamp_serialized.h b/src/commonlib/include/commonlib/timestamp_serialized.h
index 63b7806..79e70b7 100644
--- a/src/commonlib/include/commonlib/timestamp_serialized.h
+++ b/src/commonlib/include/commonlib/timestamp_serialized.h
@@ -144,9 +144,9 @@
 	/* 990+ reserved for vendorcode extensions (990-999: Intel ME continued) */
 	TS_ME_ROM_START = 990,
 
-	/* 1000+ reserved for payloads (1000-1200: ChromeOS depthcharge) */
+	/* 1000+ reserved for payloads */
 
-	/* Depthcharge entry IDs start at 1000 */
+	/* 1000-1200: Depthcharge */
 	TS_DC_START = 1000,
 
 	TS_RO_PARAMS_INIT = 1001,
@@ -164,6 +164,16 @@
 
 	TS_KERNEL_START = 1101,
 	TS_KERNEL_DECOMPRESSION = 1102,
+
+	/* 1200-1300: Chrome OS Hypervisor */
+	TS_CRHV_BOOT = 1200,
+	TS_CRHV_PLATFORM_INIT = 1201,
+	TS_CRHV_SERVICES_STARTED = 1202,
+	TS_CRHV_HW_PASSTRHOUGH_START = 1203,
+	TS_CRHV_HW_PASSTRHOUGH_END = 1204,
+	TS_CRHV_PSTORE_START = 1205,
+	TS_CRHV_PSTORE_END = 1206,
+	TS_CRHV_VMM_START = 1207,
 };
 
 #define TS_NAME_DEF(id, id_end, desc) {(id), (id_end),  STRINGIFY(id), (desc)}
@@ -333,6 +343,18 @@
 
 	TS_NAME_DEF(TS_KERNEL_START, 0, "jumping to kernel"),
 	TS_NAME_DEF(TS_KERNEL_DECOMPRESSION, 0, "starting kernel decompression/relocation"),
+
+	/* Chrome OS hypervisor */
+	TS_NAME_DEF(TS_CRHV_BOOT, 0, "hypervisor boot finished"),
+	TS_NAME_DEF(TS_CRHV_PLATFORM_INIT, 0, "hypervisor platform initialized"),
+	TS_NAME_DEF(TS_CRHV_SERVICES_STARTED, 0, "hypervisor services started"),
+	TS_NAME_DEF(TS_CRHV_HW_PASSTRHOUGH_START, TS_CRHV_HW_PASSTRHOUGH_END,
+		    "hypervisor hardware passtrough setup start"),
+	TS_NAME_DEF(TS_CRHV_HW_PASSTRHOUGH_END, 0,
+		    "hypervisor hardware passtrhough setup complete"),
+	TS_NAME_DEF(TS_CRHV_PSTORE_START, TS_CRHV_PSTORE_END, "hypervisor pstore init start"),
+	TS_NAME_DEF(TS_CRHV_PSTORE_END, 0, "hypervisor pstore init complete"),
+	TS_NAME_DEF(TS_CRHV_VMM_START, 0, "hypervisor OS VMM start"),
 };
 
 #endif