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

[Xen-devel] [PATCH] SVM: enables TSC scaling ratio support for SVM

Future AMD CPUs support TSC scaling. It allows guests to have a different TSC frequency from host system using this formula: guest_tsc = host_tsc * tsc_ratio + vmcb_offset. The tsc_ratio is a 64bit MSR contains a fixed-point number in 8.32 format (8 bits for integer part and 32bits for fractional part). For instance 0x00000003_80000000 means tsc_ratio=3.5.

This patch enables TSC scaling ratio for SVM. With it, guest VMs don't need take #VMEXIT to calculate a translated TSC value when it is running under TSC emulation mode. This can SUBSTANTIALLY reduce the rdtsc overhead.

Signed-off-by: Wei Huang <wei.huang2@xxxxxxx>

 arch/x86/hvm/svm/svm.c        |   32 +++++++++++++++++++++++++++++++-
 arch/x86/hvm/svm/vmcb.c       |    4 +++-
 include/asm-x86/hvm/svm/svm.h |    8 ++++++++
 include/asm-x86/msr-index.h   |    3 +++
 4 files changed, 45 insertions(+), 2 deletions(-)

Attachment: xen_tsc_ratio.txt
Description: xen_tsc_ratio.txt

Xen-devel mailing list



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