diff options
author | Jan Beulich <jbeulich@suse.com> | 2013-01-23 14:20:28 +0100 |
---|---|---|
committer | Jan Beulich <jbeulich@suse.com> | 2013-01-23 14:20:28 +0100 |
commit | ec13fd3b0e11493ab8a7cb672897052d0c12807d (patch) | |
tree | 685c6eab7e030d285ff5aabd9d6b1a20e1563cfd /xen | |
parent | 1c96f3d3287dcf0a477166a65b9025c1d448908a (diff) | |
download | xen-ec13fd3b0e11493ab8a7cb672897052d0c12807d.tar.gz xen-ec13fd3b0e11493ab8a7cb672897052d0c12807d.tar.bz2 xen-ec13fd3b0e11493ab8a7cb672897052d0c12807d.zip |
x86/HVM: generalize IRQ raising on RTC_REG_B writes
Raise the RTC IRQ not only when UIE gets set while UF was already set,
but generalize this to cover AIE and PIE as well.
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
Diffstat (limited to 'xen')
-rw-r--r-- | xen/arch/x86/hvm/rtc.c | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/xen/arch/x86/hvm/rtc.c b/xen/arch/x86/hvm/rtc.c index f8d3bed6d9..a7315cc0c2 100644 --- a/xen/arch/x86/hvm/rtc.c +++ b/xen/arch/x86/hvm/rtc.c @@ -371,7 +371,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; + uint32_t orig, mask; spin_lock(&s->lock); @@ -442,12 +442,17 @@ static int rtc_ioport_write(void *opaque, uint32_t addr, uint32_t data) if ( orig & RTC_SET ) rtc_set_time(s); } - /* if the interrupt is already set when the interrupt become - * enabled, raise an interrupt immediately*/ - if ((data & RTC_UIE) && !(orig & RTC_UIE)) - if (s->hw.cmos_data[RTC_REG_C] & RTC_UF) + /* + * If the interrupt is already set when the interrupt becomes + * enabled, raise an interrupt immediately. + * NB: RTC_{A,P,U}IE == RTC_{A,P,U}F respectively. + */ + for ( mask = RTC_UIE; mask <= RTC_PIE; mask <<= 1 ) + if ( (data & mask) && !(orig & mask) && + (s->hw.cmos_data[RTC_REG_C] & mask) ) { rtc_toggle_irq(s); + break; } s->hw.cmos_data[RTC_REG_B] = data; check_update_timer(s); |