Re: Need info on timer/timing mechanisms (w.r.t KVM)

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

 



Hi...

On Fri, Jul 11, 2008 at 12:55 AM, Arn <cse.syslab@xxxxxxxxx> wrote:
> Hi,  (already posted this on KVM devel list)
>
> I'd like to know what happens when the KVM guest kernel or process in the
> guest tries to get timing information. For example if a userspace
> process in the guest calls nanotime(), getnanotime() or gettimeofday()
> functions, then where is the time info read from ?
>
> I had a look thru the latest 2.6.25.10 kernel source at lxr.no and I
> found some functions in include/linux/kvm_host.h  ---
> kvm_guest_exit() calls account_system_vtime()  but this function is
> empty i.e. does nothing (include/linux/hardirq.h)

Ehm, CMIIW, it's possible that those timing query functions are simply
translated as gettimeofday() or something similar in user space. But I
could be wrong on this part.

Another possibility that I can offer: as we know, KVM is actually qemu
plus a kernel module that does the direct code execution (if it's
possible to do so i.e not triggering any traps and so on).
Specifically, it does code translation...so if we talks about opcodes
translation, probably the timing could come from virtual timer
register, emulated TSC or emulated jiffies. I don't know if they could
be derived from real memory location or real device register though (I
believe it has to be guarded via IO-MMU).

regards,

Mulyadi.

--
To unsubscribe from this list: send an email with
"unsubscribe kernelnewbies" to ecartis@xxxxxxxxxxxx
Please read the FAQ at http://kernelnewbies.org/FAQ


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux