SlideShare a Scribd company logo
1 of 126
Download to read offline
ARMvisor
                                   Peter Chang




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

• Peter Chang
Who am I?

• Peter Chang
• One of the current developers of ARMvisor
Who am I?

• Peter Chang
• One of the current developers of ARMvisor
• http://tw.linkedin.com/in/peterchangtw
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
Guest OS: Linux 2.6.35




            QEMU 0.14                   Driver


                      Device
Driver                             ARMvisor
           Host OS: Linux 2.6.38



         Hardware: ARM Cortex-A8
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
Supported Hardware


            ARM Realview-eb

                ARM11

              ARMv6 ISA
Supported Hardware


             TI BeagleBoard

              Cortex-A8

              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)
System model of ARMvisor
CPU virtualization
CPU virtualization

• ARM is non-virtualizable CPU
 • Patch guest OS
• “Trap and emulation”
ARMv6 ISA
1.Branch instructions
2.Data-processing instructions
3.Multiply instructions
4.Parallel addition and subtraction instructions
5.Extend instructions
6.Miscellaneous arithmetic instructions
7.Other miscellaneous instructions
8.Status register access instructions
9.Load and store instructions
10.Load and Store Multiple instructions
11.Semaphore instructions
12.Exception-generating instructions
13.Coprocessor instructions
ARMv6 ISA
1.Branch instructions
                                             Sensitive
2.Data-processing instructions            Instructions ?
3.Multiply instructions
4.Parallel addition and subtraction instructions
5.Extend instructions
6.Miscellaneous arithmetic instructions
7.Other miscellaneous instructions
8.Status register access instructions
9.Load and store instructions
10.Load and Store Multiple instructions
11.Semaphore instructions
12.Exception-generating instructions
13.Coprocessor instructions
ARMv6 ISA
1.Branch instructions
2.Data-processing instructions
3.Multiply instructions
4.Parallel addition and subtraction instructions
5.Extend instructions
6.Miscellaneous arithmetic instructions
7.Other miscellaneous instructions
8.Status register access instructions
9.Load and store instructions
10.Load and Store Multiple instructions
11.Semaphore instructions
12.Exception-generating instructions
13.Coprocessor instructions
Sensitive Instructions
  Data-processing instructions            S-BIT: MOVS, ...

Status register access instructions   MRS, MSR, CPS, SETEND

   Load and store instructions         T-BIT: LDRT, STRT, ...

     Load and Store Multiple
          instructions                LDM(2), LDM(3), STM(2)

Exception-generating instructions           SWI, BKPT

    Coprocessor instructions           MCR, MRC, MCRR, ...
Observation from
Guest Linux Code
• MOVS
• (MRS, MSR, CPS)
• (LDRBT, LDRT, STRBT, STRT)
• (LDM(2), LDM(3), STM(2))
• SWI
• (MCR, MRC, MCRR)

   15 sensitive instructions
 used in the guest linux code
“Trap & emulation”

                Guest%OS

 User%space%     trap
            %
Kernel%space
                 VMM
How to “trap”?
…
mov r0, r0
add sp, sp
movs pc, lr
…
How to “trap”?
…
mov r0, r0
add sp, sp
virt_svc_movs “movs pc, lr”
…
How to “trap”?
…
mov r0, r0
add sp, sp
virt_svc_movs “movs pc, lr”
…
How to “trap”?
                              .macro virt_svc_movs, inst
                              SWI 0x190
                              inst
…                             .endm
mov r0, r0
add sp, sp
virt_svc_movs “movs pc, lr”
…
How to “emulate”?
oxffff1000


0xffff001c
             Kernel Vector
oxffff0000
oxffff1000


0xffff001c
             Kernel Vector
oxffff0000
The KVM trap
               Interface
oxffff1000


0xffff001c
             Kernel Vector
oxffff0000
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
User space   Kernel space   Guest Mode




  QEMU          KVM          Guest OS
User space                 Kernel space   Guest Mode

    1. VM initialization




  QEMU                        KVM          Guest OS
User space                         Kernel space   Guest Mode

    1. VM initialization

                    2. Return to QEMU




  QEMU                                  KVM        Guest OS
User space                         Kernel space   Guest Mode

    1. VM initialization

                    2. Return to QEMU

    3. Run VM




  QEMU                                  KVM        Guest OS
User space                         Kernel space           Guest Mode

    1. VM initialization

                    2. Return to QEMU

    3. Run VM
                                         4. Enter Guest




  QEMU                                  KVM                Guest OS
User space                         Kernel space                    Guest Mode

    1. VM initialization

                    2. Return to QEMU

    3. Run VM
                                         4. Enter Guest


                                                          5. Exit Guest




  QEMU                                  KVM                         Guest OS
User space                         Kernel space                     Guest Mode

    1. VM initialization

                    2. Return to QEMU

    3. Run VM
                                          4. Enter Guest


                                                           5. Exit Guest
                      Lightweight trap




  QEMU                                   KVM                         Guest OS
User space                         Kernel space                     Guest Mode

    1. VM initialization

                    2. Return to QEMU

    3. Run VM
                                          4. Enter Guest


                                                           5. Exit Guest
                      Lightweight trap


                                          6. Enter Guest




  QEMU                                   KVM                         Guest OS
User space                         Kernel space                     Guest Mode

    1. VM initialization

                    2. Return to QEMU

    3. Run VM
                                          4. Enter Guest


                                                           5. Exit Guest
                      Lightweight trap


                                          6. Enter Guest


                                                             7. Exit Guest




  QEMU                                   KVM                         Guest OS
User space                         Kernel space                      Guest Mode

    1. VM initialization

                    2. Return to QEMU

    3. Run VM
                                           4. Enter Guest


                                                            5. Exit Guest
                      Lightweight trap


                                           6. Enter Guest


                                                              7. Exit Guest
                      8. Return to QEMU




  QEMU                                    KVM                         Guest OS
User space                         Kernel space                      Guest Mode

    1. VM initialization

                    2. Return to QEMU

    3. Run VM
                                           4. Enter Guest


                                                            5. Exit Guest
                      Lightweight trap


                                           6. Enter Guest

                     Heavyweight trap
                                                              7. Exit Guest
                      8. Return to QEMU




  QEMU                                    KVM                         Guest OS
User space                         Kernel space                      Guest Mode

    1. VM initialization

                    2. Return to QEMU

    3. Run VM
                                           4. Enter Guest


                                                            5. Exit Guest
                      Lightweight trap


                                           6. Enter Guest

                     Heavyweight trap
                                                              7. Exit Guest
                      8. Return to QEMU


    9. Run VM




  QEMU                                    KVM                         Guest OS
User space                         Kernel space                       Guest Mode

    1. VM initialization

                    2. Return to QEMU

    3. Run VM
                                           4. Enter Guest


                                                             5. Exit Guest
                      Lightweight trap


                                           6. Enter Guest

                     Heavyweight trap
                                                               7. Exit Guest
                      8. Return to QEMU


    9. Run VM

                                           10. Enter Guest


  QEMU                                    KVM                          Guest OS
VCPU	
        oxffff2000
Register	
  
               Sync
  File



                            The KVM trap
                              Interface
               oxffff1000

               0xffff001c
                            Kernel Vector
               oxffff0000
VCPU	
        oxffff2000
Register	
                  Shadow	
  Register	
  File
               Sync
  File



                             The KVM trap
                               Interface
               oxffff1000

               0xffff001c
                             Kernel Vector
               oxffff0000
mcr	
  cpsr,	
  r1



 VCPU	
        oxffff2000
Register	
                  Shadow	
  Register	
  File
               Sync
  File



                             The KVM trap
                               Interface
               oxffff1000

               0xffff001c
                             Kernel Vector
               oxffff0000
mcr	
  cpsr,	
  r1



 VCPU	
        oxffff2000
Register	
                  Shadow	
  Register	
  File
               Sync
  File



                             The KVM trap
                               Interface
               oxffff1000

               0xffff001c
                             Kernel Vector
               oxffff0000
mcr	
  cpsr,	
  r1



 VCPU	
        oxffff2000
                                                         Read/Write
Register	
                  Shadow	
  Register	
  File
               Sync                                      Instructions
  File



                             The KVM trap
                               Interface
               oxffff1000

               0xffff001c
                             Kernel Vector
               oxffff0000
mcr	
  cpsr,	
  r1



 VCPU	
        oxffff2000
                                                         Read/Write
Register	
                  Shadow	
  Register	
  File
               Sync                                      Instructions
  File



                             The KVM trap
                               Interface
               oxffff1000

               0xffff001c
                             Kernel Vector
               oxffff0000
Memory virtualization
PTB   Virtual	
  Address




      Physical	
  Address
GVA



GPA


HVA


HPA
Guest	
  PTB
               GVA



               GPA


               HVA


               HPA
Guest	
  PTB
               GVA



               GPA


               HVA


               HPA
Guest	
  PTB
               GVA



               GPA


                     Host	
  PTB
               HVA


               HPA
Guest	
  PTB
                        GVA



                        GPA


                              Host	
  PTB
                        HVA
   New	
  SPTE	
  !!!
                        HPA
PABT/DABT	
  trap
PABT/DABT	
  trap



     guest	
  
   page	
  table	
  
     walker
PABT/DABT	
  trap



       guest	
  
     page	
  table	
  
       walker




True	
  Translation	
  fault
PABT/DABT	
  trap



       guest	
             Guest	
  
     page	
  table	
     permission	
  
       walker             checker




True	
  Translation	
  fault
PABT/DABT	
  trap



       guest	
              Guest	
  
     page	
  table	
      permission	
  
       walker              checker




                  True	
  permission	
  fault

True	
  Translation	
  fault
PABT/DABT	
  trap



       guest	
              Guest	
  
                                           MMIO	
  access	
  
     page	
  table	
      permission	
  
                                            checker
       walker              checker




                  True	
  permission	
  fault

True	
  Translation	
  fault
PABT/DABT	
  trap



       guest	
              Guest	
  
                                               MMIO	
  access	
  
     page	
  table	
      permission	
  
                                                checker
       walker              checker




                  True	
  permission	
  fault

True	
  Translation	
  fault               MMIO	
  emulation
