Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Optimize builds for AMD Zen Platform #84

Open
4-FLOSS-Free-Libre-Open-Source-Software opened this issue Nov 20, 2024 · 6 comments
Open

Comments

@4-FLOSS-Free-Libre-Open-Source-Software
Copy link
Contributor

This enables -march=znver1 (MZEN), -march=znver2 (MZEN2), -march=znver3 (MZEN3) or -march=znver4 (MZEN4) to be set for the kernel's make process, which will optimize the kernel's binary for the target CPU architecture.

@taalojarvi
Copy link
Contributor

taalojarvi commented Nov 21, 2024

JFYI I maintain a fork of Locietta's Xanmod kernel for AMD Zen platforms.. Apart from very few changes from my side, its close to 1:1 in case you need to test builds.

@Andarwinux
Copy link
Contributor

I suspect this may not make sense at all, kbuild removes the increased ISA capabilities of march via CFLAGS and the kernel doesn't use autovec, so march-specific SIMD scheduling tuning doesn't make sense either.

@4-FLOSS-Free-Libre-Open-Source-Software
Copy link
Contributor Author

in case you need to test builds.

Test builds can be found in artifacts:

I suspect this may not make sense at all, kbuild removes the increased ISA capabilities of march via CFLAGS

Good hint. The kernel build system (kbuild) may override or strip out certain flags. Perhaps we need benchmarks to weigh the potential benefits?

and the kernel doesn't use autovec, so march-specific SIMD scheduling tuning doesn't make sense either.

so the kernel does not heavily rely on SIMD (Single Instruction, Multiple Data) instructions, and many of the optimizations provided by -march should be more relevant to user-space applications.

@Locietta
Copy link
Owner

The -march build feature in Xanmod (and many other x86v3 kernels) is enabled by graysky's kernel compiler patch, they do have a few benchmarks there. There isn't significant difference between x86v3 and zen3 build though.

x86v4 (with AVX-512) doesn't make much sense for kernel either, but xanmod upstream ships x86v4 build anyway, so I just follow their choice. I'm also thinking about dropping skylake build, as I don't like too many arch-specific builds that most people not using. I don't feel like to add 4 more such builds...

Maybe I can just add scoop manifests for taalojarvi's kernel at https://github.com/Locietta/sniffer.

@4-FLOSS-Free-Libre-Open-Source-Software
Copy link
Contributor Author

Maybe I can just add scoop manifests for taalojarvi's kernel at https://github.com/Locietta/sniffer.

Those forked builds are far too different from yours? Personally, I would prefer to stay with locietta-WSL2-xanmod.

@Andarwinux
Copy link
Contributor

Some advanced architectures might not be affected by some of the older vulnerabilities, so it might still make sense to disable some of the unnecessary mitigations for those specific kernel, but this could bring extra maintenance burdens and security risks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants