On 20.01.2026 10:57, Tu Dinh wrote: > time_offset is currently always added to wc_sec. This means that without > the actual value of time_offset, guests have no way of knowing what's > the actual host clock. Once the guest clock drifts beyond 1 second, > updates to the guest RTC would themselves change time_offset and make it > impossible to resync guest time to host time.
Despite my earlier comments this part of the description looks unchanged. I still don't see why host time (or in fact about any host property) should be exposed to guests. > Since there's no way to add more fields to struct shared_info, the > addition has to be done through struct arch_shared_info instead. Add two > fields in arch_shared_info representing time_offset's low and high > 32-bit halves. Again, despite my earlier question, reasoning of why two halves rather than a (signed) 64-bit value isn't supplied here. > Provide a new feature bit XENFEAT_shared_info_time_offset for this > functionality. > > Signed-off-by: Tu Dinh <[email protected]> > --- > v2: Remove unnecessary casts. Did you really? What about ... > --- a/xen/common/time.c > +++ b/xen/common/time.c > @@ -118,6 +118,11 @@ void update_domain_wallclock_time(struct domain *d) > shared_info(d, wc_sec_hi) = sec >> 32; > #endif > > + shared_info(d, arch.time_offset) = > + (uint32_t)d->time_offset.seconds; > + shared_info(d, arch.time_offset_hi) = > + (uint32_t)(d->time_offset.seconds >> 32); ... both of these? Jan
