Linux in mixed-criticality systems
For the moment, this work is focused on automotive systems, which have a bunch of non-critical tasks (user interaction and displaying multimedia, for example) and critical tasks (such as autonomous driving and engine control). These tasks can be (and often are) handled with independent computers running different operating systems, but there is a lot of interest in combining these computers into one. The result, should this effort be successful, would be a system that is both cheaper and more flexible.
One way of doing this would be to turn Linux into a fully realtime system.
In the past, dual-kernel approaches, such as RTLinux, RTAI, and Xenomai have been
developed toward that end. More recently, the PREEMPT-RT
patches have seen the most attention,
though Scordino described the result as "soft realtime". The problem with
all of these systems is certification for use in safety-critical settings,
which is hard (if not impossible) for a kernel as large
as Linux. In addition, regulations can prevent its use anyway; European
automotive regulations do not allow the use of a shared system for both
non-critical tasks and engine control, for example.
So attention has shifted to an alternative approach: resource partitioning that can create a hard separation between tasks on a single platform. Modern processors support this under most common architectures. If one of these systems could be successfully partitioned, it would become possible to use Linux for non-critical code and a certified operating system for the rest. This is the focus of the Hercules project, which has been funded by the European Union.
For the safety-critical side of the system, Hercules has chosen Erika Enterprise, a system that is licensed under GPLv2+. It has been designed explicitly for automotive electronic control units, and carries a number of the relevant certifications. Erika is used in production in some cars now; it supports a range of CPUs and can run under a variety of hypervisors.
On the hypervisor side, the system of choice is Jailhouse, which is also available under GPLv2. Jailhouse, too, has been designed for safety-critical applications with certification in mind; to that end, the project has a goal of not exceeding 10,000 lines of code on any architecture that it supports. The plan is to use Jailhouse to run realtime, safety-critical tasks on multicore platforms alongside Linux. It should be able to provide strong and clean isolation between the two while performing at "bare-metal levels".
Jailhouse has the concept of a "root cell" which, while being in control of the system as a whole, is not in full control of the hardware it is running on. The root cell will be running Linux. Other "cells" can run (as an "inmate") any kernel that has Jailhouse support; unlike full virtualization systems, Jailhouse is not able to run unmodified kernels. There is no scheduling built into Jailhouse; each core in the system is given over fully to one system for its use. There is no overcommitting of hardware, and no hardware emulation. Memory is partitioned between the cells, with some set aside for Jailhouse itself.
Linux systems with Jailhouse support have a special device (/dev/jailhouse) used for configuration of the root cell and the loading of inmate systems into the other cells. It uses a rather long and intimidating configuration file, written as a set of C data-structure definitions, that fully describes the hardware and its partitioning; this file can be automatically generated on x86 systems, but must be written by hand for Arm systems.
Cells in Jailhouse are isolated from each other, but they are still likely to need to communicate; Jailhouse provides a virtual PCI device for that purpose. There is no multicast capability, which is a bit of a shortcoming, so the Hercules developers have added their own communications library on top. It provides both blocking and non-blocking calls and dynamic message sizes; this code should be released soon.
One of the biggest problems that needs to be solved is avoiding interference between the cells, which can happen even with hard partitioning. Memory bandwidth and cache space can be particularly problematic. One solution for cache contention is to use cache coloring — assigning virtual addresses so that each cell uses a different portion of the cache. Another approach is to use the system's performance counters to monitor the use of memory bandwidth and cache space; tasks can then be throttled if need be to keep them within their limits. Coscheduling, wherein processes are scheduled so as to avoid contending with each other for memory, is also under development. This code, too, is expected to be released soon.
As the session ended, Thomas Gleixner observed from the audience that Hercules is "a nice fairy tale", an embodiment of the design that everybody seems to want. He also said that it is "a pipe dream", though, for a simple reason: there are no CPUs large enough to run this kind of system that have been certified for safety-critical tasks. Without a certified CPU, the system as a whole cannot be certified. Scordino responded that the vendors are working on this problem. Once they have a solution, it would appear that Hercules will be ready to run on it.
[Thanks to LinuxLab and to the Linux Foundation, LWN's travel sponsor, for
supporting my travel to the event.]
Posted Dec 13, 2018 18:39 UTC (Thu)
by nopsled (guest, #129072)
[Link] (2 responses)
Posted Dec 13, 2018 20:55 UTC (Thu)
by smurf (subscriber, #17840)
[Link]
Posted Dec 14, 2018 19:41 UTC (Fri)
by glenn (subscriber, #102223)
[Link]
This is good for mixed-criticality systems, because it helps isolates potential side-effects of PI to the threads that share resources. Independent threads are generally isolated from the effects of bandwidth-server-based PI employed by other threads (this is not the case with simple PI). This helps realize the "freedom from interference" requirement of some safety standards (e.g., the automotive ISO-26262 standard).
Folks have used real-time Linux in mission-critical applications. SpaceX has been open about their heavy use of Linux on their rockets: https://lwn.net/Articles/540368/
Posted Dec 14, 2018 5:45 UTC (Fri)
by marcH (subscriber, #57642)
[Link] (21 responses)
Let's not even get into the price of insurance and human life.
Posted Dec 14, 2018 8:32 UTC (Fri)
by wsy (subscriber, #121706)
[Link]
Posted Dec 14, 2018 9:27 UTC (Fri)
by nim-nim (subscriber, #34454)
[Link] (8 responses)
So basically, consolidating the car information systems, can easily result in savings at least equal to the profit the manufacturer currently makes on the car as a whole.
Posted Dec 14, 2018 15:18 UTC (Fri)
by marcH (subscriber, #57642)
[Link] (7 responses)
Posted Dec 15, 2018 10:30 UTC (Sat)
by drag (guest, #31333)
[Link] (6 responses)
So there is a conflict of interest there. If manufacturers produce 'open' technology that is easy and simple for anybody to repair, provide parts for, and support then they risk alienating the sales goons. So they design vehicles specifically to be anti-serviceable and keep diagnostic tools and software extremely proprietary.
As the technology improves cars should be becoming simpler and easier to repair. The technology and engineering that goes into modern vehicles is incredible, very expensive, and hugely difficult... but the actual execution is still really basic. Hall effect sensors, fuel injectors, temperature sensors, O2 sensors, fuel meters, fuel pumps are all late 1970's early 1980's technology just highly evolved. A effective modern fuel injection system is much simpler and easier to support and repair then a old carbureted system. Parts are cheaper to manufacture on a large scale, too. Which is some of the major reasons why cars moved away from the old tech in the first place.
So, yes, piling on tons of gadgets and features to otherwise basic form of transportation is a big way they can help plump up the profits of their dealer networks.
As is tying computer systems together into big massive proprietary lumps and protecting access and tools required to diagnose with DRM in order to trigger DMCA legislation and making it illegal, or at least extremely difficult, for people to produce third party diagnostic and support tools.
https://www.wired.com/2015/04/dmca-ownership-john-deere/
> General Motors told the Copyright Office that proponents of copyright reform mistakenly “conflate ownership of a vehicle with ownership of the underlying computer software in a vehicle.”
Because of that sort of crap I am extremely weary of any attempt to combine entertainment and vehicle management systems into one big lump. Besides the fact that it's just poor engineering. I just don't trust these people.
Next thing you know they will have to have all sorts of backdoors and encrypted control over firmware that prevents user serviceability because of 'security'. Can't have somebody hack your bluetooth speaker and then updating the firmware for your anti-lock brake system... right? Right?
For tying these systems together in a secure manner it should be very possible to setup one-way communication so that information and logging and other things can flow from vehicle management into the display and networking computers. The protocols should be documented and 'best effort' standards should be established so that third party tools and software can be used to reduce the cost of ownership and increase the value of vehicles for the customers.
I have hopes for companies like Tesla will move the industry away from car dealerships and such things. And I think that things will improved provided the Government resists the temptation of strengthening IP protection legislation for the sake of these major corporations. (which are all already extremely damaging at all levels of society). But until that happens I really am going to stick with buying the most basic cars possible.
Posted Dec 18, 2018 13:28 UTC (Tue)
by nilsmeyer (guest, #122604)
[Link]
There really is no good reason for an in-vehicle entertainment system providing anything beyond sound or display output and perhaps networking, since passengers usually have a powerful device like a smartphone or tablet with them which they replace more often than the car. The same also goes for airplanes.
I use the train a lot here in Germany, and while the railway company gets a lot wrong in the software / digitalization realm at least they resisted the temptation to outfit the trains with an entertainment system like you have on some airlines. Instead you can log-in to the on-board wifi over which they also offer a streaming service (persumably with lots of content cached on the train), since people bring their own devices anyways.
> So, yes, piling on tons of gadgets and features to otherwise basic form of transportation is a big way they can help plump up the profits of their dealer networks.
You can diversify a lot in the realm of sales here by offering choices so no two car buys are similar and then upselling the hell out of it - "want the soundsystem? You also have to get the undercoating." I never personally bought a car but from what I hear it's a very unpleasant experience, especially if you don't like to haggle.
Posted Dec 20, 2018 0:40 UTC (Thu)
by rahvin (guest, #16953)
[Link] (3 responses)
And the remarkable thing about these suits was just how long it took and how much legal effort was expended just to prove it. IIRC it took almost 3 years of legal work before a set of lawyers were able to get discovery granted to the source code to the systems that caused the problem and a proper analysis was done.
With the move to drive by wire systems we need government regulations and code quality and testing requirements that protect life safety possibly even a requirement for a switch that turns the whole drive system off while preserving braking and steering or some other failsafe. One of the reasons cars were so bloody reliable from 1990 to about 2008 and didn't have these type of issues was because everything was designed previously as single controllers and ASIC's for every function so that a computer failure would only take out a single system not the whole drivetrain. This convergence is very scary to me and was vindicated by the finding on the Toyota acceleration issue where it was a code quality issue. Life safety needs very high standards and multiple failsafes.
I design roadways for a living and I'm legally required to consider safety before any other variable at the risk of my possible incarceration for failure to do so. I believe vehicle source code should be held to a similar standard.
Posted Dec 21, 2018 7:35 UTC (Fri)
by murukesh (subscriber, #97031)
[Link] (2 responses)
Posted Jan 3, 2019 16:02 UTC (Thu)
by sdalley (subscriber, #18550)
[Link] (1 responses)
https://embeddedgurus.com/barr-code/2013/10/an-update-on-...
Posted Jan 6, 2019 1:02 UTC (Sun)
by marcH (subscriber, #57642)
[Link]
Whether these bugs are real or not and no matter who "wins" this eventually, Toyota and others should already have learned a lesson the hard way: every time human life is at stake legal costs alone far outweigh any development cost saved by sloppy programming. While a rather low bar it's still a somewhat "good" bit of news.
People cope with getting screwed over again and again by $BIGCORP and the 0.1% but funny enough there's always this line that you really can't cross: they don't like to... die.
Now rebooting my smartphone to work around some memory leak and other random issues...
Posted Dec 20, 2018 20:12 UTC (Thu)
by kamil (guest, #3802)
[Link]
Well, those hopes may be misplaced. Tesla, innovative though it is, has a well-deserved reputation of being extremely proprietary. There are plenty of stories flying around about the difficulties of reverse engineering what its cars do internally, etc.
Heck, recently they announced that they will stop working with third-party body shops and that they want all such repairs to be handled in-house. Compared to Tesla, traditional car manufacturers are a model of openness...
Posted Dec 14, 2018 11:32 UTC (Fri)
by smurf (subscriber, #17840)
[Link]
The typical car (i.e. basically anything that's mid-range or better) consists of a veritable heap of embedded processors with no way to log anything substantial if/when something goes wrong, and with no way to update them from the outside. Tesla excepted …
Posted Dec 14, 2018 12:02 UTC (Fri)
by nhippi (subscriber, #34640)
[Link] (8 responses)
Internet connectivity and cloud services OTOH are much big risks.
Posted Dec 14, 2018 15:11 UTC (Fri)
by marcH (subscriber, #57642)
[Link] (7 responses)
Not for everything; for safety-critical systems. Cars used to be certified and pretty safe before micro controllers so there can't be that many safety-critical micro controllers in a car today.
Reducing the number of micro controllers and wires is great and all and sure you also want to add some partitioning and "soft real-time" there but that's different.
Posted Dec 14, 2018 15:24 UTC (Fri)
by marcH (subscriber, #57642)
[Link] (1 responses)
Posted Dec 14, 2018 17:01 UTC (Fri)
by ibukanov (subscriber, #3942)
[Link]
Posted Dec 14, 2018 16:54 UTC (Fri)
by smurf (subscriber, #17840)
[Link] (3 responses)
Yeah, but that was before brake assistants and airbags and automatic transmissions and mandatory seatbelt warnings and central locks and theft protection and whatnot. All of these, and more, either require µCs outright or are more expensive if you build them without one.
Today? No way. Even less way if you want a car that doesn't burn gasoline.
Posted Dec 14, 2018 17:33 UTC (Fri)
by marcH (subscriber, #57642)
[Link] (2 responses)
Central locks and rear cameras are "real-time" (for some definition of it) but really not safety critical.
Posted Dec 20, 2018 6:26 UTC (Thu)
by JdGordy (subscriber, #70103)
[Link] (1 responses)
Posted Dec 20, 2018 6:39 UTC (Thu)
by marcH (subscriber, #57642)
[Link]
Check what it takes to open a damaged car door.
ABS when fitted is a good example considering its job is to ... release the brakes. Cruise control and any other sort of self driving feature are other obvious ones. Can't wait for the fun of seeing these interact with security holes and other bugs in the media player. As usual the only winners will be the lawyers.
Posted Dec 14, 2018 17:38 UTC (Fri)
by mpr22 (subscriber, #60784)
[Link]
Posted Dec 14, 2018 15:43 UTC (Fri)
by marcH (subscriber, #57642)
[Link]
You'd think car makers are paranoid about safety and you'd be right. The problem is: that doesn't magically make them able to attract and hire good computer professionals (bar super rare exceptions like Tesla).
This is where I find the security "circus" extremely valuable: hacking a phone is one thing, hacking a car makes much bigger headlines and shows the emperor is naked.
I've also heard a couple software engineering horror stories from the inside and it's actually not pretty.
Please consider this presentation for what it is: a very interesting but *long term research* project and wish none of it shows up in your car tomorrow.
Posted Dec 14, 2018 16:13 UTC (Fri)
by shemminger (subscriber, #5739)
[Link]
Posted Dec 18, 2018 6:31 UTC (Tue)
by alison (subscriber, #63752)
[Link] (2 responses)
I've read that ARM and ARM64 don't support cache coloring. If x86_64 is the only arch with this feature then the applicability to embedded use cases may be limited.
If anyone knows contrary information, please speak up!
Posted Dec 18, 2018 16:15 UTC (Tue)
by nybble41 (subscriber, #55106)
[Link] (1 responses)
You can find more information on the ARMv6 and ARMv7 cache architecture here: https://community.arm.com/processors/b/blog/posts/page-co...
Posted Dec 18, 2018 16:31 UTC (Tue)
by alison (subscriber, #63752)
[Link]
Posted Dec 24, 2018 4:46 UTC (Mon)
by tiffang (guest, #48653)
[Link]
Posted Jan 9, 2019 6:46 UTC (Wed)
by robbe (guest, #16131)
[Link]
This design ensures that the powers-that-be will have to lock down this Linux system to keep any safety guarantees. Is this an accident?
A more user-friendly design would keep Linux out of the Trusted Computing Base, and therefore able to be replaced without jeopardising overall system safety.
Posted Feb 24, 2022 2:49 UTC (Thu)
by jiaming (guest, #156804)
[Link]
Linux in mixed-criticality systems
Linux in mixed-criticality systems
Linux in mixed-criticality systems
Linux in mixed-criticality systems
Linux in mixed-criticality systems
Linux in mixed-criticality systems
Linux in mixed-criticality systems
Linux in mixed-criticality systems
Linux in mixed-criticality systems
Linux in mixed-criticality systems
Linux in mixed-criticality systems
Linux in mixed-criticality systems
http://www.safetyresearch.net/Library/Bookout_v_Toyota_Ba...
Toyota's Unintended Acceleration
Linux in mixed-criticality systems
Linux in mixed-criticality systems
Linux in mixed-criticality systems
Linux in mixed-criticality systems
Linux in mixed-criticality systems
Linux in mixed-criticality systems
Linux in mixed-criticality systems
Linux in mixed-criticality systems
Linux in mixed-criticality systems
Linux in mixed-criticality systems
Linux in mixed-criticality systems
Linux in mixed-criticality systems
Linux in mixed-criticality systems
When the jailhouse is broken, and it will be; the car will be an open target. Because of the long lead times for development, the regulations, and the fork-from-upstream-five-years-ago model these kind of system are doomed. Having two processors gives some hardware isolation for the restricted software engineering process.
Linux in mixed-criticality systems
Linux in mixed-criticality systems
Linux in mixed-criticality systems
Linux in mixed-criticality systems
What else can be shortcomings from hardware?
Linux in mixed-criticality systems
> as a whole, is not in full control of the hardware it is running on. The root cell will be
> running Linux.
Linux in mixed-criticality systems