Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 10 Oct 2017 08:23:19 +0000 (UTC)
From:      Sepherosa Ziehau <sephe@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r324488 - in head/sys/dev/hyperv: include vmbus
Message-ID:  <201710100823.v9A8NJ28065767@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: sephe
Date: Tue Oct 10 08:23:19 2017
New Revision: 324488
URL: https://svnweb.freebsd.org/changeset/base/324488

Log:
  hyperv/vmbus: Expose Hyper-V major version.
  
  MFC after:	3 days
  Sponsored by:	Microsoft

Modified:
  head/sys/dev/hyperv/include/hyperv.h
  head/sys/dev/hyperv/vmbus/hyperv.c

Modified: head/sys/dev/hyperv/include/hyperv.h
==============================================================================
--- head/sys/dev/hyperv/include/hyperv.h	Tue Oct 10 08:16:55 2017	(r324487)
+++ head/sys/dev/hyperv/include/hyperv.h	Tue Oct 10 08:23:19 2017	(r324488)
@@ -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 */
 

Modified: head/sys/dev/hyperv/vmbus/hyperv.c
==============================================================================
--- head/sys/dev/hyperv/vmbus/hyperv.c	Tue Oct 10 08:16:55 2017	(r324487)
+++ head/sys/dev/hyperv/vmbus/hyperv.c	Tue Oct 10 08:23:19 2017	(r324488)
@@ -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"



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201710100823.v9A8NJ28065767>