hypervisor x86: provide a generic LapicState structure

This requires making get/set_lapic_reg part of the type.

For the moment we cannot provide a default variant for the new type,
because picking one will be wrong for the other hypervisor, so I just
drop the test cases that requires LapicState::default().

Signed-off-by: Wei Liu <liuwe@microsoft.com>
This commit is contained in:
Wei Liu
2022-07-18 15:47:51 +00:00
committed by Liu Wei
parent d461daa7fa
commit 05e5106b9b
10 changed files with 132 additions and 86 deletions

View File

@@ -13,12 +13,10 @@ use crate::aarch64::VcpuInit;
#[cfg(target_arch = "aarch64")]
use crate::aarch64::{RegList, Register, StandardRegisters};
#[cfg(target_arch = "x86_64")]
use crate::arch::x86::{CpuIdEntry, FpuState, SpecialRegisters, StandardRegisters};
use crate::arch::x86::{CpuIdEntry, FpuState, LapicState, SpecialRegisters, StandardRegisters};
#[cfg(feature = "tdx")]
use crate::kvm::{TdxExitDetails, TdxExitStatus};
#[cfg(target_arch = "x86_64")]
use crate::x86_64::LapicState;
#[cfg(target_arch = "x86_64")]
use crate::x86_64::MsrEntries;
use crate::CpuState;
#[cfg(target_arch = "aarch64")]