Skip to contentSkip to conversation

x86/time: Update wallclock in shared info when altering domain time offset

PATCH In review Andrew Cooper 2 participants 2 messages Jul 17, 2013

lore
Share & tools
lore
#0 lore raw

PATCH v3 1/1 x86/time: Update wallclock in shared info when altering domain time offset

domain_set_time_offset() udpates d->time_offset_seconds, but does not correct the wallclock in the shared info, meaning that it is incorrect until the next XENPF_settime hypercall from dom0 which resynchronises the wallclock for all domains.

CC Keir Fraser <[email protected]>
CC Jan Beulich <[email protected]>
CC Paul Durrant <[email protected]>

---
This should be backported to all stable releases.

Changes since v2:
* No real need to write the wallclock at shinfo-create time. Given f8e8fd56, it will be correct before an HVM PV aware domain can actually get at it, and this avoids use of a global lock (even though the use is brief).

Changes since v1:
* s/watchdog/wallclock/ - Stupid typo.

---
 xen/arch/x86/time.c |    1 +
 1 file changed, 1 insertion(+)
xen/arch/x86/time.c +1 -0
index cf8bc78..f047cb3 100644
@@ -931,6 +931,7 @@ void domain_set_time_offset(struct domain *d, int32_t time_offset_seconds)
     d->time_offset_seconds = time_offset_seconds;
     if ( is_hvm_domain(d) )
         rtc_update_clock(d);
+    update_domain_wallclock_time(d);
 }
 
 int cpu_frequency_change(u64 freq)
Signature · 1 line
1.7.10.4
Acked-by on v3 1/1
#1 lore raw
Quoted 9 lines · Andrew Cooper

domain_set_time_offset() udpates d->time_offset_seconds, but does not correct the wallclock in the shared info, meaning that it is incorrect until the next XENPF_settime hypercall from dom0 which resynchronises the wallclock for all domains.

CC Keir Fraser <[email protected]>
CC Jan Beulich <[email protected]>
CC Paul Durrant <[email protected]>