MCPcopy Create free account
hub / github.com/cloud-hypervisor/cloud-hypervisor / new

Method new

hypervisor/src/kvm/aarch64/gic/mod.rs:265–287  ·  view source on GitHub ↗

Method to initialize the GIC device

(vm: &dyn Vm, config: &VgicConfig)

Source from the content-addressed store, hash-verified

263
264 /// Method to initialize the GIC device
265 pub fn new(vm: &dyn Vm, config: &VgicConfig) -> Result<KvmGicV3Its> {
266 // This is inside KVM module
267 let vm = vm.as_any().downcast_ref::<KvmVm>().expect("Wrong VM type?");
268
269 let vgic = Self::create_device(vm)?;
270
271 let mut gic_device = KvmGicV3Its {
272 device: vgic,
273 its_device: None,
274 gicr_typers: vec![0; config.vcpu_count.try_into().unwrap()],
275 dist_addr: config.dist_addr,
276 dist_size: config.dist_size,
277 redists_addr: config.redists_addr,
278 redists_size: config.redists_size,
279 msi_addr: config.msi_addr,
280 msi_size: config.msi_size,
281 vcpu_count: config.vcpu_count,
282 };
283
284 gic_device.init_device_attributes(vm, config.nr_irqs)?;
285
286 Ok(gic_device)
287 }
288}
289
290impl Vgic for KvmGicV3Its {

Callers

nothing calls this directly

Calls 2

as_anyMethod · 0.45

Tested by

no test coverage detected