Linux Kernel & OS

Linux kernel RFC proposes cleaner AMD Zen microarchitecture detection

Key Takeaway

An AMD engineer has proposed a new way to handle AMD Zen CPU microarchitecture detection in the Linux kernel, using AI to assist in the code cleanup.

Summary

AMD Linux engineer Borislav Petkov has submitted a Request for Comments (RFC) to the Linux Kernel Mailing List to improve how the kernel detects and handles AMD Zen microarchitectures. The proposal aims to allow code paths to target specific ranges of Zen generations, such as Zen 3 through Zen 5. The developer noted that AI was used to help structure the logic for this cleanup.

Improving Zen microarchitecture handling

  • The RFC aims to enable range checks for microarchitectures (e.g., "this code runs on Zen 3 through Zen 5").
  • It seeks to clean up existing code paths that are specific to certain AMD Zen generations.
  • The developer mentioned that X86_FEATURE_ZEN will remain to mark all Zen CPUs for now.
  • The implementation involves moving Hygon usage away from certain existing checks to allow for more granular detection.

Original reference: www.phoronix.com →