SlideShare uma empresa Scribd logo
1 de 87
Baixar para ler offline
/VM

                Tsuyoshi Ozawa
                Twitter oza_x86




2009   11   9                     1
2009   11   9   2
2009   11   9   3
2009   11   9   4
2009   11   9   5
KVM


2009   11   9         6
for x86

2009   11   9             7
Linux on Real Machine   Linux on Virtual Machine




                          (=OS)
2009   11   9                                                      8
2009   11   9   9
x86

                      (Shadow Page Table)




2009   11   9                               10
CPU

                            0x1000   0x11000
                  Virtual                      Physical
                  Memory                       Memory
                            0x2000   0x12000

                              ...      ...

2009   11   9                                             11
•

                •


2009   11   9       12
•
                •


2009   11   9       13
• OS
                •      0x1000   0x11000

                •      0x2000   0x12000

                         ...      ...



2009   11   9                             14
•
                   0x1000   0x11000


            • OS   0x2000   0x12000

                     ...      ...



2009   11   9                         15
•
                                          ?

                •
                                swap in
                    Physical   swap out
                    Memory



2009   11   9                                 16
1.
                             CR3

                2.               MMU

                3.   TLB               CPU
                                             CR3
                           x86
                       CPU                   MMU
                                             TLB
2009   11   9                                      17
CR3
                •

                • Control Register   3


2009   11   9                                  18
•                      MMU


                • Memory Management Unit
2009   11   9                                19
• Translation Look-aside Buffer   TLB
                •


                • CPU      SRAM


2009   11   9                                           20
Virtual Address 0xc0003120        3



                       20bit        12bit     4.

                          CR3
                    2.
                                               MMU Physical
                                                   Memory

                          TLB        3.

                1.TLB
2009   11   9                                                 21
2009   11   9   22
VM


2009   11   9        23
2009   11   9   24
VM


2009   11   9        25
VM




                • OS
2009   11   9           26
VM




                Virtual
                Machine
                Monitor
                           VMM
                           Hardware
2009   11   9                         27
VMM

                •                 3         VMM

                • Robert P. Goldberg. ,Architectural
                  Principles for Virtual Computer Systems.




2009   11   9                                                28
Type I VMM

                •

                • Xen,VMware ESX
                                   VMM
                                   Hardware
2009   11   9                                 29
Type II VMM
                • OS


                • Qemu      Proc       VMM
                 LilyVM
                 Bochs               OS
                                   Hardware
2009   11   9                                 30
Hybrid    VMM

                • Type I + Type II
                •
                • VMware Proc VMM
                  Workstation
                 Linux KVM
                             OS          VMM
                              Hardware
2009   11   9                                  31
Hybrid    VMM


            •
                         VMM
                         OS     VMM
                          Hardware
2009   11   9                         32
VM


2009   11   9        33
2

                • Shadow Page Table ( SPT )
                • Nested Page Table (Extended Page Table)


2009   11   9                                               34
Shadow Page Table

                •     OS
                               Shadow
                      OS

                •     OS   Shadow



2009   11   9                           35
SPT
                Hybrid   VMM




                         OS      VMM
                           Hardware

2009   11   9                          36
SPT
                          OS
                          VM
       Guest side        vTLB   vCR3

            Host side   VMM
                        Hardware
                          TLB    CR3

2009   11   9                          37
SPT
                                create page table
                          OS                      Guest
                                                page table
                          VM
       Guest side        vTLB      vCR3

            Host side   VMM
                        Hardware
                          TLB    CR3

2009   11   9                                                38
SPT
                          OS             Guest
                                       page table
                          VM
       Guest side        vTLB   vCR3

            Host side   VMM
                                                    ...
                        Hardware
                          TLB    CR3

2009   11   9                                             39
SPT
                          OS             Guest
                                       page table
                          VM
       Guest side        vTLB   vCR3
                                       VMM
            Host side   VMM
                        Hardware
                          TLB    CR3

2009   11   9                                       40
SPT
                          OS             Guest
                                       page table
                          VM
       Guest side        vTLB   vCR3
                                       VMM
            Host side   VMM              PT
                        Hardware
                          TLB    CR3

2009   11   9                                       41
SPT
                          OS                   Guest
                                             page table
                          VM
       Guest side        vTLB   vCR3
                                create SPT
            Host side   VMM                   Shadow
                                             page table
                        Hardware
                          TLB    CR3

2009   11   9                                             42
SPT
                  OS             Guest
                               page table
                                                  Guest
                                                 Physical
                  VM                             Memory
                 vTLB   vCR3

                 VMM            Shadow
                               page table
                                            OS   vCR3
                                                  Host
                                                 Physical
                Hardware                         Memory
                  TLB    CR3

