From: Keir Fraser Date: Mon, 20 Oct 2008 14:14:55 +0000 (+0100) Subject: vtd: make the xen_in_range/tboot_in_range checkings also work for IA64. X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~14066^2~25 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=aeb7d7395583e3c3b268d8c93730e8a1fdf21f5a;p=xen.git vtd: make the xen_in_range/tboot_in_range checkings also work for IA64. Signed-off-by: Anthony Xu Signed-off-by: Dexuan Cui --- diff --git a/xen/drivers/passthrough/vtd/iommu.c b/xen/drivers/passthrough/vtd/iommu.c index dd5d7a4e79..4a855c772f 100644 --- a/xen/drivers/passthrough/vtd/iommu.c +++ b/xen/drivers/passthrough/vtd/iommu.c @@ -1012,7 +1012,7 @@ static int intel_iommu_domain_init(struct domain *d) { struct hvm_iommu *hd = domain_hvm_iommu(d); struct iommu *iommu = NULL; - u64 i; + u64 i, j, tmp; struct acpi_drhd_unit *drhd; drhd = list_entry(acpi_drhd_units.next, typeof(*drhd), list); @@ -1031,11 +1031,13 @@ static int intel_iommu_domain_init(struct domain *d) */ for ( i = 0; i < max_page; i++ ) { - if ( xen_in_range(i << PAGE_SHIFT_4K, (i + 1) << PAGE_SHIFT_4K) || - tboot_in_range(i << PAGE_SHIFT_4K, (i + 1) << PAGE_SHIFT_4K) ) + if ( xen_in_range(i << PAGE_SHIFT, (i + 1) << PAGE_SHIFT) || + tboot_in_range(i << PAGE_SHIFT, (i + 1) << PAGE_SHIFT) ) continue; - iommu_map_page(d, i, i); + tmp = 1 << (PAGE_SHIFT - PAGE_SHIFT_4K); + for ( j = 0; j < tmp; j++ ) + iommu_map_page(d, (i*tmp+j), (i*tmp+j)); } setup_dom0_devices(d);