[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [Bug 1080086] Re: MC146818 RTC breaks when SET bit in Regis

From: Peter Maydell
Subject: [Qemu-devel] [Bug 1080086] Re: MC146818 RTC breaks when SET bit in Register B is on.
Date: Tue, 07 Nov 2017 18:42:58 -0000

We fixed this bug long ago in 2012, in commit 02c6ccc6dde90d (thanks for
your patch!) but forgot to close the bug...so I'm doing it now.

** Changed in: qemu
       Status: New => Fix Released

You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.

  MC146818 RTC breaks when SET bit in Register B is on.

Status in QEMU:
  Fix Released

Bug description:
  This bug occurs when the SET flag of Register B is enabled. When an RTC
  data register (i.e. any of the 10 bytes of time/calender data in CMOS) is set,
  the data is (as expected) correctly stored in the cmos_data array. However,
  since the SET flag is enabled, the function rtc_set_time is not invoked.
  As a result, the field base_rtc in RTCState remains uninitialized. This 
appears to
  cause a problem on subsequent writes which can end up overwriting data.

  To see this, consider writing data to Register A after having written
  data to any of the RTC data registers; the following figure illustrates
  the call stack for the Register A write operation:

   +- cmos_io_port_write
   +-- check_update_timer
   +---- get_next_alarm
   +------ rtc_update_time

  In rtc_update_time, get_guest_rtc calculates the wrong time and
  overwrites the previously written RTC data register values.

  I have created a standalone test case which exposes this bug:


To manage notifications about this bug go to:

reply via email to

[Prev in Thread] Current Thread [Next in Thread]