4 ms·
I’m not sure I understand what you’re talking about. All the ugly CPU vulnerabilities make context switching very, very slow. A microkernel needs to contest swi
by amluto 7y ago
I’m not sure I understand what you’re talking about. All the ugly CPU vulnerabilities make context switching very, very slow. A microkernel needs to contest switch more than a monolithic kernel, and the overhead keeps increasing.
- rvz 7y ago> All the ugly CPU vulnerabilities make context switching very, very slow. A microkernel needs to contest switch more than a monolithic kernel, and the overhead keeps increasing. In the case of the Zircon microkernel in Fuchsia, unlike Linux, almost all system-calls are asynchronous/non-blocking with a small number that are blocking [0], which is interesting since the OS is also fundamentally optimised for multi-core systems. Combined with both features, it makes it very suitable for real-time based applications, something that Linux is not optimised for and requires fundamental tweaking and changes for Linux or even some other traditional microkernels to achieve. Thus, I doubt that on a system like Fuchsia/Zircon, the context switch would be notably 'very, very slow', even if Fuchsia was running on modern-hardware optimised for microkernels such as Zircon if that were to happen. [0] https://fuchsia.googlesource.com/fuchsia/+/refs/heads/master/docs/concepts/kernel/README.md https://fuchsia.googlesource.com/fuchsia/+/refs/heads/master...
- chc4 7y agoReading around, Zircon syscalls are non-blocking at the scheduler level. Each syscall still requires a full context switch into kernel mode, though. They can probably do some smart stuff with having each syscall just add stuff to a work queue so userspace can resume as quickly as possible, but it's still fundamentally more context switches than e.g. Linux would have, which if side-channel attacks keep coming out might be a problem for them.
- yabadabadoes 7y agoMy impression on systems from the days before linux/Intel began having real SMP is that if you are willing to go off the rails completely on supporting 1-2 core machines and making every CPU available to every task, then blocking side channel attacks no longer requires all the work.. If mitigation is starting to amount to ~20%, that's roughly a CPU and soon to be 2-3, that can be told to never process directly for Userland and never tell Userland when exactly output queue contents of sensitive tasks become available. All that work essentially being free compared to running with Intel's fixes and full CPU flexibility.
- chrisseaton 7y agoI’m not sure why you think syscalls all being async means that the mitigations don’t have as much of an impact. They still require a context switch to access the protected memory in order to enqueue the async request. Can you expand on your reasoning?
- gpderetta 7y agoExactly. In fact you'll now need two calls per operation, one to submit it and one to fetch the results. You might make submission lazy and ond only actually submit all queued operations on the poll call, but it is not much better.
- ori_b 7y ago> Fuchsia/Zircon, the context switch would be notably 'very, very slow The part that the Intel fixes makes slow is the mode switch, since you need to flush caches and trash data that may leak. Making it async doubles (at minimum) the number of mode switches needed to do work.
- sansnomme 7y agohttps://blog.darknedgy.net/technology/2016/01/01/0/ https://blog.darknedgy.net/technology/2016/01/01/0/
- mike_hock 7y agoCouldn't a microkernel forego the expensive mitigations when switching between kernel processes? It wouldn't get the level of isolation that it ideally should, but it would still gain a lot over a monolithic kernel with fully shared memory.
- tedunangst 7y agoHard to make this a consistent coherent argument though. The microkernel will be secure because it has Spectre mitigations. The microkernel will be fast because it doesn't use Spectre mitigations. ?
- mike_hock 7y agoThe "microkernel" will be more secure than a monolithic kernel because a breach in one subsystem will confine an attacker to what is possible with Spectre exploits, as opposed to being able to read and write any memory directly.
- tedunangst 7y agoBut parent claims that with CPU vulns, the need for microkernel has never been greater. You're talking about disabling those mitigations. The need for general address space separation hasn't been changed by Spectre.
- mike_hock 7y agoYes, you're right.
- pjmlp 7y agoMonolith kernels like Linux have so much layers on top to emulate microkernel features, like user space drivers, containers, hypervisors that in the end they end up losing whatever advantage they had as bare bones kernels. Additionally there are quite a few production quality microkernels, that people keep forgetting, because most only look at desktop OSes.
- hinkley 7y agoI’m really curious to see what the container orchestration landscape could look like on top of microkernels. It feels like this should be an area where they could particularly shine, or at least reach feature parity.