2009   11   9                                               43
SPT
                  OS             Guest
                               page table
                                                    Guest
                                                   Physical
                  VM                               Memory
                 vTLB   vCR3
                                            Hook
                 VMM            Shadow
                                   VMM
                               page table           Host
                                                   Physical
                Hardware                           Memory
                  TLB    CR3

2009   11   9                                                 44
SPT
                  OS             Guest
                               page table
                                                   Guest
                                                  SPT
                                                  Physical
                  VM                              Memory
                 vTLB   vCR3                CR3


                 VMM            Shadow
                               page table          Host
                                                  Physical
                Hardware                          Memory
                  TLB    CR3

2009   11   9                                                45
2009   11   9   46
SPT
                  OS             Guest
                               page table
                                             Guest
                                            Physical
                  VM                        Memory
                 vTLB   vCR3

                 VMM            Shadow
                               page table    Host
                                            Physical
                Hardware                    Memory
                  TLB    CR3

2009   11   9                                          47
SPT
                  OS             Guest
                               page table
                                             Guest
                                            Physical
                  VM                        Memory
                 vTLB   vCR3

                 VMM            Shadow
                               page table    Host
                                            Physical
                Hardware                    Memory
                  TLB    CR3

2009   11   9                                          48
SPT
                  OS             Guest
                               page table
                                             Guest
                                            Physical
                  VM                        Memory
                 vTLB   vCR3

                 VMM            Shadow
                               page table    Host
                                            Physical
                Hardware                    Memory
                  TLB    CR3

2009   11   9                                          49
SPT

                •       OS




                • VMM        SPT




2009   11   9                      50
SPT

                • Pre-Validation
                • Virtual TLB
                • Virtual TLB + Memory Trace


2009   11   9                                  51
Pre-validation

                • CR3
                •            PT

                • SPT


2009   11   9                            52
Pre-validation
                                create page table
                          OS                      Guest
                                                page table
                          VM
       Guest side        vTLB      vCR3

            Host side   VMM
                        Hardware
                          TLB    CR3

2009   11   9                                                53
Pre-validation
                          OS             Guest
                                       page table
                          VM
       Guest side        vTLB   vCR3
                                           OS
            Host side   VMM
                                        PT
                        Hardware
                          TLB    CR3

2009   11   9                                       54
Pre-validation
                          OS             Guest
                                       page table
                          VM
       Guest side        vTLB   vCR3
                                       CR3
            Host side   VMM
                        Hardware
                          TLB    CR3

2009   11   9                                       55
Pre-validation
                          OS             Guest
                                       page table
                          VM
       Guest side        vTLB   vCR3
                                       VMM
            Host side   VMM
                        Hardware
                          TLB    CR3

2009   11   9                                       56
Pre-validation
                          OS             Guest
                                       page table
                          VM
       Guest side        vTLB   vCR3
                                       VMM
            Host side   VMM              PT
                        Hardware
                          TLB    CR3

2009   11   9                                       57
Pre-validation
                          OS                   Guest
                                             page table
                          VM
       Guest side        vTLB   vCR3
                                create SPT
            Host side   VMM                   Shadow
                                             page table
                        Hardware
                          TLB    CR3

2009   11   9                                             58
Pre-validation
                  OS              Guest
                                page table
                                                    Guest
                                                   SPT
                                                   Physical
                  VM                               Memory
                 vTLB    vCR3                CR3


                VMM              Shadow
                                page table          Host
                                                   Physical
                Hardware                           Memory
                  TLB    CR3

2009   11   9                                                 59
SPT
                  OS             Guest
                               page table
                                                   Guest
                                                  Physical
                  VM                              Memory
                 vTLB   vCR3

                 VMM            Shadow
                               page table          Host
                                            SPT   Physical
                Hardware                          Memory
                  TLB    CR3

2009   11   9                                                60
Pre-validation
                •
                    ( CR3    )   SPT




                •

2009   11   9                          61
Virtual TLB
                • CR3
                    SPT 1

                •       TLB
                            SPT

                • TLB
                                  VMM

2009   11   9                             62
Virtual TLB
                                create page table
                          OS                      Guest
                                                page table
                          VM
       Guest side        vTLB      vCR3

            Host side   VMM
                        Hardware
                          TLB    CR3

2009   11   9                                                63
Virtual TLB
                          OS             Guest
                                       page table
                          VM
       Guest side        vTLB   vCR3
                                           OS
            Host side   VMM
                                        PT
                        Hardware
                          TLB    CR3

