<mchadha <at> cse.iitd.ernet.in> writes: > > My question is regarding performance counters for guest. I run my KVM on > an i3 Intel Processor. > > My objective is to get the number of instructions in between every > interrupt delivered to the guest OS after which I log into a file. I use > the PERFEVTSEL0 for enabling instruction retired perf counter. I enable > the counter before VMlaunch/Vmresume instruction and on the return I > disable the counter. This approach is not good as I may be counting > instructions in host interrupts and other processes also. > > I tried to use these performance counters inside the guest and the guest > gets a GPF and kvm says it as an "unhandled wrmsr". > > What is the right approach to solve the problem? I would prefer to have > the guest unmodified to get the counters. > Does Intel i3 provide "guest mode only" performance counters? > > Thanks, > Mehul > > -- > To unsubscribe from this list: send the line "unsubscribe kvm" in > the body of a message to majordomo <at> vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html > > Pls Reply. I really want to understand this and implement. I figured out that VMCS maintains an area where the counters can be saved and restored automatically on Vmentry and VMexit Respectively. Does KVM have the implementation for the same? Secondly, what happens on a context switch when the CPU is in guest mode? Would these counters still be saved in VMCS on a context switch? Thanks, Mehul -- To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html