-
Notifications
You must be signed in to change notification settings - Fork 108
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
Arm processers support #96
Comments
Hi, |
Hi @anrieff you can integrate, but i using prebuilded config.h and cmake build system https://github.com/fastogt/common/tree/master/src/third-party/cpuid, some definitions i receive via cmake https://github.com/fastogt/cmake/blob/master/config.cmake , i have arm devices for testing, but i don't know which function need to implement, it will be cool if we will found how to integrate arm CPU's. |
OK, don't worry, I'll take care of the initial coding so that libcpuid successfully compiles on ARM with both autotools and CMake, and my AArch64 processor is recognized; you'll then be able to fork the ARM supported version and test on your machines and potentially produce pull requests with the additions for recognizing them properly. Details to follow here, when I make progress on this task. |
Hi @anrieff , sure will wait you, also it will be perfect have CMakeLists.txt to build/inegrate libcpuid via cmake. |
@anrieff any progress on this? |
Hey, sorry about the much delay. As you may have noted, I haven't been active here for the last few months and that's because of tremendous workload I have at my regular work. I'll be back to more regular schedule and writing new features around the end of November - sorry about overpromising and underdelivering on the ARM feature specifically : |
Ping |
Haven't had time to look into this, sorry. I don't want to promise anything though, I may not be able to integrate ARM support anytime soon. |
I'm sorry, I thought we together will do this issue, in any case i will wait when you will be ready. Thank you. |
FYI |
It would be great to get an update on this |
Re: ways to implement this, |
Hi, Is the ARM support integration available with the latest libcpuid? CPU-X:core.c:274: failed to call libcpuid (CPUID instruction is not supported) CPU-X works fine on Intel based computers. |
Hello, I am playing a little bit on my Raspberry Pi 4 Model B. I found following code: https://wiki.osdev.org/Detecting_Raspberry_Pi_Board For information, Main ID Register, MIDR, provides identification information for the processor. Some useful links:
So I tried to build and run it:
It does not work, because this instruction is accessible only in privileged modes. Correct me if I am wrong, but I do not think we can provide CPU identification for the ARM architecture in libcpuid. |
Have you tried the |
I cannot use
It is a ARMv7 Processor rev 3 (v7l). I do not have ARMv8 available to me. |
Hello, I have good and bad news. The good new is despite having bare metal ARMv8 CPU running in AArch64 mode, I found that I can use QEMU's TCG to emulate some ARM CPUs. It works very well, I can emulate a Cortex A57 CPU to run Debian 12 and FreeBSD 14 (I cannot run Windows 11 though, VM stucks after "Press any key to boot...").
What I learned about AArch64 is Exception levels: for short, libcpuid is running at EL0 while kernel is running at EL1, so in theory any software running at EL0 cannot access EL1/EL2/EL3 registers. And the bad new is still about EL1 registers: to decode information about caches, a cache level needs to be write in CSSELR-EL1, then CCSIDR-EL1 can be read to get current cache size, but Linux do not allow access to these registers. Some people will probably tell me that we can still harcode cache size for each CPU in the DB, but caches are optional on some CPUs (like Cortex M7) or the value can be in a range (see Arm Cortex-A Processor Comparison Table), so I do not think it is a great idea because it may reports wrong information to end users IMHO. I hope I will be able to open a PR for review soon, I need to decode ARM CPUs features before. |
I added initial support for ARM CPUs in c588569. Please note that only AArch64 mode (ARMv8+) is supported on OS where access to EL1 registers from userspace is trapped (Linux and FreeBSD as far as I know). For volunteers who meet the prerequisites, feel free to build libcpuid from master, share RAW data ( |
About CCSIDR_EL1:
We, I guess it is explicit... Even Linux developers removed CCSIDR-based cache information probing. |
Related to #96 Kernel modules to access AArch32 registers will be added in a separate commit.
Support for AArch32 mode and older CPUs is in progress: ea9ada7. |
I updated the macOS and Windows are not supported yet. If someone is interested to work on this support, I will be happy to leave this task to him. The arm-cpusysregs repository provides an example with modules for macOS and Windows, it should not be that complicated to adapt the code. The tricky part is to create one dedicated device that runs on a dedicated CPU core (the MPIDR register contains the core ID, e.g. |
About macOS: it looks painful to load a kernel extension according to this. The System Integrity Protection (SIP) must be disabled if we are not registered "Apple developers". Also, I found this deprecation notice:
Apple is promoting system extensions as an alternative to kernel extensions, but it requires an entitlement from Apple, meaning an developer ID is required. About Windows: it tried to install Windows Insider Preview ARM64 on a QEMU VM by using CPU emulation, but I was not able to configure the system, so I cannot progress on this topic. Anyway, Windows ARM64 runners for GitHub Actions are still not publicly available. Since libcpuid is supporting ARM CPUs, I am closing this issue. I plan to release v0.7.0 as is, we will see if people are requesting raw data extraction on macOS/Windows systems running on ARM CPUs. Any contributors are welcome to work on such support. |
Hi, do you have some plans to support arm processors? Now i have some stubs for arm platform: https://github.com/fastogt/libcpuid
The text was updated successfully, but these errors were encountered: