improving interrupt response time in a verifiable protected...

22
Improving Interrupt Response Time in a Verifiable Protected Microkernel Blackham, Bernard and Shi, Yao and Heiser, Gernot EuroSys ‘12 James Marshall, GW-SSL Fall 2013

Upload: others

Post on 01-Mar-2021

2 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Improving Interrupt Response Time in a Verifiable Protected …home.gwu.edu/~jcmarsh/wiki/uploads/Research/seL4.pdf · 2016. 2. 21. · Elphinstone, Kevin, and Gernot Heiser. "From

Improving Interrupt Response Time in a Verifiable Protected MicrokernelBlackham, Bernard and Shi, Yao and Heiser, GernotEuroSys ‘12

James Marshall, GW-SSL Fall 2013

Page 2: Improving Interrupt Response Time in a Verifiable Protected …home.gwu.edu/~jcmarsh/wiki/uploads/Research/seL4.pdf · 2016. 2. 21. · Elphinstone, Kevin, and Gernot Heiser. "From

ResourcesBlackham, Bernard, Yao Shi, and Gernot Heiser. "Improving interrupt response time in a verifiable protected microkernel." Proceedings of the 7th ACM european conference on Computer Systems. ACM, 2012.Elphinstone, Kevin, and Gernot Heiser. "From L3 to seL4 What Have We Learnt in 20 Years of L4 Microkernels?."Mehnert, Frank, Michael Hohmuth, and Hermann Hartig. "Cost and benefit of separate address spaces in real-time operating systems." Real-Time Systems Symposium, 2002. RTSS 2002. 23rd IEEE. IEEE, 2002.Blackham, Bernard, et al. "Timing analysis of a protected operating system kernel." Real-Time Systems Symposium (RTSS), 2011 IEEE 32nd. IEEE, 2011.Blackham, Bernard, Vernon Tang, and Gernot Heiser. "To preempt or not to preempt, that is the question." Proceedings of the Asia-Pacific Workshop on Systems. ACM, 2012.Klein, Gerwin, et al. "seL4: Formal verification of an OS kernel." Proceedings of the ACM SIGOPS 22nd symposium on Operating systems principles. ACM, 2009.

Page 3: Improving Interrupt Response Time in a Verifiable Protected …home.gwu.edu/~jcmarsh/wiki/uploads/Research/seL4.pdf · 2016. 2. 21. · Elphinstone, Kevin, and Gernot Heiser. "From

DomainHard Real-Time

Worst Case Execution Time

Growing more complexMixed-criticality systems

Page 4: Improving Interrupt Response Time in a Verifiable Protected …home.gwu.edu/~jcmarsh/wiki/uploads/Research/seL4.pdf · 2016. 2. 21. · Elphinstone, Kevin, and Gernot Heiser. "From

Current Real-Time OSesFocus on lowest possible WCET

Small, simple RT kernels

Mixed-criticality dealt with like RTLinux

Page 5: Improving Interrupt Response Time in a Verifiable Protected …home.gwu.edu/~jcmarsh/wiki/uploads/Research/seL4.pdf · 2016. 2. 21. · Elphinstone, Kevin, and Gernot Heiser. "From

History80’s - L3 by Jochen Liedtke90’s - L4: fast IPC, microkernels workMany variants00’s - commercial success

Page 6: Improving Interrupt Response Time in a Verifiable Protected …home.gwu.edu/~jcmarsh/wiki/uploads/Research/seL4.pdf · 2016. 2. 21. · Elphinstone, Kevin, and Gernot Heiser. "From

seL4Redesigned L4 to be verifiedWCET analysis* Improvements for WCET of interrupts

Page 7: Improving Interrupt Response Time in a Verifiable Protected …home.gwu.edu/~jcmarsh/wiki/uploads/Research/seL4.pdf · 2016. 2. 21. · Elphinstone, Kevin, and Gernot Heiser. "From

Verification (How)

Page 8: Improving Interrupt Response Time in a Verifiable Protected …home.gwu.edu/~jcmarsh/wiki/uploads/Research/seL4.pdf · 2016. 2. 21. · Elphinstone, Kevin, and Gernot Heiser. "From

Verification (What)Functional Correctness: The implementation the abstract specification of the kernel.Implications:

No buffer overflowsWell-formed data structuresNo non-terminationmany more...

Assumptions: C-compiler, assembly, hardware, and kernel initialization.

Page 9: Improving Interrupt Response Time in a Verifiable Protected …home.gwu.edu/~jcmarsh/wiki/uploads/Research/seL4.pdf · 2016. 2. 21. · Elphinstone, Kevin, and Gernot Heiser. "From

DrawbackConcurrency is the Verification Killer- Non-Preemptive kernel- Event based kernelVerification is very expensive- Changes are hard to make

