ARMvisor:
      ARM架構上系統虛擬機的實作
            Peter Chang @ SSLab, Dept. of CS, NTHU
                 phchang@sslab.cs.nthu.edu.tw




            This side is licensed under CC-BY-NC-SA
               姓名標示─非商業性─相同方式分享
(http://creativecommons.org/licenses/by-nc-sa/3.0/tw/legalcode)
What is ARMvisor?
ARM
ARM
ARM
What is KVM?
What is KVM?


A.k.a. Kernel-based Virtual Machine
What is KVM?


A.k.a. Kernel-based Virtual Machine

Type-II Virtual Machine Monitor
What is KVM?


A.k.a. Kernel-based Virtual Machine

Type-II Virtual Machine Monitor

A module of Linux kernel
What is KVM?
What is KVM?



Officially support x86/x64, PowerPC, S390
What is KVM?



Officially support x86/x64, PowerPC, S390

  No official support for ARM architecture
What is ARMvisor?
What is ARMvisor?

ARM架構上的KVM
What is ARMvisor?

ARM架構上的KVM

Para-virtualization
What is ARMvisor?

ARM架構上的KVM

Para-virtualization

Trap & Emulation
What is ARMvisor?

ARM架構上的KVM

Para-virtualization

Trap & Emulation

Dynamic Memory Allocation
What is ARMvisor?

ARM架構上的KVM

Para-virtualization

Trap & Emulation

Dynamic Memory Allocation

virtio & IRQchip-in-kernel
Hardware: ARM Cortex-A8
Host OS: Linux 2.6.38


Hardware: ARM Cortex-A8
ARMvisor
  Host OS: Linux 2.6.38


Hardware: ARM Cortex-A8
Driver                      ARMvisor
         Host OS: Linux 2.6.38


  Hardware: ARM Cortex-A8
QEMU 0.14


Driver                      ARMvisor
         Host OS: Linux 2.6.38


  Hardware: ARM Cortex-A8
QEMU 0.14

                   Device
Driver                      ARMvisor
         Host OS: Linux 2.6.38


  Hardware: ARM Cortex-A8
QEMU 0.14

                   Device
Driver                      ARMvisor
         Host OS: Linux 2.6.38


  Hardware: ARM Cortex-A8
Guest OS: Linux 2.6.35




           QEMU 0.14

                   Device
Driver                      ARMvisor
         Host OS: Linux 2.6.38


  Hardware: ARM Cortex-A8
Guest OS: Linux 2.6.35




           QEMU 0.14

                   Device
Driver                      ARMvisor
         Host OS: Linux 2.6.38


  Hardware: ARM Cortex-A8
Guest OS: Linux 2.6.35




                                 Driver
           QEMU 0.14

                   Device
Driver                      ARMvisor
         Host OS: Linux 2.6.38


  Hardware: ARM Cortex-A8
Who are developers?



         @
2012



       2011



2010



       2009
2012



       2011



2010



       2009
2012



                  2011



           2010

Starting Point

                  2009
2012



                  2011



           2010

Starting Point

                  2009
2012



                  2011

                   ARMvisor Prototype

           2010

Starting Point

                  2009
2012



                  2011

                   ARMvisor Prototype

           2010

Starting Point

                  2009
2012
CPU Opt & Mem Opt

                     2011

                      ARMvisor Prototype

              2010

   Starting Point

                     2009
2012
CPU Opt & Mem Opt

                     2011

                      ARMvisor Prototype

              2010

   Starting Point

                     2009
I/O Opt

              2012
CPU Opt & Mem Opt

                     2011

                      ARMvisor Prototype

              2010

   Starting Point

                     2009
Current achievement
Supported Hardware
Supported Hardware

Supported Software
Supported Hardware

Supported Software

Demo
Supported Hardware



            ARM Realview-eb

                ARM11

              ARMv6 ISA
Supported Hardware



             TI BeagleBoard

               Cortex-A8

              ARMv7 ISA
Supported Hardware

             QEMU emulator

          Emulating Vexpress-a9

QEMU            Cortex-A9

               ARMv7 ISA
Supported Software

Patched Host OS:

  Linaro Linux 2.6.38

Host Root Filesystem

  Ubuntu/Debian RFS (CLI or GUI)

QEMU 0.14
Supported Software


Patched Guest OS:

  Linux 2.6.35 (running on ARMv6 ISA)

Guest Root Filesystem:

  Ubuntu/Debian RFS (CLI or GUI)
Video demo
System model of
   ARMvisor
CPU virtualization


ARM is non-virtualizable CPU

  Patch guest OS

“Trap and emulation”
Sensitive instructions


         Sensitive
       Instructions


       Non-Sensitive
        Instructions
Privileged instructions

         Privileged
        instructions


       Non-Privileged
        instructions
Virtualizable CPU
Virtualizable CPU

  Sensitive
Instructions
Virtualizable CPU

  Sensitive          Privileged
Instructions        instructions
Virtualizable CPU

  Sensitive
Instructions   =     Privileged
                    instructions
Virtualizable CPU

  Sensitive
Instructions    =    Privileged
                    instructions


Non-Sensitive
 Instructions
Virtualizable CPU

  Sensitive
Instructions    =     Privileged
                     instructions


Non-Sensitive       Non-Privileged
 Instructions        instructions
Virtualizable CPU

  Sensitive
Instructions    =     Privileged
                     instructions


Non-Sensitive
 Instructions   =   Non-Privileged
                     instructions
Non-virtualizable CPU

  Sensitive
Instructions

                =    Privileged
                    instructions
                                   Non-Privileged
                                    instructions

Non-Sensitive
 Instructions
Critical Instructions
Critical Instructions
           S




P                   NP




           NS
Critical Instructions
            S



      S&P

P                   NP




            NS
Critical Instructions
            S



      S&P   S&NP

P                   NP




            NS
Critical Instructions
             S



      S&P    S&NP

P                   NP

      NS&P



             NS
Critical Instructions
             S



      S&P    S&NP

P                    NP

      NS&P   NS&NP



             NS
Critical Instructions
            S



      S&P   S&NP

P                   NP




            NS
Critical Instructions
                 S



     Privilege   S&NP

P                       NP




                 NS
Critical Instructions
                 S



     Privilege   Critical

P                           NP




                 NS
“Trap & emulation”

                Guest%OS

 User%space%     trap
            %
Kernel%space
                 VMM
Memory virtualization



Static Partition
Memory virtualization
Memory virtualization


Static Partition

Shadow Page Table
I/O virtualization



virtio

IRQ chip in kernel
virtio

   Vir$o&Driver
                        Guest
Vir$o&PCI&Controller

       Vring           Transport
Vir$o&PCI&Controller
                        QEMU
   Vir$o&Device
irq_chip in kernel

                             Guest

                                       Deliver7

          GIC               QEMU       IRQ7

                                                  Control7
                                                  GIC7

Device   Device    Device
                              IOCTL7


                  ARMvisor
irq_chip in kernel

                            Guest
                                  Deliver$
                                  IRQ$
                           QEMU

Device   Device   Device                     Control$
                                             GIC$




    GIC$in$Kernel                            KVM
Future Works
Future Works
Future Works

Support for ARM’s Virtualization extension
Future Works

Support for ARM’s Virtualization extension

  Cortex-A15 and beyond
Future Works

Support for ARM’s Virtualization extension

  Cortex-A15 and beyond

SMP for host and guest
Future Works

Support for ARM’s Virtualization extension

  Cortex-A15 and beyond

SMP for host and guest

AArch64 Support
Future Works

Support for ARM’s Virtualization extension

  Cortex-A15 and beyond

SMP for host and guest

AArch64 Support

  ARMv8
By the way, ...
OpenSource
OpenSource

We are going to opensource in late August,
2012.
OpenSource

We are going to opensource in late August,
2012.

GNU GPLv2
OpenSource

We are going to opensource in late August,
2012.

GNU GPLv2

Source code of Host and Guest OS
OpenSource

We are going to opensource in late August,
2012.

GNU GPLv2

Source code of Host and Guest OS

User Guide
OpenSource

We are going to opensource in late August,
2012.

GNU GPLv2

Source code of Host and Guest OS

User Guide

Welcome to try and feedback to us :)
OpenSource
Q&A

ARMvisor @ COSCUP2012