From 301aa429330d11cc03961be1930fd2230fb32548 Mon Sep 17 00:00:00 2001 From: sf Date: Tue, 16 Dec 2014 21:02:58 +0000 Subject: [PATCH] Define and print HV cpuid flag. This is set by many hypervisors, including kvm, vmware, hyper-v. --- sys/arch/amd64/amd64/identcpu.c | 3 ++- sys/arch/amd64/include/specialreg.h | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/sys/arch/amd64/amd64/identcpu.c b/sys/arch/amd64/amd64/identcpu.c index ed460790fc8..1ddffa9d540 100644 --- a/sys/arch/amd64/amd64/identcpu.c +++ b/sys/arch/amd64/amd64/identcpu.c @@ -1,4 +1,4 @@ -/* $OpenBSD: identcpu.c,v 1.56 2014/10/17 18:15:48 kettenis Exp $ */ +/* $OpenBSD: identcpu.c,v 1.57 2014/12/16 21:02:58 sf Exp $ */ /* $NetBSD: identcpu.c,v 1.1 2003/04/26 18:39:28 fvdl Exp $ */ /* @@ -129,6 +129,7 @@ const struct { { CPUIDECX_AVX, "AVX" }, { CPUIDECX_F16C, "F16C" }, { CPUIDECX_RDRAND, "RDRAND" }, + { CPUIDECX_HV, "HV" }, }, cpu_ecpuid_ecxfeatures[] = { { CPUIDECX_LAHF, "LAHF" }, { CPUIDECX_CMPLEG, "CMPLEG" }, diff --git a/sys/arch/amd64/include/specialreg.h b/sys/arch/amd64/include/specialreg.h index 735b7cf89cf..c71701a863e 100644 --- a/sys/arch/amd64/include/specialreg.h +++ b/sys/arch/amd64/include/specialreg.h @@ -1,4 +1,4 @@ -/* $OpenBSD: specialreg.h,v 1.29 2014/11/30 18:29:11 mlarkin Exp $ */ +/* $OpenBSD: specialreg.h,v 1.30 2014/12/16 21:02:58 sf Exp $ */ /* $NetBSD: specialreg.h,v 1.1 2003/04/26 18:39:48 fvdl Exp $ */ /* $NetBSD: x86/specialreg.h,v 1.2 2003/04/25 21:54:30 fvdl Exp $ */ @@ -158,6 +158,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) -- 2.20.1