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 Explicitly disable ALTINST on VIA, in case ...



details:   https://anonhg.NetBSD.org/src/rev/026ebb842bc0
branches:  trunk
changeset: 837714:026ebb842bc0
user:      maxv <maxv%NetBSD.org@localhost>
date:      Sun Dec 16 10:42:32 2018 +0000

description:
Explicitly disable ALTINST on VIA, in case it isn't disabled by default
already (the 'VIA cpu backdoor').

diffstat:

 sys/arch/x86/x86/identcpu.c |  10 ++++++++--
 1 files changed, 8 insertions(+), 2 deletions(-)

diffs (31 lines):

diff -r c84d297c753f -r 026ebb842bc0 sys/arch/x86/x86/identcpu.c
--- a/sys/arch/x86/x86/identcpu.c       Sun Dec 16 08:58:21 2018 +0000
+++ b/sys/arch/x86/x86/identcpu.c       Sun Dec 16 10:42:32 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: identcpu.c,v 1.83 2018/11/19 22:21:32 jdolecek Exp $   */
+/*     $NetBSD: identcpu.c,v 1.84 2018/12/16 10:42:32 maxv Exp $       */
 
 /*-
  * Copyright (c) 1999, 2000, 2001, 2006, 2007, 2008 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: identcpu.c,v 1.83 2018/11/19 22:21:32 jdolecek Exp $");
+__KERNEL_RCSID(0, "$NetBSD: identcpu.c,v 1.84 2018/12/16 10:42:32 maxv Exp $");
 
 #include "opt_xen.h"
 
@@ -601,6 +601,12 @@
                }
        }
 
+       /* Explicitly disable unsafe ALTINST mode. */
+       if (ci->ci_feat_val[4] & CPUID_VIA_DO_ACE) {
+               msr = rdmsr(MSR_VIA_ACE);
+               wrmsr(MSR_VIA_ACE, msr & ~VIA_ACE_ALTINST);
+       } 
+
        /*
         * Determine L1 cache/TLB info.
         */



Home | Main Index | Thread Index | Old Index