Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/netbsd-9]: src/usr.sbin/cpuctl/arch Pull up following revision(s) (reque...



details:   https://anonhg.NetBSD.org/src/rev/d50f76480dd6
branches:  netbsd-9
changeset: 1026412:d50f76480dd6
user:      martin <martin%NetBSD.org@localhost>
date:      Mon Nov 22 17:05:32 2021 +0000

description:
Pull up following revision(s) (requested by mrg in ticket #1375):

        usr.sbin/cpuctl/arch/i386.c: revision 1.123
        sys/arch/x86/x86/cpu_topology.c: revision 1.20

decode SMT parts for AMD family >= 0x17, not just 0x17.

now zen3 systems are properly identified by cpu topology for the
scheduler and cpuctl identify.

diffstat:

 sys/arch/x86/x86/cpu_topology.c |  8 ++++----
 usr.sbin/cpuctl/arch/i386.c     |  6 +++---
 2 files changed, 7 insertions(+), 7 deletions(-)

diffs (56 lines):

diff -r e2f3af6a9c99 -r d50f76480dd6 sys/arch/x86/x86/cpu_topology.c
--- a/sys/arch/x86/x86/cpu_topology.c   Sat Nov 20 15:18:41 2021 +0000
+++ b/sys/arch/x86/x86/cpu_topology.c   Mon Nov 22 17:05:32 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: cpu_topology.c,v 1.14.4.1 2020/05/25 15:39:54 martin Exp $     */
+/*     $NetBSD: cpu_topology.c,v 1.14.4.2 2021/11/22 17:05:32 martin Exp $     */
 
 /*-
  * Copyright (c) 2009 Mindaugas Rasiukevicius <rmind at NetBSD org>,
@@ -36,7 +36,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: cpu_topology.c,v 1.14.4.1 2020/05/25 15:39:54 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cpu_topology.c,v 1.14.4.2 2021/11/22 17:05:32 martin Exp $");
 
 #include <sys/param.h>
 #include <sys/bitops.h>
@@ -152,8 +152,8 @@
                }
        }
 
-       /* Family 0x17 supports SMT */
-       if (cpu_vendor == CPUVENDOR_AMD && cpu_family == 0x17) { /* XXX */
+       /* Family 0x17 and above support SMT */
+       if (cpu_vendor == CPUVENDOR_AMD && cpu_family >= 0x17) { /* XXX */
                x86_cpuid(0x8000001e, descs);
                const u_int threads = ((descs[1] >> 8) & 0xff) + 1;
 
diff -r e2f3af6a9c99 -r d50f76480dd6 usr.sbin/cpuctl/arch/i386.c
--- a/usr.sbin/cpuctl/arch/i386.c       Sat Nov 20 15:18:41 2021 +0000
+++ b/usr.sbin/cpuctl/arch/i386.c       Mon Nov 22 17:05:32 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: i386.c,v 1.104.2.6 2020/07/10 11:20:29 martin Exp $    */
+/*     $NetBSD: i386.c,v 1.104.2.7 2021/11/22 17:05:32 martin 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.104.2.6 2020/07/10 11:20:29 martin Exp $");
+__RCSID("$NetBSD: i386.c,v 1.104.2.7 2021/11/22 17:05:32 martin Exp $");
 #endif /* not lint */
 
 #include <sys/types.h>
@@ -1935,7 +1935,7 @@
        }
 #endif
 
-       if (cpu_family == 0x17) {
+       if (cpu_family >= 0x17) {
                x86_cpuid(0x8000001e, descs);
                const u_int threads = ((descs[1] >> 8) & 0xff) + 1;
                smt_bits = ilog2(threads);



Home | Main Index | Thread Index | Old Index