Module Name: src Committed By: mlelstv Date: Mon Jan 20 06:50:34 UTC 2020
Modified Files: src/sys/arch/x86/x86: cpu_topology.c Log Message: assert smt_bits value only after it is computed. To generate a diff of this commit: cvs rdiff -u -r1.17 -r1.18 src/sys/arch/x86/x86/cpu_topology.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/cpu_topology.c diff -u src/sys/arch/x86/x86/cpu_topology.c:1.17 src/sys/arch/x86/x86/cpu_topology.c:1.18 --- src/sys/arch/x86/x86/cpu_topology.c:1.17 Thu Jan 9 16:35:03 2020 +++ src/sys/arch/x86/x86/cpu_topology.c Mon Jan 20 06:50:34 2020 @@ -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_cpu_topology(struct cpu_info *ci) 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; }