From nobody Mon Jul 20 12:00:05 2026 X-Original-To: dev-commits-doc-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 4h3fGG0xLZz6lr6L for ; Mon, 20 Jul 2026 12:00:06 +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 "YR1" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4h3fGF5ly1z3LyM for ; Mon, 20 Jul 2026 12:00:05 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1784548805; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=kDgEwA2YWOxPVjuFVzR7dLDYv0aUw+6hN1wrrzkARRU=; b=PFm7Zm0CCQ3R5CREe7dxaarThK0OoFFoN+5+J+k0sAzWRAd70t8jIEBGClYIkSU3JQ+Wek 6hUduqDhh458UWa18d2AV9KTKptmPGt629vWvRNM3uzQcigY4ZghRkPH0qVNBdfErljZau 2cphGp0aY0+NgDixWp8gxa7g+TAd6+Rj6vjtiQb172sr1Oqtt2BMryALe7mscVL8D0ByZf 7Vb33n8OlggJ9RhLTfnA8kkBaagJyRIoNcXON8/3aIiVmgDEYWyYecbJivAuEv2VnmutIb ZuqPIwxOsJxMvKX/jFmi1+pU4N5KPKFArPz+8Zmr64PNfSt4AZr3gtxOBXPjoQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1784548805; a=rsa-sha256; cv=none; b=oR8RXyYXvHicbMt3Gq2DpXENFdx4RT1SVU6s8w4YhFXFleW7skJLq3KS5v7YKAxtmQp3Q6 cLdLemwTe0Q1/Pqqc8FYLI+Bs6p4jiyxTjcN1BwQBUtIOkI+0tQn86yeyvFgLCoKxC6zSk W10sGmUhIh3eKXQHB1/j8IJhCIkUK26h3zNdM62JIiI/1o+h9GOrQFkUwtJCWc1SJRe+M2 b0MSKNyJIjpcvI0C2GMH5hxnmvlRrP8xXTiPUYULhsgMs8z8V5g+8BjBWcBt+2n4YHysQ/ xadnxfiAuOQaw/b5ec5qLAUeBLFLdNTHdbWAqzmk63ENgjS8kONGofKfd3UZqA== 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=1784548805; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=kDgEwA2YWOxPVjuFVzR7dLDYv0aUw+6hN1wrrzkARRU=; b=nedzUY7RjbAYHLOUz8eggEnFZcnhk4PK4ALmVZVW7VjYgiXzm5l2LZ/yNcKJ23wQiLZ3GO S+zZryZ5IAJHwKjeJEdby7weiH+LnIf8Ns7tcCtXKFkQ/IOScWslvV3byG0TJMGSeSbbAa rz2IG5rdt7Z3l2HTPJI9QZPTdetdqh2w2Od/ok/AayihchgUIU1jgY8k3tMIL5A6A4veTf A3h1NTIjnLXHQ9LOJwZaDkISs1+OTL+gDmyYiE95T+dGW9fkCi3d4Et/lgjaniWS4DRKcj xEwYjsiQMjeq/okbSXLMBOLBh/l0wc0RHg9Tev9PwKv3G2dFPr0gIEXSd2GPZw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4h3fGF4S1Pz11Bf for ; Mon, 20 Jul 2026 12:00:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 3d099 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Mon, 20 Jul 2026 12:00:05 +0000 To: doc-committers@FreeBSD.org, dev-commits-doc-all@FreeBSD.org Cc: Hans Rosenfeld From: Lorenzo Salvadore Subject: git: 459fbf1c42 - main - Status/2026Q2/bhyve-cpuid.adoc: Add report List-Id: Commit messages for all branches of the doc repository List-Archive: https://lists.freebsd.org/archives/dev-commits-doc-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-doc-all@freebsd.org Sender: owner-dev-commits-doc-all@FreeBSD.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: salvadore X-Git-Repository: doc X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 459fbf1c42b1bdb5cb3bea956649ba5fc5385ff4 Auto-Submitted: auto-generated Date: Mon, 20 Jul 2026 12:00:05 +0000 Message-Id: <6a5e0dc5.3d099.f1e6edc@gitrepo.freebsd.org> The branch main has been updated by salvadore: URL: https://cgit.FreeBSD.org/doc/commit/?id=459fbf1c42b1bdb5cb3bea956649ba5fc5385ff4 commit 459fbf1c42b1bdb5cb3bea956649ba5fc5385ff4 Author: Hans Rosenfeld AuthorDate: 2026-07-07 16:20:07 +0000 Commit: Lorenzo Salvadore CommitDate: 2026-07-20 11:59:34 +0000 Status/2026Q2/bhyve-cpuid.adoc: Add report Pull Request: https://github.com/freebsd/freebsd-doc/pull/694 --- .../status/report-2026-04-2026-06/bhyve-cpuid.adoc | 68 ++++++++++++++++++++++ 1 file changed, 68 insertions(+) diff --git a/website/content/en/status/report-2026-04-2026-06/bhyve-cpuid.adoc b/website/content/en/status/report-2026-04-2026-06/bhyve-cpuid.adoc new file mode 100644 index 0000000000..763cc9cfb8 --- /dev/null +++ b/website/content/en/status/report-2026-04-2026-06/bhyve-cpuid.adoc @@ -0,0 +1,68 @@ +=== Full CPUID Control for bhyve + +Contact: Hans Rosenfeld + +==== Project Overview + +Ongoing work on this project aims to integrate the existing proof-of-concept work into FreeBSD, and to add the following usability features: + +- a user-friendly configuration method to override individual bits, parts or even whole CPUID functions as needed, while keeping the rest of the host CPUID information or a pre-defined CPUID configuration +- a user-friendly configuration method for the hypervisor signature reported by bhyve +- a set of predefined CPUID configurations based on common x86 architecture levels, perhaps also including a set of CPUID data for a few real CPU models, and a user-friendly configuration method to choose one for a VM + +==== Changes during the last quarter + +===== Extensions to the bhyve configuration syntax + +The existing bhyve configuration file syntax was limited to assignments to configuration nodes, which parsed into tree-structured set of nvlists internally. + +In order to allow a more flexible configuration using pre-defined configuration file snippets, the bhyve configuration file syntax has been augmented with two new features: + +- A configuration node can be appended to with the `+=` operator. + If a value has already been assigned to the same configuration node, the new value is appended to the old value, separated by a comma. +- Another configuration file can be included with an `include` directive. + Absolute and relative paths are supported, but relative paths are understood as relative to the path of the configuration file the include directive appears in. + +===== Yet more flexible CPUID configuration + +The CPUID configuration mechanism has been extended to support symbolic feature names, where each name corresponds to a particular bit of a register for a CPUID function. +This is particularly useful for individual instruction set extensions or other optional features that can be turned off or on at will. + +So instead of configuring `cpuid.0x00000001+=edx|=0x00040000`, you can now simply write `cpuid.enable+=psn`. +There is also a corresponding option `cpuid.disable` for symbolic features. + +Using bit manipulation on CPUID register is of course still supported as not all CPUID features can be expressed in terms of individual feature bits. + + +===== Using x86 architecture levels + +The x86 architecture levels are now implemented as a set of pre-defined configuration file snippets, each higher level building on top of the lower level. + +To illustrate this, here's what x86-64-v3.cfg looks now: + +------------------- +include x86-64-v2.cfg +cpuid.enable+=fma,movbe,osxsave,avx,f16c +cpuid.enable+=bmi1,avx2,bmi2 +cpuid.enable+=abm +------------------- + +The CPU or architecture model can be selected either by including the corresponding configuration file from `/usr/share/bhyve/cpu` in the bhyve configuration file, or it can be specified on the command line as part of the vCPU configuration: `bhyve [...] -c 16,model=x86-64-v1 [...]` + +===== CPUID constraints + +In order to prevent accidentally enabling CPUID features for a guest CPU which the host CPU doesn't support, the CPUID configuration parser has been extended with a list of CPUID constraints, which are consulted when a particular CPUID register value is set or modified. + +For any register in a CPUID function, a constraint can specify which bits are immutable and which may be cleared only. + +The constraints are checked after the CPUID configuration has been applied. + + +==== Plans for next quarter + +* Implement overrides for CPUID constraints to ignore any constraints or to warn about violation of a constraint instead of failing VM setup. +* Provide more pre-defined CPU configurations based on real-world CPUs. +* Similar to setting a x86 architecture level, a mechanism will be implemented to override the hypervisor identification without requiring manually changing CPUID bits. +* Get the whole wad reviewed and committed into FreeBSD. + +Sponsor: The FreeBSD Foundation