-
Notifications
You must be signed in to change notification settings - Fork 360
Add/extend cpu_model numbers for the Zen arch #6230
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
base: master
Are you sure you want to change the base?
Conversation
WalkthroughA docstring line was added to Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes
Pre-merge checks✅ Passed checks (3 passed)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (1)
avocado/utils/cpu.py (1)
321-321: Consider sorting model ranges for consistency.The new Zen 5 model range (0x60, 0x6F) is functionally correct but appears out of order relative to (0x70, 0x7F). Other families in the mapping (0x17 and 0x19) use ascending ranges. Reordering improves maintainability:
- 0x1A: {5: [(0x00, 0x0F), (0x20, 0x2F), (0x40, 0x4F), (0x70, 0x7F), (0x60, 0x6F)]}, + 0x1A: {5: [(0x00, 0x0F), (0x20, 0x2F), (0x40, 0x4F), (0x60, 0x6F), (0x70, 0x7F)]},
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
avocado/utils/cpu.py(2 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (27)
- GitHub Check: rpm-build:centos-stream-9-x86_64
- GitHub Check: rpm-build:fedora-rawhide-x86_64
- GitHub Check: rpm-build:fedora-41-ppc64le
- GitHub Check: rpm-build:fedora-43-x86_64
- GitHub Check: rpm-build:fedora-41-s390x
- GitHub Check: rpm-build:fedora-41-aarch64
- GitHub Check: rpm-build:fedora-42-x86_64
- GitHub Check: rpm-build:epel-9-x86_64
- GitHub Check: rpm-build:fedora-41-x86_64
- GitHub Check: rpm-build:fedora-41-s390x
- GitHub Check: rpm-build:fedora-42-x86_64
- GitHub Check: rpm-build:fedora-41-x86_64
- GitHub Check: rpm-build:fedora-rawhide-x86_64
- GitHub Check: rpm-build:fedora-43-x86_64
- GitHub Check: rpm-build:fedora-41-aarch64
- GitHub Check: rpm-build:centos-stream-9-x86_64
- GitHub Check: rpm-build:fedora-41-ppc64le
- GitHub Check: rpm-build:epel-9-x86_64
- GitHub Check: rpm-build:fedora-41-s390x
- GitHub Check: rpm-build:fedora-42-x86_64
- GitHub Check: rpm-build:fedora-41-ppc64le
- GitHub Check: rpm-build:fedora-41-aarch64
- GitHub Check: rpm-build:centos-stream-9-x86_64
- GitHub Check: rpm-build:epel-9-x86_64
- GitHub Check: rpm-build:fedora-43-x86_64
- GitHub Check: rpm-build:fedora-rawhide-x86_64
- GitHub Check: rpm-build:fedora-41-x86_64
🔇 Additional comments (2)
avocado/utils/cpu.py (2)
305-312: Docstring improves clarity.The docstring addition properly documents the function's return value and follows the project's conventions with
:param,:type,:return, and:rtypetags. Good.
303-333: Verify purpose and integration:get_x86_amd_zen()function appears unused and lacks tests.The
get_x86_amd_zen()function at lines 303-333 has no test coverage and is not called anywhere in the codebase. Before extending CPU model detection, clarify if this function is:
- Dead code that should be removed
- An incomplete feature requiring integration with existing code and corresponding test coverage for the new Zen 5 model range (0x60, 0x6F)
|
Hi @Suneeth-D, could you please add a reference to an official documentation source where these model numbers are defined? It'd be helpful for the review process. Thanks! |
The patch has the following changes incorporated:- *Add the cpu_model numbers range (0x60, 0x6F) for detecting Zen5 CPUs in the get_x86_amd_zen(). *Extend the cpu_model dictionary to have Zen6 numbers in the get_x86_amd_zen(). *Add function description for the function get_x86_amd_zen(). Referred the cpu_model numbers from [1]. [1] https://github.com/torvalds/linux/blob/master/arch/x86/kernel/cpu/amd.c Signed-off-by: Suneeth D <[email protected]>
c99a01e to
065d5f1
Compare
|
Hi @clebergnu , Thanks for reviewing my patch. I have added the link to where I referred those cpu_model numbers from in the commit message now. Also extended the patch to have numbers for detecting Zen6 CPUs too. Thanks! |
bssrikanth
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Exact location where the numbers for zen6 are defined: https://github.com/torvalds/linux/blob/master/arch/x86/kernel/cpu/amd.c#L518
zen5 :
https://github.com/torvalds/linux/blob/master/arch/x86/kernel/cpu/amd.c#L515
@Suneeth-D apart from the comment, patch LGTM.
| }, | ||
| 0x19: {3: [(0x00, 0x0F), (0x20, 0x5F)], 4: [(0x10, 0x1F), (0x60, 0xAF)]}, | ||
| 0x1A: {5: [(0x00, 0x0F), (0x20, 0x2F), (0x40, 0x4F), (0x70, 0x7F)]}, | ||
| 0x1A: {5: [(0x00, 0x0F), (0x20, 0x2F), (0x40, 0x4F), (0x60, 0x6F), (0x70, 0x7F)], 6: [(0x50, 0x5f), (0x80, 0xAF), (0xc0, 0xcf)]}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Suneeth-D according to https://github.com/torvalds/linux/blob/master/arch/x86/kernel/cpu/amd.c#L515 should the range added for zen 5 be (0x60, 0x7F) instead of (0x60, 0x6F) ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Suneeth-D any updates here?
Add the cpu_model numbers range (0x60, 0x6F) for detecting Zen5 CPUs in the get_x86_amd_zen().
Add function description for the function get_x86_amd_zen().
Signed-off-by: Suneeth D [email protected]
Summary by CodeRabbit
Documentation
Bug Fixes