This pull request introduces a series of enhancements and refinements to the UEFI Rust hypervisor, aimed at improving functionality and stability across various components:
EPT Management: Transitioned from using separate primary and secondary EPTs (Extended Page Tables) for all threads to a single primary EPT per thread, optimizing memory management.
Runtime CPUID Hooks: Implemented hooks in the CPUID instruction at runtime, currently marked as unstable. These hooks are managed through EPT violations and are installed on a shadow copy page via vmcall. While CPUID, INT3, and other instructions could potentially employ similar hooks with minor modifications, MTF (Monitor Trap Flag) is utilized to restore hooks and execute the overwritten bytes. Future updates aim to enhance support for runtime hooks via a CPUID backdoor. Initial attempts to utilize a guest agent for executing kernel code upon EPT violations were set aside in favor of maintaining obfuscation through EPT, minimizing guest exposure.
Hook Stability and Overhead: Currently, hooks are unstable and subject to extensive testing before they can be deemed stable for public release. The implementation involves hooks during system boot and includes SSDT hooks, but is anticipated to cause multiple VM exits, though the overhead should not significantly impact performance.
Memory Management for Hooks: Accessing the Guest Physical Address (PA) now requires traversing the page tables, a crucial step for effective hook implementation.
Build System and Continuous Integration:
Adopted cargo-make for project builds, utilizing a Makefile.toml configuration.
Updated GitHub workflow YAML files to integrate cargo make.
Documentation and Configuration Updates:
Revised README.md to reflect the latest changes.
Updated workspace settings in config.toml.
Debugging Features: Introduced features to selectively enable or disable support for Hyper-V Type 2, primarily for debugging purposes. This update continues to inject #GP faults for invalid or reserved MSR accesses.
MSR Hooks: Added functionality to hook the LSTAR register at runtime, allowing for dynamic retrieval and restoration of the ntoskrnl base address.
Code Formatting: Updated the project to conform to a modified cargo fmt style.
Structural Changes: Implemented various structural changes and refactorings to enhance code organization and maintainability.
Dependency Updates: Updated the UEFI crate and other dependent crates to newer versions.
Boot Loader Addition: Integrated a new loader to facilitate system startup.
Note: This is partial support for #10 and #18.
These changes lay the groundwork for more robust and flexible hypervisor capabilities, aiming for increased stability and performance in virtualized environments. Further testing and validation are required to ensure that these enhancements meet the necessary standards for reliability and security.
Acknowledgments: Special thanks to Daax's, Satoshi Tanda, Jessiep, and Drew for their contributions and support in this update.
This pull request introduces a series of enhancements and refinements to the UEFI Rust hypervisor, aimed at improving functionality and stability across various components:
cargo-make
for project builds, utilizing aMakefile.toml
configuration.cargo make
.README.md
to reflect the latest changes.config.toml
.ntoskrnl
base address.cargo fmt
style.Note: This is partial support for #10 and #18.
These changes lay the groundwork for more robust and flexible hypervisor capabilities, aiming for increased stability and performance in virtualized environments. Further testing and validation are required to ensure that these enhancements meet the necessary standards for reliability and security.
Acknowledgments: Special thanks to Daax's, Satoshi Tanda, Jessiep, and Drew for their contributions and support in this update.