Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/x86/x86 assert smt_bits value only after it is comp...



details:   https://anonhg.NetBSD.org/src/rev/20dbea3bfcec
branches:  trunk
changeset: 1006587:20dbea3bfcec
user:      mlelstv <mlelstv%NetBSD.org@localhost>
date:      Mon Jan 20 06:50:34 2020 +0000

description:
assert smt_bits value only after it is computed.

diffstat:

 sys/arch/x86/x86/cpu_topology.c |  7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diffs (29 lines):

diff -r a9c4fa40fbd2 -r 20dbea3bfcec sys/arch/x86/x86/cpu_topology.c
--- a/sys/arch/x86/x86/cpu_topology.c   Sun Jan 19 23:49:32 2020 +0000
+++ b/sys/arch/x86/x86/cpu_topology.c   Mon Jan 20 06:50:34 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: cpu_topology.c,v 1.17 2020/01/09 16:35:03 ad Exp $     */
+/*     $NetBSD: cpu_topology.c,v 1.18 2020/01/20 06:50:34 mlelstv 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.17 2020/01/09 16:35:03 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cpu_topology.c,v 1.18 2020/01/20 06:50:34 mlelstv Exp $");
 
 #include "acpica.h"
 
@@ -190,8 +190,9 @@
                x86_cpuid(0x8000001e, descs);
                const u_int threads = ((descs[1] >> 8) & 0xff) + 1;
 
-               KASSERT(smt_bits == 0 && smt_bits <= core_bits);
+               KASSERT(smt_bits == 0);
                smt_bits = ilog2(threads);
+               KASSERT(smt_bits <= core_bits);
                core_bits -= smt_bits;
        }
 



Home | Main Index | Thread Index | Old Index