Module Name:    src
Committed By:   maxv
Date:           Sat Mar 31 07:15:47 UTC 2018

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

Log Message:
Add #ifdef, for i386 not to panic.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 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.5 src/sys/arch/x86/x86/spectre.c:1.6
--- src/sys/arch/x86/x86/spectre.c:1.5	Thu Mar 29 07:21:24 2018
+++ src/sys/arch/x86/x86/spectre.c	Sat Mar 31 07:15:47 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: spectre.c,v 1.5 2018/03/29 07:21:24 maxv Exp $	*/
+/*	$NetBSD: spectre.c,v 1.6 2018/03/31 07:15:47 maxv Exp $	*/
 
 /*
  * Copyright (c) 2018 NetBSD Foundation, Inc.
@@ -34,7 +34,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: spectre.c,v 1.5 2018/03/29 07:21:24 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: spectre.c,v 1.6 2018/03/31 07:15:47 maxv Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -94,7 +94,12 @@ speculation_detect_method(void)
 			x86_cpuid(7, descs);
 			if (descs[3] & CPUID_SEF_IBRS) {
 				/* descs[3] = %edx */
+#ifdef __x86_64__
 				mitigation_method = MITIGATION_INTEL_IBRS;
+#else
+				/* IBRS not supported on i386. */
+				mitigation_method = MITIGATION_NONE;
+#endif
 				return;
 			}
 		}

Reply via email to