SlideShare a Scribd company logo
1 of 20
AMD SVM
syuu1228 from   @livedoor
SVM
AMD

Intel-VT

VMM




qemu
↑
SVM
Ring                  Host/Guest



Guest

DMA             Host/Guest


Guest
Guest


Tagged TLB


Nested Paging
Host


Guest

VMM

          ex:
Guest

VMCB       VMRUN           Guest
 VMCB   Guest


Host                            ex:
                       Host
                AMD   #VMEXIT


Host     #VMEXIT                      VMRUN
Host             Guest


       Guest   VMRUN



λ...           #VMEXIT




Host                     #VMEXIT   VMRUN
VMCB
Virtual Machine Control Block


 VM            VMCB

4KB aligned    4KB         1



Control area

Guest   CPU             Save state area
Control Area             (1)
            on/off bit

               R/W




        ,




  I/O

  MSR
Control Area          (2)
 I/O Permissons Map
 IO



 MSR Permissons Map
 MSR



 Time stamp counter
 RDTSC, RDTSCP
Control Area                              (3)
 TLB       , Guest   ASID(TLB   tag   )




 #VMEXIT

 Nested Paging

 Event Injection
 Guest

 LBR
 LBR   Last Branch Record)AMD64
Save state area
                          RIP,RSP,RAX
ES,CS,SS,DS,FS,GS
                          STAR,LSTAR,CSTAR
GDTR,LDTR,IDTR
                          SFMASK
TR
                          KernelGsBase
CPL
                          SYSENTER_CS,SYSENTER
CR0,CR2,CR3,CR4
                          _ESP,SYSENTER_EIP
DR6,DR7
                          PAT
RFLAGS
                          LBR registers

                    RBX
…

Save state area



  Guest
  (RBX,RCX,RDX,RSI,RDI,RBI)

  Host            (!!!!)
…
Guest
	   	   "mov   %c[rbx](%[svm]),   %%ebx   nt"           ※kvm-6
	   	   "mov   %c[rcx](%[svm]),   %%ecx   nt"
	   	   "mov   %c[rdx](%[svm]),   %%edx   nt"
	   	   "mov   %c[rsi](%[svm]),   %%esi   nt"
	   	   "mov   %c[rdi](%[svm]),   %%edi   nt"
	   	   "mov   %c[rbp](%[svm]),   %%ebp   nt"

	   	   /* Enter guest mode */
	   	   "push %%eax nt"
	   	   "mov %c[vmcb](%[svm]), %%eax nt"
	   	   SVM_VMLOAD "nt"
	   	   SVM_VMRUN "nt"
	   	   SVM_VMSAVE "nt"
	   	   "pop %%eax nt"

	   	   /* Save guest registers, load host registers */
	   	   "mov %%ebx, %c[rbx](%[svm]) nt"
	   	   "mov %%ecx, %c[rcx](%[svm]) nt"
	   	   "mov %%edx, %c[rdx](%[svm]) nt"
	   	   "mov %%esi, %c[rsi](%[svm]) nt"
	   	   "mov %%edi, %c[rdi](%[svm]) nt"
	   	   "mov %%ebp, %c[rbp](%[svm]) nt"

                                             mov          ;)
