[trustable-software] No hypervisor required...

Niall Dalton niall.dalton at gmail.com
Sun Jun 17 17:58:02 BST 2018


On Sun, Jun 17, 2018 at 5:08 AM Gerald Harris <gerald.harris at t-online.de>
wrote:

> would also like to point out that even on HW which contains strong support
> for separation, some areas of interference remain unavoidable.
>


​Yes, I entirely agree.​


>    - 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.
>
>
​Indeed.​

​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.

For example, the ARM Cortex-R52 has optional "tightly coupled memories" on
a per-core basis:

https://developer.arm.com/docs/100026/0100/memory-system/tcm-memory​

​For functional safety reasons, we might have a​ realtime core with 1MB of
dedicated memory, dedicated to a certain task.

​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.

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.

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.

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.

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.


>
>    - 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.
>
>
​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.
​

>
>    - 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.
>
>
​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.



> 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)?
>


​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.

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.

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).
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.trustable.io/pipermail/trustable-software/attachments/20180617/d9b878d0/attachment.html>


More information about the trustable-software mailing list