eal/x86: implement arch-specific TSC freq query
authorSergio Gonzalez Monroy <sergio.gonzalez.monroy@intel.com>
Mon, 2 Oct 2017 11:17:38 +0000 (12:17 +0100)
committerThomas Monjalon <thomas@monjalon.net>
Fri, 13 Oct 2017 11:07:38 +0000 (13:07 +0200)
commitad3516bb4ae199cb4e7b668da34192d40caf6121
tree571dc0fe7f49e42f491d2cdda8c23d678640ff2e
parent15692396fd68932b6a81f00f12d4b0da12baa7d3
eal/x86: implement arch-specific TSC freq query

First, try to use CPUID Time Stamp Counter and Nominal Core Crystal
Clock Information Leaf to determine the tsc hz on platforms that
supports it (does not require privileged user).

If the CPUID leaf is not available, then try to determine the tsc hz by
reading the MSR 0xCE (requires privileged user).

Default to the tsc hz estimation if both methods fail.

Signed-off-by: Sergio Gonzalez Monroy <sergio.gonzalez.monroy@intel.com>
Acked-by: Harry van Haaren <harry.van.haaren@intel.com>
Tested-by: Bruce Richardson <bruce.richardson@intel.com>
lib/librte_eal/common/arch/x86/rte_cycles.c