Guest kernel can't read TSC frequency from the hypervisor
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
kvm (Ubuntu) |
Expired
|
Medium
|
Unassigned |
Bug Description
Binary package hint: kvm
Description of problem:
Guest kernel can't read TSC frequency from the hypervisor on hardy and interpid causing unstable TSC clocksource even if host has constant_tsc processor flag. This causes clock drifting on high load and freezing of guests with more than one cpu.
How reproducible:
Easily
Steps to Reproduce:
1. Boot host kernel with clocksource=tsc
2. Boot guest kernel with clocksource=tsc
3. dmesg | egrep "(tsc|TSC)" on guest
Actual results:
Hardy:
kernel version 2.6.24-24.53
[8739129.899892] Time: tsc clocksource has been installed.
[8739131.245835] Clocksource tsc unstable (delta = 144317765 ns)
Interpid:
kernel version: 2.6.27-14.41
[ 0.000000] TSC: Unable to calibrate against PIT
[ 0.000000] TSC: using PMTIMER reference calibration
Expected results:
kernel should read frequency from the hypervisor that results in stable TSC clocksource.
Aditional info:
I have tried this on jaunty host, but i'm not really sure if that matters, since the hypervisor supports it. Tried with CentOS 5.3, 2.6.18-164.el5 kernel and worked as expected.
relevant dmesg part from CentOS:
kvm_get_tsc_khz: cpu 0, msr 0:1101001
TSC: Frequency read from the hypervisor
Time: tsc clocksource has been installed.
Changed in kvm (Ubuntu): | |
importance: | Undecided → Medium |
i just found out another thing, when the time screw occures. time cycled in 5 second loop, that meams e.g. 18:13:04 to 18:13:09 and then jumped again to 18:13:04.
when I switched to acpi_pm clocksource on guest, screw dissapeared, and everything works fine. this is a possible workaround, but acpi_pm isn't accurate enoght when you need precise timing, e.g. zaptel dummy interface.
here's another interesting thing.
host:
cat /proc/cpuinfo
processor : 0
vendor_id : AuthenticAMD
cpu family : 16
model : 2
model name : Quad-Core AMD Opteron(tm) Processor 2347 HE
stepping : 3
cpu MHz : 1900.000
cache size : 512 KB
physical id : 0
siblings : 4
core id : 0
cpu cores : 4
apicid : 0
initial apicid : 0
fpu : yes
fpu_exception : yes
cpuid level : 5
wp : yes
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt pdpe1gb rdtscp lm 3dnowext 3dnow constant_tsc rep_good pni monitor cx16 lahf_lm cmp_legacy svm extapic cr8_legacy abm sse4a misalignsse 3dnowprefetch osvw ibs
bogomips : 3797.22
TLB size : 1024 4K pages
clflush size : 64
cache_alignment : 64
address sizes : 48 bits physical, 48 bits virtual
power management: ts ttp tm stc 100mhzsteps hwpstate
processor : 1
vendor_id : AuthenticAMD
cpu family : 16
model : 2
model name : Quad-Core AMD Opteron(tm) Processor 2347 HE
stepping : 3
cpu MHz : 1900.000
cache size : 512 KB
physical id : 0
siblings : 4
core id : 1
cpu cores : 4
apicid : 1
initial apicid : 1
fpu : yes
fpu_exception : yes
cpuid level : 5
wp : yes
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt pdpe1gb rdtscp lm 3dnowext 3dnow constant_tsc rep_good pni monitor cx16 lahf_lm cmp_legacy svm extapic cr8_legacy abm sse4a misalignsse 3dnowprefetch osvw ibs
bogomips : 3803.82
TLB size : 1024 4K pages
clflush size : 64
cache_alignment : 64
address sizes : 48 bits physical, 48 bits virtual
power management: ts ttp tm stc 100mhzsteps hwpstate
processor : 2
vendor_id : AuthenticAMD
cpu family : 16
model : 2
model name : Quad-Core AMD Opteron(tm) Processor 2347 HE
stepping : 3
cpu MHz : 1900.000
cache size : 512 KB
physical id : 0
siblings : 4
core id : 2
cpu cores : 4
apicid : 2
initial apicid : 2
fpu : yes
fpu_exception : yes
cpuid level : 5
wp : yes
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt pdpe1gb rdtscp lm 3dnowext 3dnow constant_tsc rep_good pni monitor cx16 lahf_lm cmp_legacy svm extapic cr8_legacy abm sse4a misalignsse 3dnowprefetch osvw ibs
bogomips : 3803.72
TLB size : 1024 4K pages
clflush size : 64
cache_alignment : 64
address sizes : 48 bits physical, 48 bits virtual
power management: ts ttp tm stc 100mhzsteps hwpstate
processor : 3
vendor_id : AuthenticAMD
cpu family : 16
model : 2
model name : Quad-Core AMD Opteron(tm) Processor 2347 HE
stepping : 3
cpu MHz : 1900.000
cache size : 512 KB
physical id : 0
siblings : 4
core id : 3
cpu cores : 4
apicid : 3
initial apicid : 3
fpu : yes
fpu_exception : yes
cpuid level : 5
wp : yes
flags : fpu vme de pse tsc ...