Source-Changes-HG archive

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

[src/netbsd-8]: src/sys/arch/x86/x86 Pull up following revision(s) (requested...



details:   https://anonhg.NetBSD.org/src/rev/1547f95023c9
branches:  netbsd-8
changeset: 451755:1547f95023c9
user:      martin <martin%NetBSD.org@localhost>
date:      Sun Jun 02 08:29:30 2019 +0000

description:
Pull up following revision(s) (requested by maxv in ticket #1279):

        sys/arch/x86/x86/spectre.c: revision 1.29

Mmh, check the highest leaf before calling x86_cpuid(), otherwise on old
CPUs we might be getting garbage. While here fix a typo.

Likely fixes PR/54256.

diffstat:

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

diffs (38 lines):

diff -r f13df5a8f19f -r 1547f95023c9 sys/arch/x86/x86/spectre.c
--- a/sys/arch/x86/x86/spectre.c        Sun Jun 02 08:27:40 2019 +0000
+++ b/sys/arch/x86/x86/spectre.c        Sun Jun 02 08:29:30 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: spectre.c,v 1.19.2.3 2019/05/14 17:12:19 martin Exp $  */
+/*     $NetBSD: spectre.c,v 1.19.2.4 2019/06/02 08:29:30 martin Exp $  */
 
 /*
  * Copyright (c) 2018 NetBSD Foundation, Inc.
@@ -34,7 +34,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: spectre.c,v 1.19.2.3 2019/05/14 17:12:19 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: spectre.c,v 1.19.2.4 2019/06/02 08:29:30 martin Exp $");
 
 #include "opt_spectre.h"
 
@@ -552,6 +552,10 @@
                return;
        }
 
+       if (cpuid_level < 7) {
+               return;
+       }
+
        x86_cpuid(0x7, descs);
        if (descs[3] & CPUID_SEF_ARCH_CAP) {
                msr = rdmsr(MSR_IA32_ARCH_CAPABILITIES);
@@ -688,7 +692,7 @@
 #endif
 
        /*
-        * Microarchectural Data Sampling.
+        * Microarchitectural Data Sampling.
         *
         * cpu0 is the one that detects the method and sets the global
         * variable.



Home | Main Index | Thread Index | Old Index