mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2025-02-01 17:35:19 +00:00
hypervisor: Fix AIA IMSIC attr calculation
The IMSIC attr of RISC-V AIA is wrongly configured to start from 0, which would error out with `os error 22` (invalid argument). ```console Error booting VM: VmBoot(DeviceManager(CreateInterruptController(CreateAia(CreateVaia(Vaia error SetDeviceAttribute(SetDeviceAttribute(Invalid argument (os error 22)))))))) ``` `riscv_imsic_attr_of` should shift `cpu_index` by 1 here to produce correct IMSIC attr. Signed-off-by: Ruoqing He <heruoqing@iscas.ac.cn>
This commit is contained in:
parent
ca8eda5399
commit
cf463b88b7
@ -99,7 +99,7 @@ impl KvmAiaImsics {
|
||||
let riscv_imsic_addr_of = |cpu_index: u32| -> u64 {
|
||||
self.imsic_addr + (cpu_index * kvm_bindings::KVM_DEV_RISCV_IMSIC_SIZE) as u64
|
||||
};
|
||||
let riscv_imsic_attr_of = |cpu_index: u32| -> u64 { cpu_index as u64 };
|
||||
let riscv_imsic_attr_of = |cpu_index: u32| -> u64 { cpu_index as u64 + 1 };
|
||||
|
||||
// Setting up RISC-V IMSICs
|
||||
for cpu_index in 0..self.vcpu_count {
|
||||
|
Loading…
x
Reference in New Issue
Block a user