Skip to content

Commit da75685

Browse files
committed
allocate and register swiotlb mem if initial_swiotlb_size != 0
Allocate the swiotlb region if requested via the /machine-config API endpoint, and register it to the VM/KVM. Signed-off-by: Patrick Roy <[email protected]>
1 parent 62d7fbb commit da75685

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/vmm/src/builder.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -248,6 +248,12 @@ pub fn build_microvm_for_boot(
248248
.map_err(VmmError::Vm)?;
249249
}
250250

251+
if let Some(swiotlb) = swiotlb {
252+
vmm.vm
253+
.register_swiotlb_region(swiotlb)
254+
.map_err(VmmError::Vm)?;
255+
}
256+
251257
let entry_point = load_kernel(&boot_config.kernel_file, vmm.vm.guest_memory())?;
252258
let initrd = InitrdConfig::from_config(boot_config, vmm.vm.guest_memory())?;
253259

0 commit comments

Comments
 (0)