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§
- Arm64
Register Io - An implementation of
HypercallIo
on top ofArm64RegisterState
. - Dispatcher
- Hypercall dispatcher.
- HvInterrupt
Parameters - Configuration for a hypervisor device interrupt.
- X64Register
Io - An implementation of
HypercallIo
on X64 register state.
Enums§
- X64Hypercall
Register - An x64 GP register. This just contains the subset used in the hypercall ABI.
Traits§
- Accept
GpaPages - Implements the
HvAcceptGpaPages
hypercall. - Arm64
Register State - Provides access to the ARM64 register state needed to parse hypercalls.
- AsHandler
- Trait for getting the handler from the
handler
parameter passed toDispatcher::dispatch
. - Assert
Virtual Interrupt - Implements the
HvAssertVirtualInterrupt
hypercall. - Enable
Partition Vtl - Implements the
HvEnablePartitionVtl
hypercall. - Enable
VpVtl - Implements the
HvEnableVpVtl
hypercall. - Extended
Query Capabilities - Implements the
HvExtQueryCapabilities
hypercall. - Flush
Virtual Address List - Implements the
HvFlushVirtualAddressList
hypercall. - Flush
Virtual Address List Ex - Implements the
HvFlushVirtualAddressListEx
hypercall. - Flush
Virtual Address Space - Implements the
HvFlushVirtualAddressSpace
hypercall. - Flush
Virtual Address Space Ex - Implements the
HvFlushVirtualAddressSpaceEx
hypercall. - GetVp
Index From Apic Id - Implements the
HvGetVpIndexFromApicId
hypercall. - GetVp
Registers - Implements the
HvGetVpRegisters
hypercall. - Hypercall
Definition - A trait defined on dummy objects to provide metadata for a hypercall.
- Hypercall
Io - Provides input and output parameters for a hypercall.
- Install
Intercept - Implements the
HvInstallIntercept
hypercall. - Modify
Sparse GpaPage Host Visibility - Implements the
HvModifySparseGpaPageHostVisibility
hypercall. - Modify
VtlProtection Mask - Implements the
HvModifyVtlProtectionMask
hypercall. - Post
Message - Implements the
HvPostMessage
hypercall. - Post
Message Direct - Implements the
HvPostMessageDirect
hypercall. - Query
Sparse GpaPage Host Visibility - Implements the
HvQuerySparseGpaPageHostVisibility
hypercall. - Retarget
Device Interrupt - Implements the
HvRetargetDeviceInterrupt
hypercall. - Send
Synthetic Cluster Ipi - Implements the
HvSendSyntheticClusterIpi
hypercall. - Send
Synthetic Cluster IpiEx - Implements the
HvSendSyntheticClusterIpi
hypercall. - SetVp
Registers - Implements the
HvSetVpRegisters
hypercall. - Signal
Event - Implements the
HvSignalEvent
hypercall. - Signal
Event Direct - Implements the
HvSignalEventDirect
hypercall. - Start
Virtual Processor - Implements the
HvStartVirtualProcessor
hypercall. - Translate
Virtual Address ExAarch64 - Implements the
HvTranslateVirtualAddressEx
hypercall. - Translate
Virtual Address ExX64 - Implements the
HvTranslateVirtualAddressEx
hypercall. - Translate
Virtual Address X64 - Implements the
HvTranslateVirtualAddress
hypercall. - VtlCall
- Implements the
HvVtlCall
hypercall. - VtlReturn
- Implements the
HvVtlReturn
hypercall. - VtlSwitch
Ops - Operations required to handle VTL switch hypercalls.
- X64Register
State - Register state access for x86/x64.
Type Aliases§
- HvAarch64
Translate Virtual Address Ex - Defines the
HvTranslateVirtualAddressEx
hypercall. - HvAccept
GpaPages - Defines the
HvAcceptGpaPages
hypercall. - HvArm64
Enable VpVtl - Defines the
HvEnableVpVtl
hypercall for arm64. - HvArm64
Start Virtual Processor - Defines the
HvStartVirtualProcessor
hypercall for arm64. - HvAssert
Virtual Interrupt - Defines the
HvAssertVirtualInterrupt
hypercall. - HvEnable
Partition Vtl - Defines the
HvEnablePartitionVtl
hypercall. - HvExt
Query Capabilities - Defines the
HvExtQueryCapabilities
hypercall. - HvFlush
Virtual Address List - Defines the
HvFlushVirtualAddressList
hypercall. - HvFlush
Virtual Address List Ex - Defines the
HvFlushVirtualAddressListEx
hypercall. - HvFlush
Virtual Address Space - Defines the
HvFlushVirtualAddressSpace
hypercall. - HvFlush
Virtual Address Space Ex - Defines the
HvFlushVirtualAddressSpaceEx
hypercall. - HvGet
VpIndex From Apic Id - Defines the
HvGetVpIndexFromApicId
hypercall. - HvGet
VpRegisters - Defines the
HvGetVpRegisters
hypercall. - HvInstall
Intercept - Defines the
HvInstallIntercept
hypercall. - HvModify
Sparse GpaPage Host Visibility - Defines the
HvModifySparseGpaPageHostVisibility
hypercall. - HvModify
VtlProtection Mask - Defines the
HvModifyVtlProtectionMask
hypercall. - HvPost
Message - Defines the
HvPostMessage
hypercall. - HvPost
Message Direct - Defines the
HvPostMessageDirect
hypercall. - HvQuery
Sparse GpaPage Host Visibility - Defines the
HvQuerySparseGpaPageHostVisibility
hypercall. - HvRep
Result - 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. AnOk
result implies that all input elements were processed successfully. - HvRetarget
Device Interrupt - Defines the
HvRetargetDeviceInterrupt
hypercall. - HvSend
Synthetic Cluster Ipi - Defines the
HvSendSyntheticClusterIpi
hypercall. - HvSend
Synthetic Cluster IpiEx - Defines the
HvSendSyntheticClusterIpi
hypercall. - HvSet
VpRegisters - Defines the
HvSetVpRegisters
hypercall. - HvSignal
Event - Defines the
HvSignalEvent
hypercall. - HvSignal
Event Direct - Defines the
HvSignalEventDirect
hypercall. - HvVtl
Call - Defines the
HvVtlCall
hypercall. - HvVtl
Return - Defines the
HvVtlReturn
hypercall. - HvX64
Enable VpVtl - Defines the
HvEnableVpVtl
hypercall for x64. - HvX64
Start Virtual Processor - Defines the
HvStartVirtualProcessor
hypercall for x64. - HvX64
Translate Virtual Address - Defines the
HvTranslateVirtualAddress
hypercall. - HvX64
Translate Virtual Address Ex - Defines the
HvTranslateVirtualAddressEx
hypercall.