last_kernel_ns ?
Zach,
vcpu->hv_clock.tsc_timestamp = tsc_timestamp;
vcpu->hv_clock.system_time = kernel_ns + v->kvm->arch.kvmclock_offset;
vcpu->last_kernel_ns = kernel_ns; <===== (1)
vcpu->last_guest_tsc = tsc_timestamp;
vcpu->hv_clock.flags = 0;If I understand your intention corretly, you should add kvmclock_offset to (1). Am I misinterpreting something?
Quoted 11 lines · Glauber Costa
Zach,
vcpu->hv_clock.tsc_timestamp = tsc_timestamp; vcpu->hv_clock.system_time = kernel_ns + v->kvm->arch.kvmclock_offset; vcpu->last_kernel_ns = kernel_ns;<===== (1) vcpu->last_guest_tsc = tsc_timestamp; vcpu->hv_clock.flags = 0;If I understand your intention corretly, you should add
kvmclock_offsetto (1). Am I misinterpreting something?
No, last_kernel_ns is the last observed value of kernel_ns, not system time. The kvmclock_offset may be modified since observation (unlikely, yet possible), and should not be considered in this computation.