Skip to content

Commit 0f04fa4

Browse files
committed
fix(vm): add missing AxArchVCpu import for riscv64
1 parent d45b622 commit 0f04fa4

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

src/vm.rs

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ use alloc::boxed::Box;
22
use alloc::format;
33
use alloc::sync::Arc;
44
use alloc::vec::Vec;
5+
#[cfg(target_arch = "aarch64")]
56
use axvmconfig::VMInterruptMode;
67
use core::sync::atomic::{AtomicBool, Ordering};
78
use memory_addr::{align_down_4k, align_up_4k};
@@ -12,6 +13,10 @@ use spin::Mutex;
1213
use axaddrspace::{AddrSpace, GuestPhysAddr, HostPhysAddr, MappingFlags, device::AccessWidth};
1314
use axdevice::{AxVmDeviceConfig, AxVmDevices};
1415
use axvcpu::{AxVCpu, AxVCpuExitReason, AxVCpuHal};
16+
17+
#[cfg(target_arch = "riscv64")]
18+
use axvcpu::AxArchVCpu;
19+
1520
use cpumask::CpuMask;
1621

1722
use crate::config::{AxVMConfig, VmMemMappingType};
@@ -220,12 +225,18 @@ impl<H: AxVMHal, U: AxVCpuHal> AxVM<H, U> {
220225
)?;
221226
}
222227

228+
#[cfg(target_arch = "aarch64")]
223229
let mut devices = axdevice::AxVmDevices::new(AxVmDeviceConfig {
224230
emu_configs: config.emu_devices().to_vec(),
225231
});
226-
232+
#[cfg(target_arch = "aarch64")]
227233
let passthrough = config.interrupt_mode() == VMInterruptMode::Passthrough;
228234

235+
#[cfg(not(target_arch = "aarch64"))]
236+
let devices = axdevice::AxVmDevices::new(AxVmDeviceConfig {
237+
emu_configs: config.emu_devices().to_vec(),
238+
});
239+
229240
#[cfg(target_arch = "aarch64")]
230241
{
231242
if passthrough {

0 commit comments

Comments
 (0)