- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
"VM exits in response to certain instructions and events (e.g., page fault) are a key source of performance degredation in a virtualized systems. But have you ever wondered why? What exactly happens during a VM exit anyway?
A VM exit marks the point at which a transition is made between the VM currently running and the VMM (hypervisor) which must exercise system control for a particular reason. In general, the processor must save a snapshot of the VM's state as it was running at the time of the exit. For Intel architectures, here is an approximation of the steps:
1. Record information about the cause of the VM exit in the VM-exit information fields (exit reason, exit qualification, guest address), and update VM-entry control fields.
2. Save processor state in the guest state area. This includes control registers, debug registers, MSRs (see next item), segment registers, descriptor-table registers, RIP, RSP, and RFLAGS, as well as non-register state like pending debug exceptions.
3. Save MSRs in the VM-exit MSR-store area. MSR stands for Machine Specific Registers, in case you are not familar. They are used to control and report on processor performance.
4. Load processor state based on the host-state area and some VM-exit controls. This includes host control registers, debug registers, MSRs, host table and descriptor-table registers, RIP, RSP, and RFLAGS, page-directory pointer table entries, as well as non-register state.
5. Load MSRs from the VM-exit MSR-load area.
Oh, and don't forget that after the VMM has performed its system management function, then a corresponding VM entry will be performed that transitions processor control from the VMM to the VM!
Now you can see why VM exits generate considerable overhead, to the tune of hundreds or thousands of cycles for a single transition. To mitigate this problem, BTW, considerable effort has gone in to both reducing the number of cycles required by a single trasition, and creating features that obviate the need for system management (and hence VM exits) in the first place.
For more information, see the "Intel 64 and IA-32 Architectures Software Developer's Manual" at http://download.intel.com/design/processor/manuals/. In particular, take a look at chapter 23 in Volume 3B: System Programming Guide, Part 2."
-Thai
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
![](/skins/images/D2683F18326913BBA0436CB7114DD569/responsive_peak/images/icon_anonymous_message.png)
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page