Re: rdtsc() in kvm-unit-tests on x86

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Aug 10, 2015 at 9:58 AM, Paolo Bonzini <pbonzini@xxxxxxxxxx> wrote:
>
>
> 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.

Thanks, Paolo.

What would be the best way to check if TSC is consistent across CPUs?
Is it synchronized in nano second (or even cpu clock cycle) resolution?

To get synchronized tsc across the host and the guest,
just calling rdtscll() in host and guest would be enough?

Thanks,
Jintack

>
> Paolo
>
>> This is useful to trace the flow of events over an SMP system in detail.
>

--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux