diff options
author | Jan Beulich <jbeulich@suse.com> | 2012-09-03 08:35:41 +0200 |
---|---|---|
committer | Jan Beulich <jbeulich@suse.com> | 2012-09-03 08:35:41 +0200 |
commit | f1297904185f73262522b6277252bfb699644766 (patch) | |
tree | 1e4bd4c1759ed533d130da87f3ec8c13efd6c791 | |
parent | aa1c1f4c57720d3f8426aab89cf8217dd687a651 (diff) | |
download | xen-f1297904185f73262522b6277252bfb699644766.tar.gz xen-f1297904185f73262522b6277252bfb699644766.tar.bz2 xen-f1297904185f73262522b6277252bfb699644766.zip |
x86/HVM: RTC periodic timer emulation adjustments
- don't call rtc_timer_update() on REG_A writes when the value didn't
change (doing the call always was reported to cause wall clock time
lagging with the JVM running on Windows)
- don't call rtc_timer_update() on REG_B writes when RTC_PIE didn't
change
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
-rw-r--r-- | xen/arch/x86/hvm/rtc.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/xen/arch/x86/hvm/rtc.c b/xen/arch/x86/hvm/rtc.c index d52a828365..ea5179a4b4 100644 --- a/xen/arch/x86/hvm/rtc.c +++ b/xen/arch/x86/hvm/rtc.c @@ -365,6 +365,7 @@ static int rtc_ioport_write(void *opaque, uint32_t addr, uint32_t data) { RTCState *s = opaque; struct domain *d = vrtc_domain(s); + uint32_t orig; spin_lock(&s->lock); @@ -382,6 +383,7 @@ static int rtc_ioport_write(void *opaque, uint32_t addr, uint32_t data) return 0; } + orig = s->hw.cmos_data[s->hw.cmos_index]; switch ( s->hw.cmos_index ) { case RTC_SECONDS_ALARM: @@ -405,9 +407,9 @@ static int rtc_ioport_write(void *opaque, uint32_t addr, uint32_t data) break; case RTC_REG_A: /* UIP bit is read only */ - s->hw.cmos_data[RTC_REG_A] = (data & ~RTC_UIP) | - (s->hw.cmos_data[RTC_REG_A] & RTC_UIP); - rtc_timer_update(s); + s->hw.cmos_data[RTC_REG_A] = (data & ~RTC_UIP) | (orig & RTC_UIP); + if ( (data ^ orig) & ~RTC_UIP ) + rtc_timer_update(s); break; case RTC_REG_B: if ( data & RTC_SET ) @@ -436,7 +438,8 @@ static int rtc_ioport_write(void *opaque, uint32_t addr, uint32_t data) hvm_isa_irq_assert(d, RTC_IRQ); } s->hw.cmos_data[RTC_REG_B] = data; - rtc_timer_update(s); + if ( (data ^ orig) & RTC_PIE ) + rtc_timer_update(s); check_update_timer(s); alarm_timer_update(s); break; |