From owner-svn-src-all@freebsd.org Fri Apr 8 09:20:48 2016 Return-Path: Delivered-To: svn-src-all@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 1ABCEB0859D; Fri, 8 Apr 2016 09:20:48 +0000 (UTC) (envelope-from sephe@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 D8E7B1B12; Fri, 8 Apr 2016 09:20:47 +0000 (UTC) (envelope-from sephe@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u389Kl46048703; Fri, 8 Apr 2016 09:20:47 GMT (envelope-from sephe@FreeBSD.org) Received: (from sephe@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u389KliR048702; Fri, 8 Apr 2016 09:20:47 GMT (envelope-from sephe@FreeBSD.org) Message-Id: <201604080920.u389KliR048702@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sephe set sender to sephe@FreeBSD.org using -f From: Sepherosa Ziehau Date: Fri, 8 Apr 2016 09:20:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297699 - head/sys/dev/hyperv/vmbus X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Apr 2016 09:20:48 -0000 Author: sephe Date: Fri Apr 8 09:20:46 2016 New Revision: 297699 URL: https://svnweb.freebsd.org/changeset/base/297699 Log: hyperv: Revert r297481 Use vm_guest == VM_GUEST_HV is not enough to determine whether FreeBSD is running on Hyper-V or not. What a mess. Reported by: smokehydration tutanota com Sponsored by: Microsoft OSTC Modified: head/sys/dev/hyperv/vmbus/hv_hv.c Modified: head/sys/dev/hyperv/vmbus/hv_hv.c ============================================================================== --- head/sys/dev/hyperv/vmbus/hv_hv.c Fri Apr 8 08:43:25 2016 (r297698) +++ head/sys/dev/hyperv/vmbus/hv_hv.c Fri Apr 8 09:20:46 2016 (r297699) @@ -36,7 +36,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include #include @@ -208,6 +207,8 @@ hv_vmbus_init(void) hv_vmbus_g_context.hypercall_page = virt_addr; + tc_init(&hv_timecounter); /* register virtual timecount */ + hv_et_init(); return (0); @@ -436,14 +437,3 @@ void hv_vmbus_synic_cleanup(void *arg) wrmsr(HV_X64_MSR_SIEFP, siefp.as_uint64_t); } -static void -hv_tc_init(void) -{ - if (vm_guest != VM_GUEST_HV) - return; - - /* register virtual timecounter */ - tc_init(&hv_timecounter); -} - -SYSINIT(hv_tc_init, SI_SUB_HYPERVISOR, SI_ORDER_FIRST, hv_tc_init, NULL);