Module Name: src Committed By: msaitoh Date: Mon Sep 9 05:36:21 UTC 2019
Modified Files: src/sys/arch/x86/x86: identcpu.c src/usr.sbin/cpuctl/arch: i386.c Log Message: Call cpu_dcp_cacheinfo() only when the cpuid Topology Extension flag is set on AMD prcessor. To generate a diff of this commit: cvs rdiff -u -r1.93 -r1.94 src/sys/arch/x86/x86/identcpu.c cvs rdiff -u -r1.105 -r1.106 src/usr.sbin/cpuctl/arch/i386.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/arch/x86/x86/identcpu.c diff -u src/sys/arch/x86/x86/identcpu.c:1.93 src/sys/arch/x86/x86/identcpu.c:1.94 --- src/sys/arch/x86/x86/identcpu.c:1.93 Fri Jul 26 10:03:40 2019 +++ src/sys/arch/x86/x86/identcpu.c Mon Sep 9 05:36:21 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: identcpu.c,v 1.93 2019/07/26 10:03:40 msaitoh Exp $ */ +/* $NetBSD: identcpu.c,v 1.94 2019/09/09 05:36:21 msaitoh Exp $ */ /*- * Copyright (c) 1999, 2000, 2001, 2006, 2007, 2008 The NetBSD Foundation, Inc. @@ -30,7 +30,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: identcpu.c,v 1.93 2019/07/26 10:03:40 msaitoh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: identcpu.c,v 1.94 2019/09/09 05:36:21 msaitoh Exp $"); #include "opt_xen.h" @@ -357,7 +357,8 @@ cpu_probe_amd_cache(struct cpu_info *ci) if (lfunc < 0x8000001d) return; - cpu_dcp_cacheinfo(ci, 0x8000001d); + if (ci->ci_feat_val[3] & CPUID_TOPOEXT) + cpu_dcp_cacheinfo(ci, 0x8000001d); } static void Index: src/usr.sbin/cpuctl/arch/i386.c diff -u src/usr.sbin/cpuctl/arch/i386.c:1.105 src/usr.sbin/cpuctl/arch/i386.c:1.106 --- src/usr.sbin/cpuctl/arch/i386.c:1.105 Fri Aug 30 13:12:24 2019 +++ src/usr.sbin/cpuctl/arch/i386.c Mon Sep 9 05:36:21 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: i386.c,v 1.105 2019/08/30 13:12:24 msaitoh Exp $ */ +/* $NetBSD: i386.c,v 1.106 2019/09/09 05:36:21 msaitoh Exp $ */ /*- * Copyright (c) 1999, 2000, 2001, 2006, 2007, 2008 The NetBSD Foundation, Inc. @@ -57,7 +57,7 @@ #include <sys/cdefs.h> #ifndef lint -__RCSID("$NetBSD: i386.c,v 1.105 2019/08/30 13:12:24 msaitoh Exp $"); +__RCSID("$NetBSD: i386.c,v 1.106 2019/09/09 05:36:21 msaitoh Exp $"); #endif /* not lint */ #include <sys/types.h> @@ -1433,7 +1433,8 @@ amd_cpu_cacheinfo(struct cpu_info *ci) if (lfunc < 0x8000001d) return; - cpu_dcp_cacheinfo(ci, 0x8000001d); + if (ci->ci_feat_val[3] & CPUID_TOPOEXT) + cpu_dcp_cacheinfo(ci, 0x8000001d); } static void