Linux Kernel Adds Emulation for Old CPUs as Native Support Fades

Linux kernel developers add software emulation for double- byte atomic operations, signaling a shift away from native support for legacy architectures like C- SKY.

C-SKY C-SKY
C-SKY C-SKY

Developers of the kernel are adding a software emulation function cmpxchg_emu_u16() to perform double byte atomic operations on archs which do not have specific instructions to perform the job. With this function it is now possible for generic kernel code to rely on double byte operations being supported on different architectures. As such it should no longer be necessary to add architecture specific workarounds to the core code.

New software bridge keeps legacy C-SKY and other architectures running

That change will obviously affect the old designs of CPUs. It is a kind of generalisation of how the kernel is dealing with memory operations. It could certainly make things simpler in terms of the kernel codebase. But at the same time it could make things more difficult when it comes to supporting legacy code.

This change is specific to SH, ARC, C-SKY and Xtensa.

It clearly means that things are changing in terms of how the Linux kernel is going to be able to support those CPU architectures. C-SKY is a 32bit domestic CPU made in China. It was merged in the kernel in 2018. It seems that it's at risk of becoming obsolete in recent kernel versions.

It means that the integration of old CPU designs into the evolving software stack that is the Linux kernel will need to be reconsidered. Those old CPU designs will have to use emulation instead of native support to perform certain atomic operations.

There is some discussion in the community which could indicate that Linux mainline may soon become unable to support systems that do not have native support for double bytes storage instruction. And many of the old CPU designs probably don't have that.

As developer Paul E. Mckenney explained it, it's about some extremely old systems (e.g. Acorn RISC PC). It's not necessarily about the whole C-SKY architecture.

That distinction makes it clear that the software emulation function is being added as a kind of bridge. Whether those old designs of CPUs will be supported in the Linux mainline kernel for the long term, if they don't have native instructions support is another matter.

The cmpxchg_emu_u16() is clearly an interim solution. It's being added to keep support while the rest of the community takes a look at the future of those legacy CPU architectures.

This change could be of interest for people developing software or using C-SKY or other old CPU designs. It shows that the pressure to switch to newer hardware that will support what is required in terms of atomic operations standards is likely to increase.

The evolution of the Linux kernel still clearly puts emphasis on performance and code simplicity. Old CPU designs will probably have to make do with a smaller and smaller field of possible official support.

Discussion

0 comments

Log in to join the thread with a thoughtful take, question, or correction.

Add to the discussion