5 ms·
I'm asking out of naiveté here -- how were they (kernel maintainers) able to get the Linux kernel to support M1 with undocumented instructions?
by mancerayder 5y ago
I'm asking out of naiveté here -- how were they (kernel maintainers) able to get the Linux kernel to support M1 with undocumented instructions?
- frabert 5y agoA kernel doesn't need to use all the instructions a CPU offers -- only the ones it needs.
- ithkuil 5y agoIf the extra instructions also operate in extra state (e.g. extra registers) a kernel needs to know about their existence so it can correctly save and restore state on context switches
- my123 5y agoNot necessarily/really, the custom extensions still need to be enabled by the kernel before they can be used. As such, it isn’t actually an issue.
- ndesaulniers 5y agoYou're confusing MSRs (which don't have to be saved/restored on context switch) with GPRs (which do).
- Someone 5y agoIt doesn’t need to use them, but it must be aware of them, insofar as they may introduce security problems. As an example, if the kernel doesn’t know of DMA channels, and it requires setup code to prevent user-level code from using them to copy across process boundaries, the kernel will run fine, but have glaring security problems.
- heavyset_go 5y agoI'm assuming they aren't using them or they've reverse engineered the ones they need to use.
- kevingadd 5y agoThe undocumented instructions aren't required in order to use the hardware
- R0b0t1 5y agoDon't use them. The instructions necessary to run Linux are likely inherited from the normal ARM set.
- deleted 5y ago[deleted]
- ducktective 5y agoMy guess: if the situation is similar to Windows laptops, they just use a subset of OEM features and provide a sub-par experience (like lack of battery usage optimizations, flaky suspend/hibernate, second-tier graphics support, etc) Now, I'm typing this on a GNU/Linux machine, but let's face it, all of the nuisances I mentioned are legit and constant source of problems in tech support forums.
- mhh__ 5y agoThe instructions are (all?) for acceleration I think.
- saagarjha 5y agoNot all of them, but the ones that don't (GXF, memory compression, etc.) are opt-in.