direct-io.hg

changeset 13673:6e3decbd3e56

[HVM] When guest explicitly modifies the TSC, update platform timers
_after_ updating guest time (since otherwise pt_reset() will get the
old hvm_get_guest_time() and subsequently pt_intr_post() will warp
the TSC back again).

This is the smallest fix for the HVM SMP TSC issues seen on recent
(viz. 2.6.18+) linux HVM kernels, but probably not the best. Cleaner
fix needs more thought.

Signed-off-by: Steven Hand <steven@xensource.com>
author shand@cosworth.eng.hq.xensource.com
date Tue Jan 30 00:52:51 2007 +0000 (2007-01-30)
parents 5e3b47bcc311
children 965cdfff68b0
files xen/arch/x86/hvm/svm/svm.c xen/arch/x86/hvm/vmx/vmx.c
line diff
     1.1 --- a/xen/arch/x86/hvm/svm/svm.c	Mon Jan 29 22:43:51 2007 +0000
     1.2 +++ b/xen/arch/x86/hvm/svm/svm.c	Tue Jan 30 00:52:51 2007 +0000
     1.3 @@ -2141,8 +2141,8 @@ static inline void svm_do_msr_access(
     1.4          switch (ecx)
     1.5          {
     1.6          case MSR_IA32_TIME_STAMP_COUNTER:
     1.7 +            hvm_set_guest_time(v, msr_content);
     1.8              pt_reset(v);
     1.9 -            hvm_set_guest_time(v, msr_content);
    1.10              break;
    1.11          case MSR_IA32_SYSENTER_CS:
    1.12              vmcb->sysenter_cs = msr_content;
     2.1 --- a/xen/arch/x86/hvm/vmx/vmx.c	Mon Jan 29 22:43:51 2007 +0000
     2.2 +++ b/xen/arch/x86/hvm/vmx/vmx.c	Tue Jan 30 00:52:51 2007 +0000
     2.3 @@ -2346,8 +2346,8 @@ static inline int vmx_do_msr_write(struc
     2.4  
     2.5      switch (ecx) {
     2.6      case MSR_IA32_TIME_STAMP_COUNTER:
     2.7 +        hvm_set_guest_time(v, msr_content);
     2.8          pt_reset(v);
     2.9 -        hvm_set_guest_time(v, msr_content);
    2.10          break;
    2.11      case MSR_IA32_SYSENTER_CS:
    2.12          __vmwrite(GUEST_SYSENTER_CS, msr_content);