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

Next-generation MMORPG service architecture
Next-generation MMORPG service architectureNext-generation MMORPG service architecture
Next-generation MMORPG service architectureJongwon Kim
 
Screen space reflection
Screen space reflectionScreen space reflection
Screen space reflectionBongseok Cho
 
[0122 구경원]게임에서의 충돌처리
[0122 구경원]게임에서의 충돌처리[0122 구경원]게임에서의 충돌처리
[0122 구경원]게임에서의 충돌처리KyeongWon Koo
 
C++でNVMeと(*´Д`)ハァハァ 戯れていたら一年経ってた。
C++でNVMeと(*´Д`)ハァハァ 戯れていたら一年経ってた。C++でNVMeと(*´Д`)ハァハァ 戯れていたら一年経ってた。
C++でNVMeと(*´Д`)ハァハァ 戯れていたら一年経ってた。hiyohiyo
 
ROS 2 Client Library for E^2
ROS 2 Client Library for E^2ROS 2 Client Library for E^2
ROS 2 Client Library for E^2Hideki Takase
 
最新C++事情 C++14-C++20 (2018年10月)
最新C++事情 C++14-C++20 (2018年10月)最新C++事情 C++14-C++20 (2018年10月)
最新C++事情 C++14-C++20 (2018年10月)Akihiko Matuura
 
유니티 + Nodejs를 활용한 멀티플레이어 게임 개발하기
유니티 + Nodejs를 활용한 멀티플레이어 게임 개발하기유니티 + Nodejs를 활용한 멀티플레이어 게임 개발하기
유니티 + Nodejs를 활용한 멀티플레이어 게임 개발하기Kiyoung Moon
 
Constexprとtemplateでコンパイル時にfizz buzz
Constexprとtemplateでコンパイル時にfizz buzzConstexprとtemplateでコンパイル時にfizz buzz
Constexprとtemplateでコンパイル時にfizz buzz京大 マイコンクラブ
 
Android起動周りのノウハウ
Android起動周りのノウハウAndroid起動周りのノウハウ
Android起動周りのノウハウchancelab
 
AVX-512(フォーマット)詳解
AVX-512(フォーマット)詳解AVX-512(フォーマット)詳解
AVX-512(フォーマット)詳解MITSUNARI Shigeo
 
realpathキャッシュと OPcacheの面倒すぎる関係
realpathキャッシュと OPcacheの面倒すぎる関係realpathキャッシュと OPcacheの面倒すぎる関係
realpathキャッシュと OPcacheの面倒すぎる関係Yoshio Hanawa
 
M5StackをRustで動かす
M5StackをRustで動かすM5StackをRustで動かす
M5StackをRustで動かすKenta IDA
 
[NDC17] Unreal.js - 자바스크립트로 쉽고 빠른 UE4 개발하기
[NDC17] Unreal.js - 자바스크립트로 쉽고 빠른 UE4 개발하기[NDC17] Unreal.js - 자바스크립트로 쉽고 빠른 UE4 개발하기
[NDC17] Unreal.js - 자바스크립트로 쉽고 빠른 UE4 개발하기현철 조
 
전형규, M2 클라이언트 스레딩 아키텍쳐, NDC2013
전형규, M2 클라이언트 스레딩 아키텍쳐, NDC2013전형규, M2 클라이언트 스레딩 아키텍쳐, NDC2013
전형규, M2 클라이언트 스레딩 아키텍쳐, NDC2013devCAT Studio, NEXON
 
Recast Detour.pptx
Recast Detour.pptxRecast Detour.pptx
Recast Detour.pptxMUUMUMUMU
 
07_PhysX 강체물리 입문
07_PhysX 강체물리 입문07_PhysX 강체물리 입문
07_PhysX 강체물리 입문noerror
 
Ndc2012 최지호 텍스쳐 압축 기법 소개
Ndc2012 최지호 텍스쳐 압축 기법 소개Ndc2012 최지호 텍스쳐 압축 기법 소개
Ndc2012 최지호 텍스쳐 압축 기법 소개Jiho Choi
 
Retrofit2 &OkHttp 
でAndroidのHTTP通信が快適だにゃん
Retrofit2 &OkHttp 
でAndroidのHTTP通信が快適だにゃんRetrofit2 &OkHttp 
でAndroidのHTTP通信が快適だにゃん
Retrofit2 &OkHttp 
でAndroidのHTTP通信が快適だにゃんYukari Sakurai
 

What's hot (20)

LLVM最適化のこつ
LLVM最適化のこつLLVM最適化のこつ
LLVM最適化のこつ
 
Next-generation MMORPG service architecture
Next-generation MMORPG service architectureNext-generation MMORPG service architecture
Next-generation MMORPG service architecture
 
Screen space reflection
Screen space reflectionScreen space reflection
Screen space reflection
 
[0122 구경원]게임에서의 충돌처리
[0122 구경원]게임에서의 충돌처리[0122 구경원]게임에서의 충돌처리
[0122 구경원]게임에서의 충돌처리
 
C++でNVMeと(*´Д`)ハァハァ 戯れていたら一年経ってた。
C++でNVMeと(*´Д`)ハァハァ 戯れていたら一年経ってた。C++でNVMeと(*´Д`)ハァハァ 戯れていたら一年経ってた。
C++でNVMeと(*´Д`)ハァハァ 戯れていたら一年経ってた。
 
ROS 2 Client Library for E^2
ROS 2 Client Library for E^2ROS 2 Client Library for E^2
ROS 2 Client Library for E^2
 
最新C++事情 C++14-C++20 (2018年10月)
最新C++事情 C++14-C++20 (2018年10月)最新C++事情 C++14-C++20 (2018年10月)
最新C++事情 C++14-C++20 (2018年10月)
 
유니티 + Nodejs를 활용한 멀티플레이어 게임 개발하기
유니티 + Nodejs를 활용한 멀티플레이어 게임 개발하기유니티 + Nodejs를 활용한 멀티플레이어 게임 개발하기
유니티 + Nodejs를 활용한 멀티플레이어 게임 개발하기
 
Constexprとtemplateでコンパイル時にfizz buzz
Constexprとtemplateでコンパイル時にfizz buzzConstexprとtemplateでコンパイル時にfizz buzz
Constexprとtemplateでコンパイル時にfizz buzz
 
Android起動周りのノウハウ
Android起動周りのノウハウAndroid起動周りのノウハウ
Android起動周りのノウハウ
 
AVX-512(フォーマット)詳解
AVX-512(フォーマット)詳解AVX-512(フォーマット)詳解
AVX-512(フォーマット)詳解
 
realpathキャッシュと OPcacheの面倒すぎる関係
realpathキャッシュと OPcacheの面倒すぎる関係realpathキャッシュと OPcacheの面倒すぎる関係
realpathキャッシュと OPcacheの面倒すぎる関係
 
M5StackをRustで動かす
M5StackをRustで動かすM5StackをRustで動かす
M5StackをRustで動かす
 
[NDC17] Unreal.js - 자바스크립트로 쉽고 빠른 UE4 개발하기
[NDC17] Unreal.js - 자바스크립트로 쉽고 빠른 UE4 개발하기[NDC17] Unreal.js - 자바스크립트로 쉽고 빠른 UE4 개발하기
[NDC17] Unreal.js - 자바스크립트로 쉽고 빠른 UE4 개발하기
 
Gstreamer Basics
Gstreamer BasicsGstreamer Basics
Gstreamer Basics
 
전형규, M2 클라이언트 스레딩 아키텍쳐, NDC2013
전형규, M2 클라이언트 스레딩 아키텍쳐, NDC2013전형규, M2 클라이언트 스레딩 아키텍쳐, NDC2013
전형규, M2 클라이언트 스레딩 아키텍쳐, NDC2013
 
Recast Detour.pptx
Recast Detour.pptxRecast Detour.pptx
Recast Detour.pptx
 
07_PhysX 강체물리 입문
07_PhysX 강체물리 입문07_PhysX 강체물리 입문
07_PhysX 강체물리 입문
 
Ndc2012 최지호 텍스쳐 압축 기법 소개
Ndc2012 최지호 텍스쳐 압축 기법 소개Ndc2012 최지호 텍스쳐 압축 기법 소개
Ndc2012 최지호 텍스쳐 압축 기법 소개
 
