Skip to content

Commit

Permalink
Add recent Apple cores, minor fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
ThomasKaiser committed Apr 2, 2023
1 parent 49a9845 commit f297ef9
Show file tree
Hide file tree
Showing 4 changed files with 98 additions and 9 deletions.
3 changes: 2 additions & 1 deletion results/ARMv8-Crypto-Extensions.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,9 @@ Crawling through [sbc-bench results collection](../Results.md) comparing +30 dif
| [Phytium FT-2000](http://ix.io/4ioj) | 2600 | 936740 | 360 |
| Carmel | | | |
| [Jetson Xavier NX](http://ix.io/3YWp) | 1890 | 706280 | 374 |
| Apple Icestorm | | | |
| Apple Icestorm/Avalanche | | | |
| [M1 Pro](http://ix.io/443N) | 2060 | 784430 | 381 |
| [M2 Pro](http://ix.io/4sp4) | 3500 | 1320470 | 377 |
| Qualcomm Kryo 3XX Gold | | | |
| [Snapdragon 845](http://ix.io/4dJV) | 2705 | 1059800 | 392 |
| Cortex-A53 | | | |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Tested with sbc-bench v0.9.40 on Fri, 31 Mar 2023 13:20:09 +0200. Full info: [ht

### General information:

Virtualized Apple M1 variant / guess flawed since running in apple-hypervisor v1, Kernel: aarch64 / apple-hypervisor v1, Userland: arm64
Apple Silicon / guess flawed since running in apple-hypervisor v1, Kernel: aarch64 / apple-hypervisor v1, Userland: arm64

CPU sysfs topology (clusters, cpufreq members, clockspeeds)
cpufreq min max
Expand Down Expand Up @@ -48,7 +48,7 @@ After:

### Swap configuration:

* /dev/vda2: 2,1G (0K used)
* /dev/vda2: 2.1G (0K used)

### Software versions:

Expand Down
65 changes: 65 additions & 0 deletions results/reviews/Apple-Virtualized-M2-Pro.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
# Apple Inc. Apple Virtualization Generic Platform 1

Tested with sbc-bench v0.9.40 on Sat, 01 Apr 2023 15:28:35 +0200. Full info: [http://ix.io/4sp4](http://ix.io/4sp4)

### General information:

Apple Silicon / guess flawed since running in apple-hypervisor v1, Kernel: aarch64 / apple-hypervisor v1, Userland: arm64

CPU sysfs topology (clusters, cpufreq members, clockspeeds)
cpufreq min max
CPU cluster policy speed speed core type
0 0 0 - - Virtualized Apple Silicon / r0p0
1 0 0 - - Virtualized Apple Silicon / r0p0
2 0 0 - - Virtualized Apple Silicon / r0p0
3 0 0 - - Virtualized Apple Silicon / r0p0
4 0 0 - - Virtualized Apple Silicon / r0p0
5 0 0 - - Virtualized Apple Silicon / r0p0
6 0 0 - - Virtualized Apple Silicon / r0p0
7 0 0 - - Virtualized Apple Silicon / r0p0
8 0 0 - - Virtualized Apple Silicon / r0p0
9 0 0 - - Virtualized Apple Silicon / r0p0
10 0 0 - - Virtualized Apple Silicon / r0p0
11 0 0 - - Virtualized Apple Silicon / r0p0

3911 KB available RAM

### Clockspeeds (idle vs. heated up):

Before:

cpu0 (Virtualized Apple Silicon): Measured: 3493

After:

cpu0 (Virtualized Apple Silicon): Measured: 3399

### Performance baseline

* memcpy: 29399.2 MB/s, memchr: 45024.9 MB/s, memset: 42712.4 MB/s
* 16M latency: 41.11 41.34 40.70 41.27 39.74 41.90 33.14 31.71
* 128M latency: 133.2 132.8 132.5 132.9 133.1 123.1 112.4 106.5
* 7-zip MIPS (3 consecutive runs): 60164, 61620, 61662 (61150 avg), single-threaded: 5776
* `aes-256-cbc 342798.53k 861036.76k 1169507.93k 1275521.71k 1316850.35k 1318890.15k`
* `aes-256-cbc 345031.93k 861389.80k 1167827.11k 1277829.12k 1314204.33k 1322046.81k`

### Storage devices:

* 3.7GB "Apple, Inc. Virtual USB Mass Storage Device" as /dev/sda: USB, Driver=usb-storage, 480Mbps
* 20GB Virtual disk: /dev/vda, Driver=virtio-pci

### Swap configuration:

* /dev/vda2: 2.1G (267.4M used)

### Software versions:

* Ubuntu 22.04.2 LTS
* Compiler: /usr/bin/gcc (Ubuntu 11.3.0-1ubuntu1~22.04) 11.3.0 / aarch64-linux-gnu

### Kernel info:

* `/proc/cmdline: BOOT_IMAGE=/BOOT/ubuntu_s040fe@/vmlinuz-5.19.0-38-generic root=ZFS=rpool/ROOT/ubuntu_s040fe ro quiet splash vt.handoff=1`
* Vulnerability Spec store bypass: Mitigation; Speculative Store Bypass disabled via prctl
* Vulnerability Spectre v1: Mitigation; __user pointer sanitization
* Kernel 5.19.0-38-generic / CONFIG_HZ=250
35 changes: 29 additions & 6 deletions sbc-bench.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ InstallLocation=/usr/local/src # change to /tmp if you want tools to be deleted
Main() {
export PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/vc/bin
PathToMe="$( cd "$(dirname "$0")" ; pwd -P )/${0##*/}"
unset LC_ALL LC_MESSAGES LANGUAGE LANG 2>/dev/null # prevent localisation of decimal points and similar stuff
unset LC_ALL LC_MESSAGES LC_NUMERIC LANGUAGE LANG 2>/dev/null # prevent localisation of decimal points and similar stuff

# use colours and bold when outputting to a terminal
CheckTerminal
Expand Down Expand Up @@ -537,6 +537,12 @@ GetARMCore() {
61/031:Apple Avalanche A15
61/032:Apple Blizzard M2
61/033:Apple Avalanche M2
61/034:Apple Blizzard M2Pro
61/035:Apple Avalanche M2Pro
61/036:Apple Sawtooth A16
61/037:Apple Everest A16
61/038:Apple Blizzard M2Max
61/039:Apple Avalanche M2Max
00/000:Virtualized Apple Silicon
66:Faraday
66/526:Faraday FA526
Expand Down Expand Up @@ -4059,11 +4065,18 @@ LogEnvironment() {
echo -e " DMC gov: ${UsedDMCGovernor} ($(( ${DRAMClock} / 1000000 )) MHz)"
;;
*)
# check whether an uptreshold value exists and if true report it
# check whether uptreshold and downdifferential values exist and if true report it
if [ -f "${DMCGovernor%/*}/upthreshold" ]; then
# report DMC governor and upthreshold value
read upthreshold <"${DMCGovernor%/*}/upthreshold"
echo -e " DMC gov: ${UsedDMCGovernor} (upthreshold: ${upthreshold})"
if [ -f "${DMCGovernor%/*}/downdifferential" ]; then
# report DMC governor and upthreshold/downdifferential values
read downdifferential <"${DMCGovernor%/*}/downdifferential"
echo -e " DMC gov: ${UsedDMCGovernor} (upthreshold: ${upthreshold}, downdifferential: ${downdifferential})"
else
# report DMC governor and upthreshold value
echo -e " DMC gov: ${UsedDMCGovernor} (upthreshold: ${upthreshold})"
fi
else
# report only DMC governor
echo -e " DMC gov: ${UsedDMCGovernor}"
Expand Down Expand Up @@ -6694,10 +6707,20 @@ GuessSoCbySignature() {
# Apple M2: 4 x Apple Blizzard / r1p0 + 4 x Apple Avalanche / r1p0 / https://github.com/hrw/arm-socs-table/blob/main/cpuinfo-data/apple-m2
echo "Apple M2"
;;
*AppleM2Pro*|*AppleA16*)
# Apple M2: 4 x Apple Blizzard + 6/8 x Apple Avalanche / https://github.com/AsahiLinux/m1n1/commit/7904ed43dc0c2760e728f611efa0b26895ebcd10
echo "Apple M2 Pro"
;;
*AppleM2Max*)
# Apple M2: 4 x Apple Blizzard + 8 x Apple Avalanche / https://github.com/AsahiLinux/m1n1/commit/8d0474f57b1fb45588d412dcbe7e229dbe6d43cb
echo "Apple M2 Max"
;;
*VirtualizedSiliconr0p0*)
# Virtualized Apple cores using 0 for every field
grep -q 'fp asimd evtstrm aes pmull sha1 sha2 crc32 atomics fphp asimdhp cpuid asimdrdm jscvt fcma lrcpc dcpop sha3 asimddp sha512 asimdfhm dit uscat ilrcpc flagm ssbs sb paca pacg dcpodp flagm2 frint i8mm bf16 bti ecv' <<< "${ProcCPU}" && echo "Virtualized Apple M2 variant"
grep -q 'fp asimd evtstrm aes pmull sha1 sha2 crc32 atomics fphp asimdhp cpuid asimdrdm jscvt fcma lrcpc dcpop sha3 asimddp sha512 asimdfhm dit uscat ilrcpc flagm ssbs sb paca pacg dcpodp flagm2 frint' <<< "${ProcCPU}" && echo "Virtualized Apple M1 variant"
# When running bare metal M1 and M2 SoCs differ by flags/features:
# M1: 'fp asimd evtstrm aes pmull sha1 sha2 crc32 atomics fphp asimdhp cpuid asimdrdm jscvt fcma lrcpc dcpop sha3 asimddp sha512 asimdfhm dit uscat ilrcpc flagm ssbs sb paca pacg dcpodp flagm2 frint'
# M2: 'fp asimd evtstrm aes pmull sha1 sha2 crc32 atomics fphp asimdhp cpuid asimdrdm jscvt fcma lrcpc dcpop sha3 asimddp sha512 asimdfhm dit uscat ilrcpc flagm ssbs sb paca pacg dcpodp flagm2 frint i8mm bf16 bti ecv'
# Inside Hypervisor.Framework VMs all ID values are set to 0 and on M2 SoCs VMs only see M1 CPU flags/features.
grep -q 'fp asimd evtstrm aes pmull sha1 sha2 crc32 atomics fphp asimdhp cpuid asimdrdm jscvt fcma lrcpc dcpop sha3 asimddp sha512 asimdfhm dit uscat ilrcpc flagm ssbs sb paca pacg dcpodp flagm2 frint' <<< "${ProcCPU}" && echo "Apple Silicon"
;;
*thead,c906|10)
# Allwinner D1: single T-Head C906 core
Expand Down

0 comments on commit f297ef9

Please sign in to comment.