PABT/DABT	
  trap



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




                  True	
  permission	
  fault

True	
  Translation	
  fault               MMIO	
  emulation
Hidden	
  protection	
  fault
 PABT/DABT	
  trap



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




                  True	
  permission	
  fault

True	
  Translation	
  fault               MMIO	
  emulation
Hidden	
  protection	
  fault
 PABT/DABT	
  trap



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




                  True	
  permission	
  fault            Hidden	
  translation	
  fault

True	
  Translation	
  fault               MMIO	
  emulation
Hidden	
  protection	
  fault
 PABT/DABT	
  trap



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




                  True	
  permission	
  fault            Hidden	
  translation	
  fault

True	
  Translation	
  fault               MMIO	
  emulation
I/O virtualization
I/O virtualization

• Emulation by QEMU
• virtio
• IRQ chip in kernel
Emulate by QEMU
Guest OS: Linux 2.6.35




            QEMU 0.14                   Driver


                   Device
                                   ARMvisor
Driver     Host OS: Linux 2.6.38



         Hardware: ARM Cortex-A8
Guest OS: Linux 2.6.35


                                              1


            QEMU 0.14                   Driver


                   Device
                                   ARMvisor
Driver     Host OS: Linux 2.6.38



         Hardware: ARM Cortex-A8
Guest OS: Linux 2.6.35


                                              1


            QEMU 0.14                   Driver


                   Device
                                   2
                                   ARMvisor
Driver     Host OS: Linux 2.6.38



         Hardware: ARM Cortex-A8
Guest OS: Linux 2.6.35


                                                1


             QEMU 0.14                    Driver


                     Device
         3                           2
                                     ARMvisor
Driver       Host OS: Linux 2.6.38



         Hardware: ARM Cortex-A8
Guest OS: Linux 2.6.35


                                                1


             QEMU 0.14                    Driver


                     Device
         3                           2
                                     ARMvisor
Driver       Host OS: Linux 2.6.38

4



         Hardware: ARM Cortex-A8
Guest OS: Linux 2.6.35




            QEMU 0.14                   Driver


                   Device
                                   ARMvisor
Driver     Host OS: Linux 2.6.38



         Hardware: ARM Cortex-A8
Guest OS: Linux 2.6.35




                QEMU 0.14                   Driver


                       Device
                                       ARMvisor
    Driver     Host OS: Linux 2.6.38

5


             Hardware: ARM Cortex-A8
Guest OS: Linux 2.6.35




                 QEMU 0.14                    Driver


                         Device
             6
                                         ARMvisor
    Driver       Host OS: Linux 2.6.38

5


             Hardware: ARM Cortex-A8
Guest OS: Linux 2.6.35




                 QEMU 0.14                    Driver


                         Device
                                         7
             6
                                         ARMvisor
    Driver       Host OS: Linux 2.6.38

5


             Hardware: ARM Cortex-A8
Guest OS: Linux 2.6.35


                                                    8


                 QEMU 0.14                    Driver


                         Device
                                         7
             6
                                         ARMvisor
    Driver       Host OS: Linux 2.6.38

5


             Hardware: ARM Cortex-A8
virtio
virtio
      Vir,o	
  Driver
                               Guest
Vir,o	
  AMBA	
  Controller

          Vring               Transport
Vir,o	
  AMBA	
  Controller
                               QEMU
      Vir,o	
  Device
irq_chip in kernel
Opera,ng	
  System                          Interrupt	
  Controller

                     Deliver	
  Interrupt

                     Get	
  IRQ	
  number
     1
                     Ack	
  IRQ	
  number

                         Mask	
  IRQ
     2



                        End	
  of	
  IRQ
     3



                       Unmask	
  IRQ
     4
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 HAVE opened source in late August,
  2012.
OpenSource

• We HAVE opened source in late August,
  2012.
• GNU GPLv2
OpenSource

• We HAVE opened source in late August,
  2012.
• GNU GPLv2
• Source code of Host and Guest OS
OpenSource

• We HAVE opened source in late August,
  2012.
• GNU GPLv2
• Source code of Host and Guest OS
• https://github.com/SSLab-NTHU
Q &A

More Related Content

What's hot

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 introductionProject ACRN
 
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 MishraOWASP Delhi
 
Project ACRN: SR-IOV implementation
Project ACRN: SR-IOV implementationProject ACRN: SR-IOV implementation
Project ACRN: SR-IOV implementationGeoffroy Van Cutsem
 
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 hypervisorProject ACRN
 
LCA13: Xen on ARM
LCA13: Xen on ARMLCA13: Xen on ARM
LCA13: Xen on ARMLinaro
 
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 hypervisorProject ACRN
 
Project ACRN hypervisor introduction
Project ACRN hypervisor introduction Project ACRN hypervisor introduction
Project ACRN hypervisor introduction Project ACRN
 
HKG15-400: Next steps in KVM enablement on ARM
HKG15-400: Next steps in KVM enablement on ARMHKG15-400: Next steps in KVM enablement on ARM
HKG15-400: Next steps in KVM enablement on ARMLinaro
 
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 SOSProject ACRN
 
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 10Samsung Open Source Group
 
