Skip to content
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

Refactor Apple SoC detection #213

Open
Dr-Noob opened this issue Dec 22, 2023 · 2 comments
Open

Refactor Apple SoC detection #213

Dr-Noob opened this issue Dec 22, 2023 · 2 comments
Labels
enhancement New feature or request

Comments

@Dr-Noob
Copy link
Owner

Dr-Noob commented Dec 22, 2023

guess_soc_apple and get_cpu_info_mach need refactoring since they'll probably keep releasing more and more chips. Also asahilinux has a very good tracking of the MIDR values which we should replicate since currently we are setting the same MIDR for all CPU types within a family (M1/M2/M3) which is incorrect. Instead we should follow this.

Also fix this: // Must be M1 in src/arm/midr.c

Also fill_cpu_info_XXX_XXX is not maintainable.

@Dr-Noob Dr-Noob added the enhancement New feature or request label Dec 22, 2023
@Dr-Noob
Copy link
Owner Author

Dr-Noob commented Jan 25, 2024

Even more neccesary after d221f57

@ThomasKaiser
Copy link

ThomasKaiser commented Feb 5, 2024

BTW: since I had an aarch64 Linux VM running on my MacBook below the output. Wouldn't it be an idea to print Virtualized Apple Silicon in such situations?

Apple's Hypervisor.Framework limits CPU features/flags to the one of M1's cores and sets the stepping info to r0p0 on all cores regardless of their real stepping. So it should be easy to detect such an environment?

[root@fedora # /usr/local/src/cpufetch/cpufetch 
[ERROR]: Unknown microarchitecture detected: IM=0x0 P=0x0 V=0x0 R=0x0
[VERSION]: cpufetch v1.04-42-g0967 (Linux ARM build)
Please, create a new issue with this error message, your smartphone/computer model, the output of 'cpufetch --verbose' and 'cpufetch --debug' on https://github.com/Dr-Noob/cpufetch/issues

                                                            SoC:                 Unknown
                                                            Technology:          Unknown
                                                            Microarchitecture:   Unknown
                                                            Max Frequency:       Unknown
                                                            Cores:               8 cores
                                                            Features:            NEON,SHA1,SHA2,AES,CRC32
                                                            Peak Performance:    Unknown
                                                            

[root@fedora # /usr/local/src/cpufetch/cpufetch -d
[ERROR]: Unknown microarchitecture detected: IM=0x0 P=0x0 V=0x0 R=0x0
[VERSION]: cpufetch v1.04-42-g0967 (Linux ARM build)
Please, create a new issue with this error message, your smartphone/computer model, the output of 'cpufetch --verbose' and 'cpufetch --debug' on https://github.com/Dr-Noob/cpufetch/issues
cpufetch v1.04-42-g0967 (Linux ARM build)
[Core 0] 0x000F0000 -1 MHz
[Core 1] 0x000F0000 -1 MHz
[Core 2] 0x000F0000 -1 MHz
[Core 3] 0x000F0000 -1 MHz
[Core 4] 0x000F0000 -1 MHz
[Core 5] 0x000F0000 -1 MHz
[Core 6] 0x000F0000 -1 MHz
[Core 7] 0x000F0000 -1 MHz

[root@fedora # /usr/local/src/cpufetch/cpufetch -v
[WARNING]: Could not open '/sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_max_freq'
[WARNING]: Unable to fetch max frequency for core 0. This is probably because the core is offline
[WARNING]: Could not open '/sys/devices/system/cpu/cpu1/cpufreq/cpuinfo_max_freq'
[WARNING]: Unable to fetch max frequency for core 1. This is probably because the core is offline
[WARNING]: Could not open '/sys/devices/system/cpu/cpu2/cpufreq/cpuinfo_max_freq'
[WARNING]: Unable to fetch max frequency for core 2. This is probably because the core is offline
[WARNING]: Could not open '/sys/devices/system/cpu/cpu3/cpufreq/cpuinfo_max_freq'
[WARNING]: Unable to fetch max frequency for core 3. This is probably because the core is offline
[WARNING]: Could not open '/sys/devices/system/cpu/cpu4/cpufreq/cpuinfo_max_freq'
[WARNING]: Unable to fetch max frequency for core 4. This is probably because the core is offline
[WARNING]: Could not open '/sys/devices/system/cpu/cpu5/cpufreq/cpuinfo_max_freq'
[WARNING]: Unable to fetch max frequency for core 5. This is probably because the core is offline
[WARNING]: Could not open '/sys/devices/system/cpu/cpu6/cpufreq/cpuinfo_max_freq'
[WARNING]: Unable to fetch max frequency for core 6. This is probably because the core is offline
[WARNING]: Could not open '/sys/devices/system/cpu/cpu7/cpufreq/cpuinfo_max_freq'
[WARNING]: Unable to fetch max frequency for core 7. This is probably because the core is offline
[ERROR]: Unknown microarchitecture detected: IM=0x0 P=0x0 V=0x0 R=0x0
[VERSION]: cpufetch v1.04-42-g0967 (Linux ARM build)
Please, create a new issue with this error message, your smartphone/computer model, the output of 'cpufetch --verbose' and 'cpufetch --debug' on https://github.com/Dr-Noob/cpufetch/issues
[WARNING]: Could not open '/sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_max_freq'
[WARNING]: SoC detection failed using /proc/cpuinfo: No string found
[WARNING]: read_file: /sys/bus/nvmem/devices/rockchip-efuse0/nvmem: No such file or directory
[WARNING]: read_file: /sys/bus/nvmem/devices/rockchip-otp0/nvmem: No such file or directory

                                                            SoC:                 Unknown
                                                            Technology:          Unknown
                                                            Microarchitecture:   Unknown
                                                            Max Frequency:       Unknown
                                                            Cores:               8 cores
                                                            Features:            NEON,SHA1,SHA2,AES,CRC32
                                                            Peak Performance:    Unknown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants