From owner-freebsd-virtualization@FreeBSD.ORG Mon Oct 27 16:29:20 2014 Return-Path: Delivered-To: freebsd-virtualization@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 32CBCC84; Mon, 27 Oct 2014 16:29:20 +0000 (UTC) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0DBCFE7F; Mon, 27 Oct 2014 16:29:20 +0000 (UTC) Received: from ralph.baldwin.cx (pool-173-70-85-31.nwrknj.fios.verizon.net [173.70.85.31]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 3EE3AB93C; Mon, 27 Oct 2014 12:29:18 -0400 (EDT) From: John Baldwin To: freebsd-virtualization@freebsd.org Subject: Rework hypervisor detection Date: Mon, 27 Oct 2014 12:28:46 -0400 Message-ID: <3183374.mZUFeIh4pp@ralph.baldwin.cx> User-Agent: KMail/4.14.2 (FreeBSD/10.1-PRERELEASE; KDE/4.14.2; amd64; ; ) MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Mon, 27 Oct 2014 12:29:18 -0400 (EDT) Cc: delphij@freebsd.org, Jung-uk Kim X-BeenThere: freebsd-virtualization@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "Discussion of various virtualization techniques FreeBSD supports." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Oct 2014 16:29:20 -0000 The current code to detect a hypervisor in FreeBSD is a git gross. First, it's x86-specific, but stored in MI code. Second, it does not follow the best practice of using cpuid info but only depends on DMI/SMBIOS strings. The patch below attempts to improve this. We might want to move the VM_GUEST_HV detection into this new function as well. https://reviews.freebsd.org/D1010 -- John Baldwin