Page MenuHomeFreeBSD

vmm: Move defines from x86.c to x86/bhyve.h
ClosedPublic

Authored by cperciva on Feb 22 2026, 4:11 AM.
Tags
None
Referenced Files
F171607846: D55430.id172429.diff
Sat, Sep 12, 3:15 AM
Unknown Object (File)
Sun, Sep 6, 12:01 PM
Unknown Object (File)
Sat, Sep 5, 12:50 AM
Unknown Object (File)
Fri, Sep 4, 11:17 PM
Unknown Object (File)
Thu, Sep 3, 5:41 PM
Unknown Object (File)
Wed, Sep 2, 9:02 AM
Unknown Object (File)
Wed, Sep 2, 1:34 AM
Unknown Object (File)
Wed, Sep 2, 1:31 AM
Subscribers

Details

Summary

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: 2 weeks
Fixes: 313a68ea20b4 ("bhyve: Add CPUID_BHYVE_FEATURES leaf")

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

Adjusted include guard to _X86_BHYVE_H_ instead of _BHYVE_H_

Perhaps the defines should go into x86/include/specialreg.h together with all other CPUID bits definitions.

In D55430#1268961, @kib wrote:

Perhaps the defines should go into x86/include/specialreg.h together with all other CPUID bits definitions.

I considered that, but specialreg.h only has CPUID bits relating to hardware; hypervisor-related CPUID bits have always gone into hypervisor-specific header files.

IMO other bits should be also moved to specialreg.h

This revision was not accepted when it landed; it landed in state Needs Review.Mar 28 2026, 5:57 AM
This revision was automatically updated to reflect the committed changes.