From efbafdf9ed53ddbc638cd43c346d2b47a453c50d Mon Sep 17 00:00:00 2001 From: Sebastien Boeuf Date: Thu, 17 Oct 2019 12:55:23 -0700 Subject: [PATCH] vm-virtio: Allow 2MiB mappings In order to speed up the boot time and reduce the amount of mappings, this patch exposes the virtio-iommu device as supporting both 2M and 4k page sizes. Signed-off-by: Sebastien Boeuf --- vm-virtio/src/iommu.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/vm-virtio/src/iommu.rs b/vm-virtio/src/iommu.rs index b9c0b46c0..530ae8e6c 100644 --- a/vm-virtio/src/iommu.rs +++ b/vm-virtio/src/iommu.rs @@ -53,9 +53,9 @@ const VIRTIO_IOMMU_F_BYPASS: u32 = 3; #[allow(unused)] const VIRTIO_IOMMU_F_PROBE: u32 = 4; -// Default to 4KiB page size. +// Support 2MiB and 4KiB page sizes. #[allow(unused)] -const VIRTIO_IOMMU_PAGE_SIZE_MASK: u64 = 4 << 10; +const VIRTIO_IOMMU_PAGE_SIZE_MASK: u64 = (2 << 20) | (4 << 10); #[allow(unused)] #[derive(Copy, Clone, Debug, Default)]