Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 7 Aug 2017 22:30:18 +0000 (UTC)
From:      Jung-uk Kim <jkim@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org
Subject:   svn commit: r322205 - in stable/10/sys: amd64/amd64 amd64/include i386/i386 i386/include x86/x86
Message-ID:  <201708072230.v77MUI3N030738@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: jkim
Date: Mon Aug  7 22:30:18 2017
New Revision: 322205
URL: https://svnweb.freebsd.org/changeset/base/322205

Log:
  MFC:	r322076
  
  Detect hypervisor early so that we set lower hz on it.
  > Description of fields to fill in above:                     76 columns --|
  > PR:                       If and which Problem Report is related.
  > Submitted by:             If someone else sent in the change.
  > Reported by:              If someone else reported the issue.
  > Reviewed by:              If someone else reviewed your modification.
  > Approved by:              If you needed approval for this commit.
  > Obtained from:            If the change is from a third party.
  > MFC after:                N [day[s]|week[s]|month[s]].  Request a reminder email.
  > MFH:                      Ports tree branch name.  Request approval for merge.
  > Relnotes:                 Set to 'yes' for mention in release notes.
  > Security:                 Vulnerability reference (one per line) or description.
  > Sponsored by:             If the change was sponsored by an organization.
  > Differential Revision:    https://reviews.freebsd.org/D### (*full* phabric URL needed).
  > Empty fields above will be automatically removed.
  
  _M   .
  M    sys/amd64/amd64/machdep.c
  M    sys/amd64/include/md_var.h
  M    sys/i386/i386/machdep.c
  M    sys/i386/include/md_var.h
  M    sys/x86/x86/identcpu.c

Modified:
  stable/10/sys/amd64/amd64/machdep.c
  stable/10/sys/amd64/include/md_var.h
  stable/10/sys/i386/i386/machdep.c
  stable/10/sys/i386/include/md_var.h
  stable/10/sys/x86/x86/identcpu.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/amd64/amd64/machdep.c
==============================================================================
--- stable/10/sys/amd64/amd64/machdep.c	Mon Aug  7 22:28:27 2017	(r322204)
+++ stable/10/sys/amd64/amd64/machdep.c	Mon Aug  7 22:30:18 2017	(r322205)
@@ -1853,6 +1853,8 @@ hammer_time(u_int64_t modulep, u_int64_t physfree)
 	ksym_end = MD_FETCH(kmdp, MODINFOMD_ESYM, uintptr_t);
 #endif
 
+	identify_hypervisor();
+
 	/* Init basic tunables, hz etc */
 	init_param1();
 

Modified: stable/10/sys/amd64/include/md_var.h
==============================================================================
--- stable/10/sys/amd64/include/md_var.h	Mon Aug  7 22:28:27 2017	(r322204)
+++ stable/10/sys/amd64/include/md_var.h	Mon Aug  7 22:30:18 2017	(r322205)
@@ -120,6 +120,7 @@ void	gsbase_load_fault(void) __asm(__STRING(gsbase_loa
 void	dump_add_page(vm_paddr_t);
 void	dump_drop_page(vm_paddr_t);
 void	identify_cpu(void);
+void	identify_hypervisor(void);
 void	initializecpu(void);
 void	initializecpucache(void);
 bool	fix_cpuid(void);

Modified: stable/10/sys/i386/i386/machdep.c
==============================================================================
--- stable/10/sys/i386/i386/machdep.c	Mon Aug  7 22:28:27 2017	(r322204)
+++ stable/10/sys/i386/i386/machdep.c	Mon Aug  7 22:30:18 2017	(r322205)
@@ -3195,6 +3195,10 @@ init386(int first)
 	else
 		init_static_kenv(NULL, 0);
 
+#ifndef XEN
+	identify_hypervisor();
+#endif
+
 	/* Init basic tunables, hz etc */
 	init_param1();
 

Modified: stable/10/sys/i386/include/md_var.h
==============================================================================
--- stable/10/sys/i386/include/md_var.h	Mon Aug  7 22:28:27 2017	(r322204)
+++ stable/10/sys/i386/include/md_var.h	Mon Aug  7 22:30:18 2017	(r322205)
@@ -128,6 +128,7 @@ void	dump_drop_page(vm_paddr_t);
 void	finishidentcpu(void);
 void	fillw(int /*u_short*/ pat, void *base, size_t cnt);
 void	fill_based_sd(struct segment_descriptor *sdp, uint32_t base);
+void	identify_hypervisor(void);
 void	initializecpu(void);
 void	initializecpucache(void);
 bool	fix_cpuid(void);

Modified: stable/10/sys/x86/x86/identcpu.c
==============================================================================
--- stable/10/sys/x86/x86/identcpu.c	Mon Aug  7 22:28:27 2017	(r322204)
+++ stable/10/sys/x86/x86/identcpu.c	Mon Aug  7 22:30:18 2017	(r322205)
@@ -1229,7 +1229,7 @@ static const char *const vm_pnames[] = {
 	NULL
 };
 
-static void
+void
 identify_hypervisor(void)
 {
 	u_int regs[4];
@@ -1377,9 +1377,6 @@ identify_cpu(void)
 	cpu_feature2 = regs[2];
 #endif
 
-#ifndef XEN
-	identify_hypervisor();
-#endif
 	cpu_vendor_id = find_cpu_vendor_id();
 
 	if (fix_cpuid()) {



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