Intel update


Published on

We discuss the existing and new hardware virtualization features. First, we review the existing hardware features that are not used by Xen today, showing examples for use cases. 1) For example, The "descriptor-table exiting" should be useful for the guest kernels or security agent to enhance security features. 2) The VMX-preemption timer allows the hypervisor to preempt guest VM execution after a specified amount of time, which is useful to implement fair scheduling. The hardware can save the timer value on each successive VMexit, after setting the initial VM quantum. 3) VMFUNC is an operation provided by the processor that can be invoked from VMX non-root operation without a VM exit. Today, EPTP switching is available, and we discuss how we can use the feature. Second, we talk about new hardware features, especially for interrupt optimizations.

1 Like
  • Be the first to comment

No Downloads
Total views
On SlideShare
From Embeds
Number of Embeds
Embeds 0
No embeds

No notes for slide

Intel update

  1. 1. Intel UpdateJun  Nakajima  Intel  Corpora3on    
  2. 2. Legal DisclaimerŸ  INFORMATION IN THIS DOCUMENT IS PROVIDED IN CONNECTION WITH INTEL® PRODUCTS. NO LICENSE, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, TO ANY INTELLECTUAL PROPERTY RIGHTS IS GRANTED BY THIS DOCUMENT. EXCEPT AS PROVIDED IN INTEL’S TERMS AND CONDITIONS OF SALE FOR SUCH PRODUCTS, INTEL ASSUMES NO LIABILITY WHATSOEVER, AND INTEL DISCLAIMS ANY EXPRESS OR IMPLIED WARRANTY, RELATING TO SALE AND/OR USE OF INTEL® PRODUCTS INCLUDING LIABILITY OR WARRANTIES RELATING TO FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABILITY, OR INFRINGEMENT OF ANY PATENT, COPYRIGHT OR OTHER INTELLECTUAL PROPERTY RIGHT. INTEL PRODUCTS ARE NOT INTENDED FOR USE IN MEDICAL, LIFE SAVING, OR LIFE SUSTAINING APPLICATIONS.Ÿ  Intel may make changes to specifications and product descriptions at any time, without notice.Ÿ  All products, dates, and figures specified are preliminary based on current expectations, and are subject to change without notice.Ÿ  Intel, processors, chipsets, and desktop boards may contain design defects or errors known as errata, which may cause the product to deviate from published specifications. Current characterized errata are available on request.Ÿ  Intel and the Intel logo are trademarks or registered trademarks of Intel Corporation or its subsidiaries in the United States and other countries.Ÿ  *Other names and brands may be claimed as the property of others.Ÿ  Copyright © 2012 Intel Corporation.
  3. 3. Agenda • Useful VMX features and Example Usages for Xen − Descriptor-Table Exiting − Accessed and Dirty Flags for EPT − VMFUNC • New Features for Interrupt/APIC Virtualization 3
  4. 4. Descriptor-Table Exiting•  Access to GDTR or IDTR. Guest software attempted to execute LGDT, LIDT, SGDT, or SIDT − VM Exit Reason: 46•  Access to LDTR or TR. Guest software attempted to execute LLDT, LTR, SLDT, or STR − VM Exit Reason: 47 4
  5. 5. Descriptor-Table Exiting: Example Usages•  Detect unusual activities with GDT/IDT in hypervisor − Hooking GDT/IDT is classical malware attack − Since virtual platforms can have identical configurations, it’s easier to detect such suspicious activities − To detect modifications to GDT or IDT entries, hypervisor needs to write- protect GDT and IDT•  Report incidents to user dashboard, management tool in Cloud − Add API for such monitoring 5
  6. 6. Accessed and Dirty Flags for EPT•  Accessed Flag − Processor sets flag whenever it uses EPT paging-structure entry as part of the guest-physical-address translation•  Dirty Flag − Processor sets flag whenever there is a write to guest-physical address•  Available in EPT paging structures − A Flag is available for region or page (1GB, 2MB, 4KB) − D Flag is available only for page (1GB, 2MB, 4KB) 6
  7. 7. Accessed and Dirty Flags for EPT:Example Usages•  Guest memory paging − Xenpaging•  Fast VM check-pointing for fault tolerance − Log-dirty mode in Xen requires write-protection & EPT violation − Use D bits to identify dirty pages − Additional software-based optimizations should be helpful•  Monitor memory activities of VMs in Cloud − Use A/D bits to monitor memory activities with very low overheads − Scan EPT page tables every one minute (or user metric) − Report # of pages accessed/modified to user dashboard 7
  8. 8. VMFUNC Instruction•  Allows code in guest to invoke VM function − Configured by software (such as hypervisor) in VMX root operation. − No VM exits (if successful)•  VM function 0: EPTP switching VMFUNC − Allows code in guest to load new value for EPT pointer (EPTP) − Loads EPTP from EPTP list (indexed by value of ECX) − Does not modify state of any registers; no flags are modified. 8
  9. 9. VMFUNC Instruction: Example Usages•  Allow HVM guests to share pages/info with hypervisor in secure fashion 1.  Hypervisor sets up EPT page tables with additional mapping 2.  VCPU executes VMFUNC instruction in “special” thread 3.  Upon successful execution, it can access additional space that other VCPUs cannot access 4.  Hypervisor forces VCPU to use usual ETP page tables after job is done•  Optimizations for grant page tables 1.  Hypervisor sets up EPT page tables so that front-end and back-end can share pages (buffers) 2.  VCPU granted executes VMFUNC instruction to share buffers only for data transfer between front-end and back-end 9
  10. 10. Agenda • Useful VMX Features and Example Usages for Xen − Descriptor-Table Exiting − Accessed and Dirty Flags for EPT − VMFUNC • New Features for Interrupt/APIC Virtualization 10
  11. 11. Interrupt/APIC Virtualization: Overview•  VMM must virtualize guest’s interrupts and interrupt controller (APIC) − Models APIC control state on a “virtual-APIC page” in memory•  VMM must emulate nearly all guest accesses to APIC control registers − Requires “VM exits” – time-consuming transitions into VMM for emulation – and back − VMM must decode and emulate guest instructions that access APIC − Except for Intel® VT FlexPriority, which virtualizes access to one APIC control register − Task priority – TPR − No VM exits required in this case•  VMM must virtualize all interrupts coming to guest − Must determine when guest is ready to receive interrupts and deliver as needed•  Virtualization of interrupts and APIC is a major source of overhead − Illustration on next slide 11
  12. 12. Interrupt/APIC Virtualization: Major Source of Overhead* Netperf in Xen with 10GbE (SR-IOV) Candidates for optimization 90 80 70 APIC Register Access (W) % of Total VM Exits 60 APIC Register Access (R) 50 EOI 40 30 Interrupt Window 20 External Interrupts 10 0 2 VMs 4 VMs 7 VMs Candidates for elimination •  Performance cost of virtualization mostly due to VM exits •  Significant fraction of VM exits are for APIC & interrupt virtualization •  Opportunities: − Eliminate entirely VM exits for operations that can be performed by CPU − Optimize handling of remaining VM exits by simplifying task of emulation*Intel internal estimation 12
  13. 13. Motivations for Further Optimizations•  Reduce unique overheads of virtualization − Intel is fanatically committed•  Virtualization has come to be default deployment platform for IT − Any application, even most performance demanding, may run in virtualization•  Virtualization is foundation of Cloud − More I/O performance/scalability for Web apps, Database, Big Data, HPC, etc. 13
  14. 14. New Features for Interrupt/APIC Virtualization •  APIC-register virtualization: − Redirects most guest APIC reads/writes to virtual-APIC page − Most reads will be allowed without VM exits −  such as, interrupt command register - ICR_Low − VM exits occur after writes (no need for decode) −  such as, ICR_low, timer’s initial-count register •  Virtual-interrupt delivery: − Extend TPR virtualization to other APIC registers − No need for VM exits for most frequent accesses (e.g., EOI – required for every interrupt) − CPU delivers virtual interrupts to guest (including virtual IPIs) − VMM needn’t track guest readiness or deliver manually − Eliminates old “pending interrupt” VM exits •  Net result*: (Intel Netperf estimation) − Eliminate up to 50% of VM exits (most of those related to virtualization of interrupts/APIC) − Optimize up to 10% of VM exits (emulation made easier for some APIC writes)*Intel internal estimation 14
  15. 15. Call To Action •  Use existing VMX features to enhance Xen: − Descriptor-Table Exiting •  Get ready. Spec is already in Software Developer’s Manual*: − Accessed and Dirty Flags for EPT − VMFUNC •  Stay tuned: − New Features for Interrupt/APIC Virtualization − Software Developer’s Manual now added the spec (end of August 2012)*Intel® 64 and IA-32 Architectures Software Developer’s Manual , May 2012 15