SlideShare una empresa de Scribd logo
1 de 44
Linux symposium 2012
Jiun-Hung Ding, Chang-Jung Lin, Ping-Hao Chang
Chieh-Hao Tsang, Wei-Chung Hsu, Yeh-Ching Chung

ARMVISOR


                                                  1
Hypervisor on ARM architecture

ARMVISOR


                                 2
KVM

 Linux Kernel module
 Free, open
 Many developers maintain it!!!
 QEMU




                                   3
System Architecture

           Guest



           QEMU
             Device
     Driver Linux KVM

          Hardware
                        4
Trap & emulate


                  Guest OS

    User space     trap

   Kernel space
                   VMM


                             5
Challenges

 ARM is non-virtualizable.
   Sensitive instructions
   Privileged instructions




                              6
Non-virtualizable

    2531 sensitive
       sensitive but
       25 critical
    non-privileged
      instructions
      instructions
      instructions


          6 privileged
          instructions



                         7
Challenges

 ARM is non-virtualizable
   Critical instructions


 Possible solutions
   Hardware support
   Dynamic binary translation (DBT)
   Para-virtualization




                                       8
Implementation

 CPU virtualization
 Memory virtualization
 IO virtualization
 Optimization




                          9
User space                    Kernel space                   Guest Mode
     1. VM initialization

                  2. Return to QEMU

     3. Run VM
                                      4. Enter Guest

                                                       5. Exit Guest
                 Lightweight trap

                                      Enter Guest
               Heavyweight trap
                                                         Exit Guest
                    Return to QEMU

     Run VM
                                      Enter Guest

 QEMU                               KVM                        Guest OS
CPU Virtualization




                     11
CPU Virtualization

 ARM: non-virtualizable ISA
   Para-virtualization


 Manually insert software interrupts (SWI) into
  guest OS




                                                   12
Para-virtualization


…
mov r0, r0
add sp, sp
movs pc, lr
…



                      13
Para-virtualization (cont.)
                    .macro virt_svc_movs, inst
                    SWI 0x190
…                   inst
mov r0, r0
                    .endm
add sp, sp
virt_svc_movs “movs pc, lr”
…



                                             14
UND            ABORT       SWI     IRQ/FIQ



                      KVM Trap Entry

                       KVM/Guest
Host Trap Handler     Context Switch
                          Unit


                    KVM Trap Dispatcher


Instruction MMU     Exception/Interrupt QEMU I/O
Emulation Emulation     Emulation       Emulation
                                                    15
KVM Vector




oxffff1000
                      0x1C         FIQ
                      0x18         IRQ
                      0x14     (Reserved*)
0xffff001c            0x10      Data Abort
             Kernel   0x0C    Prefetch Abort
             Vector   0x08    Software Interrupt
oxffff0000            0x04   Undefined Instruction
                      0x00         Reset
                                                     16
KVM Vector



             The KVM trap
               Interface
oxffff1000


0xffff001c
                 KVM
oxffff0000      Vector

                            17
Memory Virtualization




                        18
GVA
Guest
PTB




        GPA



              19
Shadow Page Tables

 Map guest virtual address to host physical
  address

 For each guest page table (GPT), ARMvisor
  will allocate a shadow page table (SPT) to
  map it.




                                               20
Guest
PTB                    GVA



                       GPA



                             Host
                       HVA   PTB

        New SPTE !!!

                       HPA
                                    21
Emulation Flow
PABT/DABT
                                               Hidden protection fault
   trap



  guest             Guest             MMIO             Shadow             Shadow
page table        permission          access          page table         page table
  walker           checker           checker           mapping            update




             True permission fault             Hidden translation fault


True Translation fault         MMIO emulation

                                                                                  22
Shadow Page Tables

 Map guest virtual address to host physical
  address
 For each guest page table (GPT), ARMvisor
  will allocate a shadow page table (SPT) to
  map it.

 How to keep coherence between SPT and
  GPT?

                                               23
Synchronization

 Write protect page table page
   Modification would cause a protection fault.
   Reverse map (RMAP) : Record reverse mapping
    form guest physical page to SPT entries




                                                   25