2009   11   9                                       64
Virtual TLB
                          OS             Guest
                                       page table
                          VM
       Guest side        vTLB   vCR3
                                       CR3
            Host side   VMM
                        Hardware
                          TLB    CR3

2009   11   9                                       65
Virtual TLB
                          OS             Guest
                                       page table
                          VM
       Guest side        vTLB   vCR3
                                       VMM
            Host side   VMM
                        Hardware
                          TLB    CR3

2009   11   9                                       66
Virtual TLB
                          OS             Guest
                                       page table
                          VM
       Guest side        vTLB   vCR3
                                       VMM
            Host side   VMM              PT
                        Hardware
                          TLB    CR3

2009   11   9                                       67
Virtual TLB
                          OS                   Guest
                                             page table
                          VM
       Guest side        vTLB   vCR3
                                create SPT
            Host side   VMM                   Shadow
                                             page table
                        Hardware              1st stage
                          TLB    CR3

2009   11   9                                             68
Virtual TLB
                          VMM
                          OS                   Guest
                                             page table
                          VM
       Guest side 1      vTLB   vCR3
                                create SPT
            Host side   VMM                   Shadow
                                             page table
                        Hardware              1st stage
                          TLB    CR3

2009   11   9                                             69
Virtual TLB
                  OS             Guest
                               page table
                                                   Guest
                                                  SPT
                                                  Physical
                  VM                              Memory
                 vTLB   vCR3                CR3


                VMM             Shadow
                               page table          Host
                                1st stage         Physical
                Hardware                          Memory
                  TLB    CR3

2009   11   9                                                70
Virtual TLB


                  OS             Guest
                               page table
                                             Guest
                                            Physical
                  VM                        Memory
                 vTLB   vCR3

                VMM             Shadow
                               page table    Host
                                1st stage   Physical
                Hardware                    Memory
                  TLB    CR3

2009   11   9                                          71
Virtual TLB


                  OS             Guest
                               page table
                                             Guest
                                            Physical
                  VM                        Memory
                 vTLB   vCR3

                VMM             Shadow
                               page table    Host
                                1st stage   Physical
                Hardware                    Memory
                  TLB    CR3

2009   11   9                                          72
Virtual TLB


                  OS             Guest
                               page table
                                             Guest
                                            Physical
                  VM                        Memory
                 vTLB   vCR3

                VMM             Shadow
                               page table    Host
                                1st stage   Physical
                Hardware                    Memory
                  TLB    CR3

2009   11   9                                          73
Virtual TLB


                  OS             Guest
                               page table
                                                   Guest
                                                  Physical
                  VM                              Memory
                 vTLB   vCR3
                                            VMM
                VMM             Shadow
                               page table    PT    Host
                                1st stage         Physical
                Hardware                          Memory
                  TLB    CR3

2009   11   9                                                74
Virtual TLB


                  OS             Guest
                               page table   2
                                                 Guest
                                                Physical
                  VM                            Memory
                 vTLB   vCR3

                                Shadow
                VMM            page table
                                                 Host
                               2nd stage        Physical
                Hardware                        Memory
                  TLB    CR3

2009   11   9                                              75
Virtual TLB


                         OS            Guest
                                     page table
                                                     Guest
                                                    Physical
                      VM                            Memory
                     vTLB     vCR3

                                      Shadow
                    VMM              page table
                                                     Host
                                     2nd stage      Physical
                    Hardware                        Memory
                      TLB    CR3
                (    )                        CPU
2009   11   9                                                  76
Virtual TLB

                                                    OS
                         OS            Guest
                                     page table
                                                          Guest
                                                         Physical
                      VM                                 Memory
                     vTLB     vCR3

                                      Shadow
                    VMM              page table
                                                          Host
                                     2nd stage           Physical
                    Hardware                             Memory
                      TLB    CR3
                (    )                        CPU
2009   11   9                                                       77
Virtual TLB


                         OS            Guest
                                     page table
                                                     Guest
                                                    Physical
                      VM                            Memory
                     vTLB     vCR3

                                      Shadow
                    VMM              page table
                                                     Host
                                     2nd stage      Physical
                    Hardware                        Memory
                      TLB    CR3
                (    )                        CPU
2009   11   9                                                  78
Virtual TLB

                •
                    •
                    •
                •          SPT



2009   11   9                         79
Virtual TLB

                •   TLB

                    •   CR3

                    •   invlpg

                •             OS



                •
                        PTE

2009   11   9                           80
SPT

                • TLB
                    SPT

                •         OS   PT SPT




