diff options
author | Jan Beulich <jbeulich@suse.com> | 2013-07-15 14:21:03 +0200 |
---|---|---|
committer | Jan Beulich <jbeulich@suse.com> | 2013-07-15 14:21:03 +0200 |
commit | 99321e0e6cf818adcb56db23779605aaab016cc5 (patch) | |
tree | 8af22c089ce0b92824ea0ad4146f262584fb0327 /xen/drivers | |
parent | 8bfaa2c23fb96d8d6bc5c0383373f9be918b82ec (diff) | |
download | xen-99321e0e6cf818adcb56db23779605aaab016cc5.tar.gz xen-99321e0e6cf818adcb56db23779605aaab016cc5.tar.bz2 xen-99321e0e6cf818adcb56db23779605aaab016cc5.zip |
VT-d: use ioremap()
There's no point in using the fixmap here, and it gets iommu_alloc()
in line with iommu_free(), 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>
Diffstat (limited to 'xen/drivers')
-rw-r--r-- | xen/drivers/passthrough/vtd/dmar.h | 2 | ||||
-rw-r--r-- | xen/drivers/passthrough/vtd/iommu.c | 7 | ||||
-rw-r--r-- | xen/drivers/passthrough/vtd/x86/vtd.c | 6 |
3 files changed, 4 insertions, 11 deletions
diff --git a/xen/drivers/passthrough/vtd/dmar.h b/xen/drivers/passthrough/vtd/dmar.h index 6044681e9a..a2b97d6851 100644 --- a/xen/drivers/passthrough/vtd/dmar.h +++ b/xen/drivers/passthrough/vtd/dmar.h @@ -127,8 +127,6 @@ do { \ } \ } while (0) -void *map_to_nocache_virt(int nr_iommus, u64 maddr); - int vtd_hw_check(void); void disable_pmr(struct iommu *iommu); int is_usb_device(u16 seg, u8 bus, u8 devfn); diff --git a/xen/drivers/passthrough/vtd/iommu.c b/xen/drivers/passthrough/vtd/iommu.c index 0fc10de15b..76f7b8e98c 100644 --- a/xen/drivers/passthrough/vtd/iommu.c +++ b/xen/drivers/passthrough/vtd/iommu.c @@ -1142,15 +1142,16 @@ int __init iommu_alloc(struct acpi_drhd_unit *drhd) return -ENOMEM; } iommu->intel->drhd = drhd; + drhd->iommu = iommu; - iommu->reg = map_to_nocache_virt(nr_iommus, drhd->address); + iommu->reg = ioremap(drhd->address, PAGE_SIZE); + if ( !iommu->reg ) + return -ENOMEM; iommu->index = nr_iommus++; iommu->cap = dmar_readq(iommu->reg, DMAR_CAP_REG); iommu->ecap = dmar_readq(iommu->reg, DMAR_ECAP_REG); - drhd->iommu = iommu; - if ( iommu_verbose ) { dprintk(VTDPREFIX, diff --git a/xen/drivers/passthrough/vtd/x86/vtd.c b/xen/drivers/passthrough/vtd/x86/vtd.c index 875b033835..ca17cb12ca 100644 --- a/xen/drivers/passthrough/vtd/x86/vtd.c +++ b/xen/drivers/passthrough/vtd/x86/vtd.c @@ -64,12 +64,6 @@ void flush_all_cache() wbinvd(); } -void *__init map_to_nocache_virt(int nr_iommus, u64 maddr) -{ - set_fixmap_nocache(FIX_IOMMU_REGS_BASE_0 + nr_iommus, maddr); - return (void *)fix_to_virt(FIX_IOMMU_REGS_BASE_0 + nr_iommus); -} - static int _hvm_dpci_isairq_eoi(struct domain *d, struct hvm_pirq_dpci *pirq_dpci, void *arg) { |