Permission Emulation (1)

 Guest OS in non-privileged mode
 Some instructions access kernel space with
  user permission
   LDRBT, LDRT, STRBT, STRT


 Double shadow page table




                                               26
Permission Mapping

 Permission mechanism on ARM
   Permission bits
   Domain
     No access
     Client
     Manager




                                28
Using Domain Mechanism
                      GUD    GKD
 Virtual User Space   CLIENT NA

 Virtual Kernel Space CLIENT CLIENT




                                      29
Optimizations




                30
Virtualization Overhead -CPU

 CPU virtualization
   Frequent lightweight traps result lots of context
    switch


 Try to reduce…
   number of traps
   Overhead of emulation




                                                        31
CPU Optimization

 Shadow file register (SFR)
   Map VCPU’s shadow state of the register file into
    memory region that is both accessible for the
    VMM and guest with RW permission.




                                                        33
mcr cpsr, r1
           oxffff2000
 VCPU
Register      Sync
  File                     Shadow        Read/Write
                         Register File   Instructions



                         KVM/Guest
                        Context Switch
                          Interface
           oxffff1000

                         KVM vector
           oxffff0000                                   34
CPU Optimization

 Shadow file register (SFR)
   Map VCPU’s shadow state of the register file into
    memory region that is both accessible for the
    VMM and guest with RW permission.


 Para-virtualization: Fast instruction trap
   Sets of pre-defined macros which is composed of
    encoded information of the replaced instructions.


                                                        36
Virtualization Overhead –MEM

 Memory virtualization
   Synchronization model


 Try to reduce…
   Protection faults




                               37
Memory Optimization

 Para-virtualization: hyper calls for PT
  modifications
   When Guest OS sets PTEs
   When Guest OS is going to free a L2 page table




                                                     38
Implementation Status




                        39
Experiment Board

 ARMvisor supports ARMv6 & ARMv7
 architecture in host




   ARM v6 11mpcore      ARM v7 cortex-a8


                                           40
Environment

 Host OS: Linux 2.6.35 Ubuntu
 Guest OS: Linux 2.6.31


 LMBench




                                 41
Experiment Data
100

80

60

40

20

 0




            base   cpu opt   mem opt   all opt
                                                 42
16
     Experiment Data
     15.20
14        12.46                                                     12.17
12    11.24                                                     10.81
                     9.37                                                                                9.94
10                                                           8.45              7.97 8.04
8                                                                       7.18
                                   5.78                                                    5.66
6                           4.63
              4.39                                                                                4.41
4
                                          1.89 1.43
2                                                     1.23
0




                                              all opt
                                                                                                          43
Related Work

 VMware MVP
 Xen-ARM
 B LABS CODEZEOR
 OK Labs OKL4
 Virtual Open System




                        44
Conclusion

 ARMvisor supports ARMv6 & ARMv7
  architecture in host
   Support RealView EB and Beagle Board
 CPU and memory optimization gain lots of
  performance improvement
   Reduce traps
   Decrease protection faults




                                             45
Future Work

 I/O optimization
 Support ARM hardware virtualization
  extensions
 Multi-VM
 Multi-core
 …




                                        46
Contact Us

 SSLAB, NTHU, Taiwan


 Website
   https://sites.google.com/a/sslab.cs.nthu.edu.tw/ar
    mvisor/


 Thanks For Your Attention



                                                         47
IO Virtualization Overhead

           Guest

                   Driver

           QEMU
             Device
     Driver Linux KVM

          Hardware
                             49

Más contenido relacionado

La actualidad más candente

La actualidad más candente (20)

PV-Drivers for SeaBIOS using Upstream Qemu
PV-Drivers for SeaBIOS using Upstream QemuPV-Drivers for SeaBIOS using Upstream Qemu
PV-Drivers for SeaBIOS using Upstream Qemu
 
