nvmm: Make FPU state more OS-indenpendent

Operating Systems / DragonFlyBSD - Aaron LI [aaronly.me] - 20 July 2021 23:28 UTC

- Introduce an OS-indenpendent 'nvmm_x64_state_fpu' structure, derived from NetBSD's current FPU implementation.
- Also introduce the 'nvmm_x86_xsave' structure, containing the FPU area and the XSAVE header.
- Add the 'nvmm_x86_xsave_size()' that determines the XSAVE area size to simplify the code.
- Rename gfpu -> gxsave, for clarity.
- Define 'CTASSERT' because 'nvmm.h' and 'nvmm_x86.h' headers will be used by libnvmm(3), but only defines 'CTASSERT' for kernel.
- Update libnvmm.3 man page accordingly.

23b2397d3e nvmm: Make FPU state more OS-indenpendent
lib/libnvmm/libnvmm.3 | 4 +-
sys/dev/virtual/nvmm/nvmm.h | 6 +++
sys/dev/virtual/nvmm/nvmm_compat.h | 11 ------
sys/dev/virtual/nvmm/x86/nvmm_x86.c | 15 ++++++++
sys/dev/virtual/nvmm/x86/nvmm_x86.h | 65 ++++++++++++++++++++++++++++++---
sys/dev/virtual/nvmm/x86/nvmm_x86_svm.c | 41 ++++++++++-----------
sys/dev/virtual/nvmm/x86/nvmm_x86_vmx.c | 42 ++++++++++-----------
7 files changed, 121 insertions(+), 63 deletions(-)

Upstream: gitweb.dragonflybsd.org


  • Share