summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsf <sf@openbsd.org>2015-01-15 13:58:55 +0000
committersf <sf@openbsd.org>2015-01-15 13:58:55 +0000
commitb80cfae5288878c0919a049a4edfc07e19a832d5 (patch)
treea790c7010cff253f809f9231e83d26057fb77889
parentRemove an unnecessary variable and shorten a line. (diff)
downloadwireguard-openbsd-b80cfae5288878c0919a049a4edfc07e19a832d5.tar.xz
wireguard-openbsd-b80cfae5288878c0919a049a4edfc07e19a832d5.zip
Define and print HV cpuid flag on i386.
This is set by many hypervisors, including kvm, vmware, hyper-v.
-rw-r--r--sys/arch/i386/i386/machdep.c3
-rw-r--r--sys/arch/i386/include/specialreg.h3
2 files changed, 4 insertions, 2 deletions
diff --git a/sys/arch/i386/i386/machdep.c b/sys/arch/i386/i386/machdep.c
index ec638cdc682..8092e8ca97c 100644
--- a/sys/arch/i386/i386/machdep.c
+++ b/sys/arch/i386/i386/machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: machdep.c,v 1.561 2015/01/12 16:33:31 deraadt Exp $ */
+/* $OpenBSD: machdep.c,v 1.562 2015/01/15 13:58:55 sf Exp $ */
/* $NetBSD: machdep.c,v 1.214 1996/11/10 03:16:17 thorpej Exp $ */
/*-
@@ -1036,6 +1036,7 @@ const struct cpu_cpuid_feature i386_cpuid_ecxfeatures[] = {
{ CPUIDECX_AVX, "AVX" },
{ CPUIDECX_F16C, "F16C" },
{ CPUIDECX_RDRAND, "RDRAND" },
+ { CPUIDECX_HV, "HV" },
};
const struct cpu_cpuid_feature i386_ecpuid_ecxfeatures[] = {
diff --git a/sys/arch/i386/include/specialreg.h b/sys/arch/i386/include/specialreg.h
index e145d16c246..da22d51b8e5 100644
--- a/sys/arch/i386/include/specialreg.h
+++ b/sys/arch/i386/include/specialreg.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: specialreg.h,v 1.47 2014/07/03 21:15:28 matthew Exp $ */
+/* $OpenBSD: specialreg.h,v 1.48 2015/01/15 13:58:55 sf Exp $ */
/* $NetBSD: specialreg.h,v 1.7 1994/10/27 04:16:26 cgd Exp $ */
/*-
@@ -157,6 +157,7 @@
#define CPUIDECX_AVX 0x10000000 /* Advanced Vector Extensions */
#define CPUIDECX_F16C 0x20000000 /* 16bit fp conversion */
#define CPUIDECX_RDRAND 0x40000000 /* RDRAND instruction */
+#define CPUIDECX_HV 0x80000000 /* Running on hypervisor */
/*
* "Structured Extended Feature Flags Parameters" (CPUID function 0x7, leaf 0)