SFO15-202: Towards Multi-Threaded Tiny Code Generator (TCG) in QEMU
SFO15-202: Towards Multi-Threaded Tiny Code Generator (TCG) in QEMUSFO15-202: Towards Multi-Threaded Tiny Code Generator (TCG) in QEMU
SFO15-202: Towards Multi-Threaded Tiny Code Generator (TCG) in QEMU
 
ACRN vMeet-Up EU 2021 - shared memory based inter-vm communication introduction
ACRN vMeet-Up EU 2021 - shared memory based inter-vm communication introductionACRN vMeet-Up EU 2021 - shared memory based inter-vm communication introduction
ACRN vMeet-Up EU 2021 - shared memory based inter-vm communication introduction
 
Malicious Hypervisor - Virtualization in Shellcodes by Adhokshaj Mishra
Malicious Hypervisor - Virtualization in Shellcodes by Adhokshaj MishraMalicious Hypervisor - Virtualization in Shellcodes by Adhokshaj Mishra
Malicious Hypervisor - Virtualization in Shellcodes by Adhokshaj Mishra
 
openqrm4.9 Quick Start Guide
openqrm4.9 Quick Start Guideopenqrm4.9 Quick Start Guide
openqrm4.9 Quick Start Guide
 
ACRN vMeet-Up EU 2021 - debug ACRN hypervisor
ACRN vMeet-Up EU 2021 - debug ACRN hypervisorACRN vMeet-Up EU 2021 - debug ACRN hypervisor
ACRN vMeet-Up EU 2021 - debug ACRN hypervisor
 
Project ACRN: SR-IOV implementation
Project ACRN: SR-IOV implementationProject ACRN: SR-IOV implementation
Project ACRN: SR-IOV implementation
 
Dave Gilbert - KVM and QEMU
Dave Gilbert - KVM and QEMUDave Gilbert - KVM and QEMU
Dave Gilbert - KVM and QEMU
 
Esx.sc.quickref
Esx.sc.quickrefEsx.sc.quickref
Esx.sc.quickref
 
Running Dual Android Xen Instances on Nexus 10
Running Dual Android Xen Instances on Nexus 10Running Dual Android Xen Instances on Nexus 10
Running Dual Android Xen Instances on Nexus 10
 
Project ACRN CPU sharing BVT scheduler in ACRN hypervisor
Project ACRN CPU sharing BVT scheduler in ACRN hypervisorProject ACRN CPU sharing BVT scheduler in ACRN hypervisor
Project ACRN CPU sharing BVT scheduler in ACRN hypervisor
 
Project ACRN hypervisor introduction
Project ACRN hypervisor introduction Project ACRN hypervisor introduction
Project ACRN hypervisor introduction
 
JRuby Jam Session
JRuby Jam Session JRuby Jam Session
JRuby Jam Session
 
Project ACRN Device Model architecture introduction
Project ACRN Device Model architecture introductionProject ACRN Device Model architecture introduction
Project ACRN Device Model architecture introduction
 
Project ACRN expose and pass through platform hidden PCIe devices to SOS
Project ACRN expose and pass through platform hidden PCIe devices to SOSProject ACRN expose and pass through platform hidden PCIe devices to SOS
Project ACRN expose and pass through platform hidden PCIe devices to SOS
 
Embedded Systems Conference 2014 Presentation
Embedded Systems Conference 2014 PresentationEmbedded Systems Conference 2014 Presentation
Embedded Systems Conference 2014 Presentation
 
ACRN vMeet-Up EU 2021 - hypervisor new platform enabling
ACRN vMeet-Up EU 2021 - hypervisor new platform enablingACRN vMeet-Up EU 2021 - hypervisor new platform enabling
ACRN vMeet-Up EU 2021 - hypervisor new platform enabling
 
Project ACRN GVT-d introduction and tutorial
Project ACRN GVT-d introduction and tutorialProject ACRN GVT-d introduction and tutorial
Project ACRN GVT-d introduction and tutorial
 
ACRN vMeet-Up EU 2021 - Real Time Management and Performance Optimization
ACRN vMeet-Up EU 2021 - Real Time Management and Performance OptimizationACRN vMeet-Up EU 2021 - Real Time Management and Performance Optimization
ACRN vMeet-Up EU 2021 - Real Time Management and Performance Optimization
 
Project ACRN I2C mediator introduction
Project ACRN I2C mediator introductionProject ACRN I2C mediator introduction
Project ACRN I2C mediator introduction
 

Similar a ARMvisor @ Linux Symposium 2012

Virtual Pc Seminar
Virtual Pc SeminarVirtual Pc Seminar
Virtual Pc Seminar
guest5b5549
 
Xen Euro Par07
Xen Euro Par07Xen Euro Par07
Xen Euro Par07
congvc
 
Storage-Performance-Tuning-for-FAST-Virtual-Machines_Fam-Zheng.pdf
Storage-Performance-Tuning-for-FAST-Virtual-Machines_Fam-Zheng.pdfStorage-Performance-Tuning-for-FAST-Virtual-Machines_Fam-Zheng.pdf
Storage-Performance-Tuning-for-FAST-Virtual-Machines_Fam-Zheng.pdf
aaajjj4
 
Hardware supports for Virtualization
Hardware supports for VirtualizationHardware supports for Virtualization
Hardware supports for Virtualization
Yoonje Choi
 

Similar a ARMvisor @ Linux Symposium 2012 (20)

5 kvm arm
5 kvm arm5 kvm arm
5 kvm arm
 
Toward a practical “HPC Cloud”: Performance tuning of a virtualized HPC cluster
Toward a practical “HPC Cloud”: Performance tuning of a virtualized HPC clusterToward a practical “HPC Cloud”: Performance tuning of a virtualized HPC cluster
Toward a practical “HPC Cloud”: Performance tuning of a virtualized HPC cluster
 
Virtualization Primer for Java Developers
Virtualization Primer for Java DevelopersVirtualization Primer for Java Developers
Virtualization Primer for Java Developers
 
2011 10-19
2011 10-192011 10-19
2011 10-19
 
The kvm virtualization way
The kvm virtualization wayThe kvm virtualization way
The kvm virtualization way
 
Toward a practical “HPC Cloud”: Performance tuning of a virtualized HPC cluster
Toward a practical “HPC Cloud”: Performance tuning of a virtualized HPC clusterToward a practical “HPC Cloud”: Performance tuning of a virtualized HPC cluster
Toward a practical “HPC Cloud”: Performance tuning of a virtualized HPC cluster
 
Hyper V R2 Deep Dive
Hyper V R2 Deep DiveHyper V R2 Deep Dive
Hyper V R2 Deep Dive
 
Virtual Pc Seminar
Virtual Pc SeminarVirtual Pc Seminar
Virtual Pc Seminar
 
Xen Euro Par07
Xen Euro Par07Xen Euro Par07
Xen Euro Par07
 
Storage-Performance-Tuning-for-FAST-Virtual-Machines_Fam-Zheng.pdf
Storage-Performance-Tuning-for-FAST-Virtual-Machines_Fam-Zheng.pdfStorage-Performance-Tuning-for-FAST-Virtual-Machines_Fam-Zheng.pdf
Storage-Performance-Tuning-for-FAST-Virtual-Machines_Fam-Zheng.pdf
 
Static partitioning virtualization on RISC-V
Static partitioning virtualization on RISC-VStatic partitioning virtualization on RISC-V
Static partitioning virtualization on RISC-V
 
Realtime scheduling for virtual machines in SKT
Realtime scheduling for virtual machines in SKTRealtime scheduling for virtual machines in SKT
Realtime scheduling for virtual machines in SKT
 
Cooperative VM Migration for a virtualized HPC Cluster with VMM-bypass I/O de...
Cooperative VM Migration for a virtualized HPC Cluster with VMM-bypass I/O de...Cooperative VM Migration for a virtualized HPC Cluster with VMM-bypass I/O de...
Cooperative VM Migration for a virtualized HPC Cluster with VMM-bypass I/O de...
 
Virtualizare si SCVMM2008
Virtualizare si SCVMM2008Virtualizare si SCVMM2008
Virtualizare si SCVMM2008
 
Hardware supports for Virtualization
Hardware supports for VirtualizationHardware supports for Virtualization
Hardware supports for Virtualization
 
Virtualization Technology Overview
Virtualization Technology OverviewVirtualization Technology Overview
Virtualization Technology Overview
 
virtualization tutorial at ACM bangalore Compute 2009
virtualization tutorial at ACM bangalore Compute 2009virtualization tutorial at ACM bangalore Compute 2009
virtualization tutorial at ACM bangalore Compute 2009
 
Disco: Running Commodity Operating Systems on Scalable Multiprocessors Disco
Disco: Running Commodity Operating Systems on Scalable Multiprocessors DiscoDisco: Running Commodity Operating Systems on Scalable Multiprocessors Disco
Disco: Running Commodity Operating Systems on Scalable Multiprocessors Disco
 
DPDK Summit - 08 Sept 2014 - Futurewei - Jun Xu - Revisit the IP Stack in Lin...
DPDK Summit - 08 Sept 2014 - Futurewei - Jun Xu - Revisit the IP Stack in Lin...DPDK Summit - 08 Sept 2014 - Futurewei - Jun Xu - Revisit the IP Stack in Lin...
DPDK Summit - 08 Sept 2014 - Futurewei - Jun Xu - Revisit the IP Stack in Lin...
 
WAN - trends and use cases
WAN - trends and use casesWAN - trends and use cases
WAN - trends and use cases
 

Último

Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
vu2urc
 

Último (20)

A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 

