[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
|
|
Subscribe / Log in / New account

KS2012: Supporting old/oddball architectures, tool chains, and devices

By Michael Kerrisk
August 29, 2012
2012 Kernel Summit

H. Peter Anvin began his presentation on the first day of the 2012 Kernel Summit by noting that Linux supports an astonishing variety of hardware. In particular, it offers long-term support for older hardware, and is popular with some users for precisely that reason. Most of the time, supporting older and unusual hardware and tool chains is a worthwhile activity. Nevertheless, Peter's question was: what limits does the kernel development community want to set on the amount of effort invested in supporting old or unusual hardware architectures, build tool chains, and devices?

Peter's point is that supporting old and oddball systems inevitably has associated effort and problems. When it comes to supporting these systems, there is a balancing act: those systems may matter a lot to a small set of users, but supporting them imposes a development burden across a wide spectrum of the kernel development community.

Peter gave a few examples. The kernel still includes code to support old Intel 386 CPUs (i.e., the predecessor to 486 chips that appeared in 1989). One might ask whether anyone out there is still trying to boot Linux on such old hardware. However, Peter noted that as an x86 maintainer he had recently received a bug report from someone trying to boot Linux on such a system. But the genesis of that bug report is interesting. In essence, it came from someone who asked themselves, would I be able to boot a modern Linux kernel on this ancient system that I happen to have lying around? In response, Peter's question is, should the kernel developer community continue to invest effort to support such users?

There are various difficulties associated with supporting old and obscure systems. For example, maintainers may want to make kernel changes that could impact code that supports legacy systems, but it may be difficult to assess what that impact may be. Furthermore, it's unlikely that a maintainer will have the hardware needed to test the impact of changes that affect legacy code. Legacy code thus becomes rarely executed code, and rarely executed code is code that hides breakages and security holes. (Peter noted that architecture-specific "hooks" are the "common" solution for dealing with oddball architectures. Such hooks are a form of "come from" code about which it is very difficult to reason. The only way of dealing with that difficulty is careful documentation of the hook preconditions, postconditions, and invariants. It may come as no surprise that the likelihood that such documentation exists falls "somewhere between rarely and never".)

There are a few questions to consider when deciding whether to continue to support a legacy system. For example, do users of that system exist, how numerous are they, and how important is it to continue supporting them with modern kernels? The problem is that it is difficult to obtain data that answers these questions for obscure systems. In particular, Peter questioned the notion that bug reports equate to active users.

Legacy build tool chains present a similar problem. Peter notes that "People complain when we introduce something that triggers a bug in a 7-year-old tool chain. At some point we need to be able to say: if you want to use a new kernel, you've got to be prepared to install an appropriate tool chain."

Peter extended his discussion of legacy support to include user-space interfaces. One example he gave was compatibility code that has been unused for a long time. As a specific case, a.out support on x86-64 has been the source of several serious security holes; however, the a.out executable format was already largely obsolete by time the x86-64 architecture arrived, and likely has never seen serious use. Is there any good reason to support such obsolete interfaces, and is there a sane path to deprecating and removing them?

At this point, Linus spoke up to detail his stance on changes to user-space interfaces: "I never said don't change the ABI. We have done it to fix bad bugs. Just don't break user space. If we can change the ABI, but no one complains, then we are good to go." As a step in the removal process, Rusty Russell proposed the addition of a CONFIG_MODERN option that would be on by default, and could be disabled if access is needed to legacy features. Len Brown responded that this would likely suffer a similar fate to CONFIG_EXPERIMENTAL, which was always turned on (i.e., CONFIG_MODERN would likely always be turned off by distributors). Thomas Gleixner instead suggested to place legacy features under configuration options marked as "bool n", preventing the options from being selected, and then removing the legacy features unless someone complains within a reasonable time.

The session ended without any particular conclusions, but a few people expressed sentiments in favor of removing support for legacy systems, and no one raised serious objections. Thus, it may be that in the future we see some serious effort devoted to cleaning out kernel code for systems that clearly see no serious contemporary use. (It is noteworthy that a discussion on removing stale platforms was also taking place in the ARM minisummit.)


to post comments

KS2012: Supporting old/oddball architectures, tool chains, and devices

Posted Aug 30, 2012 3:06 UTC (Thu) by gmaxwell (guest, #30048) [Link] (2 responses)

I can't say much for the kernel— But in userspace code I've found that supporting and testing on oddball systems often exposes bugs which regular users on primary platforms were at least potentially exposed to, and results in higher quality code as a result.

Of course, if no one is testing it at all then it probably doesn't provide even this value.

KS2012: Supporting old/oddball architectures, tool chains, and devices

Posted Aug 30, 2012 8:23 UTC (Thu) by justincormack (subscriber, #70439) [Link] (1 responses)

Absolutely, I always try to test on a variety of architectures to root out odd stuff, and have a pile of miscellaneous hardware. Certainly helps find those odd bugs.

But I see there is still a driver of mine in the kernel that I no longer have the hardware for and probably no one else does, from ten years back which may well not work (I did keep up with various subsystem changes for some years), but it could certainly do with being deprecated now.

KS2012: Supporting old/oddball architectures, tool chains, and devices

Posted Aug 31, 2012 14:30 UTC (Fri) by nevets (subscriber, #11875) [Link]

Feel free to send a patch that moves that driver to staging. As the author of the driver, you are the most adequate person to submit this change.

KS2012: Supporting old/oddball architectures, tool chains, and devices

Posted Sep 4, 2012 1:55 UTC (Tue) by Baylink (guest, #755) [Link]

"Embedded systems".

See also "Raspberry Pi", as I noted in an earlier comment.

KS2012: Supporting old/oddball architectures, tool chains, and devices

Posted Sep 6, 2012 22:25 UTC (Thu) by gb (subscriber, #58328) [Link] (4 responses)

Two things seem missing in this article.

First, there are emulators. It's significantly easier to emulate 386 than core2-due i guess, and probably faster. Presence of emulators also means that you have no need to search for old 386 hardware to test 386 support.

Second, Peter seem approach linux kernel like a fully commercial product, he has a 'effort' which may be 'put' into some 'direction' or 'wasted' doing something that do not push 'product' forward. In fact, Linux would be dead if idea behind it dies, idea that software development is interesting. It's usually interesting to run on some unusual hardware, to fix some crappy bug and not 'supporting' such platforms is linux would mean more 'we do not accept patches for this outdated XXX' than 'we spent so many time on supporting it'.

I hope linux would not replicate fate of gnome which in 2.0 branch started from 'removing unusual and rarely used features' and finished up with complete rewrite in new shiny way everybody loves.

KS2012: Supporting old/oddball architectures, tool chains, and devices

Posted Sep 6, 2012 23:10 UTC (Thu) by dlang (guest, #313) [Link] (1 responses)

> Presence of emulators also means that you have no need to search for old 386 hardware to test 386 support.

This assumes that the emulator is perfect.

There are differences between different flavors of 386 chips that sometimes trip things up.

As a smoke test and emulator is Ok, but it doesn't replace all testing on real hardware.

KS2012: Supporting old/oddball architectures, tool chains, and devices

Posted Sep 10, 2012 18:02 UTC (Mon) by BenHutchings (subscriber, #37955) [Link]

Indeed. For a while there was a bug in the 'alternatives' code that would cause 386 and 486 processors to crash because it patched an instruction that was already fetched into the pipeline. (Later processors will flush the pipeline in this case. These differences in behaviour are documented, by the way.) I very much doubt that, say, QEMU simulates processor behaviour down to this level - that would tend to make it much slower.

KS2012: Supporting old/oddball architectures, tool chains, and devices

Posted Sep 7, 2012 20:55 UTC (Fri) by wtanksleyjr (subscriber, #74601) [Link]

The cost of supporting legacy platforms is NOT merely the time and money it takes to run a few tests on those platforms; rather, it's the inability to add new features because they impact a code path that can't be tested because it's only exercised on the legacy hardware.

KS2012: Supporting old/oddball architectures, tool chains, and devices

Posted Sep 25, 2012 6:26 UTC (Tue) by muwlgr (guest, #35359) [Link]

80386 did not have 'cmpxchg' instruction which only appeared in i486.
I am not sure it is possible to emulate its absence with native KVM/QEMU.


Copyright © 2012, Eklektix, Inc.
This article may be redistributed under the terms of the Creative Commons CC BY-SA 4.0 license
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds