]> git.ipfire.org Git - thirdparty/open-vm-tools.git/commitdiff
Add a stolen time interface for guests
authorOliver Kurth <okurth@vmware.com>
Fri, 15 Sep 2017 18:22:39 +0000 (11:22 -0700)
committerOliver Kurth <okurth@vmware.com>
Fri, 15 Sep 2017 18:22:39 +0000 (11:22 -0700)
This change adds a cheap stolen time interface for guests. Guests must
use the backdoor port to register a per-VCPU object in memory called the
"stealclock" with the monitor. From then on, until the clock is
disabled, the monitor publishes clock values whenever stolen time is
accumulated. A complete specification of the interface is included in
this change, as a text document: bora/doc/stealclock.txt.

Pending clock updates are represented by an idempotent monitor action,
posted whenever stolen time is accumulated. In the current
implementation, this is whenever we update stolen time on transit from
host to vmm. In the future, it may an action posted by the vmkernel,
whenever stolen time is updated.

open-vm-tools/lib/include/backdoor_def.h

index 4d1a9520366ff32137ce639db2d0d5c46f378679..682b581fa83be68826825d0f8befb92c4fd796b5 100644 (file)
@@ -1,5 +1,5 @@
 /*********************************************************
- * Copyright (C) 1998-2015 VMware, Inc. All rights reserved.
+ * Copyright (C) 1998-2016 VMware, Inc. All rights reserved.
  *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms of the GNU Lesser General Public License as published
 #  define BDOOR_CMD_MKSSTATS_STOP             1
 #define   BDOOR_CMD_SECUREBOOT               89
 #define   BDOOR_CMD_COPY_PHYSMEM             90 /* Devel only. */
-#define   BDOOR_CMD_MAX                      91
+#define   BDOOR_CMD_STEALCLOCK               91 /* CPL 0 only. */
+#  define BDOOR_CMD_STCLK_STATUS              0
+#  define BDOOR_CMD_STCLK_ENABLE              1
+#  define BDOOR_CMD_STCLK_DISABLE             2
+#  define BDOOR_CMD_STCLK_STATUS_NOAVAIL      0
+#  define BDOOR_CMD_STCLK_STATUS_ENABLED      1
+#  define BDOOR_CMD_STCLK_STATUS_DISABLED     2
+#  define BDOOR_CMD_STCLK_OK                  0
+#  define BDOOR_CMD_STCLK_ERROR               1
+#define   BDOOR_CMD_MAX                      92
 
 
 /*