8000 GitHub - cwuom/KNHV: WIP - Type-2 Hypervisor implementation for Intel Processors based on VT-x technology. (Demo) · GitHub
[go: up one dir, main page]

Skip to content
cwuomPublic

About

WIP - Type-2 Hypervisor implementation for Intel Processors based on VT-x technology. (Demo)

Topics

Resources

Stars

23 stars

Watchers

0 watching

Forks

Repository files navigation

KNHV

KanoHypervisor is an experimental Intel VT-x hypervisor for Windows x64.

The nested VMX backend runs L2 through hardware VMCS02. Entry is enabled only after per-CPU resources, VMCS ownership, and a uniform capability profile pass validation on every active processor. VMX capability MSRs expose the supported control subset.

Compatibility with unmodified VMX drivers, clock behavior, and hardware performance still require validation on an isolated target.

Requirements

  • Windows x64
  • Intel processor with VMX and EPT enabled in firmware
  • One processor group, at most 64 logical processors, and 4-level host paging
  • Visual Studio C++ build tools and MASM
  • Windows SDK and matching Windows Driver Kit
  • CMake and Ninja

Use an isolated Windows installation with a kernel debugger and a recovery image for driver testing. KNHV refuses native ownership when another hypervisor is already active.

Build

Run from the repository root in a Visual Studio Developer PowerShell:

.\tools\Build-Driver.ps1 -Configuration Debug
.\tools\Build-Driver.ps1 -Configuration Release

Artifacts are written to build/vscode/<Configuration>/:

  • sys/KNHV.sys: native hypervisor driver
  • bin/KNHV_ContractTests.exe: host-side regression tests
  • bin/KNHV_NativeVmxProbe.exe: native VMX status tool
  • KNHV*.pdb: debug symbols

Builds are unsigned by default. Signing and loading are separate steps.

Tests

.\build\vscode\Debug\bin\KNHV_ContractTests.exe --root .
ctest --test-dir build/vscode/Debug --output-on-failure

Host-side tests cover control logic and shared assembly contracts. Hardware execution requires separate validation on the isolated target.

Hardware options

Both options default to OFF. Hardware nested entry requires KNHV_NATIVE_HOST_MEMORY=ON:

$build = 'build/vscode/Hardware'
.\tools\Build-Driver.ps1 -Configuration Release `
    -BuildDirectory $build -ConfigureOnly
cmake -S . -B $build -DKNHV_NATIVE_HOST_MEMORY=ON
.\tools\Build-Driver.ps1 -Configuration Release -BuildDirectory $build

The sys-hardware preset configures the same build from a developer shell:

cmake --preset sys-hardware
cmake --build --preset sys-hardware
CMake option Purpose
KNHV_NATIVE_HOST_MEMORY Owned host paging, physical windows, and nested entry
KNHV_RUN_NATIVE_L2_PROBE Fixed hardware L2 probe using VMLAUNCH and VMRESUME

Query the loaded driver on the test target. The engine status reports availability and its generation; VMCS02 selection alone does not prove L2 execution. All active processors must be launched for nested entry.

.\build\vscode\Hardware\bin\KNHV_NativeVmxProbe.exe --status

Source layout

Path Contents
src/core Driver entry and lifecycle
src/vmx Native VMX, exits, memory, and teardown
src/nested VMCS12, VMCS02, VMX instruction handling, and entry coordination
src/asm Hardware entry, exit, and state restoration
tests Regression tests
tools Build and target-validation scripts

License

MIT.

About

WIP - Type-2 Hypervisor implementation for Intel Processors based on VT-x technology. (Demo)

Topics

Resources

Stars

23 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages

0