Rootlinux17: Hypervisors on ARM - Overview and Design Choices by Julien Grall...
Rootlinux17: Hypervisors on ARM - Overview and Design Choices by Julien Grall...Rootlinux17: Hypervisors on ARM - Overview and Design Choices by Julien Grall...
Rootlinux17: Hypervisors on ARM - Overview and Design Choices by Julien Grall...The Linux Foundation
 
Project ACRN configuration scenarios and config tool
Project ACRN configuration scenarios and config toolProject ACRN configuration scenarios and config tool
Project ACRN configuration scenarios and config toolProject ACRN
 
Project ACRN Device Model architecture introduction
Project ACRN Device Model architecture introductionProject ACRN Device Model architecture introduction
Project ACRN Device Model architecture introductionProject ACRN
 
Embedded Systems Conference 2014 Presentation
Embedded Systems Conference 2014 PresentationEmbedded Systems Conference 2014 Presentation
Embedded Systems Conference 2014 PresentationManish Jaggi
 
Hardware accelerated Virtualization in the ARM Cortex™ Processors
Hardware accelerated Virtualization in the ARM Cortex™ ProcessorsHardware accelerated Virtualization in the ARM Cortex™ Processors
Hardware accelerated Virtualization in the ARM Cortex™ ProcessorsThe Linux Foundation
 
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 enablingProject ACRN
 
Esx.sc.quickref
Esx.sc.quickrefEsx.sc.quickref
Esx.sc.quickrefhellocn
 

What's hot (20)

Qemu
QemuQemu
Qemu
 
XS Boston 2008 Cache
XS Boston 2008 CacheXS Boston 2008 Cache
XS Boston 2008 Cache
 
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
 
Project ACRN: SR-IOV implementation
Project ACRN: SR-IOV implementationProject ACRN: SR-IOV implementation
Project ACRN: SR-IOV implementation
 
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
 
openqrm4.9 Quick Start Guide
openqrm4.9 Quick Start Guideopenqrm4.9 Quick Start Guide
openqrm4.9 Quick Start Guide
 
LCA13: Xen on ARM
LCA13: Xen on ARMLCA13: Xen on ARM
LCA13: Xen on ARM
 
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
 
HKG15-400: Next steps in KVM enablement on ARM
HKG15-400: Next steps in KVM enablement on ARMHKG15-400: Next steps in KVM enablement on ARM
HKG15-400: Next steps in KVM enablement on ARM
 
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
 
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
 
Rootlinux17: Hypervisors on ARM - Overview and Design Choices by Julien Grall...
Rootlinux17: Hypervisors on ARM - Overview and Design Choices by Julien Grall...Rootlinux17: Hypervisors on ARM - Overview and Design Choices by Julien Grall...
Rootlinux17: Hypervisors on ARM - Overview and Design Choices by Julien Grall...
 
Project ACRN configuration scenarios and config tool
Project ACRN configuration scenarios and config toolProject ACRN configuration scenarios and config tool
Project ACRN configuration scenarios and config tool
 
Project ACRN Device Model architecture introduction
Project ACRN Device Model architecture introductionProject ACRN Device Model architecture introduction
Project ACRN Device Model architecture introduction
 
Embedded Systems Conference 2014 Presentation
Embedded Systems Conference 2014 PresentationEmbedded Systems Conference 2014 Presentation
Embedded Systems Conference 2014 Presentation
 
Hardware accelerated Virtualization in the ARM Cortex™ Processors
Hardware accelerated Virtualization in the ARM Cortex™ ProcessorsHardware accelerated Virtualization in the ARM Cortex™ Processors
Hardware accelerated Virtualization in the ARM Cortex™ Processors
 
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
 
Esx.sc.quickref
Esx.sc.quickrefEsx.sc.quickref
Esx.sc.quickref
 

Similar to ARMvisor: A KVM for ARM Architecture

Virtualization Technology Overview
Virtualization Technology OverviewVirtualization Technology Overview
Virtualization Technology OverviewOpenCity Community
 
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 SKTThe Linux Foundation
 
Venom vulnerability Overview and a basic demo
Venom vulnerability Overview and a basic demoVenom vulnerability Overview and a basic demo
Venom vulnerability Overview and a basic demoAkash Mahajan
 
Virtualization Primer for Java Developers
Virtualization Primer for Java DevelopersVirtualization Primer for Java Developers
Virtualization Primer for Java DevelopersRichard McDougall
 
Advancedperformancetroubleshootingusingesxtop 101110131727-phpapp02
Advancedperformancetroubleshootingusingesxtop 101110131727-phpapp02Advancedperformancetroubleshootingusingesxtop 101110131727-phpapp02
Advancedperformancetroubleshootingusingesxtop 101110131727-phpapp02Suresh Kumar
 
Joyent's Bryan Cantrill: Experiences Porting KVM to SmartOS at KVM Forum, Aug...
Joyent's Bryan Cantrill: Experiences Porting KVM to SmartOS at KVM Forum, Aug...Joyent's Bryan Cantrill: Experiences Porting KVM to SmartOS at KVM Forum, Aug...
Joyent's Bryan Cantrill: Experiences Porting KVM to SmartOS at KVM Forum, Aug...Peter Tripp
 
