Bug 1268604

Summary: Cannot use -p option for over-256 processor systems
Product: [Fedora] Fedora EPEL Reporter: Seiichi Ikarashi <sikarash>
Component: msr-toolsAssignee: Greg Bailey <gbailey>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: unspecified    
Version: epel7CC: gbailey
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: msr-tools-1.3-3.el7 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-11-08 17:52:02 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Seiichi Ikarashi 2015-10-03 13:19:06 UTC
Description of problem:
-p option is limited to processor number 255 intentionally but
nowadays, over-256 processor systems are coming.
Let's expand the max limit to, say, 65535 or more.

Version-Release number of selected component (if applicable):
msr-tools-1.3-1.el7

How reproducible:
Always

Steps to Reproduce:
1. Install msr-tools into a system that has 257 processors or more.
2. Use rdmsr command with "-p 256" option.

Actual results:
rdmsr exits with errno 127.

Expected results:
rdmsr should print the MSR value from CPU 256.

Additional info:

A sample fix is
https://github.com/sikarash/msr-tools/commit/3bfa9f712203bd0ad029df8489d2122bd51e0a7b

Comment 1 Greg Bailey 2015-10-03 13:40:37 UTC
Wouldn't we want a similar patch to wrmsr.c and cpuid.c?  It looks like your pull request on github only addresses rdmsr.c.

Comment 2 Seiichi Ikarashi 2015-10-04 05:12:10 UTC
Greg,

(In reply to Greg Bailey from comment #1)
> Wouldn't we want a similar patch to wrmsr.c and cpuid.c?  It looks like your
> pull request on github only addresses rdmsr.c.

You are correct. They are necessary.

https://github.com/sikarash/msr-tools/commit/34f8aa57d4fb571356fcefc5b1b0303af10d0d31
https://github.com/sikarash/msr-tools/commit/a6d856368a354532bf0218dfc334f4e14673271d

Comment 3 Seiichi Ikarashi 2015-10-04 14:21:27 UTC
I was wrong.
The value 65535 is nonsense because the variable is type of (int),
and also the theoretical max logical CPUs of RHEL7 is 5120.
https://access.redhat.com/articles/rhel-limits

So 5120 is enough here.

Comment 4 Seiichi Ikarashi 2015-10-04 14:24:31 UTC
I was wrong again, 2,147,483,647 is the maximum of signed int for x86_64.
Still, 5120 is enough for RHEL7.

Comment 5 Seiichi Ikarashi 2015-10-08 15:57:32 UTC
Greg, are you going to fix these three commands?

Comment 6 Greg Bailey 2015-10-09 15:40:33 UTC
(In reply to Seiichi Ikarashi from comment #5)
> Greg, are you going to fix these three commands?

Yes, of course, I just returned from vacation and will address these either today or tomorrow.

Comment 7 Fedora Update System 2015-10-10 12:04:41 UTC
msr-tools-1.3-3.el7 has been submitted as an update to Fedora EPEL 7. https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2015-ace89f67cb

Comment 8 Fedora Update System 2015-10-12 18:50:11 UTC
msr-tools-1.3-3.el7 has been pushed to the Fedora EPEL 7 testing repository. If problems still persist, please make note of it in this bug report.
If you want to test the update, you can install it with
$ su -c 'yum --enablerepo=epel-testing update msr-tools'
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2015-ace89f67cb

Comment 9 Fedora Update System 2015-11-08 17:52:00 UTC
msr-tools-1.3-3.el7 has been pushed to the Fedora EPEL 7 stable repository. If problems still persist, please make note of it in this bug report.