diff options
author | kaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk> | 2006-04-22 10:14:11 +0100 |
---|---|---|
committer | kaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk> | 2006-04-22 10:14:11 +0100 |
commit | b14982374140d6030b992658473473089b3caf72 (patch) | |
tree | 010390c858cec6a7d3278a3485fae57f59368a52 /xen/arch/x86/hvm/i8254.c | |
parent | 83d83bb96649d5d76deca90ebe604686c221ec5f (diff) | |
download | xen-b14982374140d6030b992658473473089b3caf72.tar.gz xen-b14982374140d6030b992658473473089b3caf72.tar.bz2 xen-b14982374140d6030b992658473473089b3caf72.zip |
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>
Diffstat (limited to 'xen/arch/x86/hvm/i8254.c')
-rw-r--r-- | xen/arch/x86/hvm/i8254.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/xen/arch/x86/hvm/i8254.c b/xen/arch/x86/hvm/i8254.c index 8a863240e1..b66c11ea23 100644 --- a/xen/arch/x86/hvm/i8254.c +++ b/xen/arch/x86/hvm/i8254.c @@ -136,6 +136,9 @@ int pit_get_out(hvm_virpit *pit, int channel, s64 current_time) static __inline__ s64 missed_ticks(PITChannelState *s, s64 current_time) { struct hvm_time_info *hvm_time = s->hvm_time; + struct domain *d = (void *) s - + offsetof(struct domain, arch.hvm_domain.vpit.channels[0]); + /* ticks from current time(expected time) to NOW */ int missed_ticks; /* current_time is expected time for next intr, check if it's true @@ -145,7 +148,11 @@ static __inline__ s64 missed_ticks(PITChannelState *s, s64 current_time) if (missed_time >= 0) { missed_ticks = missed_time/(s_time_t)s->period + 1; - hvm_time->pending_intr_nr += missed_ticks; + if (test_bit(_DOMF_debugging, &d->domain_flags)) { + hvm_time->pending_intr_nr++; + } else { + hvm_time->pending_intr_nr += missed_ticks; + } s->next_transition_time = current_time + (missed_ticks ) * s->period; } else printk("HVM_PIT:missed ticks < 0 \n"); |