-
Notifications
You must be signed in to change notification settings - Fork 302
Update README.md to report support of POWER and s390x #284
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
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
there is a question related to Windows AArch64, we have two ways to add support via software driver as we need EL1 (userland) to get info about system registers, see #186 or just read via
IsProcessorFeaturePresentandHARDWARE\\DESCRIPTION\\System\\CentralProcessor\\0the first approach is not easy, but we will have consistent features detection with Linux/FreeBSD,
the second approach is easy to get info, but
IsProcessorFeaturePresentprovides a small range of features detectionBy the way, Linux and FreeBSD support reading features EL1 in user space (https://www.kernel.org/doc/html/latest/arm64/cpu-feature-registers.html), so we can replace impl to detection via asm if we want
Thoughts?
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.
also, there is an interesting fact in Windows arm64 that we can run our x86 impl and get virtual info :)
Broadcom BCM2837B0 (Raspberry Pi 3B+)
Uh oh!
There was an error while loading. Please reload this page.
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.
For the purpose of this PR I will leave it as-is but we definitely want to support other ways to gather CPU info data. For instance, getting
midris a nice addition, it's a bit like thevendorandbrand_stringfor x86.That said, I really want to keep
cpu_featuresas a userland library ( i.e., not a driver ).EL1reading via filesystem under Linux / FreeBSD LGTM. Writing a driver for Windows less so.(The raspberry pi emulating x86 on windows is amazing 😀)
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.
I'll close this PR but we can continue the discussion here if you want.
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.
Got it, so we choose reading from
IsProcessorFeaturePresent, my next question is about public API should we create a separate struct for win arm64 so as not to confuse the user (for instanceAarch64WindowsInfo)? Since for the current structAarch64Infowe have flags thatIsProcessorFeaturePresentdoesn't provide, for example,PF_ARM_V8_CRYPTO_INSTRUCTIONS_AVAILABLEwe don't know which instructions CPU supports AES, SHA1, SHA2...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.
I'll leave here FreeBSD RPI4
dmesg.boot:CPU 0: ARM Cortex-A72 r0p3 affinity: 0 Cache Type = <64 byte D-cacheline,64 byte I-cacheline,PIPT ICache,64 byte ERG,64 byte CWG> Instruction Set Attributes 0 = <CRC32> Instruction Set Attributes 1 = <> Instruction Set Attributes 2 = <> Processor Features 0 = <AdvSIMD,FP,EL3 32,EL2 32,EL1 32,EL0 32> Processor Features 1 = <> Memory Model Features 0 = <TGran4,TGran64,SNSMem,BigEnd,16bit ASID,16TB PA> Memory Model Features 1 = <8bit VMID> Memory Model Features 2 = <32bit CCIDX,48bit VA> Debug Features 0 = <DoubleLock,2 CTX BKPTs,4 Watchpoints,6 Breakpoints,PMUv3,Debugv8> Debug Features 1 = <> Auxiliary Features 0 = <> Auxiliary Features 1 = <> AArch32 Instruction Set Attributes 5 = <CRC32,SEVL> AArch32 Media and VFP Features 0 = <FPRound,FPSqrt,FPDivide,DP VFPv3+v4,SP VFPv3+v4,AdvSIMD> AArch32 Media and VFP Features 1 = <SIMDFMAC,FPHP DP Conv,SIMDHP SP Conv,SIMDSP,SIMDInt,SIMDLS,FPDNaN,FPFtZ> CPU 1: ARM Cortex-A72 r0p3 affinity: 1 CPU 2: ARM Cortex-A72 r0p3 affinity: 2 CPU 3: ARM Cortex-A72 r0p3 affinity: 3There 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.
macOS hw docs:
https://developer.apple.com/documentation/kernel/1387446-sysctlbyname/determining_instruction_set_characteristics
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.
gentle ping @gchatelet
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.
I forgot to hit send 😅
"If windows fields are just a subset of the fields I would just keep the same structure and document which fields are not populated on Windows. If they are disjoint (some exist on windows only, others exist on linux only) then it may make sense to have different structs. For now I would just keep the same and use documentation. We can always add a different struct later on if it makes sense. Keeping the interface as small as possible has maintenance value."
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.
clear, thanks a lot! I will implement it for Windows and will play with parsing FreeBSD if no objections