barkhauseninstitut.org
M 3 : Taking Microkernels to the Next Level Nils Asmussen FOSDEM, - - PowerPoint PPT Presentation
M 3 : Taking Microkernels to the Next Level Nils Asmussen FOSDEM, - - PowerPoint PPT Presentation
barkhauseninstitut.org M 3 : Taking Microkernels to the Next Level Nils Asmussen FOSDEM, 02/02/2020, Brussels About Me Nils Asmussen PhD last year at the OS chair of the TU Dresden Low-level system programming and microkernels Worked on
About Me
Nils Asmussen PhD last year at the OS chair of the TU Dresden Low-level system programming and microkernels Worked on several microkernel-based OSes in the past
Escape, own hobby OS (presented here in 2013): https://github.com/Nils-TUD/Escape NRE, userland for NOVA: https://github.com/TUD-OS/NRE M3, presented today: https://github.com/TUD-OS/M3
Since 2019 at the Barkhausen Institut
2 / 23
Barkhausen Institut
Research institute in Dresden, founded end of 2017 Currently about 30 people Low-latency and secure IoT systems Focus on research and demonstrators
2 / 23
Barkhausen Institut
Research institute in Dresden, founded end of 2017 Currently about 30 people Low-latency and secure IoT systems Focus on research and demonstrators Wireless RF Design Privacy Lab MPSoC OS
1 / 23
Motivation
Microkernel-based systems have proven valuable for several objectives
Security Robustness Real time Flexibility
Recently, new challenges are coming from the hardware side
Heterogeneous systems Third-party components Security issues of complex general-purpose cores
2 / 23
Heterogeneous Systems
Demanded by performance and energy requirements Big challenge for OSes: single shared kernel on all cores does no longer work OSes need to be prepared for processing elements with different feature sets
3 / 23
Third-party Components
Market pressure forces us to integrate third-party components We should not trust these components Currently, ofen no isolation between them Bug in such a component can compromise whole system (see Broadcom incident)
4 / 23
Security Issues of Complex General-purpose Cores
20 known atacks (and counting ...) Allow to leak private data, sometimes bypassing all security measures of the core Mitigations exist, but these are complex and costly These security holes have been lurking in CPUs for many years Should we still trust these complex cores to properly enforce the isolation between different sofware components?
5 / 23
Microkernel-based System as Foundation
Microkernel Core Core Core Service Service Application Application
6 / 23
Microkernel-based System as Foundation
Microkernel Core Core Core Service Service Application Application Management
6 / 23
Microkernel-based System as Foundation
Microkernel Core Core Core Service Service Application Application Management Enforcement
6 / 23
Microkernel-based System as Foundation
Microkernel Core Core Core Service Service Application Application Management Enforcement FPGA TPU GPU
6 / 23
Outline 1 The New System Architecture 2 M3: The Operating System 3 What are the Benefits?
7 / 23
Outline 1 The New System Architecture 2 M3: The Operating System 3 What are the Benefits?
8 / 23
Hardware/Operating System Co-Design
9 / 23
Hardware/Operating System Co-Design
Core Core Core GPU FPGA TPU
9 / 23
Hardware/Operating System Co-Design
Core Core Core GPU FPGA TPU
9 / 23
Hardware/Operating System Co-Design
Core Core Core GPU FPGA TPU TCU TCU TCU TCU TCU TCU Key ideas: TCU as new hardware component
9 / 23
Hardware/Operating System Co-Design
Core Core Core GPU FPGA TPU TCU TCU TCU TCU TCU TCU Key ideas: TCU as new hardware component
9 / 23
Hardware/Operating System Co-Design
Core Core Core GPU FPGA TPU TCU TCU TCU TCU TCU TCU Serv Kernel App App Serv App Key ideas: TCU as new hardware component Kernel on dedicated PE
9 / 23
Hardware/Operating System Co-Design
Core Core Core GPU FPGA TPU TCU TCU TCU TCU TCU TCU Serv Kernel App App Serv App Manage Enforce Enforce Enforce Enforce Enforce Enforce Key ideas: TCU as new hardware component Kernel on dedicated PE Kernel manages, TCU enforces
9 / 23
Hardware/Operating System Co-Design
Core Core Core GPU FPGA TPU TCU TCU TCU TCU TCU TCU Serv Kernel App App Serv App Takes µ-kernels to the next level: TCU as secure foundation
9 / 23
Hardware/Operating System Co-Design
Core Core Core GPU FPGA TPU TCU TCU TCU TCU TCU TCU Serv Kernel App App Serv App Takes µ-kernels to the next level: TCU as secure foundation Heterogeneity: Uniform interface
9 / 23
Hardware/Operating System Co-Design
Core Core Core GPU FPGA TPU TCU TCU TCU TCU TCU TCU Serv Kernel App App Serv App Takes µ-kernels to the next level: TCU as secure foundation Heterogeneity: Uniform interface Untrusted HW comp.: Protected by TCU
9 / 23
Hardware/Operating System Co-Design
Core Core Core GPU FPGA TPU TCU TCU TCU TCU TCU TCU Serv Kernel App App Serv App Takes µ-kernels to the next level: TCU as secure foundation Heterogeneity: Uniform interface Untrusted HW comp.: Protected by TCU Side channels: Physical isolation
9 / 23
Communication
Core Core Core GPU DRAM TPU Serv Kernel App App App TCU TCU TCU TCU TCU
M
TCU provides endpoints to: Access memory (contiguous range, byte granular)
10 / 23
Communication
Core Core Core GPU DRAM TPU Serv Kernel App App App TCU TCU TCU TCU TCU
M S R S R
TCU provides endpoints to: Access memory (contiguous range, byte granular) Receive messages into a receive buffer Send messages to a receiving endpoint
10 / 23
Communication
Core Core Core GPU DRAM TPU Serv Kernel App App App TCU TCU TCU TCU TCU
M S R S R
TCU provides endpoints to: Access memory (contiguous range, byte granular) Receive messages into a receive buffer Send messages to a receiving endpoint Replies for RPC
10 / 23
Isolation
User tile TCU Kernel tile TCU User tile TCU User tile TCU User tile TCU Core Core Core GPU DRAM TPU Serv Kernel App App App TCU-based isolation: Additional protection layer
11 / 23
Isolation
User tile TCU Kernel tile TCU User tile TCU User tile TCU User tile TCU Core Core Core GPU DRAM TPU Serv Kernel App App App TCU-based isolation: Additional protection layer
11 / 23
Isolation
User tile TCU Kernel tile TCU User tile TCU User tile TCU User tile TCU Core Core Core GPU DRAM TPU Serv Kernel App App App
M S R S R
TCU-based isolation: Additional protection layer Only kernel tile can establish communication channels
11 / 23
Isolation
User tile TCU Kernel tile TCU User tile TCU User tile TCU User tile TCU Core Core Core GPU DRAM TPU Serv Kernel App App App
M S R S R
TCU-based isolation: Additional protection layer Only kernel tile can establish communication channels User tiles can only use established channels
11 / 23
Outline 1 The New System Architecture 2 M3: The Operating System 3 What are the Benefits?
12 / 23
OS Design
M3: Microkernel-based system for het. manycores (or L4 ± 1) Implemented from scratch in Rust and C++ Drivers, filesystems, etc. implemented on user tiles Kernel manages permissions, using capabilities TCU enforces permissions (communication, memory access) Kernel is independent of other tiles Kernel M3FS pipes App App App
13 / 23
M3 System Call
User tile PE TCU Kernel tile PE TCU Kernel App
R
14 / 23
M3 System Call
User tile PE TCU Kernel tile PE TCU Kernel App
R S
14 / 23
M3 System Call
User tile PE TCU Kernel tile PE TCU Kernel App
R S
14 / 23
M3 System Call
User tile PE TCU Kernel tile PE TCU Kernel App
R S
14 / 23
M3 System Call
User tile PE TCU Kernel tile PE TCU Kernel App
R S
14 / 23
OS Service Access
Client Server DRAM TCU TCU
15 / 23
OS Service Access
Client Server DRAM TCU TCU File Protocol: Used for: files, pipes, ...
15 / 23
OS Service Access
Client Server DRAM TCU TCU File Protocol: Used for: files, pipes, ... Data in memory
15 / 23
OS Service Access
Client Server DRAM TCU TCU S R req(in/out) resp(pos,len) File Protocol: Used for: files, pipes, ... Data in memory Msg channel between client and server
req(in) for next input piece req(out) for next output piece
15 / 23
OS Service Access
Client Server DRAM TCU TCU S R req(in/out) resp(pos,len) M File Protocol: Used for: files, pipes, ... Data in memory Msg channel between client and server
req(in) for next input piece req(out) for next output piece
Server configures client’s memory EP
15 / 23
OS Service Access
Client Server DRAM TCU TCU S R req(in/out) resp(pos,len) M File Protocol: Used for: files, pipes, ... Data in memory Msg channel between client and server
req(in) for next input piece req(out) for next output piece
Server configures client’s memory EP Client accesses data via TCU
15 / 23
Outline 1 The New System Architecture 2 M3: The Operating System 3 What are the Benefits?
16 / 23
Example System
TCU TCU TCU TCU TCU TCU Core Core Core Core Core 5G Kernel
17 / 23
Example System
TCU TCU TCU TCU TCU TCU Core Core Core Core Core 5G Kernel Control Monitor FS Net
17 / 23
Example System
TCU TCU TCU TCU TCU TCU Core Core Core Core Core 5G Kernel Control Monitor FS Net
17 / 23
Example System – TCB
TCU TCU TCU TCU TCU TCU Core Core Core Core Core 5G Kernel Control Monitor FS Net TCU TCU TCU TCU TCU TCU Core Core Core Core Core 5G Kernel Control Monitor FS Net
18 / 23
Example System – TCB
TCU TCU TCU TCU TCU TCU Core Core Core Core Core 5G Kernel Control Monitor FS Net TCU TCU TCU TCU TCU TCU Core Core Core Core Core 5G Kernel Control Monitor FS Net TCU TCU TCU TCU TCU TCU Core Core Core Core Core 5G Kernel Control Monitor FS Net Control
18 / 23
Example System – TCB
TCU TCU TCU TCU TCU TCU Core Core Core Core Core 5G Kernel Control Monitor FS Net TCU TCU TCU TCU TCU TCU Core Core Core Core Core 5G Kernel Control Monitor FS Net TCU TCU TCU TCU TCU TCU Core Core Core Core Core 5G Kernel Control Monitor FS Net Monitor
18 / 23
Example System – Untrusted Core
TCU TCU TCU TCU TCU TCU Core Core OoO Core Core 5G Kernel Data Control Monitor FS Data Net
19 / 23
Example System – Untrusted Core
TCU TCU TCU TCU TCU TCU Core Core OoO Core Core 5G Kernel Data Control Monitor FS Data Net
19 / 23
Example System – Sharing (WIP)
TCU TCU TCU TCU TCU Core Core Core Core 5G Kernel Data Control Mux FS Monitor Net
20 / 23
Prototype Platforms
gem5 simulator
21 / 23
Prototype Platforms
gem5 simulator FPGA
21 / 23
Demo
22 / 23
barkhauseninstitut.org
Summary
Microkernels are great! Their ideas can also be applied to hardware:
Trusted communication unit per tile Isolated sofware and hardware components on top
Has several additional benefits:
Allows to securely integrate untrusted third-party components Prevents (known) side-channel atacks by physical isolation Simplifies heterogeneous systems by uniform interface
M3 is available at https://github.com/TUD-OS/M3, gem5 extensions at https://github.com/TUD-OS/gem5-dtu