Since each logical processor has to have its own VMX regions it’s only fitting that our structure to represent these logical processors contains information about them. Having this structure defined with make initialization of the regions simple.

struct __vcpu_t
{
  struct __vmcs_t *vmcs;
  unsigned __int64 vmcs_physical;
  struct __vmcs_t *vmxon;
  unsigned __int64 vmxon_physical;
};

Recall that the operand to the vmxon instruction requires the physical address of the VMXON Region , we’ve added a member to our virtual processor context to hold that information. The physical address of the VMCS is also required for vmptrld, and vmclear.


🌱 Back to Garden