From: Oliver Kurth Date: Fri, 15 Sep 2017 18:22:39 +0000 (-0700) Subject: Add a stolen time interface for guests X-Git-Tag: stable-10.2.0~750 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=71aedd8d535ebeaf29a2ffa780176f8bb72cb87c;p=thirdparty%2Fopen-vm-tools.git Add a stolen time interface for guests 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. --- diff --git a/open-vm-tools/lib/include/backdoor_def.h b/open-vm-tools/lib/include/backdoor_def.h index 4d1a95203..682b581fa 100644 --- a/open-vm-tools/lib/include/backdoor_def.h +++ b/open-vm-tools/lib/include/backdoor_def.h @@ -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 @@ -212,7 +212,16 @@ # 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 /*