Re: Calculate the frequency of the tsc timecounter

2017-08-02 Thread Adam Steen
On Tue, Aug 1, 2017 at 6:43 PM, Adam Steen wrote: > Hi Mike > > Please see the output below (I did have to update a few DPRINTF's with > the change to clang, did you want a diff for checking in?) > I appreciate you having a look. > > Cheers > Adam > > root on sd0a

Re: Calculate the frequency of the tsc timecounter

2017-08-02 Thread Mike Larkin
On Thu, Aug 03, 2017 at 07:56:11AM +0800, Adam Steen wrote: > On Mon, Jul 31, 2017 at 3:58 PM, Mike Belopuhov wrote: > > On Mon, Jul 31, 2017 at 09:48 +0800, Adam Steen wrote: > >> Ted Unangst wrote: > >> > we don't currently export this info, but we could add some sysctls.

Re: Calculate the frequency of the tsc timecounter

2017-08-02 Thread Adam Steen
On Mon, Jul 31, 2017 at 3:58 PM, Mike Belopuhov wrote: > On Mon, Jul 31, 2017 at 09:48 +0800, Adam Steen wrote: >> Ted Unangst wrote: >> > we don't currently export this info, but we could add some sysctls. there's >> > some cpufeatures stuff there, but generally stuff isn't

Re: Calculate the frequency of the tsc timecounter

2017-08-01 Thread Adam Steen
Hi Mike Please see the output below (I did have to update a few DPRINTF's with the change to clang, did you want a diff for checking in?) I appreciate you having a look. Cheers Adam root on sd0a (15cc7df693e2251e.a) swap on sd0b dump on sd0b vm_impl_init_vmx: created vm_map @ 0x80b99000

Re: Calculate the frequency of the tsc timecounter

2017-08-01 Thread Mike Larkin
On Tue, Aug 01, 2017 at 07:32:19AM +0800, Adam Steen wrote: > On Tue, Aug 1, 2017 at 7:26 AM, Adam Steen wrote: > > Mike Belopuhov wrote: > > > >> To be able to use TSC as a timecounter source on OpenBSD or Solo5 > >> you'd have to improve the in-kernel measurement of the

Re: Calculate the frequency of the tsc timecounter

2017-07-31 Thread Adam Steen
On Tue, Aug 1, 2017 at 7:26 AM, Adam Steen wrote: > Mike Belopuhov wrote: > >> To be able to use TSC as a timecounter source on OpenBSD or Solo5 >> you'd have to improve the in-kernel measurement of the TSC frequency >> first. I've tried to perform 10 measurements and take

Re: Calculate the frequency of the tsc timecounter

2017-07-31 Thread Adam Steen
Mike Belopuhov wrote: > To be able to use TSC as a timecounter source on OpenBSD or Solo5 > you'd have to improve the in-kernel measurement of the TSC frequency > first. I've tried to perform 10 measurements and take an average and > it does improve accuracy, however I believe we need to poach

Re: Calculate the frequency of the tsc timecounter

2017-07-31 Thread Mike Larkin
ukvm tsc clock. > > > > Is there currently a way to get the TSC frequency programmatically? > > and is CPUID the best way to check if the tsc is invariant? > > (CPUID.8007H:EDX[8], Intel's Designer's vol3b, section 16.11.1 > > Invariant TSC) > > > > On M

Re: Calculate the frequency of the tsc timecounter

2017-07-31 Thread Mike Belopuhov
On Mon, Jul 31, 2017 at 09:48 +0800, Adam Steen wrote: > Ted Unangst wrote: > > we don't currently export this info, but we could add some sysctls. there's > > some cpufeatures stuff there, but generally stuff isn't exported until > > somebody finds a use for it... it shouldn't be too hard to add

Re: Calculate the frequency of the tsc timecounter

2017-07-30 Thread Adam Steen
Ted Unangst wrote: > we don't currently export this info, but we could add some sysctls. there's > some cpufeatures stuff there, but generally stuff isn't exported until > somebody finds a use for it... it shouldn't be too hard to add something to > amd64/machdep.c sysctl if you're interested. I

Re: Calculate the frequency of the tsc timecounter

2017-07-30 Thread Ted Unangst
Adam Steen wrote: > Sorry, i sent that before i had finished. > > I am trying to find an equivalent of the following code for FreeBSD we don't currently export this info, but we could add some sysctls. there's some cpufeatures stuff there, but generally stuff isn't exported until somebody finds

Re: Calculate the frequency of the tsc timecounter

2017-07-30 Thread Adam Steen
:EDX[8], Intel's Designer's vol3b, section 16.11.1 > Invariant TSC) > > On Mon, Jul 31, 2017 at 1:57 AM, Mike Belopuhov <m...@belopuhov.com> wrote: >> On Wed, Jul 26, 2017 at 19:24 +0800, Adam Steen wrote: >>> Hi >>> >>> Is there an easy/accurate way to calcu

Re: Calculate the frequency of the tsc timecounter

2017-07-30 Thread Adam Steen
t; Is there an easy/accurate way to calculate the tsc timecounter frequency? >> like Time Stamp Counters <http://blog.tinola.com/?e=54> on Linux. (on a >> Sandy Bridge cpu) >> >> Another reference Converting Sandy Bridge TSC to wall clock time >> <ht

Re: Calculate the frequency of the tsc timecounter

2017-07-30 Thread Mike Belopuhov
On Wed, Jul 26, 2017 at 19:24 +0800, Adam Steen wrote: > Hi > > Is there an easy/accurate way to calculate the tsc timecounter frequency? > like Time Stamp Counters <http://blog.tinola.com/?e=54> on Linux. (on a > Sandy Bridge cpu) > > Another reference Converting San

Calculate the frequency of the tsc timecounter

2017-07-26 Thread Adam Steen
Hi Is there an easy/accurate way to calculate the tsc timecounter frequency? like Time Stamp Counters <http://blog.tinola.com/?e=54> on Linux. (on a Sandy Bridge cpu) Another reference Converting Sandy Bridge TSC to wall clock time <https://software.intel.com/en-us/forums/intel-isa-e