diff options
author | Keir Fraser <keir.fraser@citrix.com> | 2007-11-16 19:07:46 +0000 |
---|---|---|
committer | Keir Fraser <keir.fraser@citrix.com> | 2007-11-16 19:07:46 +0000 |
commit | 0d501a859896c20a2da0a0df35943b236d56473e (patch) | |
tree | 87ca39ec595b6a2fb0f627eeef2413dff23b3a68 /xen/arch/x86/hvm/rtc.c | |
parent | a36b32e53f7d146757e84587fe70c65c7b0a35fc (diff) | |
download | xen-0d501a859896c20a2da0a0df35943b236d56473e.tar.gz xen-0d501a859896c20a2da0a0df35943b236d56473e.tar.bz2 xen-0d501a859896c20a2da0a0df35943b236d56473e.zip |
hvm: RTC emulation - RTC_UIE/RTC_SET fix
This patch fixes a bug in the RTC code which appears to originate in
having written the emuated device following an incorrect
specification. VMware has (or had, at least, at the time we were still
testing on both VMWare and Xen) the same issue. In the current code,
when RTC_SET is set, RTC_UIE is cleared. This does not match the
behavior of real hardware, where the case is simply that no update
ended interrupts are sent as long as RTC_SET is set, but the UE ints
will resume as soon as RTC_SET is cleared and the clock update is
done. This little patch fixes this issue. In practicality, this means
OS/2 can now set the time without having the clock stop. I don't know
if any other guests have been affected by this issue.
From: Trolle Selander <trolle.selander@gmail.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
Diffstat (limited to 'xen/arch/x86/hvm/rtc.c')
-rw-r--r-- | xen/arch/x86/hvm/rtc.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/xen/arch/x86/hvm/rtc.c b/xen/arch/x86/hvm/rtc.c index 469eb34cf3..c4b082a322 100644 --- a/xen/arch/x86/hvm/rtc.c +++ b/xen/arch/x86/hvm/rtc.c @@ -128,7 +128,6 @@ static int rtc_ioport_write(void *opaque, uint32_t addr, uint32_t data) { /* set mode: reset UIP mode */ s->hw.cmos_data[RTC_REG_A] &= ~RTC_UIP; - data &= ~RTC_UIE; } else { @@ -350,7 +349,7 @@ static void rtc_update_second2(void *opaque) } /* update ended interrupt */ - if ( s->hw.cmos_data[RTC_REG_B] & RTC_UIE ) + if ( (s->hw.cmos_data[RTC_REG_B] & (RTC_UIE|RTC_SET)) == RTC_UIE ) { s->hw.cmos_data[RTC_REG_C] |= 0x90; hvm_isa_irq_deassert(d, RTC_IRQ); |