From mboxrd@z Thu Jan 1 00:00:00 1970 From: Zachary Amsden Subject: Re: last_kernel_ns ? Date: Mon, 04 Oct 2010 11:49:00 -1000 Message-ID: <4CAA4BCC.2010303@redhat.com> References: <20101004165004.GI1230@mothafucka.localdomain> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: kvm@vger.kernel.org, mtosatti@redhat.com, avi@redhat.com To: Glauber Costa Return-path: Received: from mx1.redhat.com ([209.132.183.28]:65172 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752222Ab0JDVtE (ORCPT ); Mon, 4 Oct 2010 17:49:04 -0400 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o94Ln4GU010439 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Mon, 4 Oct 2010 17:49:04 -0400 In-Reply-To: <20101004165004.GI1230@mothafucka.localdomain> Sender: kvm-owner@vger.kernel.org List-ID: On 10/04/2010 06:50 AM, Glauber Costa wrote: > 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? > 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.