aboutsummaryrefslogtreecommitdiffstats
path: root/xen/drivers
diff options
context:
space:
mode:
authorJan Beulich <jbeulich@suse.com>2013-07-15 14:21:45 +0200
committerJan Beulich <jbeulich@suse.com>2013-07-15 14:21:45 +0200
commitd7f913b8de206464f2a18e4c6d20886d32483de3 (patch)
treef3cf84f02bbd2f7685f12ea967afa141dce13f23 /xen/drivers
parent99321e0e6cf818adcb56db23779605aaab016cc5 (diff)
downloadxen-d7f913b8de206464f2a18e4c6d20886d32483de3.tar.gz
xen-d7f913b8de206464f2a18e4c6d20886d32483de3.tar.bz2
xen-d7f913b8de206464f2a18e4c6d20886d32483de3.zip
AMD IOMMU: use ioremap()
There's no point in using the fixmap here, and it gets map_iommu_mmio_region() in line with unmap_iommu_mmio_region(), which was already using iounmap() (thus crashing if actually used). Signed-off-by: Jan Beulich <jbeulich@suse.com> Acked-by: Keir Fraser <keir@xen.org> Acked-by: Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>
Diffstat (limited to 'xen/drivers')
-rw-r--r--xen/drivers/passthrough/amd/iommu_init.c15
1 files changed, 3 insertions, 12 deletions
diff --git a/xen/drivers/passthrough/amd/iommu_init.c b/xen/drivers/passthrough/amd/iommu_init.c
index ba86e1b3cf..c19b51db4a 100644
--- a/xen/drivers/passthrough/amd/iommu_init.c
+++ b/xen/drivers/passthrough/amd/iommu_init.c
@@ -48,19 +48,10 @@ static int iommu_has_ht_flag(struct amd_iommu *iommu, u8 mask)
static int __init map_iommu_mmio_region(struct amd_iommu *iommu)
{
- unsigned long mfn;
-
- if ( nr_amd_iommus > MAX_AMD_IOMMUS )
- {
- AMD_IOMMU_DEBUG("nr_amd_iommus %d > MAX_IOMMUS\n", nr_amd_iommus);
+ iommu->mmio_base = ioremap(iommu->mmio_base_phys,
+ IOMMU_MMIO_REGION_LENGTH);
+ if ( !iommu->mmio_base )
return -ENOMEM;
- }
-
- iommu->mmio_base = (void *)fix_to_virt(
- FIX_IOMMU_MMIO_BASE_0 + nr_amd_iommus * MMIO_PAGES_PER_IOMMU);
- mfn = (unsigned long)(iommu->mmio_base_phys >> PAGE_SHIFT);
- map_pages_to_xen((unsigned long)iommu->mmio_base, mfn,
- MMIO_PAGES_PER_IOMMU, PAGE_HYPERVISOR_NOCACHE);
memset(iommu->mmio_base, 0, IOMMU_MMIO_REGION_LENGTH);