From nobody Thu Apr 16 15:04:32 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 4fxLrx3vDPz6ZpDB for ; Thu, 16 Apr 2026 15:04:33 +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 4fxLrw4Wntz4J4Z for ; Thu, 16 Apr 2026 15:04:32 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1776351872; 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=22NhhYdK59KFr9Ni4uy8X2dK2DdGjNnjFkjSvll5leU=; b=TcpfM35/AVtpWf3ovLFSnVo056Dvf4rf0+tNrHxzMnuogLYqgGPsF0Nx9TttJUNUPWKR8L v6D6PtQFY2Rza9cUyfLBcrYl9e8igaugxjKN9kIInUR5s3xHIw5z9EpXJUvmPx5mIwfEDr gS5EI7wT+iBUL0urUN4te1jdRb+nxxNs9bVIxaitkUXtvEBQH3ylxaaMUWqrtLe8yDCpER 5/Z+MJLyrXGq30kvH3e14m89ikfCqq1AzyTrvxAwcRaWYie7nR/GkNStJY+v/hyaUdNJ24 fDaxbjlOLxsQXCU0PIQNYogcWT3mDYOS8k6JcDBGwjbu7mltcspwguNmspEmsw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1776351872; a=rsa-sha256; cv=none; b=Dz5GHlk1pfv3jFW+GTDebmU76gG9Zyc91gUWr4TCVXISoC52iX0a7GTCSVo1tiNL5qXW9Q C8Zncw1Z+MxdFcUnAiIKnBWA5ZZq/PHOv1oZPf5yCm2Axwovb00zt57s+Gch833r0Fvu94 iPQ3mLoRQ3KDimAvzdY+zSP0hhcXEFuuKCSCt+gn/R+EZcVh4rbHBM5ZLwTZCavk9zt9Np QeRq51tWQZq1BzCQ8bfc9Txx+m0fxP1XYW64PeJAJTQmH6Iv1zbSE20XNzz9gMFE8Nz2dd UnuK+bKHq2qp3sDvUdVoJU4PxmSbpr5km6GGkRaENDv92yqoFzgV/yHwD4vaww== 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=1776351872; 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=22NhhYdK59KFr9Ni4uy8X2dK2DdGjNnjFkjSvll5leU=; b=lCCNgypemjRPwPp9cO0Pug4/Y83GrfXGOeBOYDADbWPi2mxM20ykcGW1t7ePIqxBl+E2iU Kh274WBM4wBTpwX3TT6mStJs8zPdHumIJu2qmXUWxUecxyfR4RPLz4sEgZxyi3OAd0ZZKk j/UtulXQi/5T6Zcrk90pv+roaBVcztfMBTwpHOUmThtwzWp1XzSIgHJ1CoKlOmcalmRNWx jY9CIvlTl01U87pIgEwFgmQf+xYURMAIYpYzpw7QYt4Qh21sAS1lc8F0q9/SJuV3WSvS2J FlWm1p2J0XKW/q//lOqnbZnayQI4V32Gj5BUAI6V4AhJLt9GrgGXx7/r1iLH3Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4fxLrw43jCz1BYx for ; Thu, 16 Apr 2026 15:04:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 1c95f by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Thu, 16 Apr 2026 15:04:32 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Colin Percival Subject: git: 7d44ef361055 - stable/15 - 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/15 X-Git-Reftype: branch X-Git-Commit: 7d44ef361055cf235152104711f1d0d3ca27d77a Auto-Submitted: auto-generated Date: Thu, 16 Apr 2026 15:04:32 +0000 Message-Id: <69e0fa80.1c95f.2f48d88d@gitrepo.freebsd.org> The branch stable/15 has been updated by cperciva: URL: https://cgit.FreeBSD.org/src/commit/?id=7d44ef361055cf235152104711f1d0d3ca27d77a commit 7d44ef361055cf235152104711f1d0d3ca27d77a Author: Colin Percival AuthorDate: 2026-02-22 04:09:00 +0000 Commit: Colin Percival CommitDate: 2026-04-16 15:03:59 +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 f32107124eb8..6794110f067a 100644 --- a/sys/amd64/vmm/x86.c +++ b/sys/amd64/vmm/x86.c @@ -37,6 +37,7 @@ #include #include #include +#include #include #include @@ -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