2009   11   9                           81
Memory Trace

                •             OS   PT



                •             OS
                                   SPT
                    (Trace)



2009   11   9                            82
• x86
                 •
                   CPU

                 • Linux KVM


2009   11   9                  83
kvm-88/kernel/x86/paging_tmpl.h



2009   11   9                                     84
Nested Page Table
                (Extended Page Table)
                •

                    0x1000   0x11000   0x21000

                    0x2000   0x12000   0x42000

                      ...      ...

2009   11   9                                    85
NPT/EPT
                • AMD    CPU
                              CPU

                • Intel CPU
                              CPU(i7   )

                • VMM
                • SPT
2009   11   9                              86
• VM
                 • SPT
                   • Pre-validation
                   • Virtual TLB
                 • NPT/EPT
2009   11   9                         87

Mais conteúdo relacionado

Mais procurados

Hardware supports for Virtualization
Hardware supports for VirtualizationHardware supports for Virtualization
Hardware supports for Virtualization
Yoonje Choi
 
Redesigning Xen Memory Sharing (Grant) Mechanism
Redesigning Xen Memory Sharing (Grant) MechanismRedesigning Xen Memory Sharing (Grant) Mechanism
Redesigning Xen Memory Sharing (Grant) Mechanism
The Linux Foundation
 
Hyper-V High Availability and Live Migration
Hyper-V High Availability and Live MigrationHyper-V High Availability and Live Migration
Hyper-V High Availability and Live Migration
Paulo Freitas
 
Yabusame: postcopy live migration for qemu/kvm
Yabusame: postcopy live migration for qemu/kvmYabusame: postcopy live migration for qemu/kvm
Yabusame: postcopy live migration for qemu/kvm
Isaku Yamahata
 
Xen and the Art of Virtualization
Xen and the Art of VirtualizationXen and the Art of Virtualization
Xen and the Art of Virtualization
Susheel Thakur
 

Mais procurados (20)

Demand-Based Coordinated Scheduling for SMP VMs
Demand-Based Coordinated Scheduling for SMP VMsDemand-Based Coordinated Scheduling for SMP VMs
Demand-Based Coordinated Scheduling for SMP VMs
 
Xen io
Xen ioXen io
Xen io
 
Hypervisors and Virtualization - VMware, Hyper-V, XenServer, and KVM
Hypervisors and Virtualization - VMware, Hyper-V, XenServer, and KVMHypervisors and Virtualization - VMware, Hyper-V, XenServer, and KVM
Hypervisors and Virtualization - VMware, Hyper-V, XenServer, and KVM
 
1.Introduction to virtualization
1.Introduction to virtualization1.Introduction to virtualization
1.Introduction to virtualization
 
CPU Scheduling for Virtual Desktop Infrastructure
CPU Scheduling for Virtual Desktop InfrastructureCPU Scheduling for Virtual Desktop Infrastructure
CPU Scheduling for Virtual Desktop Infrastructure
 
6. Live VM migration
6. Live VM migration6. Live VM migration
6. Live VM migration
 
Xen Memory Management
Xen Memory ManagementXen Memory Management
Xen Memory Management
 
Hardware supports for Virtualization
Hardware supports for VirtualizationHardware supports for Virtualization
Hardware supports for Virtualization
 
Hypervisor Framework
Hypervisor FrameworkHypervisor Framework
Hypervisor Framework
 
Hypervisors
HypervisorsHypervisors
Hypervisors
 
Redesigning Xen Memory Sharing (Grant) Mechanism
Redesigning Xen Memory Sharing (Grant) MechanismRedesigning Xen Memory Sharing (Grant) Mechanism
Redesigning Xen Memory Sharing (Grant) Mechanism
 
Hyper-V High Availability and Live Migration
Hyper-V High Availability and Live MigrationHyper-V High Availability and Live Migration
Hyper-V High Availability and Live Migration
 
Yabusame: postcopy live migration for qemu/kvm
Yabusame: postcopy live migration for qemu/kvmYabusame: postcopy live migration for qemu/kvm
Yabusame: postcopy live migration for qemu/kvm
 
Ian Pratt Nsdi Keynote Apr2008
Ian Pratt Nsdi Keynote Apr2008Ian Pratt Nsdi Keynote Apr2008
Ian Pratt Nsdi Keynote Apr2008
 
Virtualization & Network Connectivity
Virtualization & Network Connectivity Virtualization & Network Connectivity
Virtualization & Network Connectivity
 
Cloud.pptm
Cloud.pptmCloud.pptm
Cloud.pptm
 
Live VM Migration
Live VM MigrationLive VM Migration
Live VM Migration
 
