<div dir="ltr"><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_quote"><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">> If I had to approve ONE codebase for isolating safety related <br>
> and<div class="gmail_default" style="font-size:small;display:inline"> </div>non safety related applications on one processor (and those <br>
> applications<div class="gmail_default" style="font-size:small;display:inline"> </div>could be full operating system stacks) then I would use a hypervisor.<br>
<br>
> Why ? Because a hypervisor is fundamentally designed to serve this <br>
> purpose<br>
> and tested as such. Hypervisors are designed to absolutely prevent <br>
> guests<br>
> interacting with or effecting each other in any way, ever. Any other<br>
> operating system is not designed with that absolute intent at all.</blockquote><div><br></div><div><br></div><div><div class="gmail_default" style="font-size:small">In the spirit of lively debate, allow me to respectfully disagree. An operating system and a hypervisor of equivalent capability are essentially the same thing. And suffer from equivalent problems in these areas while enabling consolidation (i.e. multi-tenancy on shared hardware). </div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">Put it another way - a hypervisor is an operating system that can run at least one other operating system. Just as there are small & simple operating systems (just hundreds to thousands of lines), and grossly complicated ones (hundreds of millions of lines), the same is true of hypervisors. There are hypervisors that run the gamut of sizes too, to provide different levels of functionality. </div></div><div class="gmail_default" style="font-size:small"><div style="font-size:13px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial"><br></div><div style="font-size:13px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial"><div class="gmail_default" style="font-size:small">If my hyperkernel is a glorified boot loader, then on suitable hardware I can launch several guest kernels on disjoint hardware, and declare victory after several hundred lines. I could do the same on not-entirely-disjoint hardware, but then the guests can and will interfere via buses, caches, thermally, etc. In either case, I can do the same from an operating system (e.g. use it as a fancy boot loader to run bare metal code or another os on disjoint hardware).</div></div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default">If I need my hypervisor to implement (real-time) scheduling policies, efficient context switches, deterministic hypervisor calls, interrupt reinjection,.. then I'm building a kernel, hyper or otherwise. Once I've gone beyond fancy-bootloader status, I'm potentially opening the door to performance and determinism problems, and they need to be addressed either way. Some hypervisors need to have device drivers and provide IO services to guests. They can and are just as complex as 'full grown' operating systems, and in fact some of them just reuse an existing OS kernel for these purposes. </div><br></div><div class="gmail_default" style="font-size:small">I can make exactly the same for/against arguments for an operating system.</div><div class="gmail_default" style="font-size:small"><br></div><div><span style="font-size:small"><div class="gmail_default" style="font-size:small;display:inline">So, l</div>et's <div class="gmail_default" style="font-size:small;display:inline">take a more general view.</div></span></div><div><span style="font-size:small"><div class="gmail_default" style="font-size:small;display:inline"><br></div></span></div><div><div class="gmail_default" style="font-size:small">1) can software be designed to absolutely prevent guests tasks (whether process or kernel+process) interacting with or affecting each other in any way, ever?</div><br></div><div><div class="gmail_default" style="font-size:small">Not unless the hardware implements <i>hard</i> partitioning of all resources. This can not otherwise be achieved by any solution that involves software. Where guests are sharing hardware, software of any name will typically go to great length to facilitate the orderly interaction, though all too frequently we end up measuring costs of calls to the base layer of software (whether system calls or hyper calls, or both).</div><div class="gmail_default" style="font-size:small"><br></div></div><div><div class="gmail_default" style="font-size:small">Guest tasks may contend for cores, caches, interrupt controller, memory controller, system bus and io buses, etc. For this very reason, hardware often provides virtualized hardware (e.g. multiple contexts on a controller). Hard-realtime oriented hardware supports, under various names, mechanisms like "tightly coupled memory" for exclusive use by some core, since otherwise it's impossible to guarantee deterministic access and freedom from interference, no matter what software you do or do not use.</div><br></div><div><div class="gmail_default" style="font-size:small">Hypervisors advertising hard separation require hardware that implements hard separation to do the heavy lifting. If such hardware is available, it can often be used by other software to provide hard separation too. E.g. if you processor supports cache partitioning, some operating systems support the use of it to further strengthen the walls between tasks. </div></div><div><br></div><div><div class="gmail_default" style="font-size:small">2) can an operating system be designed to provide this separation</div><br></div><div><div class="gmail_default" style="font-size:small">Yes, and some of them are. Often these are not used to the degree that it's possible to do so, but that's a user choice not a constraint. As was mentioned, applications can and do interfere by <i>opting</i> into OS facilities that expose them to contention, and latency through the kernel. The more "general purpose" the OS and configuration, the less deterministic these latencies are. The usual reasoning being that higher utilization and utilization warrants the trade-off. </div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">Can an OS protect you from applications use such OS facilities and causing interference? Yes, some operating systems allow you to selectively disable functionality for certain tasks or groups of tasks. E.g. disallow use of network system calls, or shared memory, or other system calls of your choosing, no matter what the developer does.</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">I'd argue strongly that we can implement equivalent functionality, either way. And that complexity rises in proportion, either way. We'd have to pick a particular system architecture to discuss if we want to debate the merits of using two pieces of software - in terms of separation or not, extra overheads and complexity, etc. The only way to guarantee freedom from interference is to hard partition on suitable hardware, so we might want to pick an example there too.</div></div><div><div style="background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial"><br></div></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
> <div class="gmail_default" style="font-size:small;display:inline">Any </div>other operating system is designed to allow applications to interact <br>
> with<div class="gmail_default" style="font-size:small;display:inline"> </div>each other if you so desire. </blockquote><div><br></div><div><br></div><div><div class="gmail_default" style="font-size:small">Many but not all are - just as with hypervisors.</div></div><div> </div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
> <div class="gmail_default" style="font-size:small;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;display:inline">i</div><span style="background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">t is therefore up to the people<span> </span></span>developing<br>
> the applications to know what they are doing. </blockquote><div><br></div><div><br></div><div><div class="gmail_default" style="font-size:small">Not necessarily true; some operating systems allow you to constrain the environment the application processes are running in such that you disallow any/all interaction mechanisms. Where they cannot, you often have to solve the same problem in a different way, were we using a hypervisor.</div></div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">A hypervisor may possibly stop them interfering, but fundamentally that's only true if the hardware enables it (as it is for any OS design).</div><div> </div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">> application bugs cause problems to other applications, via interaction <br>
> over<div class="gmail_default" style="font-size:small;display:inline"> </div>the various network interconnects . . . that is better isolation than <br>
> any<div class="gmail_default" style="font-size:small;display:inline"> </div>hypervisor can ever provide and certainly better than a badly used<br>
> (developer quality again) single operating system.<br></blockquote><div><br></div><div> </div><div><div class="gmail_default" style="font-size:small">Yes; when sharing hardware, any software will struggle to mount a defense. Having chosen a platform, real world systems will need to make careful tradeoffs, as we all do all the time, about how to partition and provide the necessary guarantees within budget (yes, $, but also other metrics as usual). Hypervisors are one tool - thought neither necessary nor sufficient - so as usual it comes back to the humans to wrestle with the trade-offs.</div></div><div><div class="gmail_default" style="font-size:small"></div></div><div class="gmail_default" style="font-size:small"><br></div></div></div>