Experiences porting KVM to SmartOS
Experiences porting KVM to SmartOSExperiences porting KVM to SmartOS
Experiences porting KVM to SmartOSbcantrill
 
Hypervisor Security - OpenStack Summit Hong Kong
Hypervisor Security - OpenStack Summit Hong KongHypervisor Security - OpenStack Summit Hong Kong
Hypervisor Security - OpenStack Summit Hong KongRobert Clark
 
Rmll Virtualization As Is Tool 20090707 V1.0
Rmll Virtualization As Is Tool 20090707 V1.0Rmll Virtualization As Is Tool 20090707 V1.0
Rmll Virtualization As Is Tool 20090707 V1.0guest72e8c1
 

Similar to ARMvisor: A KVM for ARM Architecture (20)

The kvm virtualization way
The kvm virtualization wayThe kvm virtualization way
The kvm virtualization way
 
5 kvm arm
5 kvm arm5 kvm arm
5 kvm arm
 
Virtualization Technology Overview
Virtualization Technology OverviewVirtualization Technology Overview
Virtualization Technology Overview
 
Hypervisors
HypervisorsHypervisors
Hypervisors
 
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
 
Venom vulnerability Overview and a basic demo
Venom vulnerability Overview and a basic demoVenom vulnerability Overview and a basic demo
Venom vulnerability Overview and a basic demo
 
virtual machine.ppt
virtual machine.pptvirtual machine.ppt
virtual machine.ppt
 
Server virtualization
Server virtualizationServer virtualization
Server virtualization
 
Virtualization Primer for Java Developers
Virtualization Primer for Java DevelopersVirtualization Primer for Java Developers
Virtualization Primer for Java Developers
 
UDS 2012 Xen
UDS 2012 XenUDS 2012 Xen
UDS 2012 Xen
 
17-virtualization.pptx
17-virtualization.pptx17-virtualization.pptx
17-virtualization.pptx
 
Xen and Apache cloudstack
Xen and Apache cloudstack  Xen and Apache cloudstack
Xen and Apache cloudstack
 
003-vmm.pptx
003-vmm.pptx003-vmm.pptx
003-vmm.pptx
 
Advancedperformancetroubleshootingusingesxtop 101110131727-phpapp02
Advancedperformancetroubleshootingusingesxtop 101110131727-phpapp02Advancedperformancetroubleshootingusingesxtop 101110131727-phpapp02
Advancedperformancetroubleshootingusingesxtop 101110131727-phpapp02
 
ARM-KVM: Weather Report
ARM-KVM: Weather ReportARM-KVM: Weather Report
ARM-KVM: Weather Report
 
Joyent's Bryan Cantrill: Experiences Porting KVM to SmartOS at KVM Forum, Aug...
Joyent's Bryan Cantrill: Experiences Porting KVM to SmartOS at KVM Forum, Aug...Joyent's Bryan Cantrill: Experiences Porting KVM to SmartOS at KVM Forum, Aug...
Joyent's Bryan Cantrill: Experiences Porting KVM to SmartOS at KVM Forum, Aug...
 
Experiences porting KVM to SmartOS
Experiences porting KVM to SmartOSExperiences porting KVM to SmartOS
Experiences porting KVM to SmartOS
 
Hypervisor Security - OpenStack Summit Hong Kong
Hypervisor Security - OpenStack Summit Hong KongHypervisor Security - OpenStack Summit Hong Kong
Hypervisor Security - OpenStack Summit Hong Kong
 
RMLL / LSM 2009
RMLL / LSM 2009RMLL / LSM 2009
RMLL / LSM 2009
 
Rmll Virtualization As Is Tool 20090707 V1.0
Rmll Virtualization As Is Tool 20090707 V1.0Rmll Virtualization As Is Tool 20090707 V1.0
Rmll Virtualization As Is Tool 20090707 V1.0
 

Recently uploaded

Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxLoriGlavin3
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersNicole Novielli
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Manik S Magar
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxLoriGlavin3
 
unit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxunit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxBkGupta21
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .Alan Dix
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxLoriGlavin3
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionDilum Bandara
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningLars Bell
 
Training state-of-the-art general text embedding
Training state-of-the-art general text embeddingTraining state-of-the-art general text embedding
Training state-of-the-art general text embeddingZilliz
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024Lonnie McRorey
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 

Recently uploaded (20)

Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software Developers
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
 
unit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxunit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptx
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An Introduction
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine Tuning
 
Training state-of-the-art general text embedding
Training state-of-the-art general text embeddingTraining state-of-the-art general text embedding
Training state-of-the-art general text embedding
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 