Xen and the Art of Virtualization
Xen and the Art of VirtualizationXen and the Art of Virtualization
Xen and the Art of Virtualization
 
LCA13: Xen on ARM
LCA13: Xen on ARMLCA13: Xen on ARM
LCA13: Xen on ARM
 
Rootlinux17: An introduction to Xen Project Virtualisation
Rootlinux17:  An introduction to Xen Project VirtualisationRootlinux17:  An introduction to Xen Project Virtualisation
Rootlinux17: An introduction to Xen Project Virtualisation
 

Semelhante a Memory Virtualization

Developing For The Windows Azure Platform
Developing For The Windows Azure PlatformDeveloping For The Windows Azure Platform
Developing For The Windows Azure Platform
drmarcustillett
 
TSM 6.4 Technical updates
TSM 6.4 Technical updates TSM 6.4 Technical updates
TSM 6.4 Technical updates
Solv AS
 
Tivoli Storage Manager 6.3.3 & 6.4
Tivoli Storage Manager 6.3.3 & 6.4Tivoli Storage Manager 6.3.3 & 6.4
Tivoli Storage Manager 6.3.3 & 6.4
Solv AS
 
Dynamo 100107092845-phpapp02
Dynamo 100107092845-phpapp02Dynamo 100107092845-phpapp02
Dynamo 100107092845-phpapp02
Takefumi MIYOSHI
 
Windsor: Domain 0 Disaggregation for XenServer and XCP
	Windsor: Domain 0 Disaggregation for XenServer and XCP	Windsor: Domain 0 Disaggregation for XenServer and XCP
Windsor: Domain 0 Disaggregation for XenServer and XCP
The Linux Foundation
 
Dena Loves Perl
Dena Loves PerlDena Loves Perl
Dena Loves Perl
notolab
 
大容量データバックアップ
大容量データバックアップ大容量データバックアップ
大容量データバックアップ
Takashi Abe
 

Semelhante a Memory Virtualization (20)

SLES 11 SP2 PerformanceEvaluation for Linux on System z
SLES 11 SP2 PerformanceEvaluation for Linux on System zSLES 11 SP2 PerformanceEvaluation for Linux on System z
SLES 11 SP2 PerformanceEvaluation for Linux on System z
 
Running Asterisk on virtualized environments
Running Asterisk on virtualized environmentsRunning Asterisk on virtualized environments
Running Asterisk on virtualized environments
 
第二回Bitvisor読書会 前半 Intel-VT について
第二回Bitvisor読書会 前半 Intel-VT について第二回Bitvisor読書会 前半 Intel-VT について
第二回Bitvisor読書会 前半 Intel-VT について
 
virtualization tutorial at ACM bangalore Compute 2009
virtualization tutorial at ACM bangalore Compute 2009virtualization tutorial at ACM bangalore Compute 2009
virtualization tutorial at ACM bangalore Compute 2009
 
Linux KVM のコードを追いかけてみよう
Linux KVM のコードを追いかけてみようLinux KVM のコードを追いかけてみよう
Linux KVM のコードを追いかけてみよう
 
Developing For The Windows Azure Platform
Developing For The Windows Azure PlatformDeveloping For The Windows Azure Platform
Developing For The Windows Azure Platform
 
TSM 6.4 Technical updates
TSM 6.4 Technical updates TSM 6.4 Technical updates
TSM 6.4 Technical updates
 
Tivoli Storage Manager 6.3.3 & 6.4
Tivoli Storage Manager 6.3.3 & 6.4Tivoli Storage Manager 6.3.3 & 6.4
Tivoli Storage Manager 6.3.3 & 6.4
 
Presentation power vm common 2012
Presentation   power vm common 2012Presentation   power vm common 2012
Presentation power vm common 2012
 
Dynamo 100107092845-phpapp02
Dynamo 100107092845-phpapp02Dynamo 100107092845-phpapp02
Dynamo 100107092845-phpapp02
 
Open systems Specialists: XiV Storage Reinvented
Open systems Specialists: XiV Storage ReinventedOpen systems Specialists: XiV Storage Reinvented
Open systems Specialists: XiV Storage Reinvented
 
Cooperative VM Migration for a virtualized HPC Cluster with VMM-bypass I/O de...
Cooperative VM Migration for a virtualized HPC Cluster with VMM-bypass I/O de...Cooperative VM Migration for a virtualized HPC Cluster with VMM-bypass I/O de...
Cooperative VM Migration for a virtualized HPC Cluster with VMM-bypass I/O de...
 
Windsor: Domain 0 Disaggregation for XenServer and XCP
	Windsor: Domain 0 Disaggregation for XenServer and XCP	Windsor: Domain 0 Disaggregation for XenServer and XCP
