Crate hv1_hypercall

Source
Expand description

Hyper-V hypercall parsing.

This crate helps you implement handling for Hyper-V hypercalls issued by guest VMs. These are the hypercalls defined in the Hypervisor Top Level Functional Specification.

Besides providing parsing of the core hypercall ABI, it also provides Rust traits for each supported hypercall.

To use this crate, you provide access to the processor’s registers, and you implement the trait corresponding to each hypercall you want to support. Then you use the dispatcher macro to instantiate a dispatcher, and you call Dispatcher::dispatch dispatch the hypercall.

Macros§

dispatcher
Creates a hypercall dispatcher, where the dispatcher can support any of the list of provided hypercalls.

Structs§

Arm64RegisterIo
An implementation of HypercallIo on top of Arm64RegisterState.
Dispatcher
Hypercall dispatcher.
HvInterruptParameters
Configuration for a hypervisor device interrupt.
X64RegisterIo
An implementation of HypercallIo on X64 register state.

Enums§

X64HypercallRegister
An x64 GP register. This just contains the subset used in the hypercall ABI.

Traits§

AcceptGpaPages
Implements the HvAcceptGpaPages hypercall.
Arm64RegisterState
Provides access to the ARM64 register state needed to parse hypercalls.
AsHandler
Trait for getting the handler from the handler parameter passed to Dispatcher::dispatch.
AssertVirtualInterrupt
Implements the HvAssertVirtualInterrupt hypercall.
EnablePartitionVtl
Implements the HvEnablePartitionVtl hypercall.
EnableVpVtl
Implements the HvEnableVpVtl hypercall.
ExtendedQueryCapabilities
Implements the HvExtQueryCapabilities hypercall.
FlushVirtualAddressList
Implements the HvFlushVirtualAddressList hypercall.
FlushVirtualAddressListEx
Implements the HvFlushVirtualAddressListEx hypercall.
FlushVirtualAddressSpace
Implements the HvFlushVirtualAddressSpace hypercall.
FlushVirtualAddressSpaceEx
Implements the HvFlushVirtualAddressSpaceEx hypercall.
GetVpIndexFromApicId
Implements the HvGetVpIndexFromApicId hypercall.
GetVpRegisters
Implements the HvGetVpRegisters hypercall.
HypercallDefinition
A trait defined on dummy objects to provide metadata for a hypercall.
HypercallIo
Provides input and output parameters for a hypercall.
InstallIntercept
Implements the HvInstallIntercept hypercall.
ModifySparseGpaPageHostVisibility
Implements the HvModifySparseGpaPageHostVisibility hypercall.
ModifyVtlProtectionMask
Implements the HvModifyVtlProtectionMask hypercall.
PostMessage
Implements the HvPostMessage hypercall.
PostMessageDirect
Implements the HvPostMessageDirect hypercall.
QuerySparseGpaPageHostVisibility
Implements the HvQuerySparseGpaPageHostVisibility hypercall.
RetargetDeviceInterrupt
Implements the HvRetargetDeviceInterrupt hypercall.
SendSyntheticClusterIpi
Implements the HvSendSyntheticClusterIpi hypercall.
SendSyntheticClusterIpiEx
Implements the HvSendSyntheticClusterIpi hypercall.
SetVpRegisters
Implements the HvSetVpRegisters hypercall.
SignalEvent
Implements the HvSignalEvent hypercall.
SignalEventDirect
Implements the HvSignalEventDirect hypercall.
StartVirtualProcessor
Implements the HvStartVirtualProcessor hypercall.
TranslateVirtualAddressExAarch64
Implements the HvTranslateVirtualAddressEx hypercall.
TranslateVirtualAddressExX64
Implements the HvTranslateVirtualAddressEx hypercall.
TranslateVirtualAddressX64
Implements the HvTranslateVirtualAddress hypercall.
VtlCall
Implements the HvVtlCall hypercall.
VtlReturn
Implements the HvVtlReturn hypercall.
VtlSwitchOps
Operations required to handle VTL switch hypercalls.
X64RegisterState
Register state access for x86/x64.

Type Aliases§

HvAarch64TranslateVirtualAddressEx
Defines the HvTranslateVirtualAddressEx hypercall.
HvAcceptGpaPages
Defines the HvAcceptGpaPages hypercall.
HvArm64EnableVpVtl
Defines the HvEnableVpVtl hypercall for arm64.
HvArm64StartVirtualProcessor
Defines the HvStartVirtualProcessor hypercall for arm64.
HvAssertVirtualInterrupt
Defines the HvAssertVirtualInterrupt hypercall.
HvEnablePartitionVtl
Defines the HvEnablePartitionVtl hypercall.
HvExtQueryCapabilities
Defines the HvExtQueryCapabilities hypercall.
HvFlushVirtualAddressList
Defines the HvFlushVirtualAddressList hypercall.
HvFlushVirtualAddressListEx
Defines the HvFlushVirtualAddressListEx hypercall.
HvFlushVirtualAddressSpace
Defines the HvFlushVirtualAddressSpace hypercall.
HvFlushVirtualAddressSpaceEx
Defines the HvFlushVirtualAddressSpaceEx hypercall.
HvGetVpIndexFromApicId
Defines the HvGetVpIndexFromApicId hypercall.
HvGetVpRegisters
Defines the HvGetVpRegisters hypercall.
HvInstallIntercept
Defines the HvInstallIntercept hypercall.
HvModifySparseGpaPageHostVisibility
Defines the HvModifySparseGpaPageHostVisibility hypercall.
HvModifyVtlProtectionMask
Defines the HvModifyVtlProtectionMask hypercall.
HvPostMessage
Defines the HvPostMessage hypercall.
HvPostMessageDirect
Defines the HvPostMessageDirect hypercall.
HvQuerySparseGpaPageHostVisibility
Defines the HvQuerySparseGpaPageHostVisibility hypercall.
HvRepResult
Hypervisor result type for rep hypercalls. These hypercalls have either no or only rep output data, which is passed separately from the result. The error is an a tuple consisting of an HvError and the number of elements successfully processed prior to the error being returned. An Ok result implies that all input elements were processed successfully.
HvRetargetDeviceInterrupt
Defines the HvRetargetDeviceInterrupt hypercall.
HvSendSyntheticClusterIpi
Defines the HvSendSyntheticClusterIpi hypercall.
HvSendSyntheticClusterIpiEx
Defines the HvSendSyntheticClusterIpi hypercall.
HvSetVpRegisters
Defines the HvSetVpRegisters hypercall.
HvSignalEvent
Defines the HvSignalEvent hypercall.
HvSignalEventDirect
Defines the HvSignalEventDirect hypercall.
HvVtlCall
Defines the HvVtlCall hypercall.
HvVtlReturn
Defines the HvVtlReturn hypercall.
HvX64EnableVpVtl
Defines the HvEnableVpVtl hypercall for x64.
HvX64StartVirtualProcessor
Defines the HvStartVirtualProcessor hypercall for x64.
HvX64TranslateVirtualAddress
Defines the HvTranslateVirtualAddress hypercall.
HvX64TranslateVirtualAddressEx
Defines the HvTranslateVirtualAddressEx hypercall.