ia64/xen-unstable

changeset 9825:d0a632bea419

Avoid flood of PIT interrupts while debugging an hvm guest.

This is rebased to the new PIT code now. It has the same logic as
earlier. PIT tries to catch up the missed timer ticks by injected all
the ticks one by one so that Guest time stays close to the wall clock.
But while debugging a hvm guest if you stop the guest by debugger and
then continue, the guest sees flood of interrupts compensating the
missed ticks for the stopped time. This patch just check if the guest is
being debugged, if yes then it does not try to catch up with the missed
ticks.

Signed-off-by: Nitin A Kamble <nitin.a.kamble@.intel.com>
author kaf24@firebug.cl.cam.ac.uk
date Sat Apr 22 10:14:11 2006 +0100 (2006-04-22)
parents 1171e42b900f
children 3145b215598c
files xen/arch/x86/hvm/i8254.c
line diff
     1.1 --- a/xen/arch/x86/hvm/i8254.c	Sat Apr 22 09:45:45 2006 +0100
     1.2 +++ b/xen/arch/x86/hvm/i8254.c	Sat Apr 22 10:14:11 2006 +0100
     1.3 @@ -136,6 +136,9 @@ int pit_get_out(hvm_virpit *pit, int cha
     1.4  static __inline__ s64 missed_ticks(PITChannelState *s, s64 current_time)
     1.5  {
     1.6      struct hvm_time_info *hvm_time = s->hvm_time;
     1.7 +    struct domain *d = (void *) s - 
     1.8 +        offsetof(struct domain, arch.hvm_domain.vpit.channels[0]);
     1.9 +
    1.10      /* ticks from current time(expected time) to NOW */ 
    1.11      int missed_ticks;
    1.12      /* current_time is expected time for next intr, check if it's true
    1.13 @@ -145,7 +148,11 @@ static __inline__ s64 missed_ticks(PITCh
    1.14  
    1.15      if (missed_time >= 0) {
    1.16          missed_ticks = missed_time/(s_time_t)s->period + 1;
    1.17 -        hvm_time->pending_intr_nr += missed_ticks;
    1.18 +        if (test_bit(_DOMF_debugging, &d->domain_flags)) {
    1.19 +            hvm_time->pending_intr_nr++;
    1.20 +        } else {
    1.21 +            hvm_time->pending_intr_nr += missed_ticks;
    1.22 +        }
    1.23          s->next_transition_time = current_time + (missed_ticks ) * s->period;
    1.24      } else
    1.25          printk("HVM_PIT:missed ticks < 0 \n");