SlideShare ist ein Scribd-Unternehmen logo
1 von 38
Downloaden Sie, um offline zu lesen
Xvisor: embedded and
lightweight hypervisor
Jim Huang ( 黃敬群 ) <jserv@0xlab.org>
Aug 3, 2013 / COSCUP
CPU
MMU
Instruction
Set
Clocks
&
Timers
Busses
&
I/O Devices
Interrupt
Controllers
Memory
On-Chip
Resources
Let's review how a computer works
Agenda (1) Virtualization Concepts
(2) Xvisor for ARM
(3) Device Virtualization
Virtualization Concepts
CPU Performance
• 1965 - IBM S/360 – 0.1 MIPS (133,300 IPS)
– Provided full hardware virtualization with the ability to
run 14 OS instances.
• 1972 - IBM S/370 – 1.0 MIPS (1,000,000 IPS)
• 2000 - 1 GHz Intel P3 – 3,000 MIPS (3,000,000,000 IPS)
• 2009 - Qualcomm Snapdragon A8 – 2,000 MIPS
• 2010 - Intel Core i7 – 4 x 147,600 MIPS
• 2010 - Qualcomm Snapdragon MP – 2 x 2,500 MIPS
• 2011 - Qualcomm/Samsung/nVidia A9 MP – 2 x 5,000 MIPS
• 2012 – ARM Cortex A15 MP – 4 x 25,000 MIPS
ARM processors are capable to virtualize in much cheaper and powerful way!
Operating System Level Virtualization
• Why to have another layer below existing operating
systems?
– OS is not perfect: compatibility, stability,
security
• Workload consolidation
– Increase server utilization
– Reduce capital, hardware, power, space, heat costs
• Legacy OS support
– Especially with large 3rd-party software products
• Migration
– Predicted hardware downtime
– Workload balancing
Use Case: Low-cost 3G Phone
• Mobile Handsets
– Major applications runs on Linux
– 3G Modem software stack runs on
RTOS domain
• Virtualization in multimedia Devices
– Reduces BOM (bill of materials)
– Enables the Reusability of legacy
code/applications
– Reduces the system development
time
• Instrumentation, Automation
– Run RTOS for Measurement and
analysis
– Run a GPOS for Graphical Interface
• Real cases: Motorola Evoke QA4
Hypervisor
Type 1: Bare metal Hypervisor
A pure Hypervisor that runs directly on
the hardware and hosts Guest OS’s.
Type 2: OS ‘Hosted’
A Hypervisor that runs within a Host OS
and hosts Guest OS’s inside of it, using the
host OS services to provide the virtual
environment.
Provides partition isolation +
reliability,
higher security
Low cost, no additional drivers
Ease of use & installation
Host HW
Memory CPUsI/O
Host HW
Memory CPUsI/O
HypervisorScheduler
MMU
Device Drivers/Models
VMn
VM1
VM0
Guest OS
and Apps
Host OS
Device Drivers
Ring-0 VM Monitor
“Kernel “
VMn
VM1
VM0
Guest OS
and Apps
User
Apps
User-level VMM
Device Models
General Classification of Virtualization
Virtualizable
is a property of the Instruction Set Architecture (ISA)
• A sensitive instruction
– changes the
configuration or mode
of the processor,
or
– depends in its behavior
on the processor’s
state
• A privileged instruction
– must be executed with
sufficient privilege
– causes a trap in user
mode
If all sensitive instructions are privileged,
virtual machine monitor can be written.
●
Privileged instructions: OS kernel and device
driver access to system hardware
●
Trapped and Emulated by VMM
– execute guest in separate address space in
unprivileged mode
– emulate all instructions that cause traps
Privileged Instructions
11
• branch and branch with Link (B, BL)
• data processing instructions (AND, TST, MOV, …)
• shifts: logical (LSR), arithmetic (ASR), rotate (ROR)
• test (TEQ, TST, CMP, CMN)
• processor status register transfer (MSR, MRS)
• memory load/store words (LDR, STR)
• push/pop Stack Operations (STM, LDM)
• software Interrupt (SWI; operating mode switch)
• co-processor (CDP, LDC, STC, MRC, MCR)
Typical ARM instructions (armv4)
Problematic Instructions (1)
• Type 1
Instructions which executed in user mode will cause
undefined instruction exception
• Example
MCR p15, 0, r0, c2, c0, 0
Move r0 to c2 and c0 in coprocessor specified by p15
(co-processor) for operation according to option 0
and 0
– MRC: from coproc to register
– MCR: from register to coproc
• Problem:
– Operand-dependent operation
Problematic Instructions (2)
• Type 2
Instructions which executed in user mode will have
no effect
• Example
MSR cpsr_c, #0xD3
Switch to privileged mode and disable interrupt
N Z C V Q -- J -- GE[3:0] -- E A I F T M[4:0]
31 0
Execution
Flags
Exception
Mask
Execution
Mode
Program Status Register (PSR)
Problematic Instructions (3)
• Type 3
Instructions which executed in user mode will cause
unpredictable behaviors.
• Example
MOVS PC, LR
The return instruction
changes the program counter and switches to user
mode.
• This instruction causes unpredictable behavior when
executed in user mode.
ARM Sensitive Instructions
• Coprocessor Access Instructions
MRC / MCR / CDP / LDC / STC
• SIMD/VFP System Register Access Instructions
VMRS / VMSR
• TrustZone Secure State Entry Instructions
SMC
• Memory-Mapped I/O Access Instructions
Load/Store instructions from/into memory-mapped I/O locations
• Direct (Explicit/Implicit) CPSR Access Instructions
MRS / MSR / CPS / SRS / RFE / LDM (conditional execution) / DPSPC
• Indirect CPSR Access Instructions
LDRT / STRT – Load/Store Unprivileged (“As User”)
• Banked Register Access Instructions
LDM/STM (User mode registers)
Solutions to Problematic Instructions
[ Hardware Techniques ]
• Privileged Instruction Semantics dictated/translated
by instruction set architecture
• MMU-enforced traps
– Example: page fault
• Tracing/debug support
– Example: bkpt (breakpoint)
• Hardware-assisted Virtualization
– Example: extra privileged mode, HYP, in ARM
Cortex-A15
Complexity
Binary
translation
Hypercall
Design High Low
Implementation Medium High
Runtime High Medium
Method: trap and emulate
Solutions to Problematic Instructions
[ Software Techniques ]
Dynamic Binary Translation
BL TLB_FLUSH_DENTRY
…
TLB_FLUSH_DENTRY:
MCR p15, 0, R0, C8, C6, 1
MOV PC, LR
…
BL TLB_FLUSH_DENTRY_NEW
…
TLB_FLUSH_DENTRY:
MCR p15, 0, R0, C8, C6, 1
MOV PC, LR
…
TLB_FLUSH_DENTRY_NEW:
MOV R1, R0
MOV R0, #CMD_FLUSH_DENTRY
SWI #HYPER_CALL_TLB
Translation Basic Block
• ARM has a fixed instruction size
– 32-bit in ARM mode and 16-bit in Thumb mode
• Perform binary translation
– Follow control-flow
– Translate basic block (if not already translated) at the current PC
– Ensure interposition at end of translated sequence
– All writes (but not reads) to PC now become problematic instructions
– Replace problematic instructions 1-1 with hypercalls to trap and emulate
→ self-modifying code
Virtualization APIs – hypercalls
BL TLB_FLUSH_DENTRY
…
TLB_FLUSH_DENTRY:
MOV R1, R0
MOV R0, #CMD_FLUSH_DENTRY
SWI #HYPER_CALL_TLB
…
Restore User Context & PC
SWI Handler
Hypercall Handler
……
LDR R1, [SP, #4]
MCR p15, 0, R1, C8, C6, 1
/* In Hypervisor */
/* In Guest OS */
• Use trap instruction to issue hypercall
• Encode hypercall type and original instruction bits in hypercall hint
• Upon trapping into the VMM, decode the hypercall type and the original
instruction bits, and emulate instruction semantics
mrs r8, cpsr swi 0x088000
mrs Rd, R <cpsr/spsr>
Xvisor:
Type 1 Hypervisor; GPL; ARM
Xvisor
• new open source bare-metal hypervisor, which aims
towards providing virtualization solution, which is
light-weight, portable, and flexible with small memory
footprint and less virtualization overhead
• distributed under GNU Public License (GPLv2).
• On real hardware specifically BeagleBoard, it
reaches near native CPU performance
– Native Linux 3.0.4 gives 1120 DMIPS whereas Linux 3.0.4
running as guest on Xvisor ARM gives 1070 DMIPS.
• Major targets: x86 and ARM
– ARM target supports ARM9, ARM11, Cortex-A8,
Cortex-A9, Cortex-A15
– Virtualization Extension
Xvisor-ARM
https://github.com/xvisor
• File: arch/arm/cpu/arm32/elf2cpatch.py
– Script to generate cpatch script from guest OS ELF
• Functionality before generating the final ELF image
– Encode all privileged instructions into SVC instructions
(software interrupt)
– For each privilege instruction, generate a primitive to
replace it
– read the directive from ELF2CPATCH and mangle the
target binary file
– The patched image contains no privilege instructions
and could run with in user mode
elf2cpatch.py : 
...
if (len(w)==3):
    if (w[2]=="wfi"):
        print "t#", w[2] 
        print "twrite32,0x%x,0x%08x" % (addr, convert_wfi_inst(w[1]))
    elif (len(w)==4):
        if (w[2]=="cps" or w[2]=="cpsie" or w[2]=="cpsid"):
            print "t#", w[2], w[3]
           print "twrite32,0x%x,0x%08x" % (addr, convert_cps_inst(w[1]))
How does Xvisor handle problematic
instructions like MSR?
• Type 2
Instructions which executed in user mode will have
no effect
• Example
MSR cpsr_c, #0xD3
Switch to privileged mode and disable interrupt
N Z C V Q -- J -- GE[3:0] -- E A I F T M[4:0]
31 0
Execution
Flags
Exception
Mask
Execution
Mode
Program Status Register (PSR)
MSR cpsr_c, #0xD3
Switch to privileged mode and disable interrupt
# MSR (immediate)
# Syntax:
# msr<c> <spec_reg>, #<const>
# Fields:
# cond = bits[31:28]
# R = bits[22:22]
# mask = bits[19:16]
# imm12 = bits[11:0]
# Hypercall Fields:
# inst_cond[31:28] = cond
# inst_op[27:24] = 0xf
# inst_id[23:20] = 0
# inst_subid[19:17] = 2
# inst_fields[16:13] = mask
# inst_fields[12:1] = imm12
# inst_fields[0:0] = R
First, cpatch (ELF patching tool) looks
up the instructions...
def convert_msr_i_inst(hxstr):
hx = int(hxstr, 16)
inst_id = 0
inst_subid = 2
cond = (hx >> 28) & 0xF
R = (hx >> 22) & 0x1
mask = (hx >> 16) & 0xF
imm12 = (hx >> 0) & 0xFFF
rethx = 0x0F000000
rethx = rethx | (cond << 28)
rethx = rethx | (inst_id << 20)
rethx = rethx | (inst_subid << 17)
rethx = rethx | (mask << 13)
rethx = rethx | (imm12 << 1)
rethx = rethx | (R << 0)
return rethx
# MSR (immediate)
# Syntax:
# msr<c> <spec_reg>, #<const>
# Fields:
# cond = bits[31:28]
# R = bits[22:22]
# mask = bits[19:16]
# imm12 = bits[11:0]
# Hypercall Fields:
# inst_cond[31:28] = cond
# inst_op[27:24] = 0xf
# inst_id[23:20] = 0
# inst_subid[19:17] = 2
# inst_fields[16:13] = mask
# inst_fields[12:1] = imm12
# inst_fields[0:0] = R
Xvisor utilizes cpatch to convert
all problematic instructions for OS
image files (ELF format).
But it is not enough...
• have to handle virtual CPU, memory, devices.
Boot ARM/Linux under Xvisor
Qemu/ Xvisor img
Xvisor shell
Guest instance 0
MUGGLE Boot loader
MUGGLE Linux 3.0.4
QEMUVirtualIO
TIME
XvisorDev
MUGGLE TTY
attach
mangling
Scheduling
• Xvisor is basically a RTOS
• A thread in Xvisor is a “vcpu”
• Xvisor provides a priority-based
time slicing scheduler policy
• guest OS know nothing about
Xvisor
Hypervisor
Tasks
Guest
Memory
CPU CPU
VCPU VCPU
Thread
CPU
Xvisor
Thread Thread
VCPU Execution
• Guest OS is not expected to release the CPU during
its initial state
• While executing WFI instruction...
– with VE (Virtualization Extension) configuration
WFI is configured to trap into HYP mode
– with Non-VE configuration
WFI is converted into single SVC call during build
time
Boot up
• Generate system image
tools/scripts/memimg.py ­a 0x70010000­o build/qemu.img  
build/vmm.bin@0x70010000   
build/tests/arm32/pb­a8/basic/arm_test.bin.patched@0x70800000 
• Launch QEMU
qemu­system­arm ­M realview­pb­a8 ­display none ­serial 
stdio ­kernel build/qemu.img
• QEMU starts by executing the image head with vmm.bin. The vmm.bin is
linked on VA = 0xff000000 during compiling time and its designed to be able
to load with any address. And it relocates itself as follow
– Copy itself into a ARM-MMU-Section aligned (1M boundary) address
e.g. 0x80010000-> 0x80000000
– Enable MMU and mapping its VA to load address
e.g. 0xFF000000 → 0x80000000
• Then vmm.elf setup data structures to manage all physical page in system
– The management scheme is buddy allocator.
virtualizervirtualizer
P1P1
P2P2
P3P3
virtualizervirtualizer
0000
0300
0500
0800
P1’s world
P1P1
virtualizervirtualizer
0000
P2’s world
virtualizervirtualizer
P2P2
P3’s world
virtualizervirtualizer
P3P3
Real world
0000 0000
Page Table 1
Page Table 2
Page Table 3
Page Table 1
Page Table 2
Page Table 3
Page Table 1
Page Table 2
Page Table 3
Privilege
What if P1 do something like
memset(pagetable, 0, …)
virtual memory
Memory Virtualization
• Start the guest0/cpu0 vcpu
Xvisor>guest kick guest0
• The guest hardware configure is defined with an
standard Device Tree (DT) format
http://devicetree.org/Main_Page
Memory in DTvcpu0 {
    device_type = "vcpu";
    compatible = "ARMv7a,cortex­a8";
    start_pc = <0x40000000>;
}
mem1 {
     guest_physical_addr = <0x70000000>;
     host_physical_addr = <0x82000000>;
     physical_size = <0x06000000>; /* 96 MB */
     device_type = "ram";
};
nor_flash {
    manifest_type = "real";
    address_type = "memory";
    guest_physical_addr = <0x40000000>;
    host_physical_addr = <0x80800000>;
    physical_size = <0x00800000>; 
}
vmm.bin applies a on-demand paging scheme to
support space virtualization, In this example, The
start address 0x40000000 triggers the prefetch
abort which is then catched by vmm.bin
The vmm.bin parse the configure file and find that
0x40000000 is mapping to 0x80800000.
Then Its setup the mapping and resume guest program
Device Virtualization
Device Virtualization Bigpicture
• userspace device emulation
• Paravirtualized device drivers (VirtIO)
vhost-net
worker
thread
EMU
VCPU
PHY
virtio
ring &
buffers
memory
slot
table
Io event
memory r/w
r/w
r
irq
hypervisor
The vhost-net model
•
Host user space opens and
configures kernel helper
•
virtio as guest-host interface
Enables multi-gigabit throughput
Device Virtualization in DTgic0 {
    manifest_type = "virtual";
    address_type = "memory";
    guest_physical_addr = <0x1E000000>;
    physical_size = <0x2000>;
    device_type = "pic";
    compatible = "realview,gic";
    parent_irq = <6>;
};
The device virtualization also utilizes the device tree.
For all device region, The Xvisor setups a mmu mapping with a
"no r/w permission" attribute in the page table.
Everytime the guest program access the device memory, a page fault
is triggered and CPU jump into the data_abort handler.
By decoding the instruction pointed by the fault address, the data-abort
handler emulate the device behavior before resume guesst VCPU
Device Emulator
• Since the device is actually a plain memory with its
functionalities emulated by software, the multiplex
could be easily implemented as following:
• Guest OS runs in pure user-mode, and Xvisor
applies the V5 domain field in the page table to
emulate the privilege level for the guest OS.
vmm guest1
guest0v_uart
uart
v_uart
v_uart
trap
trap
bind
Reference
• ARM Virtualization: CPU & MMU Issues, Prashanth Bungale,
vmware
• Hardware accelerated Virtualization in the
ARM Cortex™ Processors, John Goodacre, ARM
Ltd. (2011)

Weitere ähnliche Inhalte

Was ist angesagt?

Quick and Easy Device Drivers for Embedded Linux Using UIO
Quick and Easy Device Drivers for Embedded Linux Using UIOQuick and Easy Device Drivers for Embedded Linux Using UIO
Quick and Easy Device Drivers for Embedded Linux Using UIOChris Simmonds
 
Riscv 20160507-patterson
Riscv 20160507-pattersonRiscv 20160507-patterson
Riscv 20160507-pattersonKrste Asanovic
 
Linux Memory Management with CMA (Contiguous Memory Allocator)
Linux Memory Management with CMA (Contiguous Memory Allocator)Linux Memory Management with CMA (Contiguous Memory Allocator)
Linux Memory Management with CMA (Contiguous Memory Allocator)Pankaj Suryawanshi
 
05.2 virtio introduction
05.2 virtio introduction05.2 virtio introduction
05.2 virtio introductionzenixls2
 
Memory management in Linux kernel
Memory management in Linux kernelMemory management in Linux kernel
Memory management in Linux kernelVadim Nikitin
 
Computing Performance: On the Horizon (2021)
Computing Performance: On the Horizon (2021)Computing Performance: On the Horizon (2021)
Computing Performance: On the Horizon (2021)Brendan Gregg
 
Linux Memory Management
Linux Memory ManagementLinux Memory Management
Linux Memory ManagementNi Zo-Ma
 
Introduction to armv8 aarch64
Introduction to armv8 aarch64Introduction to armv8 aarch64
Introduction to armv8 aarch64Yi-Hsiu Hsu
 
U-Boot Porting on New Hardware
U-Boot Porting on New HardwareU-Boot Porting on New Hardware
U-Boot Porting on New HardwareRuggedBoardGroup
 
BUD17-209: Reliability, Availability, and Serviceability (RAS) on ARM64
BUD17-209: Reliability, Availability, and Serviceability (RAS) on ARM64 BUD17-209: Reliability, Availability, and Serviceability (RAS) on ARM64
BUD17-209: Reliability, Availability, and Serviceability (RAS) on ARM64 Linaro
 
HKG15-505: Power Management interactions with OP-TEE and Trusted Firmware
HKG15-505: Power Management interactions with OP-TEE and Trusted FirmwareHKG15-505: Power Management interactions with OP-TEE and Trusted Firmware
HKG15-505: Power Management interactions with OP-TEE and Trusted FirmwareLinaro
 
RISC-V : Berkeley Boot Loader & Proxy Kernelのソースコード解析
RISC-V : Berkeley Boot Loader & Proxy Kernelのソースコード解析RISC-V : Berkeley Boot Loader & Proxy Kernelのソースコード解析
RISC-V : Berkeley Boot Loader & Proxy Kernelのソースコード解析Mr. Vengineer
 
LCA14: LCA14-306: CPUidle & CPUfreq integration with scheduler
LCA14: LCA14-306: CPUidle & CPUfreq integration with schedulerLCA14: LCA14-306: CPUidle & CPUfreq integration with scheduler
LCA14: LCA14-306: CPUidle & CPUfreq integration with schedulerLinaro
 
Arm device tree and linux device drivers
Arm device tree and linux device driversArm device tree and linux device drivers
Arm device tree and linux device driversHoucheng Lin
 

Was ist angesagt? (20)

Embedded Hypervisor for ARM
Embedded Hypervisor for ARMEmbedded Hypervisor for ARM
Embedded Hypervisor for ARM
 
Quick and Easy Device Drivers for Embedded Linux Using UIO
Quick and Easy Device Drivers for Embedded Linux Using UIOQuick and Easy Device Drivers for Embedded Linux Using UIO
Quick and Easy Device Drivers for Embedded Linux Using UIO
 
Riscv 20160507-patterson
Riscv 20160507-pattersonRiscv 20160507-patterson
Riscv 20160507-patterson
 
Linux Memory Management with CMA (Contiguous Memory Allocator)
Linux Memory Management with CMA (Contiguous Memory Allocator)Linux Memory Management with CMA (Contiguous Memory Allocator)
Linux Memory Management with CMA (Contiguous Memory Allocator)
 
05.2 virtio introduction
05.2 virtio introduction05.2 virtio introduction
05.2 virtio introduction
 
Qemu Introduction
Qemu IntroductionQemu Introduction
Qemu Introduction
 
Memory management in Linux kernel
Memory management in Linux kernelMemory management in Linux kernel
Memory management in Linux kernel
 
Computing Performance: On the Horizon (2021)
Computing Performance: On the Horizon (2021)Computing Performance: On the Horizon (2021)
Computing Performance: On the Horizon (2021)
 
Linux Memory Management
Linux Memory ManagementLinux Memory Management
Linux Memory Management
 
Introduction to armv8 aarch64
Introduction to armv8 aarch64Introduction to armv8 aarch64
Introduction to armv8 aarch64
 
Making Linux do Hard Real-time
Making Linux do Hard Real-timeMaking Linux do Hard Real-time
Making Linux do Hard Real-time
 
U-Boot Porting on New Hardware
U-Boot Porting on New HardwareU-Boot Porting on New Hardware
U-Boot Porting on New Hardware
 
BUD17-209: Reliability, Availability, and Serviceability (RAS) on ARM64
BUD17-209: Reliability, Availability, and Serviceability (RAS) on ARM64 BUD17-209: Reliability, Availability, and Serviceability (RAS) on ARM64
BUD17-209: Reliability, Availability, and Serviceability (RAS) on ARM64
 
HKG15-505: Power Management interactions with OP-TEE and Trusted Firmware
HKG15-505: Power Management interactions with OP-TEE and Trusted FirmwareHKG15-505: Power Management interactions with OP-TEE and Trusted Firmware
HKG15-505: Power Management interactions with OP-TEE and Trusted Firmware
 
RISC-V : Berkeley Boot Loader & Proxy Kernelのソースコード解析
RISC-V : Berkeley Boot Loader & Proxy Kernelのソースコード解析RISC-V : Berkeley Boot Loader & Proxy Kernelのソースコード解析
RISC-V : Berkeley Boot Loader & Proxy Kernelのソースコード解析
 
Kernel Debugging & Profiling
Kernel Debugging & ProfilingKernel Debugging & Profiling
Kernel Debugging & Profiling
 
Linux Kernel Overview
Linux Kernel OverviewLinux Kernel Overview
Linux Kernel Overview
 
LCA14: LCA14-306: CPUidle & CPUfreq integration with scheduler
LCA14: LCA14-306: CPUidle & CPUfreq integration with schedulerLCA14: LCA14-306: CPUidle & CPUfreq integration with scheduler
LCA14: LCA14-306: CPUidle & CPUfreq integration with scheduler
 
Arm device tree and linux device drivers
Arm device tree and linux device driversArm device tree and linux device drivers
Arm device tree and linux device drivers
 
USB Drivers
USB DriversUSB Drivers
USB Drivers
 

Andere mochten auch

Lecture notice about Embedded Operating System Design and Implementation
Lecture notice about Embedded Operating System Design and ImplementationLecture notice about Embedded Operating System Design and Implementation
Lecture notice about Embedded Operating System Design and ImplementationNational Cheng Kung University
 
給自己更好未來的 3 個練習:嵌入式作業系統設計、實做,與移植 (2015 年春季 ) 課程說明
給自己更好未來的 3 個練習:嵌入式作業系統設計、實做,與移植 (2015 年春季 ) 課程說明給自己更好未來的 3 個練習:嵌入式作業系統設計、實做,與移植 (2015 年春季 ) 課程說明
給自己更好未來的 3 個練習:嵌入式作業系統設計、實做,與移植 (2015 年春季 ) 課程說明National Cheng Kung University
 
Develop Your Own Operating Systems using Cheap ARM Boards
Develop Your Own Operating Systems using Cheap ARM BoardsDevelop Your Own Operating Systems using Cheap ARM Boards
Develop Your Own Operating Systems using Cheap ARM BoardsNational Cheng Kung University
 
進階嵌入式系統開發與實做 (2014 年秋季 ) 課程說明
進階嵌入式系統開發與實做 (2014 年秋季 ) 課程說明進階嵌入式系統開發與實做 (2014 年秋季 ) 課程說明
進階嵌入式系統開發與實做 (2014 年秋季 ) 課程說明National Cheng Kung University
 
中輟生談教育: 完全用開放原始碼軟體進行 嵌入式系統教學
中輟生談教育: 完全用開放原始碼軟體進行 嵌入式系統教學中輟生談教育: 完全用開放原始碼軟體進行 嵌入式系統教學
中輟生談教育: 完全用開放原始碼軟體進行 嵌入式系統教學National Cheng Kung University
 
PyPy's approach to construct domain-specific language runtime
PyPy's approach to construct domain-specific language runtimePyPy's approach to construct domain-specific language runtime
PyPy's approach to construct domain-specific language runtimeNational Cheng Kung University
 

Andere mochten auch (13)

Lecture notice about Embedded Operating System Design and Implementation
Lecture notice about Embedded Operating System Design and ImplementationLecture notice about Embedded Operating System Design and Implementation
Lecture notice about Embedded Operating System Design and Implementation
 
Implement Runtime Environments for HSA using LLVM
Implement Runtime Environments for HSA using LLVMImplement Runtime Environments for HSA using LLVM
Implement Runtime Environments for HSA using LLVM
 
給自己更好未來的 3 個練習:嵌入式作業系統設計、實做,與移植 (2015 年春季 ) 課程說明
給自己更好未來的 3 個練習:嵌入式作業系統設計、實做,與移植 (2015 年春季 ) 課程說明給自己更好未來的 3 個練習:嵌入式作業系統設計、實做,與移植 (2015 年春季 ) 課程說明
給自己更好未來的 3 個練習:嵌入式作業系統設計、實做,與移植 (2015 年春季 ) 課程說明
 
Explore Android Internals
Explore Android InternalsExplore Android Internals
Explore Android Internals
 
Develop Your Own Operating Systems using Cheap ARM Boards
Develop Your Own Operating Systems using Cheap ARM BoardsDevelop Your Own Operating Systems using Cheap ARM Boards
Develop Your Own Operating Systems using Cheap ARM Boards
 
How A Compiler Works: GNU Toolchain
How A Compiler Works: GNU ToolchainHow A Compiler Works: GNU Toolchain
How A Compiler Works: GNU Toolchain
 
進階嵌入式系統開發與實做 (2014 年秋季 ) 課程說明
進階嵌入式系統開發與實做 (2014 年秋季 ) 課程說明進階嵌入式系統開發與實做 (2014 年秋季 ) 課程說明
進階嵌入式系統開發與實做 (2014 年秋季 ) 課程說明
 
中輟生談教育: 完全用開放原始碼軟體進行 嵌入式系統教學
中輟生談教育: 完全用開放原始碼軟體進行 嵌入式系統教學中輟生談教育: 完全用開放原始碼軟體進行 嵌入式系統教學
中輟生談教育: 完全用開放原始碼軟體進行 嵌入式系統教學
 
Making Linux do Hard Real-time
Making Linux do Hard Real-timeMaking Linux do Hard Real-time
Making Linux do Hard Real-time
 
從線上售票看作業系統設計議題
從線上售票看作業系統設計議題從線上售票看作業系統設計議題
從線上售票看作業系統設計議題
 
Virtual Machine Constructions for Dummies
Virtual Machine Constructions for DummiesVirtual Machine Constructions for Dummies
Virtual Machine Constructions for Dummies
 
PyPy's approach to construct domain-specific language runtime
PyPy's approach to construct domain-specific language runtimePyPy's approach to construct domain-specific language runtime
PyPy's approach to construct domain-specific language runtime
 
Priority Inversion on Mars
Priority Inversion on MarsPriority Inversion on Mars
Priority Inversion on Mars
 

Ähnlich wie Xvisor: embedded and lightweight hypervisor

Sierraware ARM hypervisor
Sierraware ARM hypervisor Sierraware ARM hypervisor
Sierraware ARM hypervisor Sierraware
 
The ring 0 facade: awakening the processor's inner demons
The ring 0 facade: awakening the processor's inner demonsThe ring 0 facade: awakening the processor's inner demons
The ring 0 facade: awakening the processor's inner demonsPriyanka Aash
 
GOD MODE UNLOCKED - Hardware Backdoors in x86 CPUs
GOD MODE UNLOCKED - Hardware Backdoors in x86 CPUsGOD MODE UNLOCKED - Hardware Backdoors in x86 CPUs
GOD MODE UNLOCKED - Hardware Backdoors in x86 CPUsPriyanka Aash
 
Summer training embedded system and its scope
Summer training  embedded system and its scopeSummer training  embedded system and its scope
Summer training embedded system and its scopeArshit Rai
 
How Triton can help to reverse virtual machine based software protections
How Triton can help to reverse virtual machine based software protectionsHow Triton can help to reverse virtual machine based software protections
How Triton can help to reverse virtual machine based software protectionsJonathan Salwan
 
Escalating Privileges in Linux using Fault Injection - FDTC 2017
Escalating Privileges in Linux using Fault Injection - FDTC 2017Escalating Privileges in Linux using Fault Injection - FDTC 2017
Escalating Privileges in Linux using Fault Injection - FDTC 2017Cristofaro Mune
 
GOD MODE Unlocked: Hardware backdoors in x86 CPUs
GOD MODE Unlocked: Hardware backdoors in x86 CPUsGOD MODE Unlocked: Hardware backdoors in x86 CPUs
GOD MODE Unlocked: Hardware backdoors in x86 CPUsPriyanka Aash
 
AVR_Course_Day4 introduction to microcontroller
AVR_Course_Day4 introduction to microcontrollerAVR_Course_Day4 introduction to microcontroller
AVR_Course_Day4 introduction to microcontrollerMohamed Ali
 
ARM - Advance RISC Machine
ARM - Advance RISC MachineARM - Advance RISC Machine
ARM - Advance RISC MachineEdutechLearners
 
Summer training embedded system and its scope
Summer training  embedded system and its scopeSummer training  embedded system and its scope
Summer training embedded system and its scopeArshit Rai
 
Design of control unit.pptx
Design of control unit.pptxDesign of control unit.pptx
Design of control unit.pptxShubham014
 
Arm cm3 architecture_and_programmer_model
Arm cm3 architecture_and_programmer_modelArm cm3 architecture_and_programmer_model
Arm cm3 architecture_and_programmer_modelGanesh Naik
 

Ähnlich wie Xvisor: embedded and lightweight hypervisor (20)

Sierraware ARM hypervisor
Sierraware ARM hypervisor Sierraware ARM hypervisor
Sierraware ARM hypervisor
 
The ring 0 facade: awakening the processor's inner demons
The ring 0 facade: awakening the processor's inner demonsThe ring 0 facade: awakening the processor's inner demons
The ring 0 facade: awakening the processor's inner demons
 
Unit 3 CO.pptx
Unit 3 CO.pptxUnit 3 CO.pptx
Unit 3 CO.pptx
 
Introduction to ARM Architecture
Introduction to ARM ArchitectureIntroduction to ARM Architecture
Introduction to ARM Architecture
 
Hypervisors
HypervisorsHypervisors
Hypervisors
 
GOD MODE UNLOCKED - Hardware Backdoors in x86 CPUs
GOD MODE UNLOCKED - Hardware Backdoors in x86 CPUsGOD MODE UNLOCKED - Hardware Backdoors in x86 CPUs
GOD MODE UNLOCKED - Hardware Backdoors in x86 CPUs
 
Summer training embedded system and its scope
Summer training  embedded system and its scopeSummer training  embedded system and its scope
Summer training embedded system and its scope
 
How Triton can help to reverse virtual machine based software protections
How Triton can help to reverse virtual machine based software protectionsHow Triton can help to reverse virtual machine based software protections
How Triton can help to reverse virtual machine based software protections
 
Escalating Privileges in Linux using Fault Injection - FDTC 2017
Escalating Privileges in Linux using Fault Injection - FDTC 2017Escalating Privileges in Linux using Fault Injection - FDTC 2017
Escalating Privileges in Linux using Fault Injection - FDTC 2017
 
GOD MODE Unlocked: Hardware backdoors in x86 CPUs
GOD MODE Unlocked: Hardware backdoors in x86 CPUsGOD MODE Unlocked: Hardware backdoors in x86 CPUs
GOD MODE Unlocked: Hardware backdoors in x86 CPUs
 
AVR_Course_Day4 introduction to microcontroller
AVR_Course_Day4 introduction to microcontrollerAVR_Course_Day4 introduction to microcontroller
AVR_Course_Day4 introduction to microcontroller
 
ARM - Advance RISC Machine
ARM - Advance RISC MachineARM - Advance RISC Machine
ARM - Advance RISC Machine
 
Summer training embedded system and its scope
Summer training  embedded system and its scopeSummer training  embedded system and its scope
Summer training embedded system and its scope
 
arm
armarm
arm
 
Arm
ArmArm
Arm
 
Arm architecture overview
Arm architecture overviewArm architecture overview
Arm architecture overview
 
Design of control unit.pptx
Design of control unit.pptxDesign of control unit.pptx
Design of control unit.pptx
 
CPU.ppd
CPU.ppdCPU.ppd
CPU.ppd
 
Arm cm3 architecture_and_programmer_model
Arm cm3 architecture_and_programmer_modelArm cm3 architecture_and_programmer_model
Arm cm3 architecture_and_programmer_model
 
003-vmm.pptx
003-vmm.pptx003-vmm.pptx
003-vmm.pptx
 

Mehr von National Cheng Kung University

進階嵌入式作業系統設計與實做 (2015 年秋季 ) 課程說明
進階嵌入式作業系統設計與實做 (2015 年秋季 ) 課程說明進階嵌入式作業系統設計與實做 (2015 年秋季 ) 課程說明
進階嵌入式作業系統設計與實做 (2015 年秋季 ) 課程說明National Cheng Kung University
 
F9: A Secure and Efficient Microkernel Built for Deeply Embedded Systems
F9: A Secure and Efficient Microkernel Built for Deeply Embedded SystemsF9: A Secure and Efficient Microkernel Built for Deeply Embedded Systems
F9: A Secure and Efficient Microkernel Built for Deeply Embedded SystemsNational Cheng Kung University
 
進階嵌入式系統開發與實作 (2013 秋季班 ) 課程說明
進階嵌入式系統開發與實作 (2013 秋季班 ) 課程說明進階嵌入式系統開發與實作 (2013 秋季班 ) 課程說明
進階嵌入式系統開發與實作 (2013 秋季班 ) 課程說明National Cheng Kung University
 
LLVM 總是打開你的心:從電玩模擬器看編譯器應用實例
LLVM 總是打開你的心:從電玩模擬器看編譯器應用實例LLVM 總是打開你的心:從電玩模擬器看編譯器應用實例
LLVM 總是打開你的心:從電玩模擬器看編譯器應用實例National Cheng Kung University
 
Shorten Device Boot Time for Automotive IVI and Navigation Systems
Shorten Device Boot Time for Automotive IVI and Navigation SystemsShorten Device Boot Time for Automotive IVI and Navigation Systems
Shorten Device Boot Time for Automotive IVI and Navigation SystemsNational Cheng Kung University
 

Mehr von National Cheng Kung University (16)

2016 年春季嵌入式作業系統課程說明
2016 年春季嵌入式作業系統課程說明2016 年春季嵌入式作業系統課程說明
2016 年春季嵌入式作業系統課程說明
 
Interpreter, Compiler, JIT from scratch
Interpreter, Compiler, JIT from scratchInterpreter, Compiler, JIT from scratch
Interpreter, Compiler, JIT from scratch
 
進階嵌入式作業系統設計與實做 (2015 年秋季 ) 課程說明
進階嵌入式作業系統設計與實做 (2015 年秋季 ) 課程說明進階嵌入式作業系統設計與實做 (2015 年秋季 ) 課程說明
進階嵌入式作業系統設計與實做 (2015 年秋季 ) 課程說明
 
Construct an Efficient and Secure Microkernel for IoT
Construct an Efficient and Secure Microkernel for IoTConstruct an Efficient and Secure Microkernel for IoT
Construct an Efficient and Secure Microkernel for IoT
 
The Internals of "Hello World" Program
The Internals of "Hello World" ProgramThe Internals of "Hello World" Program
The Internals of "Hello World" Program
 
F9: A Secure and Efficient Microkernel Built for Deeply Embedded Systems
F9: A Secure and Efficient Microkernel Built for Deeply Embedded SystemsF9: A Secure and Efficient Microkernel Built for Deeply Embedded Systems
F9: A Secure and Efficient Microkernel Built for Deeply Embedded Systems
 
Open Source from Legend, Business, to Ecosystem
Open Source from Legend, Business, to EcosystemOpen Source from Legend, Business, to Ecosystem
Open Source from Legend, Business, to Ecosystem
 
Summer Project: Microkernel (2013)
Summer Project: Microkernel (2013)Summer Project: Microkernel (2013)
Summer Project: Microkernel (2013)
 
進階嵌入式系統開發與實作 (2013 秋季班 ) 課程說明
進階嵌入式系統開發與實作 (2013 秋季班 ) 課程說明進階嵌入式系統開發與實作 (2013 秋季班 ) 課程說明
進階嵌入式系統開發與實作 (2013 秋季班 ) 課程說明
 
LLVM 總是打開你的心:從電玩模擬器看編譯器應用實例
LLVM 總是打開你的心:從電玩模擬器看編譯器應用實例LLVM 總是打開你的心:從電玩模擬器看編譯器應用實例
LLVM 總是打開你的心:從電玩模擬器看編譯器應用實例
 
Faults inside System Software
Faults inside System SoftwareFaults inside System Software
Faults inside System Software
 
Hints for L4 Microkernel
Hints for L4 MicrokernelHints for L4 Microkernel
Hints for L4 Microkernel
 
Shorten Device Boot Time for Automotive IVI and Navigation Systems
Shorten Device Boot Time for Automotive IVI and Navigation SystemsShorten Device Boot Time for Automotive IVI and Navigation Systems
Shorten Device Boot Time for Automotive IVI and Navigation Systems
 
Microkernel Evolution
Microkernel EvolutionMicrokernel Evolution
Microkernel Evolution
 
Develop Your Own Operating System
Develop Your Own Operating SystemDevelop Your Own Operating System
Develop Your Own Operating System
 
olibc: Another C Library optimized for Embedded Linux
olibc: Another C Library optimized for Embedded Linuxolibc: Another C Library optimized for Embedded Linux
olibc: Another C Library optimized for Embedded Linux
 

Kürzlich hochgeladen

08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
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 CVKhem
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
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 WorkerThousandEyes
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessPixlogix Infotech
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
[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.pdfhans926745
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
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?Igalia
 
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 slidevu2urc
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
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.pdfsudhanshuwaghmare1
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxKatpro Technologies
 

Kürzlich hochgeladen (20)

08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
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
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
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
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
[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
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
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?
 
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
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
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
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 

Xvisor: embedded and lightweight hypervisor

  • 1. Xvisor: embedded and lightweight hypervisor Jim Huang ( 黃敬群 ) <jserv@0xlab.org> Aug 3, 2013 / COSCUP
  • 3. Agenda (1) Virtualization Concepts (2) Xvisor for ARM (3) Device Virtualization
  • 5. CPU Performance • 1965 - IBM S/360 – 0.1 MIPS (133,300 IPS) – Provided full hardware virtualization with the ability to run 14 OS instances. • 1972 - IBM S/370 – 1.0 MIPS (1,000,000 IPS) • 2000 - 1 GHz Intel P3 – 3,000 MIPS (3,000,000,000 IPS) • 2009 - Qualcomm Snapdragon A8 – 2,000 MIPS • 2010 - Intel Core i7 – 4 x 147,600 MIPS • 2010 - Qualcomm Snapdragon MP – 2 x 2,500 MIPS • 2011 - Qualcomm/Samsung/nVidia A9 MP – 2 x 5,000 MIPS • 2012 – ARM Cortex A15 MP – 4 x 25,000 MIPS ARM processors are capable to virtualize in much cheaper and powerful way!
  • 6. Operating System Level Virtualization • Why to have another layer below existing operating systems? – OS is not perfect: compatibility, stability, security • Workload consolidation – Increase server utilization – Reduce capital, hardware, power, space, heat costs • Legacy OS support – Especially with large 3rd-party software products • Migration – Predicted hardware downtime – Workload balancing
  • 7. Use Case: Low-cost 3G Phone • Mobile Handsets – Major applications runs on Linux – 3G Modem software stack runs on RTOS domain • Virtualization in multimedia Devices – Reduces BOM (bill of materials) – Enables the Reusability of legacy code/applications – Reduces the system development time • Instrumentation, Automation – Run RTOS for Measurement and analysis – Run a GPOS for Graphical Interface • Real cases: Motorola Evoke QA4 Hypervisor
  • 8. Type 1: Bare metal Hypervisor A pure Hypervisor that runs directly on the hardware and hosts Guest OS’s. Type 2: OS ‘Hosted’ A Hypervisor that runs within a Host OS and hosts Guest OS’s inside of it, using the host OS services to provide the virtual environment. Provides partition isolation + reliability, higher security Low cost, no additional drivers Ease of use & installation Host HW Memory CPUsI/O Host HW Memory CPUsI/O HypervisorScheduler MMU Device Drivers/Models VMn VM1 VM0 Guest OS and Apps Host OS Device Drivers Ring-0 VM Monitor “Kernel “ VMn VM1 VM0 Guest OS and Apps User Apps User-level VMM Device Models General Classification of Virtualization
  • 9. Virtualizable is a property of the Instruction Set Architecture (ISA) • A sensitive instruction – changes the configuration or mode of the processor, or – depends in its behavior on the processor’s state • A privileged instruction – must be executed with sufficient privilege – causes a trap in user mode If all sensitive instructions are privileged, virtual machine monitor can be written.
  • 10. ● Privileged instructions: OS kernel and device driver access to system hardware ● Trapped and Emulated by VMM – execute guest in separate address space in unprivileged mode – emulate all instructions that cause traps Privileged Instructions
  • 11. 11 • branch and branch with Link (B, BL) • data processing instructions (AND, TST, MOV, …) • shifts: logical (LSR), arithmetic (ASR), rotate (ROR) • test (TEQ, TST, CMP, CMN) • processor status register transfer (MSR, MRS) • memory load/store words (LDR, STR) • push/pop Stack Operations (STM, LDM) • software Interrupt (SWI; operating mode switch) • co-processor (CDP, LDC, STC, MRC, MCR) Typical ARM instructions (armv4)
  • 12. Problematic Instructions (1) • Type 1 Instructions which executed in user mode will cause undefined instruction exception • Example MCR p15, 0, r0, c2, c0, 0 Move r0 to c2 and c0 in coprocessor specified by p15 (co-processor) for operation according to option 0 and 0 – MRC: from coproc to register – MCR: from register to coproc • Problem: – Operand-dependent operation
  • 13. Problematic Instructions (2) • Type 2 Instructions which executed in user mode will have no effect • Example MSR cpsr_c, #0xD3 Switch to privileged mode and disable interrupt N Z C V Q -- J -- GE[3:0] -- E A I F T M[4:0] 31 0 Execution Flags Exception Mask Execution Mode Program Status Register (PSR)
  • 14. Problematic Instructions (3) • Type 3 Instructions which executed in user mode will cause unpredictable behaviors. • Example MOVS PC, LR The return instruction changes the program counter and switches to user mode. • This instruction causes unpredictable behavior when executed in user mode.
  • 15. ARM Sensitive Instructions • Coprocessor Access Instructions MRC / MCR / CDP / LDC / STC • SIMD/VFP System Register Access Instructions VMRS / VMSR • TrustZone Secure State Entry Instructions SMC • Memory-Mapped I/O Access Instructions Load/Store instructions from/into memory-mapped I/O locations • Direct (Explicit/Implicit) CPSR Access Instructions MRS / MSR / CPS / SRS / RFE / LDM (conditional execution) / DPSPC • Indirect CPSR Access Instructions LDRT / STRT – Load/Store Unprivileged (“As User”) • Banked Register Access Instructions LDM/STM (User mode registers)
  • 16. Solutions to Problematic Instructions [ Hardware Techniques ] • Privileged Instruction Semantics dictated/translated by instruction set architecture • MMU-enforced traps – Example: page fault • Tracing/debug support – Example: bkpt (breakpoint) • Hardware-assisted Virtualization – Example: extra privileged mode, HYP, in ARM Cortex-A15
  • 17. Complexity Binary translation Hypercall Design High Low Implementation Medium High Runtime High Medium Method: trap and emulate Solutions to Problematic Instructions [ Software Techniques ]
  • 18. Dynamic Binary Translation BL TLB_FLUSH_DENTRY … TLB_FLUSH_DENTRY: MCR p15, 0, R0, C8, C6, 1 MOV PC, LR … BL TLB_FLUSH_DENTRY_NEW … TLB_FLUSH_DENTRY: MCR p15, 0, R0, C8, C6, 1 MOV PC, LR … TLB_FLUSH_DENTRY_NEW: MOV R1, R0 MOV R0, #CMD_FLUSH_DENTRY SWI #HYPER_CALL_TLB Translation Basic Block • ARM has a fixed instruction size – 32-bit in ARM mode and 16-bit in Thumb mode • Perform binary translation – Follow control-flow – Translate basic block (if not already translated) at the current PC – Ensure interposition at end of translated sequence – All writes (but not reads) to PC now become problematic instructions – Replace problematic instructions 1-1 with hypercalls to trap and emulate → self-modifying code
  • 19. Virtualization APIs – hypercalls BL TLB_FLUSH_DENTRY … TLB_FLUSH_DENTRY: MOV R1, R0 MOV R0, #CMD_FLUSH_DENTRY SWI #HYPER_CALL_TLB … Restore User Context & PC SWI Handler Hypercall Handler …… LDR R1, [SP, #4] MCR p15, 0, R1, C8, C6, 1 /* In Hypervisor */ /* In Guest OS */ • Use trap instruction to issue hypercall • Encode hypercall type and original instruction bits in hypercall hint • Upon trapping into the VMM, decode the hypercall type and the original instruction bits, and emulate instruction semantics mrs r8, cpsr swi 0x088000 mrs Rd, R <cpsr/spsr>
  • 21. Xvisor • new open source bare-metal hypervisor, which aims towards providing virtualization solution, which is light-weight, portable, and flexible with small memory footprint and less virtualization overhead • distributed under GNU Public License (GPLv2). • On real hardware specifically BeagleBoard, it reaches near native CPU performance – Native Linux 3.0.4 gives 1120 DMIPS whereas Linux 3.0.4 running as guest on Xvisor ARM gives 1070 DMIPS. • Major targets: x86 and ARM – ARM target supports ARM9, ARM11, Cortex-A8, Cortex-A9, Cortex-A15 – Virtualization Extension
  • 22. Xvisor-ARM https://github.com/xvisor • File: arch/arm/cpu/arm32/elf2cpatch.py – Script to generate cpatch script from guest OS ELF • Functionality before generating the final ELF image – Encode all privileged instructions into SVC instructions (software interrupt) – For each privilege instruction, generate a primitive to replace it – read the directive from ELF2CPATCH and mangle the target binary file – The patched image contains no privilege instructions and could run with in user mode
  • 24. How does Xvisor handle problematic instructions like MSR? • Type 2 Instructions which executed in user mode will have no effect • Example MSR cpsr_c, #0xD3 Switch to privileged mode and disable interrupt N Z C V Q -- J -- GE[3:0] -- E A I F T M[4:0] 31 0 Execution Flags Exception Mask Execution Mode Program Status Register (PSR)
  • 25. MSR cpsr_c, #0xD3 Switch to privileged mode and disable interrupt # MSR (immediate) # Syntax: # msr<c> <spec_reg>, #<const> # Fields: # cond = bits[31:28] # R = bits[22:22] # mask = bits[19:16] # imm12 = bits[11:0] # Hypercall Fields: # inst_cond[31:28] = cond # inst_op[27:24] = 0xf # inst_id[23:20] = 0 # inst_subid[19:17] = 2 # inst_fields[16:13] = mask # inst_fields[12:1] = imm12 # inst_fields[0:0] = R First, cpatch (ELF patching tool) looks up the instructions...
  • 26. def convert_msr_i_inst(hxstr): hx = int(hxstr, 16) inst_id = 0 inst_subid = 2 cond = (hx >> 28) & 0xF R = (hx >> 22) & 0x1 mask = (hx >> 16) & 0xF imm12 = (hx >> 0) & 0xFFF rethx = 0x0F000000 rethx = rethx | (cond << 28) rethx = rethx | (inst_id << 20) rethx = rethx | (inst_subid << 17) rethx = rethx | (mask << 13) rethx = rethx | (imm12 << 1) rethx = rethx | (R << 0) return rethx # MSR (immediate) # Syntax: # msr<c> <spec_reg>, #<const> # Fields: # cond = bits[31:28] # R = bits[22:22] # mask = bits[19:16] # imm12 = bits[11:0] # Hypercall Fields: # inst_cond[31:28] = cond # inst_op[27:24] = 0xf # inst_id[23:20] = 0 # inst_subid[19:17] = 2 # inst_fields[16:13] = mask # inst_fields[12:1] = imm12 # inst_fields[0:0] = R Xvisor utilizes cpatch to convert all problematic instructions for OS image files (ELF format).
  • 27. But it is not enough... • have to handle virtual CPU, memory, devices. Boot ARM/Linux under Xvisor Qemu/ Xvisor img Xvisor shell Guest instance 0 MUGGLE Boot loader MUGGLE Linux 3.0.4 QEMUVirtualIO TIME XvisorDev MUGGLE TTY attach mangling
  • 28. Scheduling • Xvisor is basically a RTOS • A thread in Xvisor is a “vcpu” • Xvisor provides a priority-based time slicing scheduler policy • guest OS know nothing about Xvisor Hypervisor Tasks Guest Memory CPU CPU VCPU VCPU Thread CPU Xvisor Thread Thread
  • 29. VCPU Execution • Guest OS is not expected to release the CPU during its initial state • While executing WFI instruction... – with VE (Virtualization Extension) configuration WFI is configured to trap into HYP mode – with Non-VE configuration WFI is converted into single SVC call during build time
  • 30. Boot up • Generate system image tools/scripts/memimg.py ­a 0x70010000­o build/qemu.img   build/vmm.bin@0x70010000    build/tests/arm32/pb­a8/basic/arm_test.bin.patched@0x70800000  • Launch QEMU qemu­system­arm ­M realview­pb­a8 ­display none ­serial  stdio ­kernel build/qemu.img • QEMU starts by executing the image head with vmm.bin. The vmm.bin is linked on VA = 0xff000000 during compiling time and its designed to be able to load with any address. And it relocates itself as follow – Copy itself into a ARM-MMU-Section aligned (1M boundary) address e.g. 0x80010000-> 0x80000000 – Enable MMU and mapping its VA to load address e.g. 0xFF000000 → 0x80000000 • Then vmm.elf setup data structures to manage all physical page in system – The management scheme is buddy allocator.
  • 31. virtualizervirtualizer P1P1 P2P2 P3P3 virtualizervirtualizer 0000 0300 0500 0800 P1’s world P1P1 virtualizervirtualizer 0000 P2’s world virtualizervirtualizer P2P2 P3’s world virtualizervirtualizer P3P3 Real world 0000 0000 Page Table 1 Page Table 2 Page Table 3 Page Table 1 Page Table 2 Page Table 3 Page Table 1 Page Table 2 Page Table 3 Privilege What if P1 do something like memset(pagetable, 0, …) virtual memory
  • 32. Memory Virtualization • Start the guest0/cpu0 vcpu Xvisor>guest kick guest0 • The guest hardware configure is defined with an standard Device Tree (DT) format http://devicetree.org/Main_Page
  • 33. Memory in DTvcpu0 {     device_type = "vcpu";     compatible = "ARMv7a,cortex­a8";     start_pc = <0x40000000>; } mem1 {      guest_physical_addr = <0x70000000>;      host_physical_addr = <0x82000000>;      physical_size = <0x06000000>; /* 96 MB */      device_type = "ram"; }; nor_flash {     manifest_type = "real";     address_type = "memory";     guest_physical_addr = <0x40000000>;     host_physical_addr = <0x80800000>;     physical_size = <0x00800000>;  } vmm.bin applies a on-demand paging scheme to support space virtualization, In this example, The start address 0x40000000 triggers the prefetch abort which is then catched by vmm.bin The vmm.bin parse the configure file and find that 0x40000000 is mapping to 0x80800000. Then Its setup the mapping and resume guest program
  • 35. Device Virtualization Bigpicture • userspace device emulation • Paravirtualized device drivers (VirtIO) vhost-net worker thread EMU VCPU PHY virtio ring & buffers memory slot table Io event memory r/w r/w r irq hypervisor The vhost-net model • Host user space opens and configures kernel helper • virtio as guest-host interface Enables multi-gigabit throughput
  • 36. Device Virtualization in DTgic0 {     manifest_type = "virtual";     address_type = "memory";     guest_physical_addr = <0x1E000000>;     physical_size = <0x2000>;     device_type = "pic";     compatible = "realview,gic";     parent_irq = <6>; }; The device virtualization also utilizes the device tree. For all device region, The Xvisor setups a mmu mapping with a "no r/w permission" attribute in the page table. Everytime the guest program access the device memory, a page fault is triggered and CPU jump into the data_abort handler. By decoding the instruction pointed by the fault address, the data-abort handler emulate the device behavior before resume guesst VCPU
  • 37. Device Emulator • Since the device is actually a plain memory with its functionalities emulated by software, the multiplex could be easily implemented as following: • Guest OS runs in pure user-mode, and Xvisor applies the V5 domain field in the page table to emulate the privilege level for the guest OS. vmm guest1 guest0v_uart uart v_uart v_uart trap trap bind
  • 38. Reference • ARM Virtualization: CPU & MMU Issues, Prashanth Bungale, vmware • Hardware accelerated Virtualization in the ARM Cortex™ Processors, John Goodacre, ARM Ltd. (2011)