From 55992104c67426350cd3f3fce1c30a6d3a3f33b9 Mon Sep 17 00:00:00 2001 From: jsg Date: Fri, 24 Aug 2018 06:25:40 +0000 Subject: [PATCH] print cpu family/model/stepping in dmesg discussed with deraadt@ bluhm@ and sthen@ --- sys/arch/amd64/amd64/identcpu.c | 5 ++++- sys/arch/i386/i386/machdep.c | 9 ++++++--- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/sys/arch/amd64/amd64/identcpu.c b/sys/arch/amd64/amd64/identcpu.c index 184379b8a51..d21871bf464 100644 --- a/sys/arch/amd64/amd64/identcpu.c +++ b/sys/arch/amd64/amd64/identcpu.c @@ -1,4 +1,4 @@ -/* $OpenBSD: identcpu.c,v 1.107 2018/08/21 19:04:38 deraadt Exp $ */ +/* $OpenBSD: identcpu.c,v 1.108 2018/08/24 06:25:40 jsg Exp $ */ /* $NetBSD: identcpu.c,v 1.1 2003/04/26 18:39:28 fvdl Exp $ */ /* @@ -563,6 +563,9 @@ identifycpu(struct cpu_info *ci) cpu_cpuspeed = cpu_amd64speed; } + printf(", %02x-%02x-%02x", ci->ci_family, ci->ci_model, + ci->ci_signature & 0x0f); + printf("\n%s: ", ci->ci_dev->dv_xname); for (i = 0; i < nitems(cpu_cpuid_features); i++) diff --git a/sys/arch/i386/i386/machdep.c b/sys/arch/i386/i386/machdep.c index b3c20696113..94a7107abc7 100644 --- a/sys/arch/i386/i386/machdep.c +++ b/sys/arch/i386/i386/machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: machdep.c,v 1.626 2018/08/23 14:47:52 jsg Exp $ */ +/* $OpenBSD: machdep.c,v 1.627 2018/08/24 06:25:40 jsg Exp $ */ /* $NetBSD: machdep.c,v 1.214 1996/11/10 03:16:17 thorpej Exp $ */ /*- @@ -1742,8 +1742,6 @@ identifycpu(struct cpu_info *ci) ci->ci_model = model; step = ci->ci_signature & 15; #ifdef CPUDEBUG - printf("%s: family %x model %x step %x\n", cpu_device, family, - model, step); printf("%s: cpuid level %d cache eax %x ebx %x ecx %x edx %x\n", cpu_device, cpuid_level, cpu_cache_eax, cpu_cache_ebx, cpu_cache_ecx, cpu_cache_edx); @@ -1946,6 +1944,11 @@ identifycpu(struct cpu_info *ci) printf(" %d MHz", cpuspeed); } } + + if (cpuid_level != -1) + printf(", %02x-%02x-%02x", ci->ci_family, ci->ci_model, + step); + printf("\n"); if (ci->ci_feature_flags) { -- 2.20.1