Fix incorrect bitmask for MBM counter length
Description
From Intel RDT spec[1] and AMD Platform QoS spec[2]: If the CPU platform supports CPUID.0FH.01H:EAX, CPUID.0FH.01H:EAX[7:0] returns MBM counter length (width) as offset from 24.
But in hw_cap_mon_discover(), the MBM counter length is calculated with incorrect 7-bits bitmask (0x7f).
Fix the issue with 8-bits bitmask (0xff) for MBM counter length.
[1] Intel Architectures SDM, Vol.3B, 19.18 Intel RDT Monitoring: https://cdrdv2.intel.com/v1/dl/getContent/671200
[2] AMD Platform QoS Extensions, Rev 1.03: https://www.amd.com/content/dam/amd/en/documents/processor-tech-docs/other/56375_1_03_PUB.pdf
Fixes: 050f8c64ad9d ("lib: detect MBM counter length")
Affected parts
- [x] library
- [ ] pqos utility
- [ ] rdtset utility
- [ ] other: (please specify)
Motivation and Context
Fix incorrect bitmask for MBM counter length
How Has This Been Tested?
- Passed all tests in intel-cmt-cat/unit-test.
- Run most pqos tests described below: https://github.com/intel/intel-cmt-cat/wiki/Usage-Examples
Types of changes
- [x] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
Checklist:
- [x] My code follows the code style of this project.
- [ ] My change requires a change to the documentation.
- [ ] I have updated the documentation accordingly.
Hi Xiaochen, Thanks for noticing this! We will review and get back to you soon. May take a week or so given the US holiday this week. Thanks, ~Andrew
Update -- we have reviewed and plan to approve. We will merge this with the next RDT Utility release in Q1-2026, and we will include this fix as part of that, and the pull request will be marked as accepted at that point. Thanks, ~Andrew