x86/svm: enable TSC scaling
authorBoris Ostrovsky <boris.ostrovsky@oracle.com>
Tue, 22 Apr 2014 10:08:06 +0000 (12:08 +0200)
committerJan Beulich <jbeulich@suse.com>
Tue, 22 Apr 2014 10:08:06 +0000 (12:08 +0200)
commitb95fd03b5f0b66384bd7c190d5861ae68eb98c85
tree4f784b46fd970216d4149e571cd8f71a9e5f066b
parent82713ec8d2b65d17f13e46a131e38bfe5baf8bd6
x86/svm: enable TSC scaling

TSC ratio enabling logic is inverted: we want to use it when we
are running in native tsc mode, i.e. when d->arch.vtsc is zero.

Also, since now svm_set_tsc_offset()'s calculations depend
on vtsc's value, we need to call hvm_funcs.set_tsc_offset() after
vtsc changes in tsc_set_info().

In addition, with TSC ratio enabled, svm_set_tsc_offset() will
need to do rdtsc. With that we may end up having TSCs on guest's
processors out of sync. d->arch.hvm_domain.sync_tsc which is set
by the boot processor can now be used by APs as reference TSC
value instead of host's current TSC.

Signed-off-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
xen/arch/x86/hvm/hvm.c
xen/arch/x86/hvm/svm/svm.c
xen/arch/x86/hvm/vmx/vmx.c
xen/arch/x86/hvm/vmx/vvmx.c
xen/arch/x86/hvm/vpt.c
xen/arch/x86/time.c
xen/include/asm-x86/hvm/domain.h
xen/include/asm-x86/hvm/hvm.h
xen/include/asm-x86/msr.h
xen/include/xen/time.h