News: 0001510913

  ARM Give a man a fire and he's warm for a day, but set fire to him and he's warm for the rest of his life (Terry Pratchett, Jingo)

More Kernel Bitrot: Old & Busted UltraSPARC T2 "Niagara 2" SPU Driver Slated For Removal

([Linux Kernel] 111 Minutes Ago Sun Niagara 2 Days...)


Following [1]107k lines of old driver code within the staging area of the kernel removed for Linux 6.13, over in the crypto space they are looking at some cleaning as well with plans raised to remove the Stream Processing Unit (SPU) driver for the old [2]Sun Niagara 2, the Sun UltraSPARC T2 and this SPU was also found in the UltraSPARC T3 as well.

Eric Biggers of Google raised the patches today for dropping the Niagara 2 SPU driver from the mainline Linux kernel. Besides being for some nearly two decade old Sun SPARC CPUs, the driver likely itself doesn't even function correctly, was known to be "completely broken" for a number of years prior, and it's holding back improvements to other crypto drivers due to increased overhead of the crypto API for all other drivers.

A lot of users like to pretend that carrying old drivers around the kernel comes with little maintenance costs on the part of the developers and that users will report bugs, but this Niagara 2 SPU driver situation perfectly illustrates the difficulties of keeping vintage drivers viable in the mainline kernel. Eric Biggers commented on the Linux kernel mailing list:

"Remove the driver for the Stream Processing Unit (SPU) on the Niagara 2.

Removing this driver allows removing the support for physical address walks in skcipher_walk. That is a misfeature that is used only by this driver and increases the overhead of the crypto API for everyone else.

There is little evidence that anyone cares about this driver. The Niagara 2, a.k.a. the UltraSPARC T2, is a server CPU released in 2007. The SPU is also present on the SPARC T3, released in 2010. However, the SPU went away in SPARC T4, released in 2012, which replaced it with proper cryptographic instructions instead. These newer instructions are supported by the kernel in arch/sparc/crypto/.

This driver was completely broken from (at least) 2015 to 2022, from commit 8996eafdcbad ("crypto: ahash - ensure statesize is non-zero") to commit 76a4e8745935 ("crypto: n2 - add missing hash statesize"), since its probe function always returned an error before registering any algorithms. Though, even with that obvious issue fixed, it is unclear whether the driver now works correctly. E.g., there are no indications that anyone has run the self-tests recently.

One bug report for this driver in 2017 complained that it crashed the kernel while being loaded. The reporter didn't seem to care about the functionality of the driver, but rather just the fact that loading it crashed the kernel. In fact not until 2022 was the driver fixed to maybe actually register its algorithms with the crypto API. The 2022 fix does have a Reported-by and Tested-by, but that may similarly have been just about making the error messages go away as opposed to someone actually wanting to use the driver.

As such, it seems appropriate to retire this driver in mainline."

[3]This patch on the kernel mailing list clears out that 2.5k lines of code for the old UltraSPARC T2 SPU driver.



[1] https://www.phoronix.com/news/Linux-6.13-Staging

[2] https://www.phoronix.com/review/798

[3] https://lore.kernel.org/lkml/20241207190503.53440-2-ebiggers@kernel.org/



rabcor

V1tol

rabcor

Congratulations! You are the one-millionth user to log into our system.
If there's anything special we can do for you, anything at all, don't
hesitate to ask!