Windsor: Domain 0 Disaggregation for XenServer and XCP
 
Dena Loves Perl
Dena Loves PerlDena Loves Perl
Dena Loves Perl
 
XS Japan 2008 BitVisor English
XS Japan 2008 BitVisor EnglishXS Japan 2008 BitVisor English
XS Japan 2008 BitVisor English
 
Toward a practical “HPC Cloud”: Performance tuning of a virtualized HPC cluster
Toward a practical “HPC Cloud”: Performance tuning of a virtualized HPC clusterToward a practical “HPC Cloud”: Performance tuning of a virtualized HPC cluster
Toward a practical “HPC Cloud”: Performance tuning of a virtualized HPC cluster
 
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
 
17-virtualization.pptx
17-virtualization.pptx17-virtualization.pptx
17-virtualization.pptx
 
大容量データバックアップ
大容量データバックアップ大容量データバックアップ
大容量データバックアップ
 
z/VM Platform Update
z/VM Platform Updatez/VM Platform Update
z/VM Platform Update
 

Mais de Tsuyoshi OZAWA (10)

YARN: a resource manager for analytic platform
YARN: a resource manager for analytic platformYARN: a resource manager for analytic platform
YARN: a resource manager for analytic platform
 
Dynamic Resource Allocation Spark on YARN
Dynamic Resource Allocation Spark on YARNDynamic Resource Allocation Spark on YARN
Dynamic Resource Allocation Spark on YARN
 
Taming YARN @ Hadoop Conference Japan 2014
Taming YARN @ Hadoop Conference Japan 2014Taming YARN @ Hadoop Conference Japan 2014
Taming YARN @ Hadoop Conference Japan 2014
 
Taming YARN @ Hadoop conference Japan 2014
Taming YARN @ Hadoop conference Japan 2014Taming YARN @ Hadoop conference Japan 2014
Taming YARN @ Hadoop conference Japan 2014
 
Spark shark
Spark sharkSpark shark
Spark shark
 
Fluent logger-scala
Fluent logger-scalaFluent logger-scala
Fluent logger-scala
 
Multilevel aggregation for Hadoop/MapReduce
Multilevel aggregation for Hadoop/MapReduceMultilevel aggregation for Hadoop/MapReduce
Multilevel aggregation for Hadoop/MapReduce
 
Memcached as a Service for CloudFoundry
Memcached as a Service for CloudFoundryMemcached as a Service for CloudFoundry
Memcached as a Service for CloudFoundry
 
First step for dynticks in FreeBSD
First step for dynticks in FreeBSDFirst step for dynticks in FreeBSD
First step for dynticks in FreeBSD
 
第二回KVM読書会
第二回KVM読書会第二回KVM読書会
第二回KVM読書会
 

Último

Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
vu2urc
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Joaquim Jorge
 

Último (20)

Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
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
 
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
 
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
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
A 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?
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
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...
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
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...
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 

Memory Virtualization

  • 1. /VM Tsuyoshi Ozawa Twitter oza_x86 2009 11 9 1
  • 2. 2009 11 9 2
  • 3. 2009 11 9 3
  • 4. 2009 11 9 4
  • 5. 2009 11 9 5
  • 6. KVM 2009 11 9 6
  • 7. for x86 2009 11 9 7
  • 8. Linux on Real Machine Linux on Virtual Machine (=OS) 2009 11 9 8
  • 9. 2009 11 9 9
  • 10. x86 (Shadow Page Table) 2009 11 9 10
  • 11. CPU 0x1000 0x11000 Virtual Physical Memory Memory 0x2000 0x12000 ... ... 2009 11 9 11
  • 12. • 2009 11 9 12
  • 13. • 2009 11 9 13
  • 14. • OS • 0x1000 0x11000 • 0x2000 0x12000 ... ... 2009 11 9 14
  • 15. 0x1000 0x11000 • OS 0x2000 0x12000 ... ... 2009 11 9 15
  • 16. ? • swap in Physical swap out Memory 2009 11 9 16
  • 17. 1. CR3 2. MMU 3. TLB CPU CR3 x86 CPU MMU TLB 2009 11 9 17
  • 18. CR3 • • Control Register 3 2009 11 9 18
  • 19. MMU • Memory Management Unit 2009 11 9 19
  • 20. • Translation Look-aside Buffer TLB • • CPU SRAM 2009 11 9 20
  • 21. Virtual Address 0xc0003120 3 20bit 12bit 4. CR3 2. MMU Physical Memory TLB 3. 1.TLB 2009 11 9 21
  • 22. 2009 11 9 22
  • 23. VM 2009 11 9 23
  • 24. 2009 11 9 24
  • 25. VM 2009 11 9 25
  • 26. VM • OS 2009 11 9 26
  • 27. VM Virtual Machine Monitor VMM Hardware 2009 11 9 27
  • 28. VMM • 3 VMM • Robert P. Goldberg. ,Architectural Principles for Virtual Computer Systems. 2009 11 9 28
  • 29. Type I VMM • • Xen,VMware ESX VMM Hardware 2009 11 9 29
  • 30. Type II VMM • OS • Qemu Proc VMM LilyVM Bochs OS Hardware 2009 11 9 30
  • 31. Hybrid VMM • Type I + Type II • • VMware Proc VMM Workstation Linux KVM OS VMM Hardware 2009 11 9 31
  • 32. Hybrid VMM • VMM OS VMM Hardware 2009 11 9 32
  • 33. VM 2009 11 9 33
  • 34. 2 • Shadow Page Table ( SPT ) • Nested Page Table (Extended Page Table) 2009 11 9 34
  • 35. Shadow Page Table • OS Shadow OS • OS Shadow 2009 11 9 35
  • 36. SPT Hybrid VMM OS VMM Hardware 2009 11 9 36
  • 37. SPT OS VM Guest side vTLB vCR3 Host side VMM Hardware TLB CR3 2009 11 9 37
  • 38. SPT create page table OS Guest page table VM Guest side vTLB vCR3 Host side VMM Hardware TLB CR3 2009 11 9 38
  • 39. SPT OS Guest page table VM Guest side vTLB vCR3 Host side VMM ... Hardware TLB CR3 2009 11 9 39
  • 40. SPT OS Guest page table VM Guest side vTLB vCR3 VMM Host side VMM Hardware TLB CR3 2009 11 9 40
  • 41. SPT OS Guest page table VM Guest side vTLB vCR3 VMM Host side VMM PT Hardware TLB CR3 2009 11 9 41
  • 42. SPT OS Guest page table VM Guest side vTLB vCR3 create SPT Host side VMM Shadow page table Hardware TLB CR3 2009 11 9 42
  • 43. SPT OS Guest page table Guest Physical VM Memory vTLB vCR3 VMM Shadow page table OS vCR3 Host Physical Hardware Memory TLB CR3 2009 11 9 43
  • 44. SPT OS Guest page table Guest Physical VM Memory vTLB vCR3 Hook VMM Shadow VMM page table Host Physical Hardware Memory TLB CR3 2009 11 9 44
  • 45. SPT OS Guest page table Guest SPT Physical VM Memory vTLB vCR3 CR3 VMM Shadow page table Host Physical Hardware Memory TLB CR3 2009 11 9 45
  • 46. 2009 11 9 46
  • 47. SPT OS Guest page table Guest Physical VM Memory vTLB vCR3 VMM Shadow page table Host Physical Hardware Memory TLB CR3 2009 11 9 47
  • 48. SPT OS Guest page table Guest Physical VM Memory vTLB vCR3 VMM Shadow page table Host Physical Hardware Memory TLB CR3 2009 11 9 48
  • 49. SPT OS Guest page table Guest Physical VM Memory vTLB vCR3 VMM Shadow page table Host Physical Hardware Memory TLB CR3 2009 11 9 49
  • 50. SPT • OS • VMM SPT 2009 11 9 50
  • 51. SPT • Pre-Validation • Virtual TLB • Virtual TLB + Memory Trace 2009 11 9 51
  • 52. Pre-validation • CR3 • PT • SPT 2009 11 9 52
  • 53. Pre-validation create page table OS Guest page table VM Guest side vTLB vCR3 Host side VMM Hardware TLB CR3 2009 11 9 53
  • 54. Pre-validation OS Guest page table VM Guest side vTLB vCR3 OS Host side VMM PT Hardware TLB CR3 2009 11 9 54
  • 55. Pre-validation OS Guest page table VM Guest side vTLB vCR3 CR3 Host side VMM Hardware TLB CR3 2009 11 9 55
  • 56. Pre-validation OS Guest page table VM Guest side vTLB vCR3 VMM Host side VMM Hardware TLB CR3 2009 11 9 56
  • 57. Pre-validation OS Guest page table VM Guest side vTLB vCR3 VMM Host side VMM PT Hardware TLB CR3 2009 11 9 57
  • 58. Pre-validation OS Guest page table VM Guest side vTLB vCR3 create SPT Host side VMM Shadow page table Hardware TLB CR3 2009 11 9 58
  • 59. Pre-validation OS Guest page table Guest SPT Physical VM Memory vTLB vCR3 CR3 VMM Shadow page table Host Physical Hardware Memory TLB CR3 2009 11 9 59
  • 60. SPT OS Guest page table Guest Physical VM Memory vTLB vCR3 VMM Shadow page table Host SPT Physical Hardware Memory TLB CR3 2009 11 9 60
  • 61. Pre-validation • ( CR3 ) SPT • 2009 11 9 61
  • 62. Virtual TLB • CR3 SPT 1 • TLB SPT • TLB VMM 2009 11 9 62
  • 63. Virtual TLB create page table OS Guest page table VM Guest side vTLB vCR3 Host side VMM Hardware TLB CR3 2009 11 9 63
  • 64. Virtual TLB OS Guest page table VM Guest side vTLB vCR3 OS Host side VMM PT Hardware TLB CR3 2009 11 9 64
  • 65. Virtual TLB OS Guest page table VM Guest side vTLB vCR3 CR3 Host side VMM Hardware TLB CR3 2009 11 9 65
  • 66. Virtual TLB OS Guest page table VM Guest side vTLB vCR3 VMM Host side VMM Hardware TLB CR3 2009 11 9 66
  • 67. Virtual TLB OS Guest page table VM Guest side vTLB vCR3 VMM Host side VMM PT Hardware TLB CR3 2009 11 9 67
  • 68. Virtual TLB OS Guest page table VM Guest side vTLB vCR3 create SPT Host side VMM Shadow page table Hardware 1st stage TLB CR3 2009 11 9 68
  • 69. Virtual TLB VMM OS Guest page table VM Guest side 1 vTLB vCR3 create SPT Host side VMM Shadow page table Hardware 1st stage TLB CR3 2009 11 9 69
  • 70. Virtual TLB OS Guest page table Guest SPT Physical VM Memory vTLB vCR3 CR3 VMM Shadow page table Host 1st stage Physical Hardware Memory TLB CR3 2009 11 9 70
  • 71. Virtual TLB OS Guest page table Guest Physical VM Memory vTLB vCR3 VMM Shadow page table Host 1st stage Physical Hardware Memory TLB CR3 2009 11 9 71
  • 72. Virtual TLB OS Guest page table Guest Physical VM Memory vTLB vCR3 VMM Shadow page table Host 1st stage Physical Hardware Memory TLB CR3 2009 11 9 72
  • 73. Virtual TLB OS Guest page table Guest Physical VM Memory vTLB vCR3 VMM Shadow page table Host 1st stage Physical Hardware Memory TLB CR3 2009 11 9 73
  • 74. Virtual TLB OS Guest page table Guest Physical VM Memory vTLB vCR3 VMM VMM Shadow page table PT Host 1st stage Physical Hardware Memory TLB CR3 2009 11 9 74
  • 75. Virtual TLB OS Guest page table 2 Guest Physical VM Memory vTLB vCR3 Shadow VMM page table Host 2nd stage Physical Hardware Memory TLB CR3 2009 11 9 75
  • 76. Virtual TLB OS Guest page table Guest Physical VM Memory vTLB vCR3 Shadow VMM page table Host 2nd stage Physical Hardware Memory TLB CR3 ( ) CPU 2009 11 9 76
  • 77. Virtual TLB OS OS Guest page table Guest Physical VM Memory vTLB vCR3 Shadow VMM page table Host 2nd stage Physical Hardware Memory TLB CR3 ( ) CPU 2009 11 9 77
  • 78. Virtual TLB OS Guest page table Guest Physical VM Memory vTLB vCR3 Shadow VMM page table Host 2nd stage Physical Hardware Memory TLB CR3 ( ) CPU 2009 11 9 78
  • 79. Virtual TLB • • • • SPT 2009 11 9 79
  • 80. Virtual TLB • TLB • CR3 • invlpg • OS • PTE 2009 11 9 80
  • 81. SPT • TLB SPT • OS PT SPT 2009 11 9 81
  • 82. Memory Trace • OS PT • OS SPT (Trace) 2009 11 9 82
  • 83. • x86 • CPU • Linux KVM 2009 11 9 83
  • 85. Nested Page Table (Extended Page Table) • 0x1000 0x11000 0x21000 0x2000 0x12000 0x42000 ... ... 2009 11 9 85
  • 86. NPT/EPT • AMD CPU CPU • Intel CPU CPU(i7 ) • VMM • SPT 2009 11 9 86
  • 87. • VM • SPT • Pre-validation • Virtual TLB • NPT/EPT 2009 11 9 87