#[derive(Clone, Copy, Debug, Eq, PartialEq, thiserror::Error)]
pub enum VirtualizationError {
#[error("virtualization hardware is unavailable")]
Unavailable,
#[error("virtualization is already enabled")]
AlreadyEnabled,
#[error("virtualization is not enabled")]
NotEnabled,
#[error("no implemented guest paging mode is supported")]
UnsupportedPaging,
#[error("guest timer comparator is unsupported")]
UnsupportedTimer,
#[error("guest page-table root is misaligned or exceeds the PPN width")]
InvalidRoot,
#[error("exception vector is misaligned")]
InvalidVector,
#[error("invalid hardware control memory")]
#[cfg(target_arch = "x86_64")]
InvalidControlMemory,
#[error("virtualization instruction failed")]
#[cfg(target_arch = "x86_64")]
InstructionFailed,
#[error("VMX feature control is not authorized and locked")]
#[cfg(target_arch = "x86_64")]
FeatureControlUnavailable,
#[error("invalid guest extended-state configuration")]
#[cfg(target_arch = "x86_64")]
InvalidExtendedState,
#[error("I/O port range exceeds the hardware bitmap")]
#[cfg(target_arch = "x86_64")]
InvalidPortRange,
#[error("MSR is not represented by the hardware permission bitmap")]
#[cfg(target_arch = "x86_64")]
UnsupportedMsr,
}