From mboxrd@z Thu Jan 1 00:00:00 1970 From: Paolo Bonzini Subject: Re: rdtsc() in kvm-unit-tests on x86 Date: Mon, 10 Aug 2015 15:58:08 +0200 Message-ID: <55C8ADF0.8040204@redhat.com> References: <55C86898.3000003@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Cc: Jintack Lim , KVM General , Shih-Wei Li To: Christoffer Dall Return-path: Received: from mx1.redhat.com ([209.132.183.28]:33503 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752901AbbHJN6O (ORCPT ); Mon, 10 Aug 2015 09:58:14 -0400 In-Reply-To: Sender: kvm-owner@vger.kernel.org List-ID: On 10/08/2015 11:42, Christoffer Dall wrote: > > Thanks for the reply. > > On this note, is there an easy mechanism on x86 to obtain a TSC which is > synchronized across PCPUs and between the host and the guest? > > We can use the physical arch timer counter on arm64, but I'm not sure if > there's something similar on x86? Yes, you just use the TSC. :) However, you first have to check that the TSC is consistent across CPUs. On older machines it's not, but the kernel can detect it. Paolo > This is useful to trace the flow of events over an SMP system in detail.