ARMvisor: A KVM for ARM Architecture

  • 1. ARMvisor Peter Chang This side is licensed under CC-BY-NC-SA 姓名標示─非商業性─相同方式分享 (http://creativecommons.org/licenses/by-nc-sa/3.0/tw/legalcode)
  • 3. Who am I? • Peter Chang
  • 4. Who am I? • Peter Chang • One of the current developers of ARMvisor
  • 5. Who am I? • Peter Chang • One of the current developers of ARMvisor • http://tw.linkedin.com/in/peterchangtw
  • 7.
  • 8. ARM
  • 9. ARM
  • 10. ARM
  • 12. What is KVM? • A.k.a. Kernel-based Virtual Machine
  • 13. What is KVM? • A.k.a. Kernel-based Virtual Machine • Type-II Virtual Machine Monitor
  • 14. What is KVM? • A.k.a. Kernel-based Virtual Machine • Type-II Virtual Machine Monitor • A module of Linux kernel
  • 16. What is KVM? • Officially support x86/x64, PowerPC, S390
  • 17. What is KVM? • Officially support x86/x64, PowerPC, S390 • No official support for ARM architecture
  • 19. What is ARMvisor? • ARM架構上的KVM
  • 20. What is ARMvisor? • ARM架構上的KVM • Para-virtualization
  • 21. What is ARMvisor? • ARM架構上的KVM • Para-virtualization • Trap & Emulation
  • 22. What is ARMvisor? • ARM架構上的KVM • Para-virtualization • Trap & Emulation • Dynamic Memory Allocation
  • 23. What is ARMvisor? • ARM架構上的KVM • Para-virtualization • Trap & Emulation • Dynamic Memory Allocation • virtio & IRQchip-in-kernel
  • 24. Guest OS: Linux 2.6.35 QEMU 0.14 Driver Device Driver ARMvisor Host OS: Linux 2.6.38 Hardware: ARM Cortex-A8
  • 25. 2012 2011 2010 2009
  • 26. 2012 2011 2010 2009
  • 27. 2012 2011 2010 Starting Point 2009
  • 28. 2012 2011 2010 Starting Point 2009
  • 29. 2012 2011 ARMvisor Prototype 2010 Starting Point 2009
  • 30. 2012 2011 ARMvisor Prototype 2010 Starting Point 2009
  • 31. 2012 CPU Opt & Mem Opt 2011 ARMvisor Prototype 2010 Starting Point 2009
  • 32. 2012 CPU Opt & Mem Opt 2011 ARMvisor Prototype 2010 Starting Point 2009
  • 33. I/O Opt 2012 CPU Opt & Mem Opt 2011 ARMvisor Prototype 2010 Starting Point 2009
  • 34. Supported Hardware ARM Realview-eb ARM11 ARMv6 ISA
  • 35. Supported Hardware TI BeagleBoard Cortex-A8 ARMv7 ISA
  • 36. Supported Software • Patched Host OS: • Linaro Linux 2.6.38 • Host Root Filesystem • Ubuntu/Debian RFS (CLI or GUI) • QEMU 0.14
  • 37. Supported Software • Patched Guest OS: • Linux 2.6.35 (running on ARMv6 ISA) • Guest Root Filesystem: • Ubuntu/Debian RFS (CLI or GUI)
  • 38. System model of ARMvisor
  • 40. CPU virtualization • ARM is non-virtualizable CPU • Patch guest OS • “Trap and emulation”
  • 41. ARMv6 ISA 1.Branch instructions 2.Data-processing instructions 3.Multiply instructions 4.Parallel addition and subtraction instructions 5.Extend instructions 6.Miscellaneous arithmetic instructions 7.Other miscellaneous instructions 8.Status register access instructions 9.Load and store instructions 10.Load and Store Multiple instructions 11.Semaphore instructions 12.Exception-generating instructions 13.Coprocessor instructions
  • 42. ARMv6 ISA 1.Branch instructions Sensitive 2.Data-processing instructions Instructions ? 3.Multiply instructions 4.Parallel addition and subtraction instructions 5.Extend instructions 6.Miscellaneous arithmetic instructions 7.Other miscellaneous instructions 8.Status register access instructions 9.Load and store instructions 10.Load and Store Multiple instructions 11.Semaphore instructions 12.Exception-generating instructions 13.Coprocessor instructions
  • 43. ARMv6 ISA 1.Branch instructions 2.Data-processing instructions 3.Multiply instructions 4.Parallel addition and subtraction instructions 5.Extend instructions 6.Miscellaneous arithmetic instructions 7.Other miscellaneous instructions 8.Status register access instructions 9.Load and store instructions 10.Load and Store Multiple instructions 11.Semaphore instructions 12.Exception-generating instructions 13.Coprocessor instructions
  • 44. Sensitive Instructions Data-processing instructions S-BIT: MOVS, ... Status register access instructions MRS, MSR, CPS, SETEND Load and store instructions T-BIT: LDRT, STRT, ... Load and Store Multiple instructions LDM(2), LDM(3), STM(2) Exception-generating instructions SWI, BKPT Coprocessor instructions MCR, MRC, MCRR, ...
  • 45. Observation from Guest Linux Code • MOVS • (MRS, MSR, CPS) • (LDRBT, LDRT, STRBT, STRT) • (LDM(2), LDM(3), STM(2)) • SWI • (MCR, MRC, MCRR) 15 sensitive instructions used in the guest linux code
  • 46. “Trap & emulation” Guest%OS User%space% trap % Kernel%space VMM
  • 47. How to “trap”? … mov r0, r0 add sp, sp movs pc, lr …
  • 48. How to “trap”? … mov r0, r0 add sp, sp virt_svc_movs “movs pc, lr” …
  • 49. How to “trap”? … mov r0, r0 add sp, sp virt_svc_movs “movs pc, lr” …
  • 50. How to “trap”? .macro virt_svc_movs, inst SWI 0x190 inst … .endm mov r0, r0 add sp, sp virt_svc_movs “movs pc, lr” …
  • 52. oxffff1000 0xffff001c Kernel Vector oxffff0000
  • 53. oxffff1000 0xffff001c Kernel Vector oxffff0000
  • 54. The KVM trap Interface oxffff1000 0xffff001c Kernel Vector oxffff0000
  • 55. 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
  • 56. User space Kernel space Guest Mode QEMU KVM Guest OS
  • 57. User space Kernel space Guest Mode 1. VM initialization QEMU KVM Guest OS
  • 58. User space Kernel space Guest Mode 1. VM initialization 2. Return to QEMU QEMU KVM Guest OS
  • 59. User space Kernel space Guest Mode 1. VM initialization 2. Return to QEMU 3. Run VM QEMU KVM Guest OS
  • 60. User space Kernel space Guest Mode 1. VM initialization 2. Return to QEMU 3. Run VM 4. Enter Guest QEMU KVM Guest OS
  • 61. User space Kernel space Guest Mode 1. VM initialization 2. Return to QEMU 3. Run VM 4. Enter Guest 5. Exit Guest QEMU KVM Guest OS
  • 62. User space Kernel space Guest Mode 1. VM initialization 2. Return to QEMU 3. Run VM 4. Enter Guest 5. Exit Guest Lightweight trap QEMU KVM Guest OS
  • 63. User space Kernel space Guest Mode 1. VM initialization 2. Return to QEMU 3. Run VM 4. Enter Guest 5. Exit Guest Lightweight trap 6. Enter Guest QEMU KVM Guest OS
  • 64. User space Kernel space Guest Mode 1. VM initialization 2. Return to QEMU 3. Run VM 4. Enter Guest 5. Exit Guest Lightweight trap 6. Enter Guest 7. Exit Guest QEMU KVM Guest OS
  • 65. User space Kernel space Guest Mode 1. VM initialization 2. Return to QEMU 3. Run VM 4. Enter Guest 5. Exit Guest Lightweight trap 6. Enter Guest 7. Exit Guest 8. Return to QEMU QEMU KVM Guest OS
  • 66. User space Kernel space Guest Mode 1. VM initialization 2. Return to QEMU 3. Run VM 4. Enter Guest 5. Exit Guest Lightweight trap 6. Enter Guest Heavyweight trap 7. Exit Guest 8. Return to QEMU QEMU KVM Guest OS
  • 67. User space Kernel space Guest Mode 1. VM initialization 2. Return to QEMU 3. Run VM 4. Enter Guest 5. Exit Guest Lightweight trap 6. Enter Guest Heavyweight trap 7. Exit Guest 8. Return to QEMU 9. Run VM QEMU KVM Guest OS
  • 68. User space Kernel space Guest Mode 1. VM initialization 2. Return to QEMU 3. Run VM 4. Enter Guest 5. Exit Guest Lightweight trap 6. Enter Guest Heavyweight trap 7. Exit Guest 8. Return to QEMU 9. Run VM 10. Enter Guest QEMU KVM Guest OS
  • 69. VCPU   oxffff2000 Register   Sync File The KVM trap Interface oxffff1000 0xffff001c Kernel Vector oxffff0000
  • 70. VCPU   oxffff2000 Register   Shadow  Register  File Sync File The KVM trap Interface oxffff1000 0xffff001c Kernel Vector oxffff0000
  • 71. mcr  cpsr,  r1 VCPU   oxffff2000 Register   Shadow  Register  File Sync File The KVM trap Interface oxffff1000 0xffff001c Kernel Vector oxffff0000
  • 72. mcr  cpsr,  r1 VCPU   oxffff2000 Register   Shadow  Register  File Sync File The KVM trap Interface oxffff1000 0xffff001c Kernel Vector oxffff0000
  • 73. mcr  cpsr,  r1 VCPU   oxffff2000 Read/Write Register   Shadow  Register  File Sync Instructions File The KVM trap Interface oxffff1000 0xffff001c Kernel Vector oxffff0000
  • 74. mcr  cpsr,  r1 VCPU   oxffff2000 Read/Write Register   Shadow  Register  File Sync Instructions File The KVM trap Interface oxffff1000 0xffff001c Kernel Vector oxffff0000
  • 76. PTB Virtual  Address Physical  Address
  • 78. Guest  PTB GVA GPA HVA HPA
  • 79. Guest  PTB GVA GPA HVA HPA
  • 80. Guest  PTB GVA GPA Host  PTB HVA HPA
  • 81. Guest  PTB GVA GPA Host  PTB HVA New  SPTE  !!! HPA
  • 82.
  • 84. PABT/DABT  trap guest   page  table   walker
  • 85. PABT/DABT  trap guest   page  table   walker True  Translation  fault
  • 86. PABT/DABT  trap guest   Guest   page  table   permission   walker checker True  Translation  fault
  • 87. PABT/DABT  trap guest   Guest   page  table   permission   walker checker True  permission  fault True  Translation  fault
  • 88. PABT/DABT  trap guest   Guest   MMIO  access   page  table   permission   checker walker checker True  permission  fault True  Translation  fault
  • 89. PABT/DABT  trap guest   Guest   MMIO  access   page  table   permission   checker walker checker True  permission  fault True  Translation  fault MMIO  emulation
  • 90. PABT/DABT  trap guest   Guest   Shadow  page   MMIO  access   page  table   permission   table   checker walker checker mapping True  permission  fault True  Translation  fault MMIO  emulation
  • 91. Hidden  protection  fault PABT/DABT  trap guest   Guest   Shadow  page   MMIO  access   page  table   permission   table   checker walker checker mapping True  permission  fault True  Translation  fault MMIO  emulation
  • 92. Hidden  protection  fault PABT/DABT  trap guest   Guest   Shadow  page   MMIO  access   page  table   permission   table   checker walker checker mapping True  permission  fault Hidden  translation  fault True  Translation  fault MMIO  emulation
  • 93. Hidden  protection  fault PABT/DABT  trap guest   Guest   Shadow  page   MMIO  access   Shadow  page   page  table   permission   table   checker table  update walker checker mapping True  permission  fault Hidden  translation  fault True  Translation  fault MMIO  emulation
  • 95. I/O virtualization • Emulation by QEMU • virtio • IRQ chip in kernel
  • 97. Guest OS: Linux 2.6.35 QEMU 0.14 Driver Device ARMvisor Driver Host OS: Linux 2.6.38 Hardware: ARM Cortex-A8
  • 98. Guest OS: Linux 2.6.35 1 QEMU 0.14 Driver Device ARMvisor Driver Host OS: Linux 2.6.38 Hardware: ARM Cortex-A8
  • 99. Guest OS: Linux 2.6.35 1 QEMU 0.14 Driver Device 2 ARMvisor Driver Host OS: Linux 2.6.38 Hardware: ARM Cortex-A8
  • 100. Guest OS: Linux 2.6.35 1 QEMU 0.14 Driver Device 3 2 ARMvisor Driver Host OS: Linux 2.6.38 Hardware: ARM Cortex-A8
  • 101. Guest OS: Linux 2.6.35 1 QEMU 0.14 Driver Device 3 2 ARMvisor Driver Host OS: Linux 2.6.38 4 Hardware: ARM Cortex-A8
  • 102. Guest OS: Linux 2.6.35 QEMU 0.14 Driver Device ARMvisor Driver Host OS: Linux 2.6.38 Hardware: ARM Cortex-A8
  • 103. Guest OS: Linux 2.6.35 QEMU 0.14 Driver Device ARMvisor Driver Host OS: Linux 2.6.38 5 Hardware: ARM Cortex-A8
  • 104. Guest OS: Linux 2.6.35 QEMU 0.14 Driver Device 6 ARMvisor Driver Host OS: Linux 2.6.38 5 Hardware: ARM Cortex-A8
  • 105. Guest OS: Linux 2.6.35 QEMU 0.14 Driver Device 7 6 ARMvisor Driver Host OS: Linux 2.6.38 5 Hardware: ARM Cortex-A8
  • 106. Guest OS: Linux 2.6.35 8 QEMU 0.14 Driver Device 7 6 ARMvisor Driver Host OS: Linux 2.6.38 5 Hardware: ARM Cortex-A8
  • 107. virtio
  • 108. virtio Vir,o  Driver Guest Vir,o  AMBA  Controller Vring Transport Vir,o  AMBA  Controller QEMU Vir,o  Device
  • 110. Opera,ng  System Interrupt  Controller Deliver  Interrupt Get  IRQ  number 1 Ack  IRQ  number Mask  IRQ 2 End  of  IRQ 3 Unmask  IRQ 4
  • 111. irq_chip in kernel Guest Deliver7 GIC QEMU IRQ7 Control7 GIC7 Device Device Device IOCTL7 ARMvisor
  • 112. irq_chip in kernel Guest Deliver$ IRQ$ QEMU Device Device Device Control$ GIC$ GIC$in$Kernel KVM
  • 115. Future Works • Support for ARM’s Virtualization extension
  • 116. Future Works • Support for ARM’s Virtualization extension • Cortex-A15 and beyond
  • 117. Future Works • Support for ARM’s Virtualization extension • Cortex-A15 and beyond • SMP for host and guest
  • 118. Future Works • Support for ARM’s Virtualization extension • Cortex-A15 and beyond • SMP for host and guest • AArch64 Support
  • 119. Future Works • Support for ARM’s Virtualization extension • Cortex-A15 and beyond • SMP for host and guest • AArch64 Support • ARMv8
  • 120. By the way, ...
  • 122. OpenSource • We HAVE opened source in late August, 2012.
  • 123. OpenSource • We HAVE opened source in late August, 2012. • GNU GPLv2
  • 124. OpenSource • We HAVE opened source in late August, 2012. • GNU GPLv2 • Source code of Host and Guest OS
  • 125. OpenSource • We HAVE opened source in late August, 2012. • GNU GPLv2 • Source code of Host and Guest OS • https://github.com/SSLab-NTHU
  • 126. Q &A