Module Name:    src
Committed By:   maxv
Date:           Mon May 28 20:18:58 UTC 2018

Modified Files:
        src/sys/arch/x86/x86: spectre.c

Log Message:
Mmh, don't automatically set enabled=1 for SpectreV4, the actual mitigation
is not yet applied by default. Just so people can test.


To generate a diff of this commit:
cvs rdiff -u -r1.18 -r1.19 src/sys/arch/x86/x86/spectre.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/spectre.c
diff -u src/sys/arch/x86/x86/spectre.c:1.18 src/sys/arch/x86/x86/spectre.c:1.19
--- src/sys/arch/x86/x86/spectre.c:1.18	Tue May 22 17:14:46 2018
+++ src/sys/arch/x86/x86/spectre.c	Mon May 28 20:18:58 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: spectre.c,v 1.18 2018/05/22 17:14:46 maxv Exp $	*/
+/*	$NetBSD: spectre.c,v 1.19 2018/05/28 20:18:58 maxv Exp $	*/
 
 /*
  * Copyright (c) 2018 NetBSD Foundation, Inc.
@@ -34,7 +34,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: spectre.c,v 1.18 2018/05/22 17:14:46 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: spectre.c,v 1.19 2018/05/28 20:18:58 maxv Exp $");
 
 #include "opt_spectre.h"
 
@@ -610,6 +610,7 @@ cpu_speculation_init(struct cpu_info *ci
 	 * cpu0 is the one that detects the method and sets the global
 	 * variable.
 	 */
+#if 0
 	if (ci == &cpu_info_primary) {
 		v4_detect_method();
 		v4_mitigation_enabled =
@@ -617,8 +618,9 @@ cpu_speculation_init(struct cpu_info *ci
 		v4_set_name();
 	}
 	if (v4_mitigation_method != V4_MITIGATION_NONE) {
-		/* Mitigation not applied by default yet. */
+		mitigation_v4_apply_cpu(ci, true);
 	}
+#endif
 }
 
 void sysctl_speculation_init(struct sysctllog **);

Reply via email to