kvm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* constant_tsc & nonstop_tsc in qemu-kvm guest
@ 2016-01-19  7:48 Dixon Xavier
  2016-01-19 14:23 ` Radim Krčmář
  0 siblings, 1 reply; 2+ messages in thread
From: Dixon Xavier @ 2016-01-19  7:48 UTC (permalink / raw)
  To: kvm

We need to use the time stamp counter in guest, were looking if the
constant_tsc & nonstop_tsc functionalities can be enabled in qemu-kvm
guest.

We have been trying to see different cpu types supported in qemu-kvm.

Below is the output from host:
# /usr/libexec/qemu-kvm --version
QEMU emulator version 1.5.3 (qemu-kvm-1.5.3-60.el7_0.11), Copyright
(c) 2003-2008 Fabrice Bellard
# /usr/libexec/qemu-kvm -cpu help
x86           qemu64  QEMU Virtual CPU version 1.5.3
x86           phenom  AMD Phenom(tm) 9550 Quad-Core Processor
x86         core2duo  Intel(R) Core(TM)2 Duo CPU     T7700  @ 2.40GHz
x86            kvm64  Common KVM processor
x86           qemu32  QEMU Virtual CPU version 1.5.3
x86            kvm32  Common 32-bit KVM processor
x86          coreduo  Genuine Intel(R) CPU           T2600  @ 2.16GHz
x86              486
x86          pentium
x86         pentium2
x86         pentium3
x86           athlon  QEMU Virtual CPU version 1.5.3
x86             n270  Intel(R) Atom(TM) CPU N270   @ 1.60GHz
x86      cpu64-rhel6  QEMU Virtual CPU version (cpu64-rhel6)
x86           Conroe  Intel Celeron_4x0 (Conroe/Merom Class Core 2)
x86           Penryn  Intel Core 2 Duo P9xxx (Penryn Class Core 2)
x86          Nehalem  Intel Core i7 9xx (Nehalem Class Core i7)
x86         Westmere  Westmere E56xx/L56xx/X56xx (Nehalem-C)
x86      SandyBridge  Intel Xeon E312xx (Sandy Bridge)
x86          Haswell  Intel Core Processor (Haswell)
x86       Opteron_G1  AMD Opteron 240 (Gen 1 Class Opteron)
x86       Opteron_G2  AMD Opteron 22xx (Gen 2 Class Opteron)
x86       Opteron_G3  AMD Opteron 23xx (Gen 3 Class Opteron)
x86       Opteron_G4  AMD Opteron 62xx class CPU
x86       Opteron_G5  AMD Opteron 63xx class CPU
x86             host  KVM processor with all supported host features
(only available in KVM mode)

Recognized CPUID flags:
  pbe ia64 tm ht ss sse2 sse fxsr mmx acpi ds clflush pn pse36 pat
cmov mca pge mtrr sep apic cx8 mce pae msr tsc pse de vme fpu
  hypervisor rdrand f16c avx osxsave xsave aes tsc-deadline popcnt
movbe x2apic sse4.2|sse4_2 sse4.1|sse4_1 dca pcid pdcm xtpr cx16 fma
cid ssse3 tm2 est smx vmx ds_cpl monitor dtes64 pclmulqdq|pclmuldq
pni|sse3
  smap adx rdseed rtm invpcid erms bmi2 smep avx2 hle bmi1 fsgsbase
  3dnow 3dnowext lm|i64 rdtscp pdpe1gb fxsr_opt|ffxsr mmxext nx|xd syscall
  perfctr_nb perfctr_core topoext tbm nodeid_msr tce fma4 lwp wdt
skinit xop ibs osvw 3dnowprefetch misalignsse sse4a abm cr8legacy
extapic svm cmp_legacy lahf_lm
  pmm-en pmm phe-en phe ace2-en ace2 xcrypt-en xcrypt xstore-en xstore
  kvm_pv_unhalt kvm_pv_eoi kvm_steal_time kvm_asyncpf kvmclock kvm_mmu
kvm_nopiodelay kvmclock
  pfthreshold pause_filter decodeassists flushbyasid vmcb_clean
tsc_scale nrip_save svm_lock lbrv npt


we can't see constant_tsc & nonstop_tsc flags in the 'Recognized CPUID
flags' section.

Is it supported in qemu-kvm ? If yes, how can we get this work in guest ?

Regards,
Dixon

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: constant_tsc & nonstop_tsc in qemu-kvm guest
  2016-01-19  7:48 constant_tsc & nonstop_tsc in qemu-kvm guest Dixon Xavier
@ 2016-01-19 14:23 ` Radim Krčmář
  0 siblings, 0 replies; 2+ messages in thread
From: Radim Krčmář @ 2016-01-19 14:23 UTC (permalink / raw)
  To: Dixon Xavier; +Cc: kvm

2016-01-19 13:18+0530, Dixon Xavier:
> We need to use the time stamp counter in guest, were looking if the
> constant_tsc & nonstop_tsc functionalities can be enabled in qemu-kvm
> guest.
> 
> we can't see constant_tsc & nonstop_tsc flags in the 'Recognized CPUID
> flags' section.

constant_tsc and nonstop_tsc aren't CPUID flags, they are Linux CPU
flags that describe a quality of TSC.  The CPUID flag you are looking
for is "invtsc" (invariant TSC).  Linux will report both constant_tsc
and nonstop_tsc when invtsc is present.

> # /usr/libexec/qemu-kvm --version
> QEMU emulator version 1.5.3 (qemu-kvm-1.5.3-60.el7_0.11), Copyright

invtsc is not available in that QEMU, upstream added it in v2.1.0.

> Is it supported in qemu-kvm ?

Yes, if your host CPU has invtsc and QEMU knows about it.

(Btw. invtsc in QEMU doesn't change the quality of guest's TSC, but it's
 very unwise to depend on it.)

>                               If yes, how can we get this work in guest ?

You must disable migrations,
  -cpu host,migratable=off

This thread has a somewhat relevant discussion:
http://www.spinics.net/lists/kvm/msg125867.html

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-01-19 14:23 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-01-19  7:48 constant_tsc & nonstop_tsc in qemu-kvm guest Dixon Xavier
2016-01-19 14:23 ` Radim Krčmář

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).