I've tried out the last few versions of KVM and think it's great. It's
much easier to use and understand than Xen and performance is
surprisingly good.

One of the things I'd like to do is modify it to allow PMI generation
based on the Intel performance counter facilities. Specifically, I'd
like to be able to pin a guest to a CPU, program one of the IA32_PMCx
MSR's to a count, configure the LVT to deliver an NMI on overflow,
enable the PERF_EVT_SELx, and use the hardware-based MSR save/restore
area to disable counting in root mode and re-enable when entering
non-root.

The questions I have now are the following:

1. It looks like the MSR save/restore area is set up already for EFER
MSR and I assume that adding IA32_PMCx and IA32_PERFEVTSEL to the
vmx_msr_index[] array would be enough to save/restore them.  Is that
correct?

2. I don't completely follow the code from vmx.c

       save_msrs(vcpu->host_msrs, vcpu->nmsrs);
       load_msrs(vcpu->guest_msrs, NR_BAD_MSRS);

       ...VMLAUNCH/RESUME etc. ...
       ....
       ...VMEXIT...

       save_msrs(vcpu->guest_msrs, NR_BAD_MSRS);
       load_msrs(vcpu->host_msrs, NR_BAD_MSRS);

Does this mean the MSR values to be loaded on VM exit are initialized
before leaving root mode while the VM_entry_load / VM_exit_store area
is not touched?

3.  Is it possible to attribute counter ticks solely to a given KVM
guest process and avoid counting ticks from other processes? I assume
this isn't a problem since a VM exit should occur if the KVM process
were to be pulled off the CPU by the kernel to do a context switch.

Thanks in advance for any insight provided.

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
kvm-devel mailing list
kvm-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/kvm-devel

Reply via email to