mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +00:00
vmm: Introduce riscv64 architecture support
Integrate all works done previously to enable booting riscv linux on
riscv platforms, example command:
```console
./target/debug/cloud-hypervisor \
--kernel path/to/kernel \
--disk path=path/to/disk \
--cmdline "console=hvc0 root=/dev/vda rw" \
--cpus boot=1 \
--memory size=1024M \
--seccomp false
```
Signed-off-by: Ruoqing He <heruoqing@iscas.ac.cn>
This commit is contained in:
@@ -19,6 +19,7 @@ use std::path::PathBuf;
|
||||
use std::rc::Rc;
|
||||
use std::sync::mpsc::{Receiver, RecvError, SendError, Sender};
|
||||
use std::sync::{Arc, Mutex};
|
||||
#[cfg(not(target_arch = "riscv64"))]
|
||||
use std::time::Instant;
|
||||
use std::{io, result, thread};
|
||||
|
||||
@@ -64,6 +65,7 @@ use crate::vm_config::{
|
||||
VmConfig, VsockConfig,
|
||||
};
|
||||
|
||||
#[cfg(not(target_arch = "riscv64"))]
|
||||
mod acpi;
|
||||
pub mod api;
|
||||
mod clone3;
|
||||
@@ -940,6 +942,7 @@ impl Vmm {
|
||||
MigratableError::MigrateReceive(anyhow!("Error cloning activate EventFd: {}", e))
|
||||
})?;
|
||||
|
||||
#[cfg(not(target_arch = "riscv64"))]
|
||||
let timestamp = Instant::now();
|
||||
let hypervisor_vm = mm.lock().unwrap().vm.clone();
|
||||
let mut vm = Vm::new_from_memory_manager(
|
||||
@@ -953,6 +956,7 @@ impl Vmm {
|
||||
&self.seccomp_action,
|
||||
self.hypervisor.clone(),
|
||||
activate_evt,
|
||||
#[cfg(not(target_arch = "riscv64"))]
|
||||
timestamp,
|
||||
self.console_info.clone(),
|
||||
self.console_resize_pipe.clone(),
|
||||
|
||||
Reference in New Issue
Block a user