Host



	   __asm __volatile (                                  ※kvm-6
	   	 "push %%ebx; push %%ecx; push %%edx;"
	   	 "push %%esi; push %%edi; push %%ebp;"


	   	   "pop   %%ebp; pop   %%edi; pop   %%esi;"
	   	   "pop   %%edx; pop   %%ecx; pop   %%ebx; nt"



push/pop
Host




 MSR,FS,GS,LDT,CR2,DR0-3,DR6-7,TR
SVM
VM_HSAVE_PA on MSR
SVM             MSR

Host

VMRUN/#VMEXIT




  CS,SS,RIP,RSP,CR0,CR4,EFER,IDTR,GDTR
/* Enter guest mode */               ※kvm-6
	   	   "push %%eax nt"
	   	   "mov %c[vmcb](%[svm]), %%eax nt"
	   	   SVM_VMLOAD "nt"
	   	   SVM_VMRUN "nt"
	   	   SVM_VMSAVE "nt"
	   	   "pop %%eax nt"



        VMRUN
VMLOAD/VMSAVE


                                       VMRUN/#VMEXIT


CS,RIP,RFLAGS,RAX,SS,RSP,CR0,CR2-4,EFER,IDTR,GDTR,ES,DS,DR6-7,CPL


                   →VMLOAD/VMSAVE
FS,GS,TR,LDTR,KernelGsBase,STAR,LSTAR,CSTAR,SFMASK,SYSENTER_CS,SY
SENTER_ESP,SYSENTER_EIP


    KVM       VMLOAD→VMRUN→VMSAVE
Host
Host
Guest
Guest                VMLOAD)
Host           (VMRUN)
Guest           (VMRUN)
 Guest   !!!
