aboutsummaryrefslogtreecommitdiff
path: root/aarch64
diff options
context:
space:
mode:
authorPierre-Clément Tosi <ptosi@google.com>2023-10-25 14:22:55 +0100
committercrosvm LUCI <crosvm-scoped@luci-project-accounts.iam.gserviceaccount.com>2023-11-15 10:50:46 +0000
commita342b8fba3d38328ffe8cf74950d7e4ce7f69435 (patch)
tree00f01a2198765bab9042eafe20e17c059e891478 /aarch64
parent1abdd9af88110631803ca9a0c51e784d90c9922f (diff)
downloadcrosvm-a342b8fba3d38328ffe8cf74950d7e4ce7f69435.tar.gz
Extend pKVM-VFIO support to virtual SIDs
Add support for assigning VFIO devices with more than one Stream ID to pKVM guests. The guest DT now uses <#iommu-cells> == 1. Implement a virtual topology where the n-th SID is mapped to the virtual SID with value n. TEST=tools/run_tests BUG=b:306110430 Change-Id: I053f4697b13b40c8c7f6eb9ef27afe5c7aeb36ca Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/5009548 Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
Diffstat (limited to 'aarch64')
-rw-r--r--aarch64/src/fdt.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/aarch64/src/fdt.rs b/aarch64/src/fdt.rs
index 5a81f2b58..c2257e6af 100644
--- a/aarch64/src/fdt.rs
+++ b/aarch64/src/fdt.rs
@@ -377,7 +377,7 @@ fn get_pkvm_pviommu_ids(platform_dev_resources: &Vec<PlatformBusResources>) -> R
for res in platform_dev_resources {
for iommu in &res.iommus {
- if let (IommuDevType::PkvmPviommu, Some(id)) = iommu {
+ if let (IommuDevType::PkvmPviommu, Some(id), _) = iommu {
ids.insert(*id);
}
}
@@ -394,7 +394,7 @@ fn create_pkvm_pviommu_node(fdt: &mut Fdt, index: usize, id: u32) -> Result<u32>
let iommu_node = fdt.root_mut().subnode_mut(&name)?;
iommu_node.set_prop("phandle", phandle)?;
- iommu_node.set_prop("#iommu-cells", 0u32)?;
+ iommu_node.set_prop("#iommu-cells", 1u32)?;
iommu_node.set_prop("compatible", "pkvm,pviommu")?;
iommu_node.set_prop("id", id)?;