Intel Virtualization (VMX/VT-x) guest general purpose registers

426 Views Asked by At

I just started learning about HW-assisted virtualization and read about how Intel VMX/VT-x works at a high level, but there are some things that are not clear to me and I hope you can help me to understand better. I've already found this question (Intel virtualization technology : how to load guest general purpose register?), but it did not help me.

  1. The Intel manual says that Virtual Control Machine Structures (VCMS) contain the information needed to manage the new non-root mode. One of the sections of a VCMS is the Guest State, which is supposed to store stuff such as the %cr3 and the %idtr registers. The manual says something like: "The state of the processor is loaded from the Guest State during a VM enter and stored back here during a VM exit". So are these loading and storing operations implemented automatically in HW by the Intel VT-x technology during a VM enter and a VM exit? Is this correct?
  2. If the answer to the above is "yes", then how is the content of normal general purpose registers of a guest stored on a VM exit and loaded back on VM enter? Should this be done by the particular implementation of the VMM/Hypervisor? If "yes", could you give a me a hint of why the loading and storing of %cr3, %idtr" etc. are done automatically, whereas that is not the case for gpr?

I'm sorry if these questions are dumb, but I just started learning virtualization-related stuff. Thanks for your help.

0

There are 0 best solutions below