qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] FreeBSD clock_gettime()
@ 2015-05-31 13:41 Sai Prajeeth
  2015-06-02 14:49 ` Stefan Hajnoczi
  0 siblings, 1 reply; 3+ messages in thread
From: Sai Prajeeth @ 2015-05-31 13:41 UTC (permalink / raw)
  To: QEMU Developers

[-- Attachment #1: Type: text/plain, Size: 367 bytes --]

Hi list,

I have done experiments and it seems that FreeBSD's libc function
clock_gettime() results in a system call when running on QEMU whereas on
hardware it does not. Does anybody know why? For those interested , you can
find the clock_gettime libc call in freebsd source here:
https://github.com/lattera/freebsd/blob/master/lib/libc/sys/clock_gettime.c

Thanks!

[-- Attachment #2: Type: text/html, Size: 521 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Qemu-devel] FreeBSD clock_gettime()
  2015-05-31 13:41 [Qemu-devel] FreeBSD clock_gettime() Sai Prajeeth
@ 2015-06-02 14:49 ` Stefan Hajnoczi
  2015-06-02 14:52   ` Peter Maydell
  0 siblings, 1 reply; 3+ messages in thread
From: Stefan Hajnoczi @ 2015-06-02 14:49 UTC (permalink / raw)
  To: Sai Prajeeth; +Cc: QEMU Developers

[-- Attachment #1: Type: text/plain, Size: 824 bytes --]

On Sun, May 31, 2015 at 07:11:25PM +0530, Sai Prajeeth wrote:
> I have done experiments and it seems that FreeBSD's libc function
> clock_gettime() results in a system call when running on QEMU whereas on
> hardware it does not. Does anybody know why? For those interested , you can
> find the clock_gettime libc call in freebsd source here:
> https://github.com/lattera/freebsd/blob/master/lib/libc/sys/clock_gettime.c

This is more of a FreeBSD kernel question than a QEMU question.  I don't
have time to dig into the FreeBSD sources but you should be able to find
the answer there.

Check out the FreeBSD kernel's vdso implementation.  Linux has something
similar, it's a library mapped into userspace processes that is provided
by the kernel.  It includes low-level utilities that depend on the
specific kernel.

Stefan

[-- Attachment #2: Type: application/pgp-signature, Size: 473 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Qemu-devel] FreeBSD clock_gettime()
  2015-06-02 14:49 ` Stefan Hajnoczi
@ 2015-06-02 14:52   ` Peter Maydell
  0 siblings, 0 replies; 3+ messages in thread
From: Peter Maydell @ 2015-06-02 14:52 UTC (permalink / raw)
  To: Stefan Hajnoczi; +Cc: Sai Prajeeth, QEMU Developers

On 2 June 2015 at 15:49, Stefan Hajnoczi <stefanha@gmail.com> wrote:
> On Sun, May 31, 2015 at 07:11:25PM +0530, Sai Prajeeth wrote:
>> I have done experiments and it seems that FreeBSD's libc function
>> clock_gettime() results in a system call when running on QEMU whereas on
>> hardware it does not. Does anybody know why? For those interested , you can
>> find the clock_gettime libc call in freebsd source here:
>> https://github.com/lattera/freebsd/blob/master/lib/libc/sys/clock_gettime.c
>
> This is more of a FreeBSD kernel question than a QEMU question.  I don't
> have time to dig into the FreeBSD sources but you should be able to find
> the answer there.

The underlying answer is presumably "some difference between
the (emulated?) (KVM?) CPU QEMU exposes to the guest and the
CPU on real h/w makes FreeBSD decide it can't provide gettime
in the vdso". Exactly what that difference is you'd need to
look at the FreeBSD sources to find out, I agree.

-- PMM

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2015-06-02 14:52 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-05-31 13:41 [Qemu-devel] FreeBSD clock_gettime() Sai Prajeeth
2015-06-02 14:49 ` Stefan Hajnoczi
2015-06-02 14:52   ` Peter Maydell

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).