From 498c36b82a03dc1b9641401eddbc26a54bb6dc07 Mon Sep 17 00:00:00 2001 From: Mark Mentovai Date: Wed, 8 Jul 2020 21:32:47 -0400 Subject: [PATCH] mac arm64: Provide something more useful from SystemSnapshot::CPURevison MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit hw.cputype is just CPU_TYPE_ARM64, which isn’t terribly useful. hw.cpufamily is somewhat better as it uses CPUFAMILY_* values, which distinguish between different CPU generations. CPUFAMILY_ARM_VORTEX_TEMPEST identifies A12, for example. (The fun cores are Vortex and the boring cores are Tempest.) Bug: crashpad:345 Change-Id: I88be4fa0b305b2fa15bd24358f63dc7d72192b27 Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/2289041 Reviewed-by: Nico Weber Commit-Queue: Mark Mentovai --- snapshot/mac/system_snapshot_mac.cc | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/snapshot/mac/system_snapshot_mac.cc b/snapshot/mac/system_snapshot_mac.cc index 2d6620dd..62eb814c 100644 --- a/snapshot/mac/system_snapshot_mac.cc +++ b/snapshot/mac/system_snapshot_mac.cc @@ -178,10 +178,8 @@ uint32_t SystemSnapshotMac::CPURevision() const { return (family << 16) | (model << 8) | stepping; #elif defined(ARCH_CPU_ARM64) - // TODO(macos_arm64): Verify that this is correct, and pack more information - // if feasible. The Apple A12Z returns hw.cputype = 0x100000c and - // hw.cpusubtype = 2. - return CastIntSysctlByName("hw.cputype", 0); + // TODO(macos_arm64): Verify and test. + return CastIntSysctlByName("hw.cpufamily", 0); #else #error port to your architecture #endif