Module Name:    src
Committed By:   christos
Date:           Thu Mar 21 13:22:37 UTC 2013

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

Log Message:
PR/47677 Aktado: x86_errata() should be avoided if NetBSD runs as a KVM guest.
XXX: pullup to 6


To generate a diff of this commit:
cvs rdiff -u -r1.20 -r1.21 src/sys/arch/x86/x86/errata.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/errata.c
diff -u src/sys/arch/x86/x86/errata.c:1.20 src/sys/arch/x86/x86/errata.c:1.21
--- src/sys/arch/x86/x86/errata.c:1.20	Fri Apr  6 13:23:39 2012
+++ src/sys/arch/x86/x86/errata.c	Thu Mar 21 09:22:37 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: errata.c,v 1.20 2012/04/06 17:23:39 chs Exp $	*/
+/*	$NetBSD: errata.c,v 1.21 2013/03/21 13:22:37 christos Exp $	*/
 
 /*-
  * Copyright (c) 2007 The NetBSD Foundation, Inc.
@@ -45,7 +45,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: errata.c,v 1.20 2012/04/06 17:23:39 chs Exp $");
+__KERNEL_RCSID(0, "$NetBSD: errata.c,v 1.21 2013/03/21 13:22:37 christos Exp $");
 
 #include <sys/types.h>
 #include <sys/systm.h>
@@ -329,6 +329,11 @@ x86_errata(void)
 	int i, j, upgrade;
 	static int again;
 
+	/* don't run if we are under a hypervisor */
+	if (cpu_feature[1] & CPUID2_RAZ)
+		return;
+
+	/* only for AMD */
 	if (cpu_vendor != CPUVENDOR_AMD)
 		return;
 

Reply via email to