What do you think about WASM in the kernel with the same high level concept with Unikernel? link in the below
https://destroyallsoftware.com/talks/the-birth-and-death-of-...
Until those are dealt with wasm will never move past it's current status quo - malware in the browser.
Is there really a support layer for Emacs in the kernel?
Now the real question. You are statically linking against a modified glibc, so they make calls to your kernel library instead to the system call and you can do some nice optimizations along the way. Which I think make sense.
I can see this is cool for things that directly interface to glibc, but do you think this is viable for applications using multiple layers between the kernel and the application?
We have only run C applications so far, so I'm unsure how it will all work for servers written in other programming languages. I think applications which rely on complex multi-process middleware (like Java JBoss, etc) will be hard or even impossible to port.
Because of that, I think “without a clear answer at the moment” is worrisome. Are there partial answers to these questions?
Hm, isn’t reboot just slightly more complicated than restarting your application? And most of the today’s apps would still require “rebooting” be it a container or a virtual machine
Not saying it is easy but at the end of the day it's just engineering work.
This can lead to some rather spectacular performance benefits. One thing is that you remove the syscall overhead, but more importantly you can do a lot more optimizations at the compiler/linking steps.
You can remove complex code that tries to dynamically model the world with rather plain code that does just what it is supposed to. With IncludeOS (C++17 unikernel) we did make a firewall implementation that instead of using complex data structures relied on preprocessing the rule set and translate it into C++ code. The code to do this was quite simple and resulted in pretty amazing figures wrt number of rules per packet per second. Metaprogramming can sometimes deliver amazing results.
Similar things can be done in a traditional kernel as well and we've seen eBPF firewall implementations that are able to get similar numbers. On the flip side eBPF and it's firewall implementation is order of magnitude more complex. However, you can push eBPF code onto the networking card which can be a huge benefit. And ofc you could make a kernel module that implements a specific firewall ruleset and get similar performance without eBPF.
I like unikernels because I feel I can understand them better. You can reason about them and they are easier to optimize for very specific workloads.
So why aren't we using them? Likely because we know Linux so well and we've invested a lot in it. It runs everywhere and is extremely well supported. Bringing a new operating system to market is challenging, bringing a new operating system with a entirely different architecture is even harder. Even if it, on a purely technical level, could yield better results.
Being actually different is one of the few things that gives someone a reason to look twice at the new system.
From Wikipedia:
“A unikernel is a specialised, single address space machine image constructed by using library operating systems. A developer selects, from a modular stack, the minimal set of libraries which correspond to the OS constructs required for their application to run. These libraries are then compiled with the application and configuration code to build sealed, fixed-purpose images (unikernels) which run directly on a hypervisor or hardware without an intervening OS such as Linux or Windows.”
Third paragraph
> The unikernel is a cloud-era handle for the classic systemstechnique of linking an application with a library of oper-ating system components (including memory management,scheduler, network stack and device drivers) into a singleflat address space, creating standalone binary image that isbootable directly on (virtual) hardware [22]. The advantageof this approach is that kernel functionality can be special-ized to fit the needs of the target application to increasethe performance of the application or to support it within ahighly restricted execution domain.
And second chapter.
Whether it's good depends on what you're doing. UKL will[1] allow you to link a regular server application to Linux and then run that single binary on baremetal or in a hypervisor, and give you a decent performance boost over running the application on top of a normal kernel. How much of a performance boost depends a great deal on the program, almost everything will be a few percent faster, and some applications a lot more.
[1] I'm using the future tense here because although we do run real programs with it today there's still a bunch of development work to do before it works smoothly. The code is: https://github.com/unikernelLinux
I'm not very convinced about the security story around unikernels, but for balance the other side of the argument is that there's much less code around in a unikernel - no shell, no command line tools at all, no compilers or interpreters, just the code required to run the program and talk to the hardware (real or virtual).
Tell me if I am wrong, but is it always true though? Unikernel libraries definitely are largely not as proven as Linux kernel. Then how is unikernel secure than Linux system call?
Instead of installing an OS and installing your app on that OS, the OS is a library you use to talk to the hardware.
It's good for two reasons.
First security, if you only use the HDD and network, you don't have to include code for display or mouse etc. which could be a security risk.
Second, it's faster, because you don't have to do syscalls, since your app IS the OS, syscalls don't need to get out of userspace.
[0] https://www.nccgroup.trust/globalassets/our-research/us/whit... , from https://news.ycombinator.com/item?id=19738905
https://nanovms.com/dev/tutorials/assessing-unikernel-securi...
It makes good sense to compare unikernels against conventional GNU/Linux. It's the standard configuration, and it sets the bar. Describing this as a pyschological hump isn't a sensible response.
I don't know what advances to things like the networking stack is meant to refer to. The article should be clear and explicit about what part of the paper this is responding to. As it stands it looks like a straw-man.
The response to unikernels are un-debuggable makes little sense. Someone can work on a debugger while claiming the current state of debugging is poor. No contradiction there.
Downplaying the significance of Data Execution Prevention isn't a convincing defence. Downplaying the significance of ASLR isn't a convincing defence. These are valuable security measures.
This excerpt from the conclusion seems to indicate a reluctance to take security concerns seriously at all, as if a security analysis is an emotional attack: there's a thousand little kids out there wanting to crap on anything they can. Security bugs are bugs at the end of the day and all one has to do is look at any random popular github to understand how many bugs we as humans create.
Edit: Thanks for the updated link. UKL can be compiled with usual hardening features like ASLR, stack hardening, RELRO.
As I said here (https://news.ycombinator.com/item?id=23202042) I'm dubious about the security story around unikernels, but most of the issues in this paper are not relevant to UKL specifically.
Mirror: https://web.archive.org/web/20200311095425/https://www.nccgr...
On the face of it, multiprocess support might seem a bit stupid, but it would greatly help the porting of more complex applications. The 'processes' wouldn't need virtual address space or memory protection, just give them a block of memory and pick a CPU to run the code.
If you have multithreading, do you need any scheduling code, or can you just pick a CPU for each thread and leave them to run? What about the kernel's own threads & processes?
That's interesting, how does Linux implement it's kernel threads without any scheduling code?
Actually achieving this is tricky: At the moment you need to use special compiler flags and a completely different link line from normal. Then there's the issue of how/whether the library Linux is configured generically or you somehow allow people to set CONFIG_* options.
Solutions based on Netbsd's rumpkernels exist. There's nothing about unikernels that says Linux.
Performance benefits: In truth we're still measuring this, there is a very smart student at BU who is investigating this and coming up with results for a forthcoming paper which I don't want to preempt too much. Almost all applications should see a small benefit, say of the order of 5%, but it's hoped that some will see a much larger benefit, and that it should be possible to make modest modifications in order to enjoy large benefits (perhaps only compiler and linker flags and such like).
These are very much hopes rather than firm promises at the moment.
getpid exists and returns a number - in fact it can return any number you like :-) Everything is linked into a single vmlinux which runs in a single address space. (As an aside I'll have to remember to ask Ali if he's thought about what number getpid() should return in UKL - I guess returning 1 would cause least surprise)
> Can I fork or create threads?
Fork no, threads yes. Threads are implemented using kernel threads.
> Can I directly access kernel's internal APIs like a kernel module?
Yes, although whether this is a good idea is another matter. Note that it's still Linux so internal APIs are unstable and can go away or change their meaning at any time, so if your application starts to rely on internal APIs you could quickly get into trouble.
There are no processes here. Everything runs inside the kernel. You don't have exec(), fork() or similar.
• Added a new kernel configuration option to allow theuser to select if he/she wants to compile the Linux kernel as UKL.
• Added a call to an undefined symbol (protected by an #ifdef) that can be used to invoke application code rather than creating the first userspace process.
• Created a small UKL library which has stubs for syscalls. These stubs hide the details of invoking the required kernel functionality now that the regular interface (i.e.,the syscall instruction) is no longer used.
• Changed glibc so that instead of making syscalls into the kernel, it makes function calls into UKL library.
• Changed the kernel linker script to define new segments such as thread local storage (TLS) segments which are present in application ELF binaries.
• Added a small amount of initialization code before invoking the application to replace initialization normally done by user level code, e.g., for network inter-face initialization.
• Modified the kernel linking stage to include the application code, glibc and UKL library to create a single binary.
Basically, I think the idea is you get all the linux syscalls (+ filesystems... + network stack... + hardware support... + everything) for 'free'. Sure you'll have a pretty large binary, but you won't have to write anything.
There's a long, detailed PDF about LTO produced by GCC which was useful in helping me to understand exactly how this works here: https://gcc.gnu.org/projects/lto/lto.pdf