pub trait EmulatorSupport: AccessCpuState {
// Required methods
fn vp_index(&self) -> VpIndex;
fn physical_address(&self) -> Option<u64>;
fn initial_gva_translation(&mut self) -> Option<InitialTranslation>;
fn interruption_pending(&self) -> bool;
fn check_vtl_access(
&mut self,
gpa: u64,
mode: TranslateMode,
) -> Result<(), EmuCheckVtlAccessError>;
fn translate_gva(
&mut self,
gva: u64,
mode: TranslateMode,
) -> Result<EmuTranslateResult, EmuTranslateError>;
fn inject_pending_event(&mut self, event_info: HvAarch64PendingEvent);
fn is_gpa_mapped(&self, gpa: u64, write: bool) -> bool;
// Provided method
fn monitor_support(&self) -> Option<&dyn EmulatorMonitorSupport> { ... }
}
Expand description
Support routines for the emulator.
Required Methods§
Sourcefn physical_address(&self) -> Option<u64>
fn physical_address(&self) -> Option<u64>
The physical address that caused the fault.
Sourcefn initial_gva_translation(&mut self) -> Option<InitialTranslation>
fn initial_gva_translation(&mut self) -> Option<InitialTranslation>
The gva translation included in the intercept message header, if valid.
Sourcefn interruption_pending(&self) -> bool
fn interruption_pending(&self) -> bool
If interrupt pending is marked in the intercept message
Sourcefn check_vtl_access(
&mut self,
gpa: u64,
mode: TranslateMode,
) -> Result<(), EmuCheckVtlAccessError>
fn check_vtl_access( &mut self, gpa: u64, mode: TranslateMode, ) -> Result<(), EmuCheckVtlAccessError>
Check that the current GPA is valid to access by the current VTL with the following access mode. Returns true if valid to access.
Sourcefn translate_gva(
&mut self,
gva: u64,
mode: TranslateMode,
) -> Result<EmuTranslateResult, EmuTranslateError>
fn translate_gva( &mut self, gva: u64, mode: TranslateMode, ) -> Result<EmuTranslateResult, EmuTranslateError>
Translates a GVA to a GPA.
Sourcefn inject_pending_event(&mut self, event_info: HvAarch64PendingEvent)
fn inject_pending_event(&mut self, event_info: HvAarch64PendingEvent)
Generates an event (exception, guest nested page fault, etc.) in the guest.
Sourcefn is_gpa_mapped(&self, gpa: u64, write: bool) -> bool
fn is_gpa_mapped(&self, gpa: u64, write: bool) -> bool
Returns true if gpa
is mapped for the specified permissions.
If true, then the emulator will use [GuestMemory
] to access the GPA,
and any failures will be fatal to the VM.
If false, then the emulator will use [CpuIo
] to access the GPA as
MMIO.
Provided Methods§
Sourcefn monitor_support(&self) -> Option<&dyn EmulatorMonitorSupport>
fn monitor_support(&self) -> Option<&dyn EmulatorMonitorSupport>
Get access to monitor support for the emulator, if it supports it.