- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I am using KVM-QEMU in Intel platform.
And I am wondering how is the PMC/PMU being virtualized in KVM?
My understanding of vPMC is as follows.
Since PMU is a shared physical resource, so hypervisor shall context save/restore VM's PMC configurations and counters during VMExit/VMEnter.
When VMEnter, the VM's PMC context is restored to physical CPU, and run.
But in my testing, I got confused.
(In my host Linux, the MSR of IA32_PERF_FIXed_CTRL is set to 0xb0)
First of all, in a launched VM, I 'wrmsr IA32_PERF_FIXed_CTRL 0x0b', to enable FIXed_CTR0 in VM.
Then, I logged the MSR of IA32_PERF_FIXed_CTRL at VMExit, and found FIXed_CTR0 is not enabled.
I think it may be when VMExit happens, it is already in the host context, so the MSR of IA32_PERF_FIXed_CTRL is the one of host, not the VM's.
But the question comes: where is VM's PMU MSR being saved in host, and when and where the VM's MSR is being restored to CPU during VMEnter???
Thanks,
- Tags:
- Virtualization
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I came across some of the related information on this topic that it may provide some hints for your case:
https://compas.cs.stonybrook.edu/~nhonarmand/courses/fa14/cse506.2/slides/VMs-Zhen_and_Heyi.pdf
https://www.codeproject.com/Articles/215458/Virtualization-for-System-Programmers
http://www.cs.nthu.edu.tw/~ychung/slides/Virtualization/Intel%20VT.pptx

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page