From nobody Thu Apr 16 15:12:26 2026 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4fxM231ySPz6Zq6b for ; Thu, 16 Apr 2026 15:12:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R12" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4fxM224v5zz4NBR for ; Thu, 16 Apr 2026 15:12:26 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776352346; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=PAf8Rte0p1SEaVde4br7U0N4wpPqOWEptwWuPXX58Lk=; b=SNyZ7Z+dBi6/hS9cKukAUJ9/etIA4VL31Bvh06lvJLZGyUG0sbGFL10VCJYaGMWxQDCTY+ SPk4aHuZEZdFFnDEmetAn2Yf7tzP8qDBQIpXfcKwUbvnjODUxXKBL8sJWD17FCcnTyx1aG c3cUv1pmQ0fFXR51N1DtDA2gEySMZIuHfTvURluqUOMOrEeATZ3/jCzTR4GWotJw+3PiGO zRIZvKPssr/Ww/njZpsBdqxJ0Wv0I7Zib+9wekz1AKwJaoNjGBAEfygBYlobhYWr/9Knr/ b8fdZbZHoR81KVVPM7vVeNEjcHBw1FFQQSGVErXjOQpb+kLO3cx+XONXA3Gqdw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1776352346; a=rsa-sha256; cv=none; b=QxBBpcW8F2Nfy9oEMnoSlqwIx6yqOU8xQsLnN975DeL1UP1n9gZ6EvVIVQUWSZwPDt5epq WIKvzInDyeJtBetkUpKaUxpZ+zHYCrch5W3Nmk5hfaSPav3Aoephs3Hb8JwsUD+Ckrankn DQ8lQTF+/xz93wT/nlgn9Z7xhN8bEOvRJ6t//EvSh52b/HoYaH67WD23SXSxiwsrYMDLsV GkshAYvwvqM2b9+b7crY0viSXOmokDUUBQnGZDg+RjEzMDYDedIylQcB3ji90AsaxrJImm wo3hEZ8s2qQZDw/Mgauu0vH+8CaPb9PJzSBJ5iT09u4gogwQ5qsga11rswSbqQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776352346; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=PAf8Rte0p1SEaVde4br7U0N4wpPqOWEptwWuPXX58Lk=; b=UgWu2GKJ42athE7U+fj/9j7Kgwc6My0r2h1YMP9HEpvR9SY62fWQCefCPj4RkY343IxWDM NI9DcG2jOMCznGBs2/VrXh3FDbitG+1NIYd/w+e1hHT93ap75UsPwGEQcU9z4rXFqglZxk RVPf/Fh6nsx/As6PDhz6hbt30joD2pcQ7dM/CEztvMPn5Qu8q7wjjGmaDsh5ZMbSIL609D MwKTnD0XLLrjNlunZWdEojPDPHsg4wpUK/nifvAEy3jS9ta4v5Hm8sWuzOncVUwLqTG+V/ W1vKwo7xSSYMqc/Xuor4P7mONVXTMVNjrhy8sHu4dPlIQwso55EBlfIri9CF8w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4fxM2249Phz1CBZ for ; Thu, 16 Apr 2026 15:12:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 1efc7 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Thu, 16 Apr 2026 15:12:26 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Colin Percival Subject: git: 075909e9faed - stable/14 - vmm: Move defines from x86.c to x86/bhyve.h List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cperciva X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 075909e9faed3cc5568a31cc049fba708e2a2d9c Auto-Submitted: auto-generated Date: Thu, 16 Apr 2026 15:12:26 +0000 Message-Id: <69e0fc5a.1efc7.753f71b0@gitrepo.freebsd.org> The branch stable/14 has been updated by cperciva: URL: https://cgit.FreeBSD.org/src/commit/?id=075909e9faed3cc5568a31cc049fba708e2a2d9c commit 075909e9faed3cc5568a31cc049fba708e2a2d9c Author: Colin Percival AuthorDate: 2026-02-22 04:09:00 +0000 Commit: Colin Percival CommitDate: 2026-04-16 15:11:55 +0000 vmm: Move defines from x86.c to x86/bhyve.h The values CPUID_BHYVE_FEATURES and CPUID_BHYVE_FEAT_EXT_DEST_ID are useful for guests, not just hosts; so they belong in a header file in sys/x86/include rather than simply in the .c file implementing the bhyve host side. The original addition of these defines took place without adding a copyright statement, but since I'm moving them into a new file I've added the original author's standard copyright (Amazon). MFC after: 3 weeks Fixes: 313a68ea20b4 ("bhyve: Add CPUID_BHYVE_FEATURES leaf") Sponsored by: Amazon Differential Revision: https://reviews.freebsd.org/D55430 (cherry picked from commit 49b6254b3e09ee741f456617111ecb18803459fb) --- sys/amd64/vmm/x86.c | 5 +---- sys/x86/include/bhyve.h | 35 +++++++++++++++++++++++++++++++++++ 2 files changed, 36 insertions(+), 4 deletions(-) diff --git a/sys/amd64/vmm/x86.c b/sys/amd64/vmm/x86.c index 8afd213e3824..00ac3c207b6f 100644 --- a/sys/amd64/vmm/x86.c +++ b/sys/amd64/vmm/x86.c @@ -39,6 +39,7 @@ #include #include +#include #include "vmm_host.h" #include "vmm_ktr.h" @@ -50,12 +51,8 @@ static SYSCTL_NODE(_hw_vmm, OID_AUTO, topology, CTLFLAG_RD | CTLFLAG_MPSAFE, 0, NULL); #define CPUID_VM_SIGNATURE 0x40000000 -#define CPUID_BHYVE_FEATURES 0x40000001 #define CPUID_VM_HIGH CPUID_BHYVE_FEATURES -/* Features advertised in CPUID_BHYVE_FEATURES %eax */ -#define CPUID_BHYVE_FEAT_EXT_DEST_ID (1UL << 0) /* MSI Extended Dest ID */ - static const char bhyve_id[12] = "bhyve bhyve "; static uint64_t bhyve_xcpuids; diff --git a/sys/x86/include/bhyve.h b/sys/x86/include/bhyve.h new file mode 100644 index 000000000000..215bee90bd1a --- /dev/null +++ b/sys/x86/include/bhyve.h @@ -0,0 +1,35 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright © 2025 Amazon.com, Inc. or its affiliates. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#ifndef _X86_BHYVE_H_ +#define _X86_BHYVE_H_ + +/* Bhyve feature detection */ +#define CPUID_BHYVE_FEATURES 0x40000001 +#define CPUID_BHYVE_FEAT_EXT_DEST_ID (1UL << 0) /* MSI Extended Dest ID */ + +#endif