Retrofit2 &OkHttp 
でAndroidのHTTP通信が快適だにゃん
Retrofit2 &OkHttp 
でAndroidのHTTP通信が快適だにゃんRetrofit2 &OkHttp 
でAndroidのHTTP通信が快適だにゃん
Retrofit2 &OkHttp 
でAndroidのHTTP通信が快適だにゃん
 

Viewers also liked

エンジニアなら知っておきたい「仮想マシン」のしくみ v1.1 (hbstudy 17)
エンジニアなら知っておきたい「仮想マシン」のしくみ v1.1 (hbstudy 17)エンジニアなら知っておきたい「仮想マシン」のしくみ v1.1 (hbstudy 17)
エンジニアなら知っておきたい「仮想マシン」のしくみ v1.1 (hbstudy 17)Takeshi HASEGAWA
 
物理ネットワーク受け入れテストの自動化を考える
物理ネットワーク受け入れテストの自動化を考える物理ネットワーク受け入れテストの自動化を考える
物理ネットワーク受け入れテストの自動化を考えるskipping classes
 
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_BTreeLixun Peng
 
Układ drogowy Franowo
Układ drogowy FranowoUkład drogowy Franowo
Układ drogowy FranowoEkokonsultacje
 
Lista projektów kluczowych
Lista projektów kluczowychLista projektów kluczowych
Lista projektów kluczowychEkokonsultacje
 
รายงานคู่มือการใช้งาน
รายงานคู่มือการใช้งานรายงานคู่มือการใช้งาน
รายงานคู่มือการใช้งานguest8ec15d
 
Presentacion Cavas Patagon Castellano
Presentacion Cavas Patagon CastellanoPresentacion Cavas Patagon Castellano
Presentacion Cavas Patagon CastellanoArmando Gavidia
 
презентация релиз 5
презентация релиз 5презентация релиз 5
презентация релиз 5eugenij eugenij
 
NESHEP Meeting Review (01-02-11)
NESHEP Meeting Review (01-02-11)NESHEP Meeting Review (01-02-11)
NESHEP Meeting Review (01-02-11)Alan Bassett
 
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.0eugenij eugenij
 
Amatciems Latvija
Amatciems   LatvijaAmatciems   Latvija
Amatciems Latvijaverka 123
 
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.09Brightwave Group
 
Kelly Ruggles | American Reliance Group
Kelly Ruggles | American Reliance GroupKelly Ruggles | American Reliance Group
Kelly Ruggles | American Reliance GroupKelly Ruggles
 

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ってなあに

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
 
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 XiaomiMichael Stack
 
Exactly once with spark streaming
Exactly once with spark streamingExactly once with spark streaming
Exactly once with spark streamingQuentin Ambard
 
Introduction to cloudforecast
Introduction to cloudforecastIntroduction to cloudforecast
Introduction to cloudforecastMasahiro Nagano
 
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)Nate Lawson
 
A little systemtap
A little systemtapA little systemtap
A little systemtapyang bingwu
 
A little systemtap
A little systemtapA little systemtap
A little systemtapyang bingwu
 
Performance Tuning EC2 Instances
Performance Tuning EC2 InstancesPerformance Tuning EC2 Instances
Performance Tuning EC2 InstancesBrendan Gregg
 
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) HypervisorDave Voutila
 
Debugging Ruby Systems
Debugging Ruby SystemsDebugging Ruby Systems
Debugging Ruby SystemsEngine Yard
 