Guest           (#VMEXIT)
Host           (#VMEXIT)
Guest              (VMSAVE)
Guest
Host
Host
AMD SVMってなあに

More Related Content

What's hot

What's hot (20)

後悔しないもんごもんごの使い方 〜アプリ編〜
後悔しないもんごもんごの使い方 〜アプリ編〜後悔しないもんごもんごの使い方 〜アプリ編〜
後悔しないもんごもんごの使い方 〜アプリ編〜
 
B-link-tree
B-link-treeB-link-tree
B-link-tree
 
LSFMM 2019 BPF Observability
LSFMM 2019 BPF ObservabilityLSFMM 2019 BPF Observability
LSFMM 2019 BPF Observability
 
オンプレML基盤on Kubernetes パネルディスカッション
オンプレML基盤on Kubernetes パネルディスカッションオンプレML基盤on Kubernetes パネルディスカッション
オンプレML基盤on Kubernetes パネルディスカッション
 
はじめてのUserLAnd。AndroidでUbuntu,Debian ArchLinuxなどをprootで動かそう Beginner for inst...
はじめてのUserLAnd。AndroidでUbuntu,Debian ArchLinuxなどをprootで動かそう  Beginner for inst...はじめてのUserLAnd。AndroidでUbuntu,Debian ArchLinuxなどをprootで動かそう  Beginner for inst...
はじめてのUserLAnd。AndroidでUbuntu,Debian ArchLinuxなどをprootで動かそう Beginner for inst...
 
仮想化技術によるマルウェア対策とその問題点
仮想化技術によるマルウェア対策とその問題点仮想化技術によるマルウェア対策とその問題点
仮想化技術によるマルウェア対策とその問題点
 
Apache Bigtopによるオープンなビッグデータ処理基盤の構築(オープンデベロッパーズカンファレンス 2021 Online 発表資料)
Apache Bigtopによるオープンなビッグデータ処理基盤の構築(オープンデベロッパーズカンファレンス 2021 Online 発表資料)Apache Bigtopによるオープンなビッグデータ処理基盤の構築(オープンデベロッパーズカンファレンス 2021 Online 発表資料)
Apache Bigtopによるオープンなビッグデータ処理基盤の構築(オープンデベロッパーズカンファレンス 2021 Online 発表資料)
 
Linux performance tuning & stabilization tips (mysqlconf2010)
Linux performance tuning & stabilization tips (mysqlconf2010)Linux performance tuning & stabilization tips (mysqlconf2010)
Linux performance tuning & stabilization tips (mysqlconf2010)
 
わかった気になるMySQL
わかった気になるMySQLわかった気になるMySQL
わかった気になるMySQL
 
明日から始める! ソフトウェアのグリーン化(GSF MeetUp Tokyo 発表資料)
明日から始める! ソフトウェアのグリーン化(GSF MeetUp Tokyo 発表資料)明日から始める! ソフトウェアのグリーン化(GSF MeetUp Tokyo 発表資料)
明日から始める! ソフトウェアのグリーン化(GSF MeetUp Tokyo 発表資料)
 
Wiresharkの解析プラグインを作る ssmjp 201409
Wiresharkの解析プラグインを作る ssmjp 201409Wiresharkの解析プラグインを作る ssmjp 201409
Wiresharkの解析プラグインを作る ssmjp 201409
 
MongoDBの監視
MongoDBの監視MongoDBの監視
MongoDBの監視
 
Dockerからcontainerdへの移行
Dockerからcontainerdへの移行Dockerからcontainerdへの移行
Dockerからcontainerdへの移行
 
Study on Android Emulator
Study on Android EmulatorStudy on Android Emulator
Study on Android Emulator
 
以 eBPF 構建一個更為堅韌的 Kubernetes 叢集
以 eBPF 構建一個更為堅韌的 Kubernetes 叢集以 eBPF 構建一個更為堅韌的 Kubernetes 叢集
以 eBPF 構建一個更為堅韌的 Kubernetes 叢集
 
GPUとSSDがPostgreSQLを加速する~クエリ処理スループット10GB/sへの挑戦~ [DB Tech Showcase Tokyo/2017]
GPUとSSDがPostgreSQLを加速する~クエリ処理スループット10GB/sへの挑戦~ [DB Tech Showcase Tokyo/2017]GPUとSSDがPostgreSQLを加速する~クエリ処理スループット10GB/sへの挑戦~ [DB Tech Showcase Tokyo/2017]
GPUとSSDがPostgreSQLを加速する~クエリ処理スループット10GB/sへの挑戦~ [DB Tech Showcase Tokyo/2017]
 
What's New In Apache CloudStack 4.17
What's New In Apache CloudStack 4.17What's New In Apache CloudStack 4.17
What's New In Apache CloudStack 4.17
 
日本OpenStackユーザ会 第37回勉強会
日本OpenStackユーザ会 第37回勉強会日本OpenStackユーザ会 第37回勉強会
日本OpenStackユーザ会 第37回勉強会
 
SMTPのSTARTTLSにおけるTLSバージョンについて
SMTPのSTARTTLSにおけるTLSバージョンについてSMTPのSTARTTLSにおけるTLSバージョンについて
SMTPのSTARTTLSにおけるTLSバージョンについて
 
HA環境構築のベスト・プラクティス
HA環境構築のベスト・プラクティスHA環境構築のベスト・プラクティス
HA環境構築のベスト・プラクティス
 

Viewers also liked

エンジニアなら知っておきたい「仮想マシン」のしくみ v1.1 (hbstudy 17)
エンジニアなら知っておきたい「仮想マシン」のしくみ v1.1 (hbstudy 17)エンジニアなら知っておきたい「仮想マシン」のしくみ v1.1 (hbstudy 17)
エンジニアなら知っておきたい「仮想マシン」のしくみ v1.1 (hbstudy 17)
Takeshi HASEGAWA
 
Układ drogowy Franowo
Układ drogowy FranowoUkład drogowy Franowo
Układ drogowy Franowo
Ekokonsultacje
 
รายงานคู่มือการใช้งาน
รายงานคู่มือการใช้งานรายงานคู่มือการใช้งาน
รายงานคู่มือการใช้งาน
guest8ec15d
 
Presentacion Cavas Patagon Castellano
Presentacion Cavas Patagon CastellanoPresentacion Cavas Patagon Castellano
Presentacion Cavas Patagon Castellano
Armando Gavidia
 
презентация релиз 5
презентация релиз 5презентация релиз 5
презентация релиз 5
eugenij eugenij
 
Scalable custom production Moving to the next level – and taking everyone wit...
Scalable custom production Moving to the next level – and taking everyone wit...Scalable custom production Moving to the next level – and taking everyone wit...
Scalable custom production Moving to the next level – and taking everyone wit...
Brightwave Group
 
http://izhtc.ru Банер для перехода с 1.6 на 2.0
http://izhtc.ru Банер для перехода с 1.6 на 2.0http://izhtc.ru Банер для перехода с 1.6 на 2.0
http://izhtc.ru Банер для перехода с 1.6 на 2.0
eugenij eugenij
 
Amatciems Latvija
Amatciems   LatvijaAmatciems   Latvija
Amatciems Latvija
verka 123
 

Viewers also liked (20)

エンジニアなら知っておきたい「仮想マシン」のしくみ v1.1 (hbstudy 17)
エンジニアなら知っておきたい「仮想マシン」のしくみ v1.1 (hbstudy 17)エンジニアなら知っておきたい「仮想マシン」のしくみ v1.1 (hbstudy 17)
エンジニアなら知っておきたい「仮想マシン」のしくみ v1.1 (hbstudy 17)
 
次世代のあれ
次世代のあれ次世代のあれ
次世代のあれ
 
物理ネットワーク受け入れテストの自動化を考える
物理ネットワーク受け入れテストの自動化を考える物理ネットワーク受け入れテストの自動化を考える
物理ネットワーク受け入れテストの自動化を考える
 
Lesson to be_learned
Lesson to be_learnedLesson to be_learned
Lesson to be_learned
 
Bear is a Douche
Bear is a DoucheBear is a Douche
Bear is a Douche
 
DB_Algorithm_and_Data_Structure_About_BTree
DB_Algorithm_and_Data_Structure_About_BTreeDB_Algorithm_and_Data_Structure_About_BTree
DB_Algorithm_and_Data_Structure_About_BTree
 
Układ drogowy Franowo
Układ drogowy FranowoUkład drogowy Franowo
Układ drogowy Franowo
 
Lista projektów kluczowych
Lista projektów kluczowychLista projektów kluczowych
Lista projektów kluczowych
 
รายงานคู่มือการใช้งาน
รายงานคู่มือการใช้งานรายงานคู่มือการใช้งาน
รายงานคู่มือการใช้งาน
 
Presentacion Cavas Patagon Castellano
Presentacion Cavas Patagon CastellanoPresentacion Cavas Patagon Castellano
Presentacion Cavas Patagon Castellano
 
презентация релиз 5
презентация релиз 5презентация релиз 5
презентация релиз 5
 
DUID TRANSFORMATION
DUID TRANSFORMATIONDUID TRANSFORMATION
DUID TRANSFORMATION
 
NESHEP Meeting Review (01-02-11)
NESHEP Meeting Review (01-02-11)NESHEP Meeting Review (01-02-11)
NESHEP Meeting Review (01-02-11)
 
Scalable custom production Moving to the next level – and taking everyone wit...
Scalable custom production Moving to the next level – and taking everyone wit...Scalable custom production Moving to the next level – and taking everyone wit...
Scalable custom production Moving to the next level – and taking everyone wit...
 
http://izhtc.ru Банер для перехода с 1.6 на 2.0
http://izhtc.ru Банер для перехода с 1.6 на 2.0http://izhtc.ru Банер для перехода с 1.6 на 2.0
http://izhtc.ru Банер для перехода с 1.6 на 2.0
 
Amatciems Latvija
Amatciems   LatvijaAmatciems   Latvija
Amatciems Latvija
 
Learning and Skills Group Webinar 09.07.09
Learning  and Skills Group Webinar 09.07.09Learning  and Skills Group Webinar 09.07.09
Learning and Skills Group Webinar 09.07.09
 
Die Reise des Mobile Content
Die Reise des Mobile ContentDie Reise des Mobile Content
Die Reise des Mobile Content
 
Keynote
Keynote Keynote
Keynote
 
Kelly Ruggles | American Reliance Group
Kelly Ruggles | American Reliance GroupKelly Ruggles | American Reliance Group
Kelly Ruggles | American Reliance Group
 

Similar to AMD SVMってなあに

s6196-chris-huybregts-microsoft-new-gpu-virtualization-technologies
s6196-chris-huybregts-microsoft-new-gpu-virtualization-technologiess6196-chris-huybregts-microsoft-new-gpu-virtualization-technologies
s6196-chris-huybregts-microsoft-new-gpu-virtualization-technologies
Chris Huybregts
 

Similar to AMD SVMってなあに (20)

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のソースコード解析
 
HBaseConAsia2018 Track1-7: HDFS optimizations for HBase at Xiaomi
HBaseConAsia2018 Track1-7: HDFS optimizations for HBase at XiaomiHBaseConAsia2018 Track1-7: HDFS optimizations for HBase at Xiaomi
HBaseConAsia2018 Track1-7: HDFS optimizations for HBase at Xiaomi
 
Exactly once with spark streaming
Exactly once with spark streamingExactly once with spark streaming
Exactly once with spark streaming
 
Introduction to cloudforecast
Introduction to cloudforecastIntroduction to cloudforecast
Introduction to cloudforecast
 
Don't Tell Joanna the Virtualized Rootkit is Dead (Blackhat 2007)
Don't Tell Joanna the Virtualized Rootkit is Dead (Blackhat 2007)Don't Tell Joanna the Virtualized Rootkit is Dead (Blackhat 2007)
Don't Tell Joanna the Virtualized Rootkit is Dead (Blackhat 2007)
 
A little systemtap
A little systemtapA little systemtap
A little systemtap
 
A little systemtap
A little systemtapA little systemtap
A little systemtap
 
Performance Tuning EC2 Instances
Performance Tuning EC2 InstancesPerformance Tuning EC2 Instances
Performance Tuning EC2 Instances
 
AsiaBSDCon2023 - Hardening Emulated Devices in OpenBSD’s vmd(8) Hypervisor
AsiaBSDCon2023 - Hardening Emulated Devices in OpenBSD’s vmd(8) HypervisorAsiaBSDCon2023 - Hardening Emulated Devices in OpenBSD’s vmd(8) Hypervisor
AsiaBSDCon2023 - Hardening Emulated Devices in OpenBSD’s vmd(8) Hypervisor
 
Debugging Ruby Systems
Debugging Ruby SystemsDebugging Ruby Systems
Debugging Ruby Systems
 
(PFC306) Performance Tuning Amazon EC2 Instances | AWS re:Invent 2014
(PFC306) Performance Tuning Amazon EC2 Instances | AWS re:Invent 2014(PFC306) Performance Tuning Amazon EC2 Instances | AWS re:Invent 2014
(PFC306) Performance Tuning Amazon EC2 Instances | AWS re:Invent 2014
 
Network Automation: Ansible 102
Network Automation: Ansible 102Network Automation: Ansible 102
Network Automation: Ansible 102
 
JavaScript on the GPU
JavaScript on the GPUJavaScript on the GPU
JavaScript on the GPU
 
System Hacking Tutorial #3 - Buffer Overflow - Egg Hunting
System Hacking Tutorial #3 - Buffer Overflow - Egg HuntingSystem Hacking Tutorial #3 - Buffer Overflow - Egg Hunting
System Hacking Tutorial #3 - Buffer Overflow - Egg Hunting
 
WAN - trends and use cases
WAN - trends and use casesWAN - trends and use cases
WAN - trends and use cases
 
Deathstar
DeathstarDeathstar
Deathstar
 
XS Japan 2008 Xen Mgmt English
XS Japan 2008 Xen Mgmt EnglishXS Japan 2008 Xen Mgmt English
XS Japan 2008 Xen Mgmt English
 
s6196-chris-huybregts-microsoft-new-gpu-virtualization-technologies
s6196-chris-huybregts-microsoft-new-gpu-virtualization-technologiess6196-chris-huybregts-microsoft-new-gpu-virtualization-technologies
s6196-chris-huybregts-microsoft-new-gpu-virtualization-technologies
 
Shellcodes for ARM: Your Pills Don't Work on Me, x86
Shellcodes for ARM: Your Pills Don't Work on Me, x86Shellcodes for ARM: Your Pills Don't Work on Me, x86
Shellcodes for ARM: Your Pills Don't Work on Me, x86
 
Code GPU with CUDA - SIMT
Code GPU with CUDA - SIMTCode GPU with CUDA - SIMT
Code GPU with CUDA - SIMT
 

More from Takuya ASADA

Seastar in 歌舞伎座.tech#8「C++初心者会」
Seastar in 歌舞伎座.tech#8「C++初心者会」Seastar in 歌舞伎座.tech#8「C++初心者会」
Seastar in 歌舞伎座.tech#8「C++初心者会」
Takuya ASADA
 
Seastar:高スループットなサーバアプリケーションの為の新しいフレームワーク
Seastar:高スループットなサーバアプリケーションの為の新しいフレームワークSeastar:高スループットなサーバアプリケーションの為の新しいフレームワーク
Seastar:高スループットなサーバアプリケーションの為の新しいフレームワーク
Takuya ASADA
 
僕のIntel nucが起動しないわけがない
僕のIntel nucが起動しないわけがない僕のIntel nucが起動しないわけがない
僕のIntel nucが起動しないわけがない
Takuya ASADA
 
Interrupt Affinityについて
Interrupt AffinityについてInterrupt Affinityについて
Interrupt Affinityについて
Takuya ASADA
 
OSvパンフレット
OSvパンフレットOSvパンフレット
OSvパンフレット
Takuya ASADA
 
BHyVeでOSvを起動したい
〜BIOSがなくてもこの先生きのこるには〜
BHyVeでOSvを起動したい
〜BIOSがなくてもこの先生きのこるには〜BHyVeでOSvを起動したい
〜BIOSがなくてもこの先生きのこるには〜
BHyVeでOSvを起動したい
〜BIOSがなくてもこの先生きのこるには〜
Takuya ASADA
 
「ハイパーバイザの作り方」読書会#2
「ハイパーバイザの作り方」読書会#2「ハイパーバイザの作り方」読書会#2
「ハイパーバイザの作り方」読書会#2
Takuya ASADA
 
「ハイパーバイザの作り方」読書会#1
「ハイパーバイザの作り方」読書会#1「ハイパーバイザの作り方」読書会#1
「ハイパーバイザの作り方」読書会#1
Takuya ASADA
 

More from Takuya ASADA (20)

Seastar in 歌舞伎座.tech#8「C++初心者会」
Seastar in 歌舞伎座.tech#8「C++初心者会」Seastar in 歌舞伎座.tech#8「C++初心者会」
Seastar in 歌舞伎座.tech#8「C++初心者会」
 
Seastar:高スループットなサーバアプリケーションの為の新しいフレームワーク
Seastar:高スループットなサーバアプリケーションの為の新しいフレームワークSeastar:高スループットなサーバアプリケーションの為の新しいフレームワーク
Seastar:高スループットなサーバアプリケーションの為の新しいフレームワーク
 
高スループットなサーバアプリケーションの為の新しいフレームワーク
「Seastar」
高スループットなサーバアプリケーションの為の新しいフレームワーク
「Seastar」高スループットなサーバアプリケーションの為の新しいフレームワーク
「Seastar」
高スループットなサーバアプリケーションの為の新しいフレームワーク
「Seastar」
 
ヤマノススメ〜秋山郷 de ハッカソン〜
ヤマノススメ〜秋山郷 de ハッカソン〜ヤマノススメ〜秋山郷 de ハッカソン〜
ヤマノススメ〜秋山郷 de ハッカソン〜
 
UEFI時代のブートローダ
UEFI時代のブートローダUEFI時代のブートローダ
UEFI時代のブートローダ
 
OSvのご紹介 in 
Java 8 HotSpot meeting
OSvのご紹介 in 
Java 8 HotSpot meetingOSvのご紹介 in 
Java 8 HotSpot meeting
OSvのご紹介 in 
Java 8 HotSpot meeting
 
OSvパンフレット v3
OSvパンフレット v3OSvパンフレット v3
OSvパンフレット v3
 
OSvのご紹介 in OSC2014 Tokyo/Fall
OSvのご紹介 in OSC2014 Tokyo/FallOSvのご紹介 in OSC2014 Tokyo/Fall
OSvのご紹介 in OSC2014 Tokyo/Fall
 
OSv噺
OSv噺OSv噺
OSv噺
 
OSvの概要と実装
OSvの概要と実装OSvの概要と実装
OSvの概要と実装
 
Linux network stack
Linux network stackLinux network stack
Linux network stack
 
Ethernetの受信処理
Ethernetの受信処理Ethernetの受信処理
Ethernetの受信処理
 
Presentation on your terminal
Presentation on your terminalPresentation on your terminal
Presentation on your terminal
 
僕のIntel nucが起動しないわけがない
僕のIntel nucが起動しないわけがない僕のIntel nucが起動しないわけがない
僕のIntel nucが起動しないわけがない
 
Interrupt Affinityについて
Interrupt AffinityについてInterrupt Affinityについて
Interrupt Affinityについて
 
OSvパンフレット
OSvパンフレットOSvパンフレット
OSvパンフレット
 
BHyVeでOSvを起動したい
〜BIOSがなくてもこの先生きのこるには〜
BHyVeでOSvを起動したい
〜BIOSがなくてもこの先生きのこるには〜BHyVeでOSvを起動したい
〜BIOSがなくてもこの先生きのこるには〜
BHyVeでOSvを起動したい
〜BIOSがなくてもこの先生きのこるには〜
 
「ハイパーバイザの作り方」読書会#2
「ハイパーバイザの作り方」読書会#2「ハイパーバイザの作り方」読書会#2
「ハイパーバイザの作り方」読書会#2
 
「ハイパーバイザの作り方」読書会#1
「ハイパーバイザの作り方」読書会#1「ハイパーバイザの作り方」読書会#1
「ハイパーバイザの作り方」読書会#1
 
10GbE時代のネットワークI/O高速化
10GbE時代のネットワークI/O高速化10GbE時代のネットワークI/O高速化
10GbE時代のネットワークI/O高速化
 

Recently uploaded

Salient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functionsSalient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functions
KarakKing
 

Recently uploaded (20)

How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17
 
Tatlong Kwento ni Lola basyang-1.pdf arts
Tatlong Kwento ni Lola basyang-1.pdf artsTatlong Kwento ni Lola basyang-1.pdf arts
Tatlong Kwento ni Lola basyang-1.pdf arts
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
 
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
 
Wellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptxWellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptx
 
Philosophy of china and it's charactistics
Philosophy of china and it's charactisticsPhilosophy of china and it's charactistics
Philosophy of china and it's charactistics
 
Understanding Accommodations and Modifications
Understanding  Accommodations and ModificationsUnderstanding  Accommodations and Modifications
Understanding Accommodations and Modifications
 
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docx
 
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptxExploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
 
Salient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functionsSalient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functions
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.
 
REMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptxREMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptx
 
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdfUnit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdf
 
Basic Intentional Injuries Health Education
Basic Intentional Injuries Health EducationBasic Intentional Injuries Health Education
Basic Intentional Injuries Health Education
 
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptxOn_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
 
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
 
Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibit
 
21st_Century_Skills_Framework_Final_Presentation_2.pptx
21st_Century_Skills_Framework_Final_Presentation_2.pptx21st_Century_Skills_Framework_Final_Presentation_2.pptx
21st_Century_Skills_Framework_Final_Presentation_2.pptx
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptx
 

AMD SVMってなあに

  • 3. SVM Ring Host/Guest Guest DMA Host/Guest Guest Guest Tagged TLB Nested Paging
  • 5. Guest VMCB VMRUN Guest VMCB Guest Host ex: Host AMD #VMEXIT Host #VMEXIT VMRUN
  • 6. Host Guest Guest VMRUN λ... #VMEXIT Host #VMEXIT VMRUN
  • 7. VMCB Virtual Machine Control Block VM VMCB 4KB aligned 4KB 1 Control area Guest CPU Save state area
  • 8. Control Area (1) on/off bit R/W , I/O MSR
  • 9. Control Area (2) I/O Permissons Map IO MSR Permissons Map MSR Time stamp counter RDTSC, RDTSCP
  • 10. Control Area (3) TLB , Guest ASID(TLB tag ) #VMEXIT Nested Paging Event Injection Guest LBR LBR Last Branch Record)AMD64
  • 11. Save state area RIP,RSP,RAX ES,CS,SS,DS,FS,GS STAR,LSTAR,CSTAR GDTR,LDTR,IDTR SFMASK TR KernelGsBase CPL SYSENTER_CS,SYSENTER CR0,CR2,CR3,CR4 _ESP,SYSENTER_EIP DR6,DR7 PAT RFLAGS LBR registers RBX
  • 12. … Save state area Guest (RBX,RCX,RDX,RSI,RDI,RBI) Host (!!!!)
  • 13. … Guest "mov %c[rbx](%[svm]), %%ebx nt" ※kvm-6 "mov %c[rcx](%[svm]), %%ecx nt" "mov %c[rdx](%[svm]), %%edx nt" "mov %c[rsi](%[svm]), %%esi nt" "mov %c[rdi](%[svm]), %%edi nt" "mov %c[rbp](%[svm]), %%ebp nt" /* Enter guest mode */ "push %%eax nt" "mov %c[vmcb](%[svm]), %%eax nt" SVM_VMLOAD "nt" SVM_VMRUN "nt" SVM_VMSAVE "nt" "pop %%eax nt" /* Save guest registers, load host registers */ "mov %%ebx, %c[rbx](%[svm]) nt" "mov %%ecx, %c[rcx](%[svm]) nt" "mov %%edx, %c[rdx](%[svm]) nt" "mov %%esi, %c[rsi](%[svm]) nt" "mov %%edi, %c[rdi](%[svm]) nt" "mov %%ebp, %c[rbp](%[svm]) nt" mov ;)
  • 14. Host __asm __volatile ( ※kvm-6 "push %%ebx; push %%ecx; push %%edx;" "push %%esi; push %%edi; push %%ebp;" "pop %%ebp; pop %%edi; pop %%esi;" "pop %%edx; pop %%ecx; pop %%ebx; nt" push/pop
  • 16. SVM VM_HSAVE_PA on MSR SVM MSR Host VMRUN/#VMEXIT CS,SS,RIP,RSP,CR0,CR4,EFER,IDTR,GDTR
  • 17. /* Enter guest mode */ ※kvm-6 "push %%eax nt" "mov %c[vmcb](%[svm]), %%eax nt" SVM_VMLOAD "nt" SVM_VMRUN "nt" SVM_VMSAVE "nt" "pop %%eax nt" VMRUN
  • 18. VMLOAD/VMSAVE VMRUN/#VMEXIT CS,RIP,RFLAGS,RAX,SS,RSP,CR0,CR2-4,EFER,IDTR,GDTR,ES,DS,DR6-7,CPL →VMLOAD/VMSAVE FS,GS,TR,LDTR,KernelGsBase,STAR,LSTAR,CSTAR,SFMASK,SYSENTER_CS,SY SENTER_ESP,SYSENTER_EIP KVM VMLOAD→VMRUN→VMSAVE
  • 19. Host Host Guest Guest VMLOAD) Host (VMRUN) Guest (VMRUN) Guest !!! Guest (#VMEXIT) Host (#VMEXIT) Guest (VMSAVE) Guest Host Host