hypervisor: x86: Add an address linearization method to CpuStateManager

From a CPU state and a segment, we can translate a logical (segmented)
address into a linear one.

Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
This commit is contained in:
Samuel Ortiz
2020-11-26 19:33:47 +01:00
committed by Rob Bradford
parent d419e30df1
commit 7a4edecd29
4 changed files with 92 additions and 9 deletions

View File

@@ -26,6 +26,9 @@ impl<T: Debug> Display for Exception<T> {
#[derive(Error, Debug)]
pub enum PlatformError {
#[error("Invalid address: {0}")]
InvalidAddress(#[source] anyhow::Error),
#[error("Invalid register: {0}")]
InvalidRegister(#[source] anyhow::Error),
@@ -46,6 +49,9 @@ pub enum PlatformError {
#[error("Unmapped virtual address: {0}")]
UnmappedGVA(#[source] anyhow::Error),
#[error("Unsupported CPU Mode: {0}")]
UnsupportedCpuMode(#[source] anyhow::Error),
}
#[derive(Error, Debug)]