From mboxrd@z Thu Jan 1 00:00:00 1970 From: Haozhong Zhang Subject: [PATCH v3 13/13] docs: Add descriptions of TSC scaling in xl.cfg and tscmode.txt Date: Thu, 31 Dec 2015 11:03:40 +0800 Message-ID: <1451531020-29964-14-git-send-email-haozhong.zhang@intel.com> References: <1451531020-29964-1-git-send-email-haozhong.zhang@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1451531020-29964-1-git-send-email-haozhong.zhang@intel.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: xen-devel@lists.xen.org, Jan Beulich , Boris Ostrovsky , Kevin Tian Cc: Haozhong Zhang , Keir Fraser , Suravee Suthikulpanit , Andrew Cooper , Aravind Gopalakrishnan , Jun Nakajima List-Id: xen-devel@lists.xenproject.org Signed-off-by: Haozhong Zhang --- Changes in v3: (addressing Kevin Tian's comments) * Reorganize words to address Kevin's comments. docs/man/xl.cfg.pod.5 | 14 +++++++++++++- docs/misc/tscmode.txt | 21 +++++++++++++++++++++ 2 files changed, 34 insertions(+), 1 deletion(-) diff --git a/docs/man/xl.cfg.pod.5 b/docs/man/xl.cfg.pod.5 index 8899f75..47aea0a 100644 --- a/docs/man/xl.cfg.pod.5 +++ b/docs/man/xl.cfg.pod.5 @@ -1313,9 +1313,17 @@ deprecated. Options are: =item B<"default"> -Guest rdtsc/p executed natively when monotonicity can be guaranteed +Guest rdtsc/p is executed natively when monotonicity can be guaranteed and emulated otherwise (with frequency scaled if necessary). +If a HVM container in B TSC mode is created on a host that +provides constant host TSC, its guest TSC frequency will be the same +as the host. If it is later migrated to another host that provide +constant host TSC and supports Intel VMX TSC scaling/AMD SVM TSC +ratio, its guest TSC frequency will be the same before and after +migration, and guest rdtsc/p will be executed natively as well after +migration. + =item B<"always_emulate"> Guest rdtsc/p always emulated at 1GHz (kernel and user). Guest rdtsc/p @@ -1337,6 +1345,10 @@ determine when a restore/migration has occurred and assumes guest obtains/uses pvclock-like mechanism to adjust for monotonicity and frequency changes. +If a HVM container in B TSC mode can execute both guest +rdtsc and guest rdtscp natively, then the guest TSC frequency will be +determined in the similar way to that of B TSC mode. + =back Please see F for more information on this option. diff --git a/docs/misc/tscmode.txt b/docs/misc/tscmode.txt index e8c84e8..01ee060 100644 --- a/docs/misc/tscmode.txt +++ b/docs/misc/tscmode.txt @@ -297,3 +297,24 @@ and also much faster than nearly all OS-provided time mechanisms. While pvrtscp is too complex for most apps, certain enterprise TSC-sensitive high-TSC-frequency apps may find it useful to obtain a significant performance gain. + +Hardware TSC Scaling + +Intel VMX TSC scaling and AMD SVM TSC ratio allow the guest TSC read +by guest rdtsc/p increasing in a different frequency than the host +TSC frequency. + +If a HVM container in default TSC mode (tsc_mode=0) or PVRDTSCP mode +(tsc_mode=3) is created on a host that provides constant TSC, its +guest TSC frequency will be the same as the host. If it is later +migrated to another host that provides constant TSC and supports Intel +VMX TSC scaling/AMD SVM TSC ratio, its guest TSC frequency will be the +same before and after migration. + +For above HVM container in default TSC mode (tsc_mode=0), if above +hosts support rdtscp, both guest rdtsc and rdtscp instructions will be +executed natively before and after migration. + +For above HVM container in PVRDTSCP mode (tsc_mode=3), if the +destination host does not support rdtscp, the guest rdtscp instruction +will be emulated with the guest TSC frequency. -- 2.4.8