ia64/xen-unstable

changeset 16394:86e4b37a06cc

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>
author Keir Fraser <keir.fraser@citrix.com>
date Fri Nov 16 19:07:46 2007 +0000 (2007-11-16)
parents 68c911f7733a
children 8e98c3d6a55f
files xen/arch/x86/hvm/rtc.c
line diff
     1.1 --- a/xen/arch/x86/hvm/rtc.c	Fri Nov 16 18:33:24 2007 +0000
     1.2 +++ b/xen/arch/x86/hvm/rtc.c	Fri Nov 16 19:07:46 2007 +0000
     1.3 @@ -128,7 +128,6 @@ static int rtc_ioport_write(void *opaque
     1.4          {
     1.5              /* set mode: reset UIP mode */
     1.6              s->hw.cmos_data[RTC_REG_A] &= ~RTC_UIP;
     1.7 -            data &= ~RTC_UIE;
     1.8          }
     1.9          else
    1.10          {
    1.11 @@ -350,7 +349,7 @@ static void rtc_update_second2(void *opa
    1.12      }
    1.13  
    1.14      /* update ended interrupt */
    1.15 -    if ( s->hw.cmos_data[RTC_REG_B] & RTC_UIE )
    1.16 +    if ( (s->hw.cmos_data[RTC_REG_B] & (RTC_UIE|RTC_SET)) == RTC_UIE )
    1.17      {
    1.18          s->hw.cmos_data[RTC_REG_C] |= 0x90; 
    1.19          hvm_isa_irq_deassert(d, RTC_IRQ);