[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen master] x86/time: extend "tsc" param with "stable:socket"



commit bc900cbc8f37b93cc6c9f6370beb14e6430b334d
Author:     Joao Martins <joao.m.martins@xxxxxxxxxx>
AuthorDate: Fri Sep 23 18:26:19 2016 +0200
Commit:     Jan Beulich <jbeulich@xxxxxxxx>
CommitDate: Fri Sep 23 18:26:19 2016 +0200

    x86/time: extend "tsc" param with "stable:socket"
    
    Extend the "tsc" boot parameter is to further relax TSC restrictions and
    allow it to be used on machines that guarantee reliable TSC across
    sockets. This is up to board manufacturers and there's no way for the OS
    to probe this property, therefore user needs to explicitly set this option.
    
    Also make one style adjustment that is to remove the unnecessary
    parenthesis around clearing TSC_RELIABLE.
    
    Signed-off-by: Joao Martins <joao.m.martins@xxxxxxxxxx>
    Reviewed-by: Jan Beulich <jbeulich@xxxxxxxx>
---
 docs/misc/xen-command-line.markdown |  6 ++++--
 xen/arch/x86/time.c                 | 11 ++++++++---
 2 files changed, 12 insertions(+), 5 deletions(-)

diff --git a/docs/misc/xen-command-line.markdown 
b/docs/misc/xen-command-line.markdown
index 07ecd5e..8ff57fa 100644
--- a/docs/misc/xen-command-line.markdown
+++ b/docs/misc/xen-command-line.markdown
@@ -270,7 +270,9 @@ If set, override Xen's default choice for the platform 
timer.
 Having TSC as platform timer requires being explicitly set. This is because
 TSC can only be safely used if CPU hotplug isn't performed on the system. On
 some platforms, the "maxcpus" option may need to be used to further adjust
-the number of allowed CPUs.
+the number of allowed CPUs.  When running on platforms that can guarantee a
+monotonic TSC across sockets you may want to adjust the "tsc" command line
+parameter to "stable:socket".
 
 ### cmci-threshold
 > `= <integer>`
@@ -1508,7 +1510,7 @@ pages) must also be specified via the tbuf\_size 
parameter.
 > `= <integer>`
 
 ### tsc
-> `= unstable | skewed`
+> `= unstable | skewed | stable:socket`
 
 ### ucode
 > `= [<integer> | scan]`
diff --git a/xen/arch/x86/time.c b/xen/arch/x86/time.c
index d307d93..dda89d8 100644
--- a/xen/arch/x86/time.c
+++ b/xen/arch/x86/time.c
@@ -477,6 +477,10 @@ uint64_t ns_to_acpi_pm_tick(uint64_t ns)
 /************************************************************
  * PLATFORM TIMER 4: TSC
  */
+static unsigned int __initdata tsc_flags;
+
+/* TSC is reliable across sockets */
+#define TSC_RELIABLE_SOCKET (1 << 0)
 
 /*
  * Called in verify_tsc_reliability() under reliable TSC conditions
@@ -492,7 +496,7 @@ static s64 __init init_tsc(struct platform_timesource *pts)
         ret = 0;
     }
 
-    if ( nr_sockets > 1 )
+    if ( nr_sockets > 1 && !(tsc_flags & TSC_RELIABLE_SOCKET) )
     {
         printk(XENLOG_WARNING "TSC: Not invariant across sockets\n");
         ret = 0;
@@ -1855,6 +1859,7 @@ int hwdom_pit_access(struct ioreq *ioreq)
 /*
  * tsc=unstable: Override all tests; assume TSC is unreliable.
  * tsc=skewed: Assume TSCs are individually reliable, but skewed across CPUs.
+ * tsc=stable:socket: Assume TSCs are reliable across sockets.
  */
 static void __init tsc_parse(const char *s)
 {
@@ -1865,9 +1870,9 @@ static void __init tsc_parse(const char *s)
         setup_clear_cpu_cap(X86_FEATURE_TSC_RELIABLE);
     }
     else if ( !strcmp(s, "skewed") )
-    {
         setup_clear_cpu_cap(X86_FEATURE_TSC_RELIABLE);
-    }
+    else if ( !strcmp(s, "stable:socket") )
+        tsc_flags |= TSC_RELIABLE_SOCKET;
 }
 custom_param("tsc", tsc_parse);
 
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxx
https://lists.xenproject.org/xen-changelog

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.