From owner-svn-src-head@freebsd.org Sat Aug 5 06:56:47 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C043EDC2209; Sat, 5 Aug 2017 06:56:47 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8D05C684BD; Sat, 5 Aug 2017 06:56:47 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v756ukbd076260; Sat, 5 Aug 2017 06:56:46 GMT (envelope-from jkim@FreeBSD.org) Received: (from jkim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v756uk48076256; Sat, 5 Aug 2017 06:56:46 GMT (envelope-from jkim@FreeBSD.org) Message-Id: <201708050656.v756uk48076256@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jkim set sender to jkim@FreeBSD.org using -f From: Jung-uk Kim Date: Sat, 5 Aug 2017 06:56:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r322076 - in head/sys: amd64/amd64 i386/i386 x86/include x86/x86 X-SVN-Group: head X-SVN-Commit-Author: jkim X-SVN-Commit-Paths: in head/sys: amd64/amd64 i386/i386 x86/include x86/x86 X-SVN-Commit-Revision: 322076 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 05 Aug 2017 06:56:47 -0000 Author: jkim Date: Sat Aug 5 06:56:46 2017 New Revision: 322076 URL: https://svnweb.freebsd.org/changeset/base/322076 Log: Detect hypervisors early. We used to set lower hz on hypervisors by default but it was broken since r273800 (and r278522, its MFC to stable/10) because identify_cpu() is called too late, i.e., after init_param1(). MFC after: 3 days Modified: head/sys/amd64/amd64/machdep.c head/sys/i386/i386/machdep.c head/sys/x86/include/x86_var.h head/sys/x86/x86/identcpu.c Modified: head/sys/amd64/amd64/machdep.c ============================================================================== --- head/sys/amd64/amd64/machdep.c Sat Aug 5 06:46:06 2017 (r322075) +++ head/sys/amd64/amd64/machdep.c Sat Aug 5 06:56:46 2017 (r322076) @@ -1537,6 +1537,8 @@ hammer_time(u_int64_t modulep, u_int64_t physfree) kmdp = init_ops.parse_preload_data(modulep); + identify_hypervisor(); + /* Init basic tunables, hz etc */ init_param1(); Modified: head/sys/i386/i386/machdep.c ============================================================================== --- head/sys/i386/i386/machdep.c Sat Aug 5 06:46:06 2017 (r322075) +++ head/sys/i386/i386/machdep.c Sat Aug 5 06:56:46 2017 (r322076) @@ -2185,6 +2185,8 @@ init386(int first) else init_static_kenv(NULL, 0); + identify_hypervisor(); + /* Init basic tunables, hz etc */ init_param1(); Modified: head/sys/x86/include/x86_var.h ============================================================================== --- head/sys/x86/include/x86_var.h Sat Aug 5 06:46:06 2017 (r322075) +++ head/sys/x86/include/x86_var.h Sat Aug 5 06:56:46 2017 (r322076) @@ -116,6 +116,7 @@ void cpu_setregs(void); 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: head/sys/x86/x86/identcpu.c ============================================================================== --- head/sys/x86/x86/identcpu.c Sat Aug 5 06:46:06 2017 (r322075) +++ head/sys/x86/x86/identcpu.c Sat Aug 5 06:56:46 2017 (r322076) @@ -1252,7 +1252,7 @@ static const char *const vm_pnames[] = { NULL }; -static void +void identify_hypervisor(void) { u_int regs[4]; @@ -1403,7 +1403,6 @@ identify_cpu(void) cpu_feature2 = regs[2]; #endif - identify_hypervisor(); cpu_vendor_id = find_cpu_vendor_id(); if (fix_cpuid()) {