arch: AArch64: support saving RDIST pending tables into guest RAM

This commit adds a function which allows to save RDIST pending
tables to the guest RAM, as well as unit test case for it.

Signed-off-by: Henry Wang <Henry.Wang@arm.com>
This commit is contained in:
Henry Wang
2020-08-31 16:34:12 +08:00
committed by Rob Bradford
parent 29ce3076c2
commit e7acbcc184
2 changed files with 25 additions and 1 deletions
+11 -1
View File
@@ -395,7 +395,7 @@ pub mod kvm {
#[cfg(target_arch = "aarch64")]
#[cfg(test)]
mod tests {
use arch::aarch64::gic::kvm::create_gic;
use arch::aarch64::gic::kvm::{create_gic, save_pending_tables};
use arch::aarch64::gic::{
get_dist_regs, get_icc_regs, get_redist_regs, set_dist_regs, set_icc_regs, set_redist_regs,
};
@@ -459,4 +459,14 @@ mod tests {
assert!(set_icc_regs(gic.device(), &gicr_typer, &state).is_ok());
}
#[test]
fn test_save_pending_tables() {
let hv = hypervisor::new().unwrap();
let vm = hv.create_vm().unwrap();
let _ = vm.create_vcpu(0).unwrap();
let gic = create_gic(&vm, 1, false).expect("Cannot create gic");
assert!(save_pending_tables(gic.device()).is_ok());
}
}