From nobody Sat Mar 28 05:56:35 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 4fjRbR65vhz6XbWj for ; Sat, 28 Mar 2026 05:56:35 +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 4fjRbR3bVtz3qjR for ; Sat, 28 Mar 2026 05:56:35 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1774677395; 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=G0Yh5okg7njgR8BxWhZ0l64yrwmMfuwDKy6QbU+60/A=; b=SItxFqu5ukmwu687Oa85E55+rIZmM7C7GuBY3uRQncC1KhHxZvkEvjm9QPyg+o9Ytlgiuz /xN8FCMNPXwl6IgOCGTzdhcP9Fu82NUKlUsx8sV2PNhs2QybyiA81N9DVoN1lBKDqbjEZn ui6oTPYS1CJxQdj6KJyPs3dag57mvSukG0KRmomidjufi08U+MEfvltBFhjWrAKBkkRrAG 4p4X4r4tC0h3sWU++nz0ibzsvKLgy+GcxK8IYIUmm8ikt+kkZJfmlhkc9D8ZG2ZKXBBncu wgQTWVtb0HcbAlOiQIf8hKTyjDxL/M9R212WEsTFMi+h8GKYFlRhYzYkryH5xA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1774677395; a=rsa-sha256; cv=none; b=NdgPNE4O1NZ+Hd2oOeCltmEKWr60vSEgox8j4oKJfBTNqTPnkZxpBJOa1O7uZuvhAKHJ5n dEDQ6e9ZgOrKsq7Hw72zdwP63aiVoSJWbE52JU8utAlkKEwkSCr5Cw8ZxCuIoMxznqJTGs CMZCXFRp2bkkdl1VqaxSMY2aVZJafWEmRUs0dqd9izqybuYJ7ybQUODWVXSAqFmHKsPQWO oGyIyWdy2UbTci8BAQlsUXUbeTyPkFLMJXY9spyWQuv9b2Ttj39/aFAiEyVxqaDaTaUhqY Ej6CjQEoRu/fK3V6y32yG0rBmJvHhMC/Tx7RHy8A7FeG0jib6N3vTa0ot4WoAA== 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=1774677395; 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=G0Yh5okg7njgR8BxWhZ0l64yrwmMfuwDKy6QbU+60/A=; b=xJaG6ZyieR3RlFcfkQvWOdcMC2Ak3p53KBkGj59rz5mJghxcflKyIltmVjBa+qHbDDwEBc DHbt5Kg6Ju1klGrTfkSMnvUmuBv/9m/gT6oSA+lF0fZC51n8jIFVfILPkCN576aJTv9vYm K36GOailLkfsLI3WZiKPM6H3p5WNR9zDpg6GSmSAkcCNWxPcKabTDjTQa6Kbq9BRsbG+TX 27FrNXpl3ag9xAK1oVw3TquqWFrUaoWVdD4J6Dn610/nbFp8PszW6qomDXBQoHbaKUohFv a1DWNJyM2kZqC2eQAzppoJGeZwUcxcSNw1/hPVw+kVulSsq7dQUsnh9AO7a39w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4fjRbR2yb9z1BDx for ; Sat, 28 Mar 2026 05:56:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 40309 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Sat, 28 Mar 2026 05:56:35 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Colin Percival Subject: git: 49b6254b3e09 - main - 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/main X-Git-Reftype: branch X-Git-Commit: 49b6254b3e09ee741f456617111ecb18803459fb Auto-Submitted: auto-generated Date: Sat, 28 Mar 2026 05:56:35 +0000 Message-Id: <69c76d93.40309.5d34ce18@gitrepo.freebsd.org> The branch main has been updated by cperciva: URL: https://cgit.FreeBSD.org/src/commit/?id=49b6254b3e09ee741f456617111ecb18803459fb commit 49b6254b3e09ee741f456617111ecb18803459fb Author: Colin Percival AuthorDate: 2026-02-22 04:09:00 +0000 Commit: Colin Percival CommitDate: 2026-03-28 05:54:49 +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 --- 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