Improving Virtualization in the Presence of Software Managed Translation Lookaside Buffers

Improving Virtualization in the Presence of Software Managed Translation Lookaside Buffers

Improving Virtualization in the Presence of Software Managed Translation Lookaside Buffers ∗ Xiaotao Chang1, Hubertus Franke2, Yi Ge1, Tao Liu1, Kun Wang1, Jimi Xenidis3, Fei Chen1, Yu Zhang1 1IBM Research-China 2IBM Thomas J. 3Qualcomm Research Beijing, China Watson Research Center Silicon Valley {changxt, geyi, liuttao, New York, USA California, USA wangkun, uchen, zhyu} [email protected] [email protected] @cn.ibm.com ABSTRACT relying on older versions of an OS can be deployed at the Virtualization has become an important technology that is same time as modern applications that require more recent used across many platforms, particularly servers, to increase OSs. Furthermore, applications and their OSs can be iso- utilization, multi-tenancy and security. Virtualization intro- lated, which gives rise to the notion of software appliances. duces additional overhead that often relates to memory man- Second, probably equally important, is that this collocation agement, interrupt handling and hypervisor mode switching. enables a much higher utilization of computing resources. It Among those, memory management and translation looka- is known that infrastructure services such as print and file side buffer (TLB) management have been shown to have servers, as well as end-user desktop systems, demonstrate a significant impact on the performance of systems. Two poor system utilization that often does not reach a double principal mechanisms for TLB management exist in today’s digit percentage [3]. Virtualization, with the resulting abil- systems, namely software and hardware managed TLBs. In ity to collocate OSs, enables a significantly higher utilization this paper, we analyze and quantify the overhead of a pure and is one of the principal enabling technologies that has software virtualization that is implemented over a software been driving cloud computing. managed TLB. We then describe our design of hardware ex- Virtualization introduces a new layer of system software, tensions to support virtualization in systems with software called the hypervisor (or Virtual Machine Monitor, VMM), managed TLBs to remove the most dominant overheads. that controls the access to the physical resources from guest These extensions were implemented in the Power embed- OSs. The guest OS has restricted control of the physical re- ded A2 core, which is used in the PowerEN and in the Blue sources and has to engage with the hypervisor to get access. Gene/Q processors. They were used to implement a KVM This new layer results in additional overhead in the execu- port. We evaluate each of these hardware extensions to de- tion of code and accesses to the I/O devices that can grossly termine their overall contributions to performance and effi- be categorized in memory management, interrupt handling ciency. Collectively these extensions demonstrate an average and I/O accesses. Processor technology has advanced and improvement of 232% over a pure software implementation. now provides many techniques to mitigate some of this over- head. In this paper we pay close attention to the impact on the 1. INTRODUCTION memory management subsystem under virtualization. For Virtualization has seen increased popularity due to cloud instance, almost all modern processors are equipped with computing, deployment of virtual appliances and consolida- TLBs. Two principal mechanisms for handling TLB misses tion. In contrast to standard system deployment where a are commonly found in modern architectures, namely hard- single operating system (OS) controls the physical machine ware managed TLBs or software managed TLBs, or some it is running on, virtualization enables multiple OSs to run combination of the two. Processors with hardware managed concurrently on a single physical machine. Doing so, enables TLBs automatically walk the page table to locate a valid new important features. First, different types and versions page table entry for the specified virtual address. If an en- of OSs can run side by side. For instance, legacy applications try exists, it is brought into the TLB and the translation ∗ is retried: this time the access will hit in the TLB, allow- All authors were with IBM when working on this paper. ing the program to proceed. For example, Intel and AMD’s x86 processors, IBM’s Power Server ISA and ARM’s Cor- tex are all equipped with hardware managed TLBs. With the introduction of virtualization, address translation is a Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are dual lookup, one within the guest translation and one within not made or distributed for profit or commercial advantage and that copies the hypervisor/host environment. In systems with hardware bear this notice and the full citation on the first page. To copy otherwise, to managed TLB, the TLB implementation can be transpar- republish, to post on servers or to redistribute to lists, requires prior specific ently extended without impact on the system stack. permission and/or a fee. In contrast, in processors with software managed TLB, ISCA ’13 Tel-Aviv, Israel a TLB miss generates a ”TLB miss” exception, and OS Copyright 2013 ACM 978-1-4503-2079-5/13/06 ...$15.00. 120 VM1 VM2 User App1 App2 App1 App2 Guest OS © App Guest OS 1 Guest OS 2 §£¤ Hypervisor ¡ ¢£¤¥¦§¨¤ Hypervisor Hardware Hardware Figure 1: Pure Software Virtualization on Tradi- Figure 2: Interrupt Handling on Pure Software Vir- tional Power Embedded Core tualization code is responsible to traverse the page table to identify the In EMUL virtualization, all instructions of the guest ma- translation in software. The OS then loads the translation chine (aka virtual machine, VM), including ones executing into the TLB and restarts the program from the instruc- in the guest OS, are executed in user mode. All privileged tion that caused the TLB miss. Processors such as MIPS, instructions running in the guest machine will trap to the UltraSPARC, and Power Embedded ISA are equipped with hypervisor (supervisor mode) and then the hypervisor per- software managed TLBs. With virtualization, two transla- forms the emulation and returns to the guest. Usually, be- tions need to be done in software, which are performed in cause there are a significant number of supervisor instruc- different protection domains. tions and privileged register accesses that need to be trapped In this paper, we describe our design of hardware ex- and emulated, EMUL virtualization introduces significant tensions to support virtualization in systems with software overhead on the Power embedded core. For example, the managed TLBs. These extensions were implemented in the privilege instruction ’mtmsr r0’ (move the MSR to GPR Power embedded A2 core, which is used in the IBM Pow- r0), which is utilized for monitoring processor state and in- erEN[10, 11] and the IBM Blue Gene/Q[14] processors, and terrupt handling, issues 669 host instructions during EMUL subsequently utilized for a port of a Kernel-based Virtual virtualization. This overhead includes the guest state sav- Machine (KVM) hypervisor. A performance comparison be- ing (158 instructions), the hypervisor management (144 in- tween a KVM implementation and a pure software mecha- structions), the emulation (290 instructions) and the guest nism is conducted which shows 232% performance improve- state restore (77 instructions). Different interrupts can cause ment on average. various overheads. In this paper, the detailed instruction The rest of this paper is organized as follows. In Section 2, counts were collected using the Mambo [9] full-system simu- we describe the pure software based classical virtualization lator, and all other performance numbers were collected on techniques on the Power embedded core which also high- real hardware. lights some of the inefficiencies of the approach. Section Next, we will examine the specifics of the software virtu- 3 proposes the hardware assisted virtualization techniques alization approach for the traditional Power embedded core. for the Power embedded core, which is a software managed TLB processor. Section 4 describes the virtualization imple- 2.1 Interrupt Interception mentations with different hardware extension mechanisms In the Power embedded core, the location of the inter- on Power embedded core. Section 5 presents the experi- rupt service routines is defined by a special purpose regis- mental results and evaluates the performance impact of the ter (SPR), named IVPR (Interrupt Vector Prefix Register). different hardware extensions. Section 6 summarizes related Since the guest OS is always executing in user mode, the hy- work and Section 7 concludes. pervisor needs to redirect the IVPR register and point it to the address of the hypervisor interrupt routines before guest 2. CLASSICAL VIRTUALIZATION MECH- machines run. Usually, there are three operations that need ANISM ON TRADITIONAL POWER EM- to be performed in the interrupt routines: hypervisor mode switch, privileged instruction or function emulation, and in- BEDDED CORE terrupt injection to the guest. Hypervisor mode switch im- Popek and Goldberg’s 1974 paper [22] defines require- plies a switch in privilege level between guest and hypervi- ments for what is termed classical virtualization. By their sor, saving the context of guest machine and preparing the standards, a piece of software can be considered a hypervi- virtualization related guest data structures. All of the guest sor if it meets the following three requirements[1]: fidelity, related states including general registers and some special performance and safety. registers, such as PID (Process ID), PC, stack pointer, re- The trap-and-emulate technique for long was thought to turn address, etc., are saved to a reserved data structure be the only practical method for virtualization. We refer to (called vcpu). The IVPR is also redirected to the interrupt it as EMUL virtualization throughout this paper, as com- routines of the host OS. pared to the hardware assisted virtualization. There are two types of instructions that need to be emu- As shown in Figure 1, in the traditional Power embed- lated.

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    10 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us