SlideShare una empresa de Scribd logo
1 de 75
Descargar para leer sin conexión
OSb: OSv on BitVisor 
@ysmoo 
Saturday, October 18, 14
BitVisor 
App App App 
BitVisor 
Hardware 
OS 
http://www.justis.as-1.co.jp 
Saturday, October 18, 14
OSv 
VMM 
Hardware 
App 
OSv 
http://medical-care.feed.jp 
Saturday, October 18, 14
BitVisor 
Saturday, October 18, 14
BitVisor OSv 
Saturday, October 18, 14
BitVisor OSv 
http://www.root.ne.jp/nishide/shs/ 
Saturday, October 18, 14
OSv on BitVisor 
BitVisor 
Hardware 
App 
OSv 
Saturday, October 18, 14
OSv on BitVisor 
BitVisor 
Hardware 
App 
OSv 
OSb 
Saturday, October 18, 14
OSv on BitVisor 
BitVisor 
Hardware 
App 
OSv 
What the fuck 
no Virtio ! 
OSb 
Physical interface 
sucks ! 
What the hell is 
PRO/1000 ! 
Saturday, October 18, 14
OSv on BitVisor 
BitVisor 
Hardware 
App 
OSv 
What the fuck 
no Virtio ! 
OSb 
Physical interface 
sucks ! 
What the hell is 
PRO/1000 ! 
You have no choice. 
Virtio 
Saturday, October 18, 14
~ The road to OSb ~ 
Saturday, October 18, 14
OSv code reading 
• Boot process 
• Some drivers 
Saturday, October 18, 14
OSv code reading 
• Boot process 
• Some drivers 
- MBR 
- Read local disk with INT13/42. 
- Load command line, boot loader, OSv kernel. 
- Get memory map with INT15/E820. 
- Setup segment descriptors/page tables. 
- Switch to 64-bit mode. 
- premain() 
- main() 
... 
Saturday, October 18, 14
OSv code reading 
• Boot process 
• Some drivers 
- MBR 
- Read local disk with INT13/42. 
- Load command line, boot loader, OSv kernel. 
- Get memory map with INT15/E820. 
- Setup segment descriptors/page tables. 
- Switch to 64-bit mode. 
- premain() 
- main() 
... 
- Serial / VGA output. 
- SATA. 
- Virtio NIC/BLK/RNG/SCSI. 
- ACPI. 
- APIC. 
... 
Saturday, October 18, 14
OSv code reading 
• Boot process 
• Some drivers 
- MBR 
- Read local disk with INT13/42. 
- Load command line, boot loader, OSv kernel. 
- Get memory map with INT15/E820. 
- Setup segment descriptors/page tables. 
- Switch to 64-bit mode. 
- premain() 
- main() 
... 
- Serial / VGA output. 
- SATA. 
- Virtio NIC/BLK/RNG/SCSI. 
- ACPI. 
- APIC. 
... 
Straightforward... 
Saturday, October 18, 14
Booting OSb 
./scripts/run.py 
Saturday, October 18, 14
Booting OSb 
In the case of normal OSv... 
./scripts/run.py 
OSv 
VMM 
Saturday, October 18, 14
Booting OSb 
Hardware 
./scripts/run.py 
Saturday, October 18, 14
Booting OSb 
Hardware 
./scripts/run.py 
Image 
Update 
Saturday, October 18, 14
Booting OSb 
Hardware 
./scripts/run.py 
Image 
Update 
IPMI 
Saturday, October 18, 14
Booting OSb 
Hardware 
./scripts/run.py 
Image 
Update 
PXE Boot 
IPMI 
Saturday, October 18, 14
Booting OSb 
Hardware 
./scripts/run.py 
Image 
Update 
PXE Boot 
IPMI 
BitVisor 
Saturday, October 18, 14
Booting OSb 
Hardware 
./scripts/run.py 
Image 
Update 
PXE Boot 
IPMI 
BitVisor 
OSv 
Network Boot 
Saturday, October 18, 14
Booting OSb 
Hardware 
./scripts/run.py 
Image 
Update 
PXE Boot 
IPMI 
BitVisor 
OSv 
Network Boot 
App 
Saturday, October 18, 14
Booting OSb 
BitVisor 
Hardware 
App 
OSv 
Network Boot 
IPMI 
./scripts/run.py 
TTY 
Image 
Update 
PXE Boot 
Saturday, October 18, 14
ACPI workaround 
drivers/acpi.cc: 
// Copy the root table list to dynamic memory 
if (!is_bitvisor()) { 
status = AcpiReallocateRootTable(); 
if (ACPI_FAILURE(status)) { 
acpi_e("AcpiReallocateRootTable failed: %sn", 
AcpiFormatException(status)); 
return; 
} 
} 
Saturday, October 18, 14
ACPI workaround 
drivers/acpi.cc: 
// Copy the root table list to dynamic memory 
if (!is_bitvisor()) { 
status = AcpiReallocateRootTable(); 
if (ACPI_FAILURE(status)) { 
acpi_e("AcpiReallocateRootTable failed: %sn", 
AcpiFormatException(status)); 
return; 
} 
} 
Triple fault 
Saturday, October 18, 14
ACPI workaround 
drivers/acpi.cc: 
// Copy the root table list to dynamic memory 
if (!is_bitvisor()) { 
status = AcpiReallocateRootTable(); 
if (ACPI_FAILURE(status)) { 
acpi_e("AcpiReallocateRootTable failed: %sn", 
AcpiFormatException(status)); 
return; 
} 
} 
Triple fault 
Skip in case of OSb 
Saturday, October 18, 14
ACPI workaround 
drivers/acpi.cc: 
// Copy the root table list to dynamic memory 
if (!is_bitvisor()) { 
status = AcpiReallocateRootTable(); 
if (ACPI_FAILURE(status)) { 
acpi_e("AcpiReallocateRootTable failed: %sn", 
AcpiFormatException(status)); 
return; 
} 
} 
Triple fault 
Skip in case of OSb 
Machine-specific...? 
Saturday, October 18, 14
Hello world ! 
Saturday, October 18, 14
Performance? 
20.75& 21.20& 
25.00& 
20.00& 
15.00& 
10.00& 
5.00& 
0.00& 
OSb& OSv& 
Elapsed(Time((sec) 
for((12(billion(6mes)(val++; 
Saturday, October 18, 14
Virtio NIC 
BitVisor 
Hardware 
App Actually PRO/1000... 
OSv 
Saturday, October 18, 14
Virtio NIC 
BitVisor 
Hardware 
App 
OSv 
Virtio NIC 
Actually PRO/1000... 
Fake Virtio NIC... 
Saturday, October 18, 14
Virtio NIC 
BitVisor 
Hardware 
App 
OSv 
Virtio NIC 
Actually PRO/1000... 
Fake Virtio NIC... 
Hook PCI config access, MMIO, PIO and fake! 
Saturday, October 18, 14
Faking 
PCI configuration space 
• Faking IDs 
• Faking BARs 
• Faking capabilities 
Saturday, October 18, 14
Faking IDs 0x1AF4 
(Virtio Device) 
Saturday, October 18, 14
Faking IDs 0x1AF4 
(Virtio Device) 
0x1000 
(Virtio NIC) 
Saturday, October 18, 14
Faking IDs 0x1AF4 
(Virtio Device) 
0x1000 
(Virtio NIC) 
0 (Legacy Virtio) 
Saturday, October 18, 14
Faking IDs 0x1AF4 
(Virtio Device) 
0x1000 
(Virtio NIC) 
0 (Legacy Virtio) 
1 (Virtio NIC) 
Saturday, October 18, 14
Faking BARs 
BAR0: IO space 
for Virtio 
BAR1: MMIO space 
for MSI-X 
Saturday, October 18, 14
Faking BARs 
BAR0: IO space 
for Virtio 
BAR1: MMIO space 
for MSI-X 
= PRO/1000 IO space 
Saturday, October 18, 14
Faking BARs 
BAR0: IO space 
for Virtio 
BAR1: MMIO space 
for MSI-X 
= PRO/1000 IO space 
= PRO/1000 MMIO space 
Saturday, October 18, 14
Faking capabilities 
Add MSI-X 
capability 
Saturday, October 18, 14
Faking capabilities 
Add MSI-X 
capability Support 
3 vectors 
Saturday, October 18, 14
Faking capabilities 
Add MSI-X 
capability Support 
3 vectors 
Vector 0: 
Reception 
Saturday, October 18, 14
Faking capabilities 
Add MSI-X 
capability Support 
3 vectors 
Vector 0: 
Reception 
Vector 1: 
Transmission 
Saturday, October 18, 14
Faking capabilities 
Add MSI-X 
capability Support 
3 vectors 
Vector 0: 
Reception 
Vector 1: 
Transmission 
Vector 2: 
Control 
Saturday, October 18, 14
Virtio NIC Operations 
• Virtio ring 
• Packet transmission 
• Packet reception 
Saturday, October 18, 14
Virtio ring 
Controlled by 
these registers 
BAR0 
(IO) 
Saturday, October 18, 14
Virtio ring 
Controlled by 
these registers 
3 rings 
available 
BAR0 
(IO) 
Saturday, October 18, 14
Virtio ring 
BAR0 Ring 0: Reception 
(IO) 
Controlled by 
these registers 
3 rings 
available 
Saturday, October 18, 14
Virtio ring 
Controlled by 
these registers 
3 rings 
available 
Ring 0: Reception 
Ring 1: Transmission 
BAR0 
(IO) 
Saturday, October 18, 14
Virtio ring 
Controlled by 
these registers 
3 rings 
available 
Ring 0: Reception 
Ring 1: Transmission 
Ring 2: Control 
BAR0 
(IO) 
Saturday, October 18, 14
Virtio ring 
Controlled by 
these registers 
3 rings 
available 
Ring 0: Reception 
Ring 1: Transmission 
Ring 2: Control 
BAR0 
(IO) 
(Memory) 
Saturday, October 18, 14
Virtio ring 
Controlled by 
these registers 
3 rings 
available 
Ring 0: Reception 
Ring 1: Transmission 
Ring 2: Control 
BAR0 
(IO) 
(Memory) 
Driver 2 Device 
Device 2 Driver 
Saturday, October 18, 14
Packet transmission 
OSv 
(Driver) 
BitVisor 
(Device) 
PRO/1000 
Saturday, October 18, 14
Packet transmission 
OSv 
(Driver) 
BitVisor 
(Device) 
Req. 
PRO/1000 
Req. Req. 
Saturday, October 18, 14
Packet transmission 
OSv 
(Driver) 
BitVisor 
(Device) 
Req. 
PRO/1000 
Req. Req. 
Req. Req. Req. 
Saturday, October 18, 14
Packet transmission 
OSv 
(Driver) 
BitVisor 
(Device) 
Req. 
PRO/1000 
Req. 
TX Ring 
Req. 
Req. Req. Req. 
Req. Req. Req. 
Saturday, October 18, 14
Packet transmission 
OSv 
(Driver) 
BitVisor 
(Device) 
Req. 
PRO/1000 
Req. 
TX Ring 
Req. 
Req. Req. Req. 
Req. Req. Req. 
Req. 
Saturday, October 18, 14
Packet transmission 
OSv 
(Driver) 
BitVisor 
(Device) 
Req. 
PRO/1000 
Req. 
TX Ring 
Req. 
Req. Req. Req. 
Req. Req. Req. 
Req. 
Notify! 
(PIO) 
Saturday, October 18, 14
Packet transmission 
OSv 
(Driver) 
BitVisor 
(Device) 
Req. 
PRO/1000 
Req. 
TX Ring 
Req. 
Req. Req. Req. 
Req. Req. Req. 
Req. 
Notify! 
(PIO) 
Req. 
Req. 
Saturday, October 18, 14
Packet transmission 
OSv 
(Driver) 
BitVisor 
(Device) 
Req. 
PRO/1000 
Req. 
TX Ring 
Req. 
Req. Req. Req. 
Req. Req. Req. 
Req. 
Notify! 
(PIO) 
Req. 
Req. 
Saturday, October 18, 14
Packet transmission 
OSv 
(Driver) 
BitVisor 
(Device) 
Req. 
PRO/1000 
Req. 
TX Ring 
Req. 
Req. Req. Req. 
Req. Req. Req. 
Req. 
Notify! 
(PIO) 
Req. 
Req. 
Reuse 
Saturday, October 18, 14
Packet reception 
OSv 
(Driver) 
BitVisor 
(Device) 
Buf. 
PRO/1000 
Buf. 
RX Ring 
Buf. 
Buf. Buf. Buf. 
Buf. Buf. Buf. 
Saturday, October 18, 14
Packet reception 
OSv 
(Driver) 
BitVisor 
(Device) 
Buf. 
PRO/1000 
Buf. 
RX Ring 
Buf. 
Buf. Buf. Buf. 
Buf. Buf. Buf. 
Buf. 
Saturday, October 18, 14
Packet reception 
OSv 
(Driver) 
BitVisor 
(Device) 
Buf. 
PRO/1000 
Buf. 
RX Ring 
Buf. 
Buf. Buf. Buf. 
Buf. Buf. Buf. 
Buf. 
Buf. 
Saturday, October 18, 14
Packet reception 
OSv 
(Driver) 
BitVisor 
(Device) 
Buf. 
PRO/1000 
Buf. 
RX Ring 
Buf. 
Buf. Buf. Buf. 
Buf. Buf. Buf. 
Buf. 
Buf. 
Buf. 
Saturday, October 18, 14
Packet reception 
OSv 
(Driver) 
BitVisor 
(Device) 
Buf. 
PRO/1000 
Buf. 
RX Ring 
Buf. 
Buf. Buf. Buf. 
Buf. Buf. Buf. 
Buf. 
Buf. 
Buf. 
Saturday, October 18, 14
Packet reception 
OSv 
(Driver) 
BitVisor 
(Device) 
Buf. 
PRO/1000 
Buf. 
RX Ring 
Buf. 
Buf. Buf. Buf. 
Buf. Buf. Buf. 
Buf. 
Buf. 
Buf. 
Int! 
Saturday, October 18, 14
Packet reception 
OSv 
(Driver) 
BitVisor 
(Device) 
Buf. 
PRO/1000 
Buf. 
RX Ring 
Buf. 
Buf. Buf. Buf. 
Buf. Buf. Buf. 
Buf. 
Int! 
Buf. 
Buf. 
Receive 
Saturday, October 18, 14
Interrupt BAR1 
(MMIO) 
MSI-X Message Data: 
Int. vector number (e.g. 0x26) 
VMX event injection 
for virtual interrupts 
Saturday, October 18, 14
DHCP succeeded ! 
Saturday, October 18, 14
Summary  
future work 
• Summary 
• Booting OSv on BitVisor 
• Virtio NIC 
• Future work 
• Further testing 
• Virtio BLK/RNG/... 
Saturday, October 18, 14
Thank you ! 
http://www.root.ne.jp/nishide/shs/ 
Saturday, October 18, 14

Más contenido relacionado

La actualidad más candente

Unveiling EMUX - ARM and MIPS IoT Emulation Framework
Unveiling EMUX - ARM and MIPS IoT Emulation FrameworkUnveiling EMUX - ARM and MIPS IoT Emulation Framework
Unveiling EMUX - ARM and MIPS IoT Emulation FrameworkSaumil Shah
 
What's New in ES6 for Web Devs
What's New in ES6 for Web DevsWhat's New in ES6 for Web Devs
What's New in ES6 for Web DevsRami Sayar
 
Hack.LU 2018 ARM IoT Firmware Emulation Workshop
Hack.LU 2018 ARM IoT Firmware Emulation WorkshopHack.LU 2018 ARM IoT Firmware Emulation Workshop
Hack.LU 2018 ARM IoT Firmware Emulation WorkshopSaumil Shah
 
Stm32 develop tool introduction
Stm32 develop tool introductionStm32 develop tool introduction
Stm32 develop tool introduction冠宇 陳
 
INSIDE ARM-X Cansecwest 2020
INSIDE ARM-X Cansecwest 2020INSIDE ARM-X Cansecwest 2020
INSIDE ARM-X Cansecwest 2020Saumil Shah
 
Introducing ARM-X
Introducing ARM-XIntroducing ARM-X
Introducing ARM-XSaumil Shah
 
IoT Chess 16th April Berlin
IoT Chess 16th April BerlinIoT Chess 16th April Berlin
IoT Chess 16th April BerlinLars Gregori
 
Retrospective: Seven VM Engineering Years
Retrospective: Seven VM Engineering YearsRetrospective: Seven VM Engineering Years
Retrospective: Seven VM Engineering YearsESUG
 
Kernel Recipes 2013 - kconfig-frontends, a packaging of the kconfig parser an...
Kernel Recipes 2013 - kconfig-frontends, a packaging of the kconfig parser an...Kernel Recipes 2013 - kconfig-frontends, a packaging of the kconfig parser an...
Kernel Recipes 2013 - kconfig-frontends, a packaging of the kconfig parser an...Anne Nicolas
 
Internet Technology for the Commodore 64
Internet Technology for the Commodore 64Internet Technology for the Commodore 64
Internet Technology for the Commodore 64Leif Bloomquist
 
Control-M 800 - Infrastructure Example
Control-M 800 - Infrastructure ExampleControl-M 800 - Infrastructure Example
Control-M 800 - Infrastructure ExampleOhio University
 
Vm ware fuzzing - defcon russia 20
Vm ware fuzzing  - defcon russia 20Vm ware fuzzing  - defcon russia 20
Vm ware fuzzing - defcon russia 20DefconRussia
 
Mikhail Belopuhov: OpenBSD: Where is crypto headed?
Mikhail Belopuhov: OpenBSD: Where is crypto headed?Mikhail Belopuhov: OpenBSD: Where is crypto headed?
Mikhail Belopuhov: OpenBSD: Where is crypto headed?Yandex
 
ARM IoT Firmware Emulation Workshop
ARM IoT Firmware Emulation WorkshopARM IoT Firmware Emulation Workshop
ARM IoT Firmware Emulation WorkshopSaumil Shah
 
【Manifes2018】私が考えるPCの"最新"学習方法
【Manifes2018】私が考えるPCの"最新"学習方法【Manifes2018】私が考えるPCの"最新"学習方法
【Manifes2018】私が考えるPCの"最新"学習方法竹田 大将
 
DOD 2016 - Ignat Korchagin - Managing Server Secrets at Scale
DOD 2016 - Ignat Korchagin - Managing Server Secrets at ScaleDOD 2016 - Ignat Korchagin - Managing Server Secrets at Scale
DOD 2016 - Ignat Korchagin - Managing Server Secrets at ScalePROIDEA
 
VA-API rust-binding (GStreamer Conference 2017)
VA-API rust-binding (GStreamer Conference 2017)VA-API rust-binding (GStreamer Conference 2017)
VA-API rust-binding (GStreamer Conference 2017)Igalia
 
[5]投影片 futurewad樹莓派研習會 141218
[5]投影片 futurewad樹莓派研習會 141218[5]投影片 futurewad樹莓派研習會 141218
[5]投影片 futurewad樹莓派研習會 141218CAVEDU Education
 

La actualidad más candente (18)

Unveiling EMUX - ARM and MIPS IoT Emulation Framework
Unveiling EMUX - ARM and MIPS IoT Emulation FrameworkUnveiling EMUX - ARM and MIPS IoT Emulation Framework
Unveiling EMUX - ARM and MIPS IoT Emulation Framework
 
What's New in ES6 for Web Devs
What's New in ES6 for Web DevsWhat's New in ES6 for Web Devs
What's New in ES6 for Web Devs
 
Hack.LU 2018 ARM IoT Firmware Emulation Workshop
Hack.LU 2018 ARM IoT Firmware Emulation WorkshopHack.LU 2018 ARM IoT Firmware Emulation Workshop
Hack.LU 2018 ARM IoT Firmware Emulation Workshop
 
Stm32 develop tool introduction
Stm32 develop tool introductionStm32 develop tool introduction
Stm32 develop tool introduction
 
INSIDE ARM-X Cansecwest 2020
INSIDE ARM-X Cansecwest 2020INSIDE ARM-X Cansecwest 2020
INSIDE ARM-X Cansecwest 2020
 
Introducing ARM-X
Introducing ARM-XIntroducing ARM-X
Introducing ARM-X
 
IoT Chess 16th April Berlin
IoT Chess 16th April BerlinIoT Chess 16th April Berlin
IoT Chess 16th April Berlin
 
Retrospective: Seven VM Engineering Years
Retrospective: Seven VM Engineering YearsRetrospective: Seven VM Engineering Years
Retrospective: Seven VM Engineering Years
 
Kernel Recipes 2013 - kconfig-frontends, a packaging of the kconfig parser an...
Kernel Recipes 2013 - kconfig-frontends, a packaging of the kconfig parser an...Kernel Recipes 2013 - kconfig-frontends, a packaging of the kconfig parser an...
Kernel Recipes 2013 - kconfig-frontends, a packaging of the kconfig parser an...
 
Internet Technology for the Commodore 64
Internet Technology for the Commodore 64Internet Technology for the Commodore 64
Internet Technology for the Commodore 64
 
Control-M 800 - Infrastructure Example
Control-M 800 - Infrastructure ExampleControl-M 800 - Infrastructure Example
Control-M 800 - Infrastructure Example
 
Vm ware fuzzing - defcon russia 20
Vm ware fuzzing  - defcon russia 20Vm ware fuzzing  - defcon russia 20
Vm ware fuzzing - defcon russia 20
 
Mikhail Belopuhov: OpenBSD: Where is crypto headed?
Mikhail Belopuhov: OpenBSD: Where is crypto headed?Mikhail Belopuhov: OpenBSD: Where is crypto headed?
Mikhail Belopuhov: OpenBSD: Where is crypto headed?
 
ARM IoT Firmware Emulation Workshop
ARM IoT Firmware Emulation WorkshopARM IoT Firmware Emulation Workshop
ARM IoT Firmware Emulation Workshop
 
【Manifes2018】私が考えるPCの"最新"学習方法
【Manifes2018】私が考えるPCの"最新"学習方法【Manifes2018】私が考えるPCの"最新"学習方法
【Manifes2018】私が考えるPCの"最新"学習方法
 
DOD 2016 - Ignat Korchagin - Managing Server Secrets at Scale
DOD 2016 - Ignat Korchagin - Managing Server Secrets at ScaleDOD 2016 - Ignat Korchagin - Managing Server Secrets at Scale
DOD 2016 - Ignat Korchagin - Managing Server Secrets at Scale
 
VA-API rust-binding (GStreamer Conference 2017)
VA-API rust-binding (GStreamer Conference 2017)VA-API rust-binding (GStreamer Conference 2017)
VA-API rust-binding (GStreamer Conference 2017)
 
[5]投影片 futurewad樹莓派研習會 141218
[5]投影片 futurewad樹莓派研習會 141218[5]投影片 futurewad樹莓派研習會 141218
[5]投影片 futurewad樹莓派研習會 141218
 

Último

Processing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptxProcessing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptxpranjaldaimarysona
 
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Dr.Costas Sachpazis
 
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
 
Introduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptxIntroduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptxupamatechverse
 
Introduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxIntroduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxupamatechverse
 
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Christo Ananth
 
Porous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writingPorous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writingrakeshbaidya232001
 
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...ranjana rawat
 
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCollege Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCall Girls in Nagpur High Profile
 
UNIT-III FMM. DIMENSIONAL ANALYSIS
UNIT-III FMM.        DIMENSIONAL ANALYSISUNIT-III FMM.        DIMENSIONAL ANALYSIS
UNIT-III FMM. DIMENSIONAL ANALYSISrknatarajan
 
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...Call Girls in Nagpur High Profile
 
University management System project report..pdf
University management System project report..pdfUniversity management System project report..pdf
University management System project report..pdfKamal Acharya
 
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...ranjana rawat
 
Booking open Available Pune Call Girls Pargaon 6297143586 Call Hot Indian Gi...
Booking open Available Pune Call Girls Pargaon  6297143586 Call Hot Indian Gi...Booking open Available Pune Call Girls Pargaon  6297143586 Call Hot Indian Gi...
Booking open Available Pune Call Girls Pargaon 6297143586 Call Hot Indian Gi...Call Girls in Nagpur High Profile
 
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
 
result management system report for college project
result management system report for college projectresult management system report for college project
result management system report for college projectTonystark477637
 
UNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its PerformanceUNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its Performancesivaprakash250
 
MANUFACTURING PROCESS-II UNIT-1 THEORY OF METAL CUTTING
MANUFACTURING PROCESS-II UNIT-1 THEORY OF METAL CUTTINGMANUFACTURING PROCESS-II UNIT-1 THEORY OF METAL CUTTING
MANUFACTURING PROCESS-II UNIT-1 THEORY OF METAL CUTTINGSIVASHANKAR N
 
Coefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxCoefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxAsutosh Ranjan
 

Último (20)

Processing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptxProcessing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptx
 
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
 
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
 
Introduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptxIntroduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptx
 
Introduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxIntroduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptx
 
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
 
Porous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writingPorous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writing
 
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...
 
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCollege Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
 
UNIT-III FMM. DIMENSIONAL ANALYSIS
UNIT-III FMM.        DIMENSIONAL ANALYSISUNIT-III FMM.        DIMENSIONAL ANALYSIS
UNIT-III FMM. DIMENSIONAL ANALYSIS
 
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...
 
(INDIRA) Call Girl Aurangabad Call Now 8617697112 Aurangabad Escorts 24x7
(INDIRA) Call Girl Aurangabad Call Now 8617697112 Aurangabad Escorts 24x7(INDIRA) Call Girl Aurangabad Call Now 8617697112 Aurangabad Escorts 24x7
(INDIRA) Call Girl Aurangabad Call Now 8617697112 Aurangabad Escorts 24x7
 
University management System project report..pdf
University management System project report..pdfUniversity management System project report..pdf
University management System project report..pdf
 
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
 
Booking open Available Pune Call Girls Pargaon 6297143586 Call Hot Indian Gi...
Booking open Available Pune Call Girls Pargaon  6297143586 Call Hot Indian Gi...Booking open Available Pune Call Girls Pargaon  6297143586 Call Hot Indian Gi...
Booking open Available Pune Call Girls Pargaon 6297143586 Call Hot Indian Gi...
 
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
 
result management system report for college project
result management system report for college projectresult management system report for college project
result management system report for college project
 
UNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its PerformanceUNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its Performance
 
MANUFACTURING PROCESS-II UNIT-1 THEORY OF METAL CUTTING
MANUFACTURING PROCESS-II UNIT-1 THEORY OF METAL CUTTINGMANUFACTURING PROCESS-II UNIT-1 THEORY OF METAL CUTTING
MANUFACTURING PROCESS-II UNIT-1 THEORY OF METAL CUTTING
 
Coefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxCoefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptx
 

Run OSv on BitVisor with a fake Virtio NIC

  • 1. OSb: OSv on BitVisor @ysmoo Saturday, October 18, 14
  • 2. BitVisor App App App BitVisor Hardware OS http://www.justis.as-1.co.jp Saturday, October 18, 14
  • 3. OSv VMM Hardware App OSv http://medical-care.feed.jp Saturday, October 18, 14
  • 5. BitVisor OSv Saturday, October 18, 14
  • 7. OSv on BitVisor BitVisor Hardware App OSv Saturday, October 18, 14
  • 8. OSv on BitVisor BitVisor Hardware App OSv OSb Saturday, October 18, 14
  • 9. OSv on BitVisor BitVisor Hardware App OSv What the fuck no Virtio ! OSb Physical interface sucks ! What the hell is PRO/1000 ! Saturday, October 18, 14
  • 10. OSv on BitVisor BitVisor Hardware App OSv What the fuck no Virtio ! OSb Physical interface sucks ! What the hell is PRO/1000 ! You have no choice. Virtio Saturday, October 18, 14
  • 11. ~ The road to OSb ~ Saturday, October 18, 14
  • 12. OSv code reading • Boot process • Some drivers Saturday, October 18, 14
  • 13. OSv code reading • Boot process • Some drivers - MBR - Read local disk with INT13/42. - Load command line, boot loader, OSv kernel. - Get memory map with INT15/E820. - Setup segment descriptors/page tables. - Switch to 64-bit mode. - premain() - main() ... Saturday, October 18, 14
  • 14. OSv code reading • Boot process • Some drivers - MBR - Read local disk with INT13/42. - Load command line, boot loader, OSv kernel. - Get memory map with INT15/E820. - Setup segment descriptors/page tables. - Switch to 64-bit mode. - premain() - main() ... - Serial / VGA output. - SATA. - Virtio NIC/BLK/RNG/SCSI. - ACPI. - APIC. ... Saturday, October 18, 14
  • 15. OSv code reading • Boot process • Some drivers - MBR - Read local disk with INT13/42. - Load command line, boot loader, OSv kernel. - Get memory map with INT15/E820. - Setup segment descriptors/page tables. - Switch to 64-bit mode. - premain() - main() ... - Serial / VGA output. - SATA. - Virtio NIC/BLK/RNG/SCSI. - ACPI. - APIC. ... Straightforward... Saturday, October 18, 14
  • 16. Booting OSb ./scripts/run.py Saturday, October 18, 14
  • 17. Booting OSb In the case of normal OSv... ./scripts/run.py OSv VMM Saturday, October 18, 14
  • 18. Booting OSb Hardware ./scripts/run.py Saturday, October 18, 14
  • 19. Booting OSb Hardware ./scripts/run.py Image Update Saturday, October 18, 14
  • 20. Booting OSb Hardware ./scripts/run.py Image Update IPMI Saturday, October 18, 14
  • 21. Booting OSb Hardware ./scripts/run.py Image Update PXE Boot IPMI Saturday, October 18, 14
  • 22. Booting OSb Hardware ./scripts/run.py Image Update PXE Boot IPMI BitVisor Saturday, October 18, 14
  • 23. Booting OSb Hardware ./scripts/run.py Image Update PXE Boot IPMI BitVisor OSv Network Boot Saturday, October 18, 14
  • 24. Booting OSb Hardware ./scripts/run.py Image Update PXE Boot IPMI BitVisor OSv Network Boot App Saturday, October 18, 14
  • 25. Booting OSb BitVisor Hardware App OSv Network Boot IPMI ./scripts/run.py TTY Image Update PXE Boot Saturday, October 18, 14
  • 26. ACPI workaround drivers/acpi.cc: // Copy the root table list to dynamic memory if (!is_bitvisor()) { status = AcpiReallocateRootTable(); if (ACPI_FAILURE(status)) { acpi_e("AcpiReallocateRootTable failed: %sn", AcpiFormatException(status)); return; } } Saturday, October 18, 14
  • 27. ACPI workaround drivers/acpi.cc: // Copy the root table list to dynamic memory if (!is_bitvisor()) { status = AcpiReallocateRootTable(); if (ACPI_FAILURE(status)) { acpi_e("AcpiReallocateRootTable failed: %sn", AcpiFormatException(status)); return; } } Triple fault Saturday, October 18, 14
  • 28. ACPI workaround drivers/acpi.cc: // Copy the root table list to dynamic memory if (!is_bitvisor()) { status = AcpiReallocateRootTable(); if (ACPI_FAILURE(status)) { acpi_e("AcpiReallocateRootTable failed: %sn", AcpiFormatException(status)); return; } } Triple fault Skip in case of OSb Saturday, October 18, 14
  • 29. ACPI workaround drivers/acpi.cc: // Copy the root table list to dynamic memory if (!is_bitvisor()) { status = AcpiReallocateRootTable(); if (ACPI_FAILURE(status)) { acpi_e("AcpiReallocateRootTable failed: %sn", AcpiFormatException(status)); return; } } Triple fault Skip in case of OSb Machine-specific...? Saturday, October 18, 14
  • 30. Hello world ! Saturday, October 18, 14
  • 31. Performance? 20.75& 21.20& 25.00& 20.00& 15.00& 10.00& 5.00& 0.00& OSb& OSv& Elapsed(Time((sec) for((12(billion(6mes)(val++; Saturday, October 18, 14
  • 32. Virtio NIC BitVisor Hardware App Actually PRO/1000... OSv Saturday, October 18, 14
  • 33. Virtio NIC BitVisor Hardware App OSv Virtio NIC Actually PRO/1000... Fake Virtio NIC... Saturday, October 18, 14
  • 34. Virtio NIC BitVisor Hardware App OSv Virtio NIC Actually PRO/1000... Fake Virtio NIC... Hook PCI config access, MMIO, PIO and fake! Saturday, October 18, 14
  • 35. Faking PCI configuration space • Faking IDs • Faking BARs • Faking capabilities Saturday, October 18, 14
  • 36. Faking IDs 0x1AF4 (Virtio Device) Saturday, October 18, 14
  • 37. Faking IDs 0x1AF4 (Virtio Device) 0x1000 (Virtio NIC) Saturday, October 18, 14
  • 38. Faking IDs 0x1AF4 (Virtio Device) 0x1000 (Virtio NIC) 0 (Legacy Virtio) Saturday, October 18, 14
  • 39. Faking IDs 0x1AF4 (Virtio Device) 0x1000 (Virtio NIC) 0 (Legacy Virtio) 1 (Virtio NIC) Saturday, October 18, 14
  • 40. Faking BARs BAR0: IO space for Virtio BAR1: MMIO space for MSI-X Saturday, October 18, 14
  • 41. Faking BARs BAR0: IO space for Virtio BAR1: MMIO space for MSI-X = PRO/1000 IO space Saturday, October 18, 14
  • 42. Faking BARs BAR0: IO space for Virtio BAR1: MMIO space for MSI-X = PRO/1000 IO space = PRO/1000 MMIO space Saturday, October 18, 14
  • 43. Faking capabilities Add MSI-X capability Saturday, October 18, 14
  • 44. Faking capabilities Add MSI-X capability Support 3 vectors Saturday, October 18, 14
  • 45. Faking capabilities Add MSI-X capability Support 3 vectors Vector 0: Reception Saturday, October 18, 14
  • 46. Faking capabilities Add MSI-X capability Support 3 vectors Vector 0: Reception Vector 1: Transmission Saturday, October 18, 14
  • 47. Faking capabilities Add MSI-X capability Support 3 vectors Vector 0: Reception Vector 1: Transmission Vector 2: Control Saturday, October 18, 14
  • 48. Virtio NIC Operations • Virtio ring • Packet transmission • Packet reception Saturday, October 18, 14
  • 49. Virtio ring Controlled by these registers BAR0 (IO) Saturday, October 18, 14
  • 50. Virtio ring Controlled by these registers 3 rings available BAR0 (IO) Saturday, October 18, 14
  • 51. Virtio ring BAR0 Ring 0: Reception (IO) Controlled by these registers 3 rings available Saturday, October 18, 14
  • 52. Virtio ring Controlled by these registers 3 rings available Ring 0: Reception Ring 1: Transmission BAR0 (IO) Saturday, October 18, 14
  • 53. Virtio ring Controlled by these registers 3 rings available Ring 0: Reception Ring 1: Transmission Ring 2: Control BAR0 (IO) Saturday, October 18, 14
  • 54. Virtio ring Controlled by these registers 3 rings available Ring 0: Reception Ring 1: Transmission Ring 2: Control BAR0 (IO) (Memory) Saturday, October 18, 14
  • 55. Virtio ring Controlled by these registers 3 rings available Ring 0: Reception Ring 1: Transmission Ring 2: Control BAR0 (IO) (Memory) Driver 2 Device Device 2 Driver Saturday, October 18, 14
  • 56. Packet transmission OSv (Driver) BitVisor (Device) PRO/1000 Saturday, October 18, 14
  • 57. Packet transmission OSv (Driver) BitVisor (Device) Req. PRO/1000 Req. Req. Saturday, October 18, 14
  • 58. Packet transmission OSv (Driver) BitVisor (Device) Req. PRO/1000 Req. Req. Req. Req. Req. Saturday, October 18, 14
  • 59. Packet transmission OSv (Driver) BitVisor (Device) Req. PRO/1000 Req. TX Ring Req. Req. Req. Req. Req. Req. Req. Saturday, October 18, 14
  • 60. Packet transmission OSv (Driver) BitVisor (Device) Req. PRO/1000 Req. TX Ring Req. Req. Req. Req. Req. Req. Req. Req. Saturday, October 18, 14
  • 61. Packet transmission OSv (Driver) BitVisor (Device) Req. PRO/1000 Req. TX Ring Req. Req. Req. Req. Req. Req. Req. Req. Notify! (PIO) Saturday, October 18, 14
  • 62. Packet transmission OSv (Driver) BitVisor (Device) Req. PRO/1000 Req. TX Ring Req. Req. Req. Req. Req. Req. Req. Req. Notify! (PIO) Req. Req. Saturday, October 18, 14
  • 63. Packet transmission OSv (Driver) BitVisor (Device) Req. PRO/1000 Req. TX Ring Req. Req. Req. Req. Req. Req. Req. Req. Notify! (PIO) Req. Req. Saturday, October 18, 14
  • 64. Packet transmission OSv (Driver) BitVisor (Device) Req. PRO/1000 Req. TX Ring Req. Req. Req. Req. Req. Req. Req. Req. Notify! (PIO) Req. Req. Reuse Saturday, October 18, 14
  • 65. Packet reception OSv (Driver) BitVisor (Device) Buf. PRO/1000 Buf. RX Ring Buf. Buf. Buf. Buf. Buf. Buf. Buf. Saturday, October 18, 14
  • 66. Packet reception OSv (Driver) BitVisor (Device) Buf. PRO/1000 Buf. RX Ring Buf. Buf. Buf. Buf. Buf. Buf. Buf. Buf. Saturday, October 18, 14
  • 67. Packet reception OSv (Driver) BitVisor (Device) Buf. PRO/1000 Buf. RX Ring Buf. Buf. Buf. Buf. Buf. Buf. Buf. Buf. Buf. Saturday, October 18, 14
  • 68. Packet reception OSv (Driver) BitVisor (Device) Buf. PRO/1000 Buf. RX Ring Buf. Buf. Buf. Buf. Buf. Buf. Buf. Buf. Buf. Buf. Saturday, October 18, 14
  • 69. Packet reception OSv (Driver) BitVisor (Device) Buf. PRO/1000 Buf. RX Ring Buf. Buf. Buf. Buf. Buf. Buf. Buf. Buf. Buf. Buf. Saturday, October 18, 14
  • 70. Packet reception OSv (Driver) BitVisor (Device) Buf. PRO/1000 Buf. RX Ring Buf. Buf. Buf. Buf. Buf. Buf. Buf. Buf. Buf. Buf. Int! Saturday, October 18, 14
  • 71. Packet reception OSv (Driver) BitVisor (Device) Buf. PRO/1000 Buf. RX Ring Buf. Buf. Buf. Buf. Buf. Buf. Buf. Buf. Int! Buf. Buf. Receive Saturday, October 18, 14
  • 72. Interrupt BAR1 (MMIO) MSI-X Message Data: Int. vector number (e.g. 0x26) VMX event injection for virtual interrupts Saturday, October 18, 14
  • 73. DHCP succeeded ! Saturday, October 18, 14
  • 74. Summary future work • Summary • Booting OSv on BitVisor • Virtio NIC • Future work • Further testing • Virtio BLK/RNG/... Saturday, October 18, 14
  • 75. Thank you ! http://www.root.ne.jp/nishide/shs/ Saturday, October 18, 14