]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
arm64: Print per-CPU cache summary
authorJustin Hibbits <jhibbits@FreeBSD.org>
Tue, 31 May 2022 15:40:20 +0000 (10:40 -0500)
committerJustin Hibbits <jhibbits@FreeBSD.org>
Mon, 6 Jun 2022 15:23:10 +0000 (10:23 -0500)
commit139ba152c9c91fad9b63ccd2382a80f753f217b9
treeedb8e104f2db6a85657255de187e4ed0e7da0c4e
parent45ef6b4b5db14eaadb1c8c2eda48353c112fd2ae
arm64: Print per-CPU cache summary

Summary:
It can be useful to see a summary of CPU caches on bootup.  This is done
for most platforms already, so add this to arm64, in the form of (taken
from Apple M1 pro test):

  L1 cache: 192KB (instruction), 128KB (data)
  L2 cache: 12288KB (unified)

This is printed out per-CPU, only under bootverbose.

Future refinements could instead determine if a cache level is shared
with other cores (L2 is shared among cores on some SoCs, for instance),
and perform a better calculation to the full true cache sizes.  For
instance, it's known that the M1 pro, on which this test was done, has 2
12MB L2 clusters, for a total of 24MB.  Seeing each CPU with 12288KB L2
would make one think that there's 12MB * NCPUs, for possibly 120MB
cache, which is incorrect.

Sponsored by: Juniper Networks, Inc.
Reviewed by: #arm64, andrew
Differential Revision: https://reviews.freebsd.org/D35366
sys/arm64/arm64/identcpu.c
sys/arm64/include/armreg.h