<div dir="ltr"><div class="gmail_default" style="font-size:small"><br></div><br><div class="gmail_quote"><div dir="ltr">On Sun, Jun 17, 2018 at 5:08 AM Gerald Harris <<a href="mailto:gerald.harris@t-online.de">gerald.harris@t-online.de</a>> wrote:<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 style="word-wrap:break-word">would also like to point out that even on HW which contains strong support for separation, some areas of interference remain unavoidable. </div></blockquote><div><br></div><div><br></div><div><div class="gmail_default" style="font-size:small">​Yes, I entirely agree.​</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 style="word-wrap:break-word"><div><ul class="gmail-m_-8757637160450200491MailOutline"><li>All guest partitions running on a single (multi-core) processor will be sharing a single memory bus. Memory contention will be a potential source of interference. Although an array of settings are usually offered that influence the way in which HW deals with contention, these are seldom well documented and should not normally be modified without a clear understanding of the problem to be resolved and strong support from the silicon provider.</li></ul></div></div></blockquote><div><br></div><div><div class="gmail_default" style="font-size:small">​Indeed.​</div><br></div><div><div class="gmail_default" style="font-size:small">​As you note, there is the option of fiddling with with QoS-type settings on a shared bus. Or, for safety critical systems, we might resort to a dedicated bus for certain cores.</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">For example, the ARM Cortex-R52 has optional "tightly coupled memories" on a per-core basis:</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small"><a href="https://developer.arm.com/docs/100026/0100/memory-system/tcm-memory">https://developer.arm.com/docs/100026/0100/memory-system/tcm-memory</a>​</div><br></div><div><div class="gmail_default" style="font-size:small">​For functional safety reasons, we might have a​ realtime core with 1MB of dedicated memory, dedicated to a certain task. </div><br></div><div><div class="gmail_default" style="font-size:small">​Elsewhere on the processor / SOC, we might have Cortex-A application cores​ running less deterministic workloads, and exposed to interference via shared buses, caches, accelerators, etc. For the sake of argument, let's imagine that the A(pplication) cores are running Linux.</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">How might we partition the R(ealtime) core, and protect the memory etc? This is mostly a hardware issue, and is support. The question becomes one of system initialization. How is the R core bootstrapped and given the correct binary to run (baremetal, or executive + app, etc). Our choices are open - we could use a hypervisor, a slightly fancy bootloader, or have linux launch it during initialization. The "general purpose" operating system starting the R side is sometimes called "asymmetric multiprocessing" - but the important thing is that the R side can be completely isolated. The code there does not run in the context of, or exposed to interference from, the linux side, which simply served as a loader. </div><br></div><div><div class="gmail_default" style="font-size:small">What does the community think about where the most cycles will be? From my point of view, the 'big compute' requirements that new application workloads, whether infotainment or autonomy, require high-performance Application cores, large (shared) DRAM, GPUs and other Accelerators (for AI - inference accelerators), vision processors and so on. These will not be R cores, and by definition are susceptible to various forms of interference at the micro-level. At the macro level I believe we need to deal with the latency distributions explicitly, rather than try (and fail) to force these into hard-realtime contexts. </div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">Of course, on the autonomy side, I would expect we'll be using architectures with R-driven safety harnesses, around the AI systems. On the perception / sensor fusion / AI / planning side, we will have performance, utilization and energy problems. </div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">To force these into the hard realtime regime partition helps neither side. Forcing the overheads of hypervisor based protection on the heavy compute workloads also seems an unnecessary complication for a not entirely obvious upside. </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 style="word-wrap:break-word"><div><ul class="gmail-m_-8757637160450200491MailOutline"><li>Interrupts are normally channeled through a single interrupt controller peripheral. With strong support for HW separation, interrupts can be delivered directly to the targeted core. However, what happens when three interrupts arrive? Postulate the first two interrupts for Core 0, with the delivery of the second interrupt being delayed due to lower priority combined with a long running ISR for the first interrupt. When the third interrupt arrives targeting Core 1, will it have to wait for the second interrupt to be delivered before being handled? I am uncertain of the details here but would be very surprised to hear that interrupt latency is fully deterministic in the type of situation I have described.</li></ul></div></div></blockquote><div><br></div><div class="gmail_default" style="font-size:small">​Yes. In practice this gets tricky, but as with the overall cores, the philosophy is the same. E.g. the R52 provides a realtime oriented GIC implementation with support for virtualized interrupts. However, at the SOC level, mixing and matching A and R cores, determinism unavoidable kicks in as you note.</div><div class="gmail_default" style="font-size:small">​</div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div style="word-wrap:break-word"><div><ul class="gmail-m_-8757637160450200491MailOutline"><li>Modern Intel processors contain complex circuitry that allows the CPU clock frequency to be adjusted both downward to prevent overheating and upward to allow (temporary) overclocking. If a CPU-hungry partition results in the clock frequency being adjusted downward to prevent overheating, this clearly affects the entire system.</li></ul></div></div></blockquote><div><br></div><div><div class="gmail_default" style="font-size:small">​Yes. This is a very real problem - and can be rather pernicious, as some code issuing a few instructions can cause enough hardware to light up to force the processor to run at a much lower frequency. E.g. to run at the "AVX-512 base clock" instead of the regular base clock - ​there are recent models with a nominal 2.1GHz base (non-turbo) clock that will derate to 1.4GHz.</div><br></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 style="word-wrap:break-word"><div><div>If complete HW separation is the goal, the only ensured mechanism is fully independent HW. Neither hypervisor (of any flavour) nor OS will be able to provide full separation from all interference. However, it must also be pointed out that the uncertainty introduced by such interference in uncounted real-world applications is so small that it has no effective significance. Is this a goal that really needs to be achieved or is this an “angels dancing on the head of a pin” discussion? How large is the margin of error that must be allowed to enable us to ignore such interference? When must such interference be considered (e.g. rowhammer)?<br></div></div></div></blockquote><div><br></div><div> </div><div><div class="gmail_default" style="font-size:small">​Completely agree. When separately safety critical hard realtime from others, the OS / hypervisor discussion is a red herring. Neither are sufficient, and it's a system architecture problem (and we make the usual tradeoffs in boot sequences etc).​ The safety critical stack should be minimally sized as usual. </div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">When discussing the partition(s) of the system where most of the hardware will be, 99.99% of the software, and a vastly increasing amount of the compute will take place for the new workloads, then the partitioning mechanisms of both regular operating systems and hypervisor based systems are sufficient. When consolidating these workloads on fewer and much more capable platforms, it hasn't been the experience in other domains that the hypervisor is necessary, or that it pulls its weight. </div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">Even in poster-child environments for virtualization, such as public clouds, we're moving to 'bare metal' - shifting the administrative domains and protection into hardware components in the system. (E.g. the approach Amazon takes using their in-house ARM SOCs in x86 servers).</div></div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small"><br></div><div><br></div></div></div>