On Jun 17, 2021, at 4:14 PM, Kallol Biswas <kallolkernel@xxxxxxxxx> wrote: > Hi, > I am trying to understand the vmcs manipulation code. > > It seems that we allocate 4096 bytes for vmcs, but the field offsets > are much larger. > > crash> p vmcs_config.size > $15 = 1024 > > vmx.h: > HOST_RIP = 0x00006c16 > GUEST_RFLAGS = 0x00006820 Those are “Encoding”, not index. > > vmx.c: > flags = vmcs_readl(GUEST_RFLAGS); > > I must have a gap in understanding. Maybe I should read the intel > manual carefully. > It’s required to use the VMREAD/VMWRITE instruction to access the VMCS fields. You should look at Appendix B of the SDM for details. --- Jun Intel Open Source Technology Center