hypervisor: kvm: Complement create_standard_regs

Complement `create_standard_regs` implementation on RISC-V platform to
work with `From` trait of `kvm_riscv_core`.

Signed-off-by: Ruoqing He <heruoqing@iscas.ac.cn>
This commit is contained in:
Ruoqing He 2024-10-09 21:57:53 +08:00 committed by Rob Bradford
parent 8cd80ea36b
commit 76256230d6

View File

@ -1260,7 +1260,14 @@ impl cpu::Vcpu for KvmVcpu {
/// Returns StandardRegisters with default value set
///
fn create_standard_regs(&self) -> StandardRegisters {
kvm_bindings::kvm_regs::default().into()
#[cfg(any(target_arch = "x86_64", target_arch = "aarch64"))]
{
kvm_bindings::kvm_regs::default().into()
}
#[cfg(target_arch = "riscv64")]
{
kvm_bindings::kvm_riscv_core::default().into()
}
}
#[cfg(target_arch = "x86_64")]
///