hypervisor: mshv: Restrict MshvEmulator to x86

Current MSHV emulator only works for x86 instruction decoder. So, let's
restrict its usage to x86.

Signed-off-by: Jinank Jain <jinankjain@microsoft.com>
This commit is contained in:
Jinank Jain 2024-03-21 21:27:30 +05:30 committed by Rob Bradford
parent 7c6c45128d
commit 58e6a289ab

View File

@ -1450,11 +1450,13 @@ impl MshvVcpu {
} }
} }
#[cfg(target_arch = "x86_64")]
struct MshvEmulatorContext<'a> { struct MshvEmulatorContext<'a> {
vcpu: &'a MshvVcpu, vcpu: &'a MshvVcpu,
map: (u64, u64), // Initial GVA to GPA mapping provided by the hypervisor map: (u64, u64), // Initial GVA to GPA mapping provided by the hypervisor
} }
#[cfg(target_arch = "x86_64")]
impl<'a> MshvEmulatorContext<'a> { impl<'a> MshvEmulatorContext<'a> {
// Do the actual gva -> gpa translation // Do the actual gva -> gpa translation
#[allow(non_upper_case_globals)] #[allow(non_upper_case_globals)]
@ -1478,6 +1480,7 @@ impl<'a> MshvEmulatorContext<'a> {
} }
} }
#[cfg(target_arch = "x86_64")]
/// Platform emulation for Hyper-V /// Platform emulation for Hyper-V
impl<'a> PlatformEmulator for MshvEmulatorContext<'a> { impl<'a> PlatformEmulator for MshvEmulatorContext<'a> {
type CpuState = EmulatorCpuState; type CpuState = EmulatorCpuState;