|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Minios-devel] [UNIKRAFT PATCH] plat/kvm/x86: retrieve TSC frequency from hypervisor if available
Hi Hugo,nice feature! I got it working by just setting '+invtsc' flag to the cpu parameter with QEMU 3.1.0. The vmware-cpuid-freq flag was not required. Thanks, Simon Reviewed-by: Simon Kuenzer <simon.kuenzer@xxxxxxxxx> On 27.03.20 10:11, Hugo Lefeuvre wrote: The TSC clock frequency is currently estimated using the i8254 timer over a period of 0.1s. This solution is undesirable because it delays the boot. Hypervisors advertise the TSC clock frequency via the hypervisor generic cpuid timing information leaf 0x40000010 [0]. This feature is available in QEMU/KVM since 2.9 with -cpu options vmware-cpuid-freq=on and +invtsc. Retrieve TSC clock frequency via cpuid. If unavailable, fall back to manual calibration. [0] https://lwn.net/Articles/301888/ Signed-off-by: Hugo Lefeuvre <hugo.lefeuvre@xxxxxxxxx> --- plat/kvm/x86/tscclock.c | 34 +++++++++++++++++++++++++--------- 1 file changed, 25 insertions(+), 9 deletions(-) diff --git a/plat/kvm/x86/tscclock.c b/plat/kvm/x86/tscclock.c index 86db814..727164a 100644 --- a/plat/kvm/x86/tscclock.c +++ b/plat/kvm/x86/tscclock.c @@ -216,7 +216,8 @@ __u64 tscclock_monotonic(void) */ int tscclock_init(void) { - __u64 tsc_freq, rtc_boot; + __u64 tsc_freq = 0, rtc_boot; + __u32 eax, ebx, ecx, edx;/* Initialise i8254 timer channel 0 to mode 2 at CONFIG_HZ frequency */ _______________________________________________ Minios-devel mailing list Minios-devel@xxxxxxxxxxxxxxxxxxxx https://lists.xenproject.org/mailman/listinfo/minios-devel
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |