After moving iommu_group setup to iommu core code [1][2] and removing
private domain support in vt-d [3], there are no users for functions such
as iommu_request_dm_for_dev(), iommu_request_dma_domain_for_dev() and
request_default_domain_for_dev(). So, remove these functions.
[1] commit dce8d6964ebd ("iommu/amd: Convert to probe/release_device()
call-backs")
[2] commit e5d1841f18b2 ("iommu/vt-d: Convert to probe/release_device()
call-backs")
[3] commit 327d5b2fee91 ("iommu/vt-d: Allow 32bit devices to uses DMA
domain")
Signed-off-by: Sai Praneeth Prakhya <email address hidden>
Cc: Joerg Roedel <joro@8bytes.org>
Cc: Lu Baolu <email address hidden>
Link: https://<email address hidden>
Signed-off-by: Joerg Roedel <email address hidden>
(cherry picked from commit 69cf449166987d9a041020be6422ee7bf94a7228
linux-next)
Signed-off-by: You-Sheng Yang <email address hidden>
Current Intel IOMMU driver sets the system level dma_ops. This causes
each dma API to go through the IOMMU driver even the devices are using
identity mapped domains. This sets per-device dma_ops only if a device
is using a DMA domain. Otherwise, use the default system level dma_ops
for direct dma.
Signed-off-by: Lu Baolu <email address hidden>
Tested-by: Daniel Drake <email address hidden>
Reviewed-by: Jon Derrick <email address hidden>
Reviewed-by: Jerry Snitselaar <email address hidden>
Link: https://<email address hidden>
Signed-off-by: Joerg Roedel <email address hidden>
(cherry picked from commit 6fc7020cf298aaec343df423746b44d99c6efaa5
linux-next)
Signed-off-by: You-Sheng Yang <email address hidden>
Before commit fa954e6831789 ("iommu/vt-d: Delegate the dma domain
to upper layer"), Intel IOMMU started off with all devices in the
identity domain, and took them out later if it found they couldn't
access all of memory. This required devices behind a PCI bridge to
use a DMA domain at the beginning because all PCI devices behind
the bridge use the same source-id in their transactions and the
domain couldn't be changed at run-time.
Intel IOMMU driver is now aligned with the default domain framework,
there's no need to keep this requirement anymore.
Signed-off-by: Lu Baolu <email address hidden>
Tested-by: Daniel Drake <email address hidden>
Reviewed-by: Jon Derrick <email address hidden>
Reviewed-by: Jerry Snitselaar <email address hidden>
Link: https://<email address hidden>
Signed-off-by: Joerg Roedel <email address hidden>
(cherry picked from commit 14b3526d5909f01e1d1baa05f50952788bb7418e
linux-next)
Signed-off-by: You-Sheng Yang <email address hidden>
Currently, if a 32bit device initially uses an identity domain, Intel
IOMMU driver will convert it forcibly to a DMA one if its address
capability is not enough for the whole system memory. The motivation was
to overcome the overhead caused by possible bounced buffer.
Unfortunately, this improvement has led to many problems. For example,
some 32bit devices are required to use an identity domain, forcing them
to use DMA domain will cause the device not to work anymore. On the
other hand, the VMD sub-devices share a domain but each sub-device might
have different address capability. Forcing a VMD sub-device to use DMA
domain blindly will impact the operation of other sub-devices without
any notification. Further more, PCI aliased devices (PCI bridge and all
devices beneath it, VMD devices and various devices quirked with
pci_add_dma_alias()) must use the same domain. Forcing one device to
switch to DMA domain during runtime will cause in-fligh DMAs for other
devices to abort or target to other memory which might cause undefind
system behavior.
With the last private domain usage in iommu_need_mapping() removed, all
private domain helpers are also cleaned in this patch. Otherwise, the
compiler will complain that some functions are defined but not used.
Signed-off-by: Lu Baolu <email address hidden>
Tested-by: Daniel Drake <email address hidden>
Reviewed-by: Jon Derrick <email address hidden>
Reviewed-by: Jerry Snitselaar <email address hidden>
Cc: Daniel Drake <email address hidden>
Cc: Derrick Jonathan <email address hidden>
Cc: Jerry Snitselaar <email address hidden>
Link: https://<email address hidden>
Signed-off-by: Joerg Roedel <email address hidden>
(cherry picked from commit 327d5b2fee91c404a3956c324193892cf2cc9528
linux-next)
Signed-off-by: You-Sheng Yang <email address hidden>
The .probe_finalize() call-back of some IOMMU drivers calls into
arm_iommu_attach_device(). This function will call back into the
IOMMU core code, where it tries to take group->mutex again, resulting
in a deadlock.
As there is no reason why .probe_finalize() needs to be called under
that mutex, move it after the lock has been released to fix the
deadlock.
Fixes: deac0b3bed26 ("iommu: Split off default domain allocation from group assignment")
Reported-by: Yong Wu <email address hidden>
Signed-off-by: Joerg Roedel <email address hidden>
Cc: Yong Wu <email address hidden>
Link: https://lore.kernel.org/r/20200519132824.15163-1-joro@8bytes.org
(cherry picked from commit 8350a49c2ef8aa166e498595e68ef3833fd74e55
linux-next)
Signed-off-by: You-Sheng Yang <email address hidden>
1116506...
by
Tero Kristo via iommu <email address hidden>
iommu/omap: Add check for iommu group when no IOMMU in use
Most of the devices in OMAP family of SoCs are not using IOMMU. The
patch for converting the OMAP IOMMU to use generic IOMMU bus probe
functionality failed to add a check for this, so add it here.
Fixes: c822b37cac48 ("iommu/omap: Remove orphan_dev tracking")
Reported-by: Tomi Valkeinen <email address hidden>
Signed-off-by: Tero Kristo <email address hidden>
Link: https://<email address hidden>
Signed-off-by: Joerg Roedel <email address hidden>
(cherry picked from commit 46b14fc61bfa409efe95a7752a5dba361d753c66
linux-next)
Signed-off-by: You-Sheng Yang <email address hidden>
The commit dce8d6964ebd ("iommu/amd: Convert to probe/release_device()
call-backs") introduced an unused variable,
drivers/iommu/amd_iommu.c: In function 'amd_iommu_uninit_device':
drivers/iommu/amd_iommu.c:422:20: warning: variable 'iommu' set but not
used [-Wunused-but-set-variable]
struct amd_iommu *iommu; ^~~~~
Signed-off-by: Qian Cai <email address hidden>
Link: https://<email address hidden>
Fixes: dce8d6964ebd ("iommu/amd: Convert to probe/release_device() call-backs")
Signed-off-by: Joerg Roedel <email address hidden>
(cherry picked from commit cfcccbe8879f79bc9f8a162bcb482c74b8768094
linux-next)
Signed-off-by: You-Sheng Yang <email address hidden>