This is easily verifiable on both Xenial and Bionic guests from uvt-kvm.
I've brought up both as nested instances, and TSC fails to show up as an
available clocksource:

== Xenial guest ==
$ uvt-kvm ssh bionic-l1

ubuntu@bionic-l1:~$ uvt-kvm ssh xenial-l2

ubuntu@xenial-l2:~$ uname -r
4.4.0-143-generic

ubuntu@xenial-l2:~$ cat 
/sys/devices/system/clocksource/clocksource0/available_clocksource
kvm-clock hpet acpi_pm

ubuntu@xenial-l2:~$ dmesg | grep -i tsc
[    0.000000] tsc: Detected 1997.676 MHz processor

== Bionic guest ==
$ uvt-kvm ssh bionic-l1

ubuntu@bionic-l1:~$ uvt-kvm ssh bionic-l2

ubuntu@bionic-l2:~$ uname -r
4.15.0-46-generic

ubuntu@bionic-l2:~$ cat 
/sys/devices/system/clocksource/clocksource0/available_clocksource
kvm-clock hpet acpi_pm

ubuntu@bionic-l2:~$ dmesg | grep -i tsc
[    0.052000] tsc: Detected 1997.676 MHz processor

==

>From what I've tested, it doesn't seem to matter which L1 kernel is
running, since they usually have TSC available. This seems to be an
issue only on nested guests.

** Description changed:

  [Impact]
   * TSC clocksource not available in nested guests
  
  [Test Case]
   * Spin up a nested Xenial/Bionic guest and check for 'tsc' at
     /sys/devices/system/clocksource/clocksource0/available_clocksource
  
  [Regression Potential]
   * The regression potential is low. Upstream code still maintains this
     behaviour of skipping calibration on guests, and tsc code verifies if
     the frequency is known before registering the clocksource
  
   * Patches were verified against the above test case, and also tested
     with stress-ng in both nested and non-nested guest scenarios
  
  [Fix]
   * By applying the upstream commits [0] [1], we skip refined calibration and
     register TSC as a clocksource directly if its frequency is known (via
     MSR or CPUID)
  
+  * Cosmic onwards (kernel 4.18+) are already fixed
+ 
  [0] For Xenial only - https://git.kernel.org/linus/47c95a46d0f
  [1] https://git.kernel.org/linus/e10f78050323

-- 
You received this bug notification because you are a member of Kernel
Packages, which is subscribed to linux in Ubuntu.
https://bugs.launchpad.net/bugs/1822821

Title:
  TSC clocksource not available in nested guests

Status in linux package in Ubuntu:
  Incomplete
Status in linux source package in Xenial:
  Confirmed
Status in linux source package in Bionic:
  Confirmed

Bug description:
  [Impact]
   * TSC clocksource not available in nested guests

  [Test Case]
   * Spin up a nested Xenial/Bionic guest and check for 'tsc' at
     /sys/devices/system/clocksource/clocksource0/available_clocksource

  [Regression Potential]
   * The regression potential is low. Upstream code still maintains this
     behaviour of skipping calibration on guests, and tsc code verifies if
     the frequency is known before registering the clocksource

   * Patches were verified against the above test case, and also tested
     with stress-ng in both nested and non-nested guest scenarios

  [Fix]
   * By applying the upstream commits [0] [1], we skip refined calibration and
     register TSC as a clocksource directly if its frequency is known (via
     MSR or CPUID)

   * Cosmic onwards (kernel 4.18+) are already fixed

  [0] For Xenial only - https://git.kernel.org/linus/47c95a46d0f
  [1] https://git.kernel.org/linus/e10f78050323

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1822821/+subscriptions

-- 
Mailing list: https://launchpad.net/~kernel-packages
Post to     : kernel-packages@lists.launchpad.net
Unsubscribe : https://launchpad.net/~kernel-packages
More help   : https://help.launchpad.net/ListHelp

Reply via email to