(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 2014Amazon Web Services
 
Network Automation: Ansible 102
Network Automation: Ansible 102Network Automation: Ansible 102
Network Automation: Ansible 102APNIC
 
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 Huntingsanghwan ahn
 
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-technologiesChris Huybregts
 
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, x86Svetlana Gaivoronski
 

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
 
高スループットなサーバアプリケーションの為の新しいフレームワーク
「Seastar」
高スループットなサーバアプリケーションの為の新しいフレームワーク
「Seastar」高スループットなサーバアプリケーションの為の新しいフレームワーク
「Seastar」
高スループットなサーバアプリケーションの為の新しいフレームワーク
「Seastar」Takuya ASADA
 
ヤマノススメ〜秋山郷 de ハッカソン〜
ヤマノススメ〜秋山郷 de ハッカソン〜ヤマノススメ〜秋山郷 de ハッカソン〜
ヤマノススメ〜秋山郷 de ハッカソン〜Takuya ASADA
 
UEFI時代のブートローダ
UEFI時代のブートローダUEFI時代のブートローダ
UEFI時代のブートローダTakuya ASADA
 
OSvのご紹介 in 
Java 8 HotSpot meeting
OSvのご紹介 in 
Java 8 HotSpot meetingOSvのご紹介 in 
Java 8 HotSpot meeting
OSvのご紹介 in 
Java 8 HotSpot meetingTakuya ASADA
 
OSvパンフレット v3
OSvパンフレット v3OSvパンフレット v3
OSvパンフレット v3Takuya ASADA
 
OSvのご紹介 in OSC2014 Tokyo/Fall
OSvのご紹介 in OSC2014 Tokyo/FallOSvのご紹介 in OSC2014 Tokyo/Fall
OSvのご紹介 in OSC2014 Tokyo/FallTakuya ASADA
 
OSvの概要と実装
OSvの概要と実装OSvの概要と実装
OSvの概要と実装Takuya ASADA
 
Linux network stack
Linux network stackLinux network stack
Linux network stackTakuya ASADA
 
Ethernetの受信処理
Ethernetの受信処理Ethernetの受信処理
Ethernetの受信処理Takuya ASADA
 
Presentation on your terminal
Presentation on your terminalPresentation on your terminal
Presentation on your terminalTakuya 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
「ハイパーバイザの作り方」読書会#2Takuya ASADA
 
「ハイパーバイザの作り方」読書会#1
「ハイパーバイザの作り方」読書会#1「ハイパーバイザの作り方」読書会#1
「ハイパーバイザの作り方」読書会#1Takuya ASADA
 
10GbE時代のネットワークI/O高速化
10GbE時代のネットワークI/O高速化10GbE時代のネットワークI/O高速化
10GbE時代のネットワークI/O高速化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

Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.pptRamjanShidvankar
 
How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17Celine George
 
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.christianmathematics
 
Interdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptxInterdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptxPooja Bhuva
 
Plant propagation: Sexual and Asexual propapagation.pptx
Plant propagation: Sexual and Asexual propapagation.pptxPlant propagation: Sexual and Asexual propapagation.pptx
Plant propagation: Sexual and Asexual propapagation.pptxUmeshTimilsina1
 
Graduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - EnglishGraduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - Englishneillewis46
 
Towards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptxTowards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptxJisc
 
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 functionsKarakKing
 
ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.MaryamAhmad92
 
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Ă...Nguyen Thanh Tu Collection
 
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.pptxDenish Jangid
 
Wellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptxWellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptxJisc
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfAdmir Softic
 
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 17Celine George
 
Food safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfFood safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfSherif Taha
 
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptxCOMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptxannathomasp01
 
Google Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptxGoogle Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptxDr. Sarita Anand
 
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.pptxAreebaZafar22
 
How to Add New Custom Addons Path in Odoo 17
How to Add New Custom Addons Path in Odoo 17How to Add New Custom Addons Path in Odoo 17
How to Add New Custom Addons Path in Odoo 17Celine George
 
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.pdfDr Vijay Vishwakarma
 

Recently uploaded (20)

Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.ppt
 
How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17
 
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.
 
Interdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptxInterdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptx
 
Plant propagation: Sexual and Asexual propapagation.pptx
Plant propagation: Sexual and Asexual propapagation.pptxPlant propagation: Sexual and Asexual propapagation.pptx
Plant propagation: Sexual and Asexual propapagation.pptx
 
Graduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - EnglishGraduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - English
 
Towards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptxTowards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.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
 
ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.
 
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Ă...
 
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
 
Wellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptxWellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptx
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdf
 
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
 
Food safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfFood safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdf
 
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptxCOMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
 
Google Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptxGoogle Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.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
 
How to Add New Custom Addons Path in Odoo 17
How to Add New Custom Addons Path in Odoo 17How to Add New Custom Addons Path in Odoo 17
How to Add New Custom Addons Path in Odoo 17
 
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
 

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