From 6bf331af5df0294bfe37e0393d23b66e105ee53e Mon Sep 17 00:00:00 2001 From: Sepherosa Ziehau Date: Tue, 10 Oct 2017 08:23:19 +0000 Subject: [PATCH] hyperv/vmbus: Expose Hyper-V major version. MFC after: 3 days Sponsored by: Microsoft --- sys/dev/hyperv/include/hyperv.h | 1 + sys/dev/hyperv/vmbus/hyperv.c | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/sys/dev/hyperv/include/hyperv.h b/sys/dev/hyperv/include/hyperv.h index d3536a1289d..dcd91bd035a 100644 --- a/sys/dev/hyperv/include/hyperv.h +++ b/sys/dev/hyperv/include/hyperv.h @@ -90,6 +90,7 @@ int hyperv_guid2str(const struct hyperv_guid *, char *, */ extern hyperv_tc64_t hyperv_tc64; extern u_int hyperv_features; /* CPUID_HV_MSR_ */ +extern u_int hyperv_ver_major; #endif /* _KERNEL */ diff --git a/sys/dev/hyperv/vmbus/hyperv.c b/sys/dev/hyperv/vmbus/hyperv.c index 2d00b45cebb..dfc85f12f49 100644 --- a/sys/dev/hyperv/vmbus/hyperv.c +++ b/sys/dev/hyperv/vmbus/hyperv.c @@ -77,6 +77,8 @@ static u_int hyperv_get_timecount(struct timecounter *); static bool hyperv_identify(void); static void hypercall_memfree(void); +u_int hyperv_ver_major; + u_int hyperv_features; u_int hyperv_recommends; @@ -169,8 +171,9 @@ hyperv_identify(void) hyperv_features3 = regs[3]; do_cpuid(CPUID_LEAF_HV_IDENTITY, regs); + hyperv_ver_major = regs[1] >> 16; printf("Hyper-V Version: %d.%d.%d [SP%d]\n", - regs[1] >> 16, regs[1] & 0xffff, regs[0], regs[2]); + hyperv_ver_major, regs[1] & 0xffff, regs[0], regs[2]); printf(" Features=0x%b\n", hyperv_features, "\020"