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 Revert rev. 1.29. Use current cpuid 7 edx v...



details:   https://anonhg.NetBSD.org/src/rev/72c1b34fbd6c
branches:  trunk
changeset: 451335:72c1b34fbd6c
user:      msaitoh <msaitoh%NetBSD.org@localhost>
date:      Thu May 16 04:26:13 2019 +0000

description:
Revert rev. 1.29. Use current cpuid 7 edx value to print.

diffstat:

 sys/arch/x86/x86/procfs_machdep.c |  12 +++++++-----
 1 files changed, 7 insertions(+), 5 deletions(-)

diffs (33 lines):

diff -r 4c7aded256ad -r 72c1b34fbd6c sys/arch/x86/x86/procfs_machdep.c
--- a/sys/arch/x86/x86/procfs_machdep.c Thu May 16 02:42:19 2019 +0000
+++ b/sys/arch/x86/x86/procfs_machdep.c Thu May 16 04:26:13 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: procfs_machdep.c,v 1.30 2019/05/16 02:42:19 msaitoh Exp $ */
+/*     $NetBSD: procfs_machdep.c,v 1.31 2019/05/16 04:26:13 msaitoh Exp $ */
 
 /*
  * Copyright (c) 2001 Wasabi Systems, Inc.
@@ -42,7 +42,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: procfs_machdep.c,v 1.30 2019/05/16 02:42:19 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: procfs_machdep.c,v 1.31 2019/05/16 04:26:13 msaitoh Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -345,9 +345,11 @@
                diff = last - *left;
        }
 
-       if (cpu_vendor == CPUVENDOR_INTEL) {
-               procfs_getonefeatreg(ci->ci_feat_val[7], x86_features[18],
-                   p + diff, left);
+       if ((cpu_vendor == CPUVENDOR_INTEL)
+           && (ci->ci_max_cpuid >= 0x00000007)) {
+               x86_cpuid(0x00000007, descs);
+               procfs_getonefeatreg(descs[3], x86_features[18], p + diff,
+                   left);
                diff = last - *left;
        }
 



Home | Main Index | Thread Index | Old Index