git: nvmm: Don't require <machine/specialreg.h> and be more self-contained
Aaron LI
aly at crater.dragonflybsd.org
Fri Aug 22 20:27:15 PDT 2025
commit df40001a2ee84052443f3eea6678cb86ed17c572
Author: Aaron LI <aly at aaronly.me>
Date: Sat Aug 23 11:12:02 2025 +0800
nvmm: Don't require <machine/specialreg.h> and be more self-contained
Define the necessary CR/XCR/MSR registers and their bits by itself, so
that <machine/specialreg.h> is no longer used and any collisions are
avoided. This is similar to the various CPUID defines and it makes NVMM
more self-contained and portable.
In addition, this commit includes the following improvements/cleanups:
- Separate the Intel- and AMD-specific registers and define them in
their own implementations.
- Define 'MSR_CMPHALT' for AMD/SVM, avoiding the hardcoded 0xC0010055.
- Rename 'MSR_BIOS_SIGN' to 'MSR_IA32_BIOS_SIGN_ID' and
'MSR_MISC_ENABLE' to 'MSR_IA32_MISC_ENABLE', in order to better align
with the Intel SDM.
Summary of changes:
sys/dev/virtual/nvmm/x86/nvmm_x86.h | 100 ++++++++++++++++++++------------
sys/dev/virtual/nvmm/x86/nvmm_x86_svm.c | 25 +++++---
sys/dev/virtual/nvmm/x86/nvmm_x86_vmx.c | 40 +++++++++----
3 files changed, 108 insertions(+), 57 deletions(-)
http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/df40001a2ee84052443f3eea6678cb86ed17c572
--
DragonFly BSD source repository
More information about the Commits
mailing list