ARMvisor @ Linux Symposium 2012

  • 1. Linux symposium 2012 Jiun-Hung Ding, Chang-Jung Lin, Ping-Hao Chang Chieh-Hao Tsang, Wei-Chung Hsu, Yeh-Ching Chung ARMVISOR 1
  • 2. Hypervisor on ARM architecture ARMVISOR 2
  • 3. KVM  Linux Kernel module  Free, open  Many developers maintain it!!!  QEMU 3
  • 4. System Architecture Guest QEMU Device Driver Linux KVM Hardware 4
  • 5. Trap & emulate Guest OS User space trap Kernel space VMM 5
  • 6. Challenges  ARM is non-virtualizable.  Sensitive instructions  Privileged instructions 6
  • 7. Non-virtualizable 2531 sensitive sensitive but 25 critical non-privileged instructions instructions instructions 6 privileged instructions 7
  • 8. Challenges  ARM is non-virtualizable  Critical instructions  Possible solutions  Hardware support  Dynamic binary translation (DBT)  Para-virtualization 8
  • 9. Implementation  CPU virtualization  Memory virtualization  IO virtualization  Optimization 9
  • 10. User space Kernel space Guest Mode 1. VM initialization 2. Return to QEMU 3. Run VM 4. Enter Guest 5. Exit Guest Lightweight trap Enter Guest Heavyweight trap Exit Guest Return to QEMU Run VM Enter Guest QEMU KVM Guest OS
  • 12. CPU Virtualization  ARM: non-virtualizable ISA  Para-virtualization  Manually insert software interrupts (SWI) into guest OS 12
  • 13. Para-virtualization … mov r0, r0 add sp, sp movs pc, lr … 13
  • 14. Para-virtualization (cont.) .macro virt_svc_movs, inst SWI 0x190 … inst mov r0, r0 .endm add sp, sp virt_svc_movs “movs pc, lr” … 14
  • 15. UND ABORT SWI IRQ/FIQ KVM Trap Entry KVM/Guest Host Trap Handler Context Switch Unit KVM Trap Dispatcher Instruction MMU Exception/Interrupt QEMU I/O Emulation Emulation Emulation Emulation 15
  • 16. KVM Vector oxffff1000 0x1C FIQ 0x18 IRQ 0x14 (Reserved*) 0xffff001c 0x10 Data Abort Kernel 0x0C Prefetch Abort Vector 0x08 Software Interrupt oxffff0000 0x04 Undefined Instruction 0x00 Reset 16
  • 17. KVM Vector The KVM trap Interface oxffff1000 0xffff001c KVM oxffff0000 Vector 17
  • 19. GVA Guest PTB GPA 19
  • 20. Shadow Page Tables  Map guest virtual address to host physical address  For each guest page table (GPT), ARMvisor will allocate a shadow page table (SPT) to map it. 20
  • 21. Guest PTB GVA GPA Host HVA PTB New SPTE !!! HPA 21
  • 22. Emulation Flow PABT/DABT Hidden protection fault trap guest Guest MMIO Shadow Shadow page table permission access page table page table walker checker checker mapping update True permission fault Hidden translation fault True Translation fault MMIO emulation 22
  • 23. Shadow Page Tables  Map guest virtual address to host physical address  For each guest page table (GPT), ARMvisor will allocate a shadow page table (SPT) to map it.  How to keep coherence between SPT and GPT? 23
  • 24. Synchronization  Write protect page table page  Modification would cause a protection fault.  Reverse map (RMAP) : Record reverse mapping form guest physical page to SPT entries 25
  • 25. Permission Emulation (1)  Guest OS in non-privileged mode  Some instructions access kernel space with user permission  LDRBT, LDRT, STRBT, STRT  Double shadow page table 26
  • 26. Permission Mapping  Permission mechanism on ARM  Permission bits  Domain  No access  Client  Manager 28
  • 27. Using Domain Mechanism GUD GKD Virtual User Space CLIENT NA Virtual Kernel Space CLIENT CLIENT 29
  • 29. Virtualization Overhead -CPU  CPU virtualization  Frequent lightweight traps result lots of context switch  Try to reduce…  number of traps  Overhead of emulation 31
  • 30. CPU Optimization  Shadow file register (SFR)  Map VCPU’s shadow state of the register file into memory region that is both accessible for the VMM and guest with RW permission. 33
  • 31. mcr cpsr, r1 oxffff2000 VCPU Register Sync File Shadow Read/Write Register File Instructions KVM/Guest Context Switch Interface oxffff1000 KVM vector oxffff0000 34
  • 32. CPU Optimization  Shadow file register (SFR)  Map VCPU’s shadow state of the register file into memory region that is both accessible for the VMM and guest with RW permission.  Para-virtualization: Fast instruction trap  Sets of pre-defined macros which is composed of encoded information of the replaced instructions. 36
  • 33. Virtualization Overhead –MEM  Memory virtualization  Synchronization model  Try to reduce…  Protection faults 37
  • 34. Memory Optimization  Para-virtualization: hyper calls for PT modifications  When Guest OS sets PTEs  When Guest OS is going to free a L2 page table 38
  • 36. Experiment Board  ARMvisor supports ARMv6 & ARMv7 architecture in host ARM v6 11mpcore ARM v7 cortex-a8 40
  • 37. Environment  Host OS: Linux 2.6.35 Ubuntu  Guest OS: Linux 2.6.31  LMBench 41
  • 38. Experiment Data 100 80 60 40 20 0 base cpu opt mem opt all opt 42
  • 39. 16 Experiment Data 15.20 14 12.46 12.17 12 11.24 10.81 9.37 9.94 10 8.45 7.97 8.04 8 7.18 5.78 5.66 6 4.63 4.39 4.41 4 1.89 1.43 2 1.23 0 all opt 43
  • 40. Related Work  VMware MVP  Xen-ARM  B LABS CODEZEOR  OK Labs OKL4  Virtual Open System 44
  • 41. Conclusion  ARMvisor supports ARMv6 & ARMv7 architecture in host  Support RealView EB and Beagle Board  CPU and memory optimization gain lots of performance improvement  Reduce traps  Decrease protection faults 45
  • 42. Future Work  I/O optimization  Support ARM hardware virtualization extensions  Multi-VM  Multi-core  … 46
  • 43. Contact Us  SSLAB, NTHU, Taiwan  Website  https://sites.google.com/a/sslab.cs.nthu.edu.tw/ar mvisor/  Thanks For Your Attention 47
  • 44. IO Virtualization Overhead Guest Driver QEMU Device Driver Linux KVM Hardware 49