gvisor is not like a seccomp-bpf process sandbox that just ACLs system calls.
At any rate: why is this better than just using KVM and Firecracker? The big problem with gvisor is that the emulation you're talking about has pretty tough overhead.
Regardless, I'm still surprised microkernels aren't more popular in this space, but perhaps the losing the ecosystem of Linux libs/applications is a non-starter.
Even if the idea wasn't fruitful, the conversation was fun. Thanks for engaging and challenging my bad ideas!
Edit: I've also realized I was thinking of Unikernels, not microkernels and I've been calling it the wrong thing all night. *sigh*
Could you link to any specific Linux kernel source that implements support for TCP offload? AFAIK networking subsystem maintainers were always opposed to accommodate TCP offload because it is A Bad Idea.
[0]: https://www.linuxjournal.com/content/userspace-networking-dp...
https://www.kernel.org/doc/Documentation/networking/segmenta...
You wouldn't have to. There's patches for hardware TCP offload using the normal socket syscall ABI. The kernel net stack maintainer is pretty ideologically against them so they're not mainlined, but plenty of people have been running them in production for decades and they're quite mature.
The closest things to what you're describing are unikernels and NetBSD rump kernels.
1. Mechanism to capture syscalls (systrap)
2. Reimplementation of parts Linux kernel
3. Narrow set of calls to outside using Linux syscalls
This thing could be envisioned as
1. Linux syscall ABI as-is, same mechanism[a]
2. Reimplementation of parts Linux kernel
3. virt-io hardware drivers for calls to outside
So the middle part of the sandwich could look the same.
Also, I think it's worth saying that I think the work in maintaining #2 there is exactly why Google Cloud Run migrated away from gVisor. People just kept asking for more and more kernel features.
[a]: Alternatively, #1 could be replaced with unikernel like linking directly with #2.
Me personally, I think HTTP/3's move away from TCP could be really interesting for this sort of stuff. The responsibilities of the kernel could be hugely simplified if all you had were UDP/IP directly hardcoded to virtio (no need for routing, address configuration, ARP, etc), no paging etc, and the only filesystems were EROFS & tmpfs. Of course, Cloud Run's move away from gVisor shows that Enterprise clients would hate it.
The "hardest" part is probably sufficiently emulating Linux userspace accurately: it's a big surface area. That's why I think creating a pseudo-OS target is the best route.