Sorry, maybe what was unclear to me is the following point: VMCS structure, apart of revision ID and VMX Abort fields, is an *opaque* collection of six subgroups (i.e. the internal structure is not known/needed to the user) and the only way to access them is with VMREAD/WMWRITE instructions (they trap to VMX root mode if executed in VMX non-root mode).Kevin wrote:If you only write data with vmwrite so that you can later read it with vmread, but you never actually start a VM from that VMCS, then there is no point in using those instructions. You can then simply write the data to some memory location with normal non-VMX instructions.
As consequence L1 hypervisor basically allocate a 4KiB aligned memory region in its (guest) physical address space for VMCS1-2 and considering that, as you said, never VMCS1-2 physical address will be loaded as current-VMCS pointer by the processor, L0 hypervisor is free to choose a whatever internal structure for VMCS1-2 (apart of first 8 byte: revision ID + VMX Abort) emulating then L1 hypervisor VMREAD/VMWRITE.
L0 hypervisor will use VMREAD/VMRITE (actually executed by processor) just in order to manage "real" VMCSs that will be actually loaded by processor as current-VMCS pointer to run L1 hypervisor (VMCS0-1) and L2 guest (VMCS0-2) respectively
Can you confirm my understanding ?