From: "Jan Beulich" Subject: Re: using mapped vcpu_runstate_info in hvm guest Date: Wed, 20 Nov 2013 13:07:33 +0000 Message-ID: <528CC2250200007800105058@nat28.tlf.novell.com> References: <5283839C.6090403@ts.fujitsu.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta4.messagelabs.com ([85.158.143.247]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1Vj7VH-0005Ro-EU for xen-devel@lists.xenproject.org; Wed, 20 Nov 2013 13:07:35 +0000 In-Reply-To: <5283839C.6090403@ts.fujitsu.com> Content-Disposition: inline List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Juergen Gross Cc: xen-devel List-Id: xen-devel@lists.xenproject.org >>> On 13.11.13 at 14:50, Juergen Gross wrote: > I'm trying to obtain runstate information from the hypervisor in a hvm guest > via VCPUOP_register_runstate_memory_area. This works, but the information is > not completely suitable for a hvm guest: > > I can see the time summed up in the different states, but I'm not able to > deduce the exact time the current vcpu has been running. I see the time when > the last change to the running state happened (state_entry_time), but this > time is the hypervisor system time obtained via NOW(). I can't see how to > map this information to any time information available to the guest (e.g. > the tsc value). __update_vcpu_system_time() specifically considers the case of vTSC, so I'm not really clear what your problem here is. NOW() (and hence state_entry_time) are in ns units, and the information presented in struct vcpu_time_info should be sufficient to do the necessary mapping (or else I can't see what's different in your case from the usual PV or PVHVM one). > A solution would be to modify the runstate information mapped via > VCPUOP_register_runstate_memory_area: it could contain state_entry_time > rebased to the guests tsc. No, that one's defined to be matching up with vcpu_time_info's system_time. Jan