Linux 5.19 allows clearcpuid to no longer use numeric parameters

The Linux x86/x86_64 kernel has long used clearcpuid=kernel parameters to disable the use of certain CPUID features by the kernel. Its use is not intuitive, however, as it relies on passing bit numbers for specific functions. In Linux 5.19, if you want to disable specific CPUID features, it will be easier to handle .

Until now, if you want to disable the CPUID feature used by the Linux kernel, the user needs to look in the cpufeatures.hheader and find the bit number of the feature you want to disable. For example, wanting to disable AVX means you need to set clearcpuid=156. And it should be noted that some tags are not exactly the same in different Linux kernel versions.

In Linux 5.19, clearcpuid=kernel parameters can be set /proc/cpuinfoto the flag value strings shown in . So instead of having to memorize numbers like clearcpuid=156this , you can now use them directly clearcpuid=avx. Multiple CPUID flags can be separated by using commas.

This is a long overdue kernel usability improvement for system administrators and developers who debug kernel behavior on their systems. This improvement does not mean that the previously used number of digits method will be eliminated, and the number of digits can still be used in the new version. Software in user space can also continue to use the corresponding function by directly calling CPUID or directly using any relevant instruction, clearcpuid=just to avoid the use of the Linux kernel and remove it from the /proc/cpuinfooutput . This change will be merged as part of the x86/cpu update for Linux 5.19.

Guess you like

Origin www.oschina.net/news/197981/linux-5-19-easier-clear-cpuid-features