-
Notifications
You must be signed in to change notification settings - Fork 102
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
[v1.06][ARM] Add Windows on Arm support #273
Conversation
cpufetch does not accept pull requests, see the contributing guidelines for details |
Overall looks good from a first sight! Thanks for your work. The only major thing is to skip the changes in |
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.
First round of reviews done!
Windows on Arm support
Windows exposes the MIDR register through the registery per-processor. Functions are added to get DWORD and QWORD registery values and the linux code may be re-used to detect e-core/p-core configurations.
Uses the first core's `ProcessorNameString` registry entry to determine the SoC. My thinkpad x13s returns `Snapdragon (TM) 8cx Gen 3 @ 3.0 GHz` for this entry. So the `match_special` is modified to map strings that start with `Snapdragon (TM) 8cx Gen 3` to the `SOC_SNAPD_SC8280XP` entry.
The `CP 4030` register maps to the `ID_AA64ISAR0_EL1` register on windows.
Should be `long long` rather than just `long`.
Wording here was pretty bad.
Uses the `ID_AA64PFR0_EL1` register to detect NEON and SVE. `SVE2` is set to false since the required `ID_AA64ZFR0_EL1`-register is not exposed.
There is no reliable way to derive the SoC details on Windows-Arm
Used to try and determine an SoC vendor based on its SoC name.
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.
Second round of reviews, looking quite good, only some small details left before merging.
And one last thing. Do you think your CPU actually has such a low frequency? 1.4 and 1.7 GHz seems extremely low to me! Or is it you are getting the base frequency and not the max frequency?
5bd1aae
to
f973c51
Compare
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.
Excellent work. LGTM, so I'll merge as soon as you confirm you are okay with it 👍
Well, the only remaining thing is the frequency issue I mentioned earlier. Copy-pasting here again: Do you think your CPU actually has such a low frequency? 1.4 and 1.7 GHz seems extremely low to me! Maybe you are getting the base frequency and not the max frequency? |
Those values are taken from the If I make this change: - ptr->freq->base = UNKNOWN_DATA;
- ptr->freq->max = freq_array[midr_idx];
+ ptr->freq->base = freq_array[midr_idx];
+ ptr->freq->max = UNKNOWN_DATA; So some additional conditional printing of frequency info would probably have to be added to support The processor-name-string says Looks like cpuinfo runs into the same problem here and just have a database of known names. |
Right, so what you are getting from I think there are two possible solutions here:
However, this is Linux only. In the near future, though, I'll implement a slight variation of this which will make it OS-agnostic in principle (see #266 for more details). In case you cannot find anything from 1., just leave the frequency as unkown (e.g., like this): ptr->freq->base = freq_array[midr_idx];
ptr->freq->max = UNKNOWN_DATA; and once I implement the OS-agnostic Edit: Parsing |
Wasn't able to find a registry entry that got the current/max frequency, so I'll just map it to the base frequency for now. I did find CallNtPowerInformation that can provide a PROCESSOR_POWER_INFORMATION which provides |
Yeah, it does not seem to be a nice way to get the frequency. So I think the way to go is setting the frequency to unkown (thanks for the commit) and we'll leave this as future work. As I said, I'll work on the OS-independent frequency measurement and once merged I'll get back to you to check if it works as expected. That said this PR is ready to be merged, I'll do so whenever you confirm you are okay with it 👍 . PS: As future reference, the TODO after this PR is:
|
All good to merge! 👍 |
Following up on this comment.
Adds Windows on Arm support. Starting with the ThinkPad x13s(
SC8280XP
).Resolves #226