x86_64 clock: now_kvm(): add system time from PV clock structure
If we don't use the system_time field of the KVM PV clock
structure, we are not returning a monotonic time but just the time
offset from the last update of the KVM PV clock structure.
@@ -47,7 +47,8 @@ timestamp now_kvm()
}
// ok - a 64 bit number (?) multiplied by a 32 bit number yields
// a 96 bit result, chuck the bottom 32 bits
- u64 nsec = ((u128)delta * vclock->tsc_to_system_mul) >> 32;
+ u64 nsec = vclock->system_time +
+ (((u128)delta * vclock->tsc_to_system_mul) >> 32);
u64 sec = nsec / BILLION;
nsec -= sec * BILLION;
timestamp out = seconds(sec) + nanoseconds(nsec);