Page 10: Improving Interrupt Response Time in a Verifiable Protected …home.gwu.edu/~jcmarsh/wiki/uploads/Research/seL4.pdf · 2016. 2. 21. · Elphinstone, Kevin, and Gernot Heiser. "From

First WCET

Microseconds; too slowapprox. 800 Mhz system

Page 11: Improving Interrupt Response Time in a Verifiable Protected …home.gwu.edu/~jcmarsh/wiki/uploads/Research/seL4.pdf · 2016. 2. 21. · Elphinstone, Kevin, and Gernot Heiser. "From

Lazy SchedulingOptimization for better average case executionWCET is king now.

Page 12: Improving Interrupt Response Time in a Verifiable Protected …home.gwu.edu/~jcmarsh/wiki/uploads/Research/seL4.pdf · 2016. 2. 21. · Elphinstone, Kevin, and Gernot Heiser. "From

Open vs. Closed systemsWhat are the slow system calls?

Kernel object creation and deletionExample: deleting an IPC port.

How do we speed them up?Original solution: Don’t do it.

Page 13: Improving Interrupt Response Time in a Verifiable Protected …home.gwu.edu/~jcmarsh/wiki/uploads/Research/seL4.pdf · 2016. 2. 21. · Elphinstone, Kevin, and Gernot Heiser. "From

Data Structure ManipulationAllow preemption pointsProgress must be made between points

Page 14: Improving Interrupt Response Time in a Verifiable Protected …home.gwu.edu/~jcmarsh/wiki/uploads/Research/seL4.pdf · 2016. 2. 21. · Elphinstone, Kevin, and Gernot Heiser. "From

Preemption PointKernel checkpoints progressChecks for interruptsResumes system call

Page 15: Improving Interrupt Response Time in a Verifiable Protected …home.gwu.edu/~jcmarsh/wiki/uploads/Research/seL4.pdf · 2016. 2. 21. · Elphinstone, Kevin, and Gernot Heiser. "From

WCETDifficult to computeObservations can not be trusted

Page 16: Improving Interrupt Response Time in a Verifiable Protected …home.gwu.edu/~jcmarsh/wiki/uploads/Research/seL4.pdf · 2016. 2. 21. · Elphinstone, Kevin, and Gernot Heiser. "From

WCET ProblemsCache policiesLoopsExecution paths

Page 17: Improving Interrupt Response Time in a Verifiable Protected …home.gwu.edu/~jcmarsh/wiki/uploads/Research/seL4.pdf · 2016. 2. 21. · Elphinstone, Kevin, and Gernot Heiser. "From

2nd WCET Results

Approx. 500 Mhz systemWith better WCET analysis:

~300 microsecond computed WCETMuch closer to observed

Page 18: Improving Interrupt Response Time in a Verifiable Protected …home.gwu.edu/~jcmarsh/wiki/uploads/Research/seL4.pdf · 2016. 2. 21. · Elphinstone, Kevin, and Gernot Heiser. "From

SignificanceVerified micro-kernelSupports address spacesProtected-mode kernel

Still manages sub-millisecond worst case interrupt execution time

Page 19: Improving Interrupt Response Time in a Verifiable Protected …home.gwu.edu/~jcmarsh/wiki/uploads/Research/seL4.pdf · 2016. 2. 21. · Elphinstone, Kevin, and Gernot Heiser. "From

Future WorkRe-verificationA few more optimizations

IPC send-receivecapability policy

Page 20: Improving Interrupt Response Time in a Verifiable Protected …home.gwu.edu/~jcmarsh/wiki/uploads/Research/seL4.pdf · 2016. 2. 21. · Elphinstone, Kevin, and Gernot Heiser. "From

That’s all folks!

Page 21: Improving Interrupt Response Time in a Verifiable Protected …home.gwu.edu/~jcmarsh/wiki/uploads/Research/seL4.pdf · 2016. 2. 21. · Elphinstone, Kevin, and Gernot Heiser. "From

L4RTLShows that RT Tasks can be run in user space along side of normal Linux applications (provides separate address spaces).The performance hit is there, but not that bad.

RTLinux keeps the RT Tasks in the kernel space.

Page 22: Improving Interrupt Response Time in a Verifiable Protected …home.gwu.edu/~jcmarsh/wiki/uploads/Research/seL4.pdf · 2016. 2. 21. · Elphinstone, Kevin, and Gernot Heiser. "From

Stack BlockingseL4 is even-based

means single stack (unlike thread based. a stack for every process, easy to preempt, just swap stacks).

Can not preempt, because the stack is shared. Stack blocking occurs if a process1 holds an exclusive object, and process2 preempts it. Process2 takes the top of the stack, effectively blocking process1 from running.

There are solutions, but this would force a policy on seL4.