KVM creation of VMCS


Hi all, first post here so I’ll try to make as much sense as possible!

I’m trying to parse some information from a VMCS in memory while a virtual machine is running.

From reading the Intel developer manuals, I believe I’m correct in saying that each virtual CPU for each virtual machine uses a VMCS to store information related to VMX transitions, from root to non-root.

I’ve been reading through the source code in vmx.c and the function vmcs_load appears to be responsible for allocating a memory region that the CPU will use for storing the VMCS data. The CPU only needs a physical memory address passed to it as the operand for the instruction VMPTRLD, then it uses this memory area to read/write data.

My question is therefore, am I looking at the right function for the creation of the VMCS region, and if I am, I should, in theory at least, be able to view the data within that struct at will.

If anyone has any information on the creation of VMCS’s within KVM, or parsing them, or anything they think might be relevant, please do let me know.