git: nvmm(4): Undefine all specialreg macros to avoid potential conflicts
Aaron LI
aly at crater.dragonflybsd.org
Sun Aug 16 19:40:27 PDT 2026
commit ea254af1abf41fc6ff9982711742628945b31c1c
Author: Aaron LI <aly at aaronly.me>
Date: Fri Aug 7 20:56:37 2026 +0800
nvmm(4): Undefine all specialreg macros to avoid potential conflicts
The 'nvmm_x86.h' is a public header that's included via 'nvmm.h', so
it's possible for the custom defined CR0/CR4/XCR0/MSR bits to conflict
with OS's version; for example, including one header that pulls in
<machine/specialreg.h>. This is actually the case happened in NetBSD
11.0.
In order to resolve the conflict in NetBSD 11.0 and be future-proof,
move the specialreg macros to the internal header 'nvmm_x86_internal.h',
and generate the `#undef` block to undefine all the macros to avoid any
redefinition warnings.
Discussed-with: Maxime Villard (m00nbsd)
Summary of changes:
sys/dev/virtual/nvmm/x86/nvmm_x86.h | 70 --------
sys/dev/virtual/nvmm/x86/nvmm_x86_internal.h | 257 ++++++++++++++++++++++++++-
sys/dev/virtual/nvmm/x86/nvmm_x86_svmfunc.S | 4 +-
sys/dev/virtual/nvmm/x86/nvmm_x86_vmxfunc.S | 4 +-
4 files changed, 260 insertions(+), 75 deletions(-)
http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/ea254af1abf41fc6ff9982711742628945b31c1c
--
DragonFly BSD source repository
More information about the Commits
mailing list