mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +00:00
vmm: hypervisor: Add a new interface to setup GICR for vcpus
For MSHV arm64 guest, there is an in-hypervisor GICv2M emulation and for that to work, it needs to be enlightened with the base address of GIC redistributor exposed to guest via FDT. Signed-off-by: Jinank Jain <jinankjain@microsoft.com>
This commit is contained in:
+22
-1
@@ -2203,6 +2203,21 @@ impl Vm {
|
||||
#[cfg(feature = "tdx")]
|
||||
let tdx_enabled = self.config.lock().unwrap().is_tdx_enabled();
|
||||
|
||||
#[cfg(target_arch = "aarch64")]
|
||||
let vgic = self
|
||||
.device_manager
|
||||
.lock()
|
||||
.unwrap()
|
||||
.get_interrupt_controller()
|
||||
.unwrap()
|
||||
.lock()
|
||||
.unwrap()
|
||||
.get_vgic()
|
||||
.unwrap();
|
||||
|
||||
#[cfg(target_arch = "aarch64")]
|
||||
let redist_addr = vgic.lock().unwrap().device_properties();
|
||||
|
||||
// Configure the vcpus that have been created
|
||||
let vcpus = self.cpu_manager.lock().unwrap().vcpus();
|
||||
for vcpu in vcpus {
|
||||
@@ -2211,7 +2226,13 @@ impl Vm {
|
||||
self.cpu_manager
|
||||
.lock()
|
||||
.unwrap()
|
||||
.configure_vcpu(vcpu, boot_setup)
|
||||
.configure_vcpu(vcpu.clone(), boot_setup)
|
||||
.map_err(Error::CpuManager)?;
|
||||
|
||||
#[cfg(target_arch = "aarch64")]
|
||||
vcpu.lock()
|
||||
.unwrap()
|
||||
.set_gic_redistributor_addr(redist_addr[2], redist_addr[3])
|
||||
.map_err(Error::CpuManager)?;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user