ia64/xen-unstable

changeset 9515:48abab2ab719

SVM patch to update guest time with latest hvm modifications.

Signed-off-by: Tom Woller <thomas.woller@amd.com>
author kaf24@firebug.cl.cam.ac.uk
date Wed Mar 29 13:56:26 2006 +0100 (2006-03-29)
parents ae6af19f47d3
children 58938b561b66
files xen/arch/x86/hvm/svm/intr.c xen/arch/x86/hvm/svm/svm.c xen/arch/x86/hvm/svm/vmcb.c
line diff
     1.1 --- a/xen/arch/x86/hvm/svm/intr.c	Wed Mar 29 12:02:45 2006 +0100
     1.2 +++ b/xen/arch/x86/hvm/svm/intr.c	Wed Mar 29 13:56:26 2006 +0100
     1.3 @@ -81,7 +81,7 @@ interrupt_post_injection(struct vcpu * v
     1.4          }
     1.5          vpit->inject_point = NOW();
     1.6  
     1.7 -        vpit->last_pit_gtime += vpit->period;
     1.8 +        vpit->last_pit_gtime += vpit->period_cycles;
     1.9          svm_set_guest_time(v, vpit->last_pit_gtime);
    1.10      }
    1.11  
     2.1 --- a/xen/arch/x86/hvm/svm/svm.c	Wed Mar 29 12:02:45 2006 +0100
     2.2 +++ b/xen/arch/x86/hvm/svm/svm.c	Wed Mar 29 13:56:26 2006 +0100
     2.3 @@ -674,9 +674,10 @@ static void svm_freeze_time(struct vcpu 
     2.4  {
     2.5      struct hvm_virpit *vpit = &v->domain->arch.hvm_domain.vpit;
     2.6      
     2.7 -    v->domain->arch.hvm_domain.guest_time = svm_get_guest_time(v);
     2.8 -    if ( vpit->first_injected )
     2.9 +    if ( vpit->first_injected && !v->domain->arch.hvm_domain.guest_time ) {
    2.10 +        v->domain->arch.hvm_domain.guest_time = svm_get_guest_time(v);
    2.11          stop_timer(&(vpit->pit_timer));
    2.12 +    }
    2.13  }
    2.14  
    2.15  static void svm_ctxt_switch_from(struct vcpu *v)
     3.1 --- a/xen/arch/x86/hvm/svm/vmcb.c	Wed Mar 29 12:02:45 2006 +0100
     3.2 +++ b/xen/arch/x86/hvm/svm/vmcb.c	Wed Mar 29 13:56:26 2006 +0100
     3.3 @@ -498,8 +498,11 @@ void svm_do_resume(struct vcpu *v)
     3.4      svm_stts(v);
     3.5      
     3.6      /* pick up the elapsed PIT ticks and re-enable pit_timer */
     3.7 -    if ( vpit->first_injected) {
     3.8 -        svm_set_guest_time(v, v->domain->arch.hvm_domain.guest_time);
     3.9 +    if ( vpit->first_injected ) {
    3.10 +        if ( v->domain->arch.hvm_domain.guest_time ) {
    3.11 +            svm_set_guest_time(v, v->domain->arch.hvm_domain.guest_time);
    3.12 +            v->domain->arch.hvm_domain.guest_time = 0;
    3.13 +        }
    3.14          pickup_deactive_ticks(vpit);
    3.15      }
    3.16  
    3.17 @@ -511,7 +514,6 @@ void svm_do_resume(struct vcpu *v)
    3.18      ASSERT(!test_bit(ARCH_HVM_IO_WAIT, &v->arch.hvm_vcpu.ioflags));
    3.19  }
    3.20  
    3.21 -
    3.22  void svm_launch_fail(unsigned long eflags)
    3.23  {
    3.24      BUG();