fix(openhcl_boot): enable swiotlb for VBS-isolated VMs#3752
Conversation
VBS-isolated VMs need swiotlb because VTL2 private memory is not accessible from VTL0, requiring bounce buffers for DMA. Previously swiotlb=4096,1 was only set for hardware-isolated VMs (TDX/SNP). Change the condition from is_hardware_isolated() to IsolationType::None to cover all isolation types, including VBS.
|
This PR modifies files containing For more on why we check whole files, instead of just diffs, check out the Rustonomicon |
|
|
||
| if params.isolation_type.is_hardware_isolated() { | ||
| for p in HARDWARE_ISOLATED_KERNEL_PARAMETERS { | ||
| if params.isolation_type != IsolationType::None { |
There was a problem hiding this comment.
I think IsolationType has an is_isolated helper we should use instead.
There was a problem hiding this comment.
Pull request overview
Updates openhcl_boot’s kernel command-line construction so SWIOTLB is enabled for all isolated partitions (not just hardware-isolated SNP/TDX), covering VBS isolation where VTL2 private memory is inaccessible to VTL0 DMA.
Changes:
- Apply
swiotlb=4096,1whenisolation_type != IsolationType::None(covers VBS + hardware isolation). - Rename/clarify the isolated-vs-non-isolated SWIOTLB parameter grouping (to match the new condition).
| const NON_HARDWARE_ISOLATED_KERNEL_PARAMETERS: &[&str] = &[ | ||
| // Even with iommu=off, the SWIOTLB is still allocated on AARCH64 | ||
| // (iommu=off ignored entirely). Set it to the minimum, saving ~63 MiB. | ||
| // The first parameter controls the area size, the second controls the | ||
| // number of areas (default is # of CPUs). Set them both to the minimum. | ||
| "swiotlb=1,1", |
|
Just so I can fully understand, how do we give access to VTL 2 private memory to VTL 0 on TDX/SNP? Why can't we do the same on VBS? |
|
what device/etc are we enabling in VTL0? i'm confused on why we need this, as isn't swiotlb only for communication with the host, not with VTL0? |
VBS-isolated VMs need swiotlb because VTL2 private memory is not accessible from VTL0, requiring bounce buffers for DMA. Previously swiotlb=4096,1 was only set for hardware-isolated VMs (TDX/SNP).
Change the condition from is_hardware_isolated() to IsolationType::None to cover all isolation types, including VBS.