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

[PATCH] x86/tsc: Fix diagnostics for TSC frequency


  • To: Xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
  • Date: Wed, 5 Aug 2020 15:18:04 +0100
  • Authentication-results: esa1.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none
  • Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Jan Beulich <JBeulich@xxxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>
  • Delivery-date: Wed, 05 Aug 2020 14:18:48 +0000
  • Ironport-sdr: yzYfChoYxqjXz6ZNKPrQGxfomKQf/lwxSR0u6zFXYBscLaDeYVSFkkF6r3ordtJAJyfAtaeW0W xugH1geM/s0FmSlhkicjqr8XsFtANsPJBd0xl4KPAmPcdVQaIOdNAPgp/Gyx01gVnYDjxDtubY VggY7gMlsl+EVZNJmGADmnp9tTDiuSahFMAxxICq5PmUKHDg8RKrkpVOJ8DhHpt/MYr00NNkBl EJXxqV5JehOuZu3R6Yc8YlH70U4pFGQL2vU1+MRtZhWnm2lplAbgOEQHQa2L4tvOhUYzVFctH0 s5I=
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

A Gemini Lake platform prints:

  (XEN) CPU0: TSC: 19200000MHz * 279 / 3 = 1785600000MHz
  (XEN) CPU0: 800..1800 MHz

during boot.  The units on the first line are Hz, not MHz, so correct that and
add a space for clarity.

Also, for the min/max line, use three dots instead of two and add more spaces
so that the line can't be mistaken for being a double decimal point typo.

Boot now reads:

  (XEN) CPU0: TSC: 19200000 Hz * 279 / 3 = 1785600000 Hz
  (XEN) CPU0: 800 ... 1800 MHz

Extend these changes to the other TSC diagnostics.

Signed-off-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
---
CC: Jan Beulich <JBeulich@xxxxxxxx>
CC: Wei Liu <wl@xxxxxxx>
CC: Roger Pau Monné <roger.pau@xxxxxxxxxx>
---
 xen/arch/x86/cpu/amd.c   |  4 ++--
 xen/arch/x86/cpu/intel.c | 12 ++++++------
 2 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/xen/arch/x86/cpu/amd.c b/xen/arch/x86/cpu/amd.c
index 0cc6853c42..8bc51bec10 100644
--- a/xen/arch/x86/cpu/amd.c
+++ b/xen/arch/x86/cpu/amd.c
@@ -624,10 +624,10 @@ void amd_log_freq(const struct cpuinfo_x86 *c)
        if (idx && idx < h &&
            !rdmsr_safe(0xC0010064 + idx, val) && (val >> 63) &&
            !rdmsr_safe(0xC0010064, hi) && (hi >> 63))
-               printk("CPU%u: %lu (%lu..%lu) MHz\n",
+               printk("CPU%u: %lu (%lu ... %lu) MHz\n",
                       smp_processor_id(), FREQ(val), FREQ(lo), FREQ(hi));
        else if (h && !rdmsr_safe(0xC0010064, hi) && (hi >> 63))
-               printk("CPU%u: %lu..%lu MHz\n",
+               printk("CPU%u: %lu ... %lu MHz\n",
                       smp_processor_id(), FREQ(lo), FREQ(hi));
        else
                printk("CPU%u: %lu MHz\n", smp_processor_id(), FREQ(lo));
diff --git a/xen/arch/x86/cpu/intel.c b/xen/arch/x86/cpu/intel.c
index 69e99bb358..ed70b43942 100644
--- a/xen/arch/x86/cpu/intel.c
+++ b/xen/arch/x86/cpu/intel.c
@@ -396,14 +396,14 @@ static void intel_log_freq(const struct cpuinfo_x86 *c)
 
             val *= ebx;
             do_div(val, eax);
-            printk("CPU%u: TSC: %uMHz * %u / %u = %LuMHz\n",
+            printk("CPU%u: TSC: %u Hz * %u / %u = %Lu Hz\n",
                    smp_processor_id(), ecx, ebx, eax, val);
         }
         else if ( ecx | eax | ebx )
         {
             printk("CPU%u: TSC:", smp_processor_id());
             if ( ecx )
-                printk(" core: %uMHz", ecx);
+                printk(" core: %u MHz", ecx);
             if ( ebx && eax )
                 printk(" ratio: %u / %u", ebx, eax);
             printk("\n");
@@ -417,11 +417,11 @@ static void intel_log_freq(const struct cpuinfo_x86 *c)
         {
             printk("CPU%u:", smp_processor_id());
             if ( ecx )
-                printk(" bus: %uMHz", ecx);
+                printk(" bus: %u MHz", ecx);
             if ( eax )
-                printk(" base: %uMHz", eax);
+                printk(" base: %u MHz", eax);
             if ( ebx )
-                printk(" max: %uMHz", ebx);
+                printk(" max: %u MHz", ebx);
             printk("\n");
         }
     }
@@ -446,7 +446,7 @@ static void intel_log_freq(const struct cpuinfo_x86 *c)
 
         printk("CPU%u: ", smp_processor_id());
         if ( min_ratio )
-            printk("%u..", (factor * min_ratio + 50) / 100);
+            printk("%u ... ", (factor * min_ratio + 50) / 100);
         printk("%u MHz\n", (factor * max_ratio + 50) / 100);
     }
 }
-- 
2.11.0




 


Rackspace

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