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

[Xen-devel] [PATCH 0/5] RTC: New logic to emulate RTC

Correct a typo in comments.

Current RTC emulation uses periodic timer(2 per second) to emulate RTC clock 
update. And it will stop CPU staying at deep C-state for long period even when 
guest is idle. Our experience shows the Pkg C6 residency reduced 6% when 
running 64 idle guest due to the two periodic timers. After investigation, I 
found the two periodic timer is used to update RTC clock, check update-ended 
and check alarm. The following patch achieves the same goal w/o always running 
the periodic timer.
For rtc clock:  the per domain variable time_offset_seconds is used to record 
the offset between the domain and wall clock. So we can get the domain rtc 
directly by calculating time_offset_seconds with wall clock.
For update-ended check: use a timer to emulate it , and the timer runs only 
when the last update-ended interrupt flag(UF) is cleared. If the UF already 
set, there is no need to set it again. 
For alarm check: also use a timer to emulate it, and the timer runs only when 
the flag of alarm interrupt enable bit is set. 

The logic is a little different between the update-ended check and alarm check. 
For update-ended check ,we use UF(update-ended flag) as the judgment and use 
AIE(alarm interrupt enable flag) for alarm check. This is because OS may poll 
the UF bit to check whether the update cycle is finished.(UF bit change from 0 
to 1 means the update cycle ended). So we need to run the timer when UF bit is 
Yang Zhang (5):
        RTC: use offset to caculatet rtc clock
        RTC: fix 12-hour mode
        RTC: Add UIP(update in progress) check logic
        RTC: Add RTC update-ended interrupt support
        RTC: Add alarm support

best regards

Xen-devel mailing list



Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.