On 6 August 2013 02:44, Alexander Spyridakis <a.spyridakis@xxxxxxxxxxxxxxxxxxxxxx> wrote: > Hello, > > > On 5 August 2013 22:47, Zhuoqun Cheng <czq@xxxxxx> wrote: >> >> So, I am wondering if it is possible to use PMU cycle counter in guest, >> both kernel mode and user mode? I tried to use kernel module to enable user >> mode access to cycle counter in host and it worked. But it seems that guest >> kernel I am using doesn't support kernel module (I am using this one: >> http://www.virtualopensystems.com/media/arndale/guest-zImage). I tried to >> add a syscall to enable user mode access but failed either (got illegal >> instruction error when programming counter in user mode). >> >> Can anyone give me any instruction or pointer on this? Thanks very much! > > > By default, guest access to the PMU is trapped. If you disable the trap > mechanism you can use the PMU from the guest both in kernel and user mode. > Of course if you start using (for example) the cycle counter and in between > there is a vm exit (due to any reason), you will also measure cycles spent > in the host. > But you have to be careful: you don't want the guest to be able to set breakpoints in the host, for example. That is why I say someone has to look carefully at this problem and make sure that we give the guest permission only to safe bits of the hardware. -Christoffer _______________________________________________ kvmarm mailing list kvmarm@xxxxxxxxxxxxxxxxxxxxx https://lists.cs.columbia.edu/cucslists/listinfo/kvmarm