From owner-svn-src-stable-11@freebsd.org Sun Jul 2 04:19:05 2017 Return-Path: Delivered-To: svn-src-stable-11@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 2E643D9C8C2; Sun, 2 Jul 2017 04:19:05 +0000 (UTC) (envelope-from araujo@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 EDF557F0A2; Sun, 2 Jul 2017 04:19:04 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v624J47c091540; Sun, 2 Jul 2017 04:19:04 GMT (envelope-from araujo@FreeBSD.org) Received: (from araujo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v624J32c091537; Sun, 2 Jul 2017 04:19:03 GMT (envelope-from araujo@FreeBSD.org) Message-Id: <201707020419.v624J32c091537@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: araujo set sender to araujo@FreeBSD.org using -f From: Marcelo Araujo Date: Sun, 2 Jul 2017 04:19:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r320568 - in stable/11/sys: kern sys x86/x86 X-SVN-Group: stable-11 X-SVN-Commit-Author: araujo X-SVN-Commit-Paths: in stable/11/sys: kern sys x86/x86 X-SVN-Commit-Revision: 320568 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Jul 2017 04:19:05 -0000 Author: araujo Date: Sun Jul 2 04:19:03 2017 New Revision: 320568 URL: https://svnweb.freebsd.org/changeset/base/320568 Log: MFC r319678: Allow sysctl kern.vm_guest to return bhyve when running under bhyve. Submitted by: Sean Fagan Reviewed by: grehan MFH: 4 weeks. Sponsored by: iXsystems, Inc. Differential Revision: https://reviews.freebsd.org/D11090 Modified: stable/11/sys/kern/subr_param.c stable/11/sys/sys/systm.h stable/11/sys/x86/x86/identcpu.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/kern/subr_param.c ============================================================================== --- stable/11/sys/kern/subr_param.c Sun Jul 2 04:14:34 2017 (r320567) +++ stable/11/sys/kern/subr_param.c Sun Jul 2 04:19:03 2017 (r320568) @@ -149,6 +149,7 @@ static const char *const vm_guest_sysctl_names[] = { "hv", "vmware", "kvm", + "bhyve", NULL }; CTASSERT(nitems(vm_guest_sysctl_names) - 1 == VM_LAST); Modified: stable/11/sys/sys/systm.h ============================================================================== --- stable/11/sys/sys/systm.h Sun Jul 2 04:14:34 2017 (r320567) +++ stable/11/sys/sys/systm.h Sun Jul 2 04:19:03 2017 (r320568) @@ -76,7 +76,7 @@ extern int vm_guest; /* Running as virtual machine gu * Keep in sync with vm_guest_sysctl_names[]. */ enum VM_GUEST { VM_GUEST_NO = 0, VM_GUEST_VM, VM_GUEST_XEN, VM_GUEST_HV, - VM_GUEST_VMWARE, VM_GUEST_KVM, VM_LAST }; + VM_GUEST_VMWARE, VM_GUEST_KVM, VM_GUEST_BHYVE, VM_LAST }; #if defined(WITNESS) || defined(INVARIANT_SUPPORT) void kassert_panic(const char *fmt, ...) __printflike(1, 2); Modified: stable/11/sys/x86/x86/identcpu.c ============================================================================== --- stable/11/sys/x86/x86/identcpu.c Sun Jul 2 04:14:34 2017 (r320567) +++ stable/11/sys/x86/x86/identcpu.c Sun Jul 2 04:19:03 2017 (r320568) @@ -1282,6 +1282,8 @@ identify_hypervisor(void) vm_guest = VM_GUEST_HV; else if (strcmp(hv_vendor, "KVMKVMKVM") == 0) vm_guest = VM_GUEST_KVM; + else if (strcmp(hv_vendor, "bhyve bhyve") == 0) + vm_guest = VM_GUEST_BHYVE; } return; }