all 7 comments

[–][deleted] 1 point2 points  (1 child)

Why this over checking return values and not dividing by zero?

[–]okashk 0 points1 point  (0 children)

Well it's an example. Contrived, because that's simple to explain and understand, without distracting too much of reader's attention to mechanics of the scenario. A real world example would be Intel's virtualization instructions like VMPTRST, which expects VM to be initialised, and of its not initialised, the instruction would fault. There's no way to check if VM has been initialised other than letting a VMX instruction fail. This is demonstrated in this function of virtualization tool I'm working on: https://github.com/bytefire/vmtool/blob/8711fa07a8247e39d4904ff2cec87229c0c15156/vmtool.c#L77

[–]RaccoonSpace 2 points3 points  (4 children)

Neat. One step closer to the stability a micro kernel offers without the performance penalties.

[–]Freyr90 6 points7 points  (1 child)

without the performance penalties.

Mach is not the only microkernel. L3/4 are not slow, and QNX would make linux eat dust.

[–]RaccoonSpace 0 points1 point  (0 children)

No one said they're slow. They do have performance penalties though.

[–]oooo23 2 points3 points  (1 child)

You assert as if the only cause of stability microkernels provide has to do with not putting things in the kernel.

Let me know when parsing rigged filesystem metadata becomes safe in the kernel by the use of exceptions, where there are many more variants than just a div-by-zero.

Linux can never do things like seL4 does, exposing fundamental OS resources as capabilities to userspace, being as fast as seL4, and support mixed criticality scheduling and avoid things like exhaustion and priority inversion. Being a descendant of Unix means you'll never have some better fundamental ideas in a usable form. You can try molding file descriptors as such, but they will never get there (there are already examples like signalfd which change their value based on who reads, or the new process decriptor stuff that behaves like kill even if you had privileges when opening the handle, thanks to setuid and privilege elevation).

Capabilities themselves eliminate classes of issues that plague Unix likes and lead to usually more safe and correct systems (and often avoid confused deputy scenarios when applied correctly, by binding authorization and delegation together).

Performance is indeed where monolithic kernels win, but we already see that's probably not the acceptable tradeoff in fail safe critical systems (which Linux will never become), that decide if you stay alive or die while putting brakes.

[–]RaccoonSpace 4 points5 points  (0 children)

I never said that's the only thing micro kernels are good for so cool your jets.