linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] powerpc/iommu: check dev->iommu_group before remove it
@ 2013-08-16 10:08 Wei Yang
  2013-08-16 10:08 ` [PATCH 1/2] iommu: Don't remove device when no iommu_group associated Wei Yang
  2013-08-16 10:08 ` [PATCH 2/2] powerpc/iommu: check dev->iommu_group before remove a device from iommu_group Wei Yang
  0 siblings, 2 replies; 13+ messages in thread
From: Wei Yang @ 2013-08-16 10:08 UTC (permalink / raw)
  To: linuxppc-dev, linux-kernel; +Cc: aik, paulus, benh, Wei Yang

Had a talk with Alexey, who suggest me to send this for comments.

On powernv platform, the P7IOC provide limited range of DMA space. For
example, there are only 8 DMA segments on each PHB. When there are more 
than 8 PEs, some of PE's tce32_table is not initialized.

In the normal case, 8 PE is enough. If VF is enabled, 8 is not enough. This
lead to some pci_dev's iommu_table_base is NULL. Which results this device
couldn't be added to any iommu_group, and finally dev->iommu_group is left NULL.
When this VF is removed from the system, this will case kernel crash.

These two patches add the check to guard the kernel. Comments are welcome for
which place is better.

One more comment from Alexey is where we allow these non-DMA capable device
exist in the system. Maybe we should not allow to create a pci_dev for those
who can't get proper DMA space. Your comments are welcome :-)

Thanks in advance.

Wei Yang (2):
  iommu: Don't remove device when no iommu_group associated
  powerpc/iommu: check dev->iommu_group before remove a device from
    iommu_group

 arch/powerpc/kernel/iommu.c |    3 ++-
 drivers/iommu/iommu.c       |    3 +++
 2 files changed, 5 insertions(+), 1 deletions(-)

-- 
1.7.5.4

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2013-08-23  1:31 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-08-16 10:08 [PATCH 0/2] powerpc/iommu: check dev->iommu_group before remove it Wei Yang
2013-08-16 10:08 ` [PATCH 1/2] iommu: Don't remove device when no iommu_group associated Wei Yang
2013-08-16 10:08 ` [PATCH 2/2] powerpc/iommu: check dev->iommu_group before remove a device from iommu_group Wei Yang
2013-08-16 10:15   ` Alexey Kardashevskiy
2013-08-19  1:29     ` Wei Yang
2013-08-19  1:39       ` Alexey Kardashevskiy
2013-08-19  1:55         ` Wei Yang
2013-08-22  7:23           ` Alexey Kardashevskiy
2013-08-22  7:52             ` Wei Yang
2013-08-22 15:28               ` Alex Williamson
2013-08-22 15:41                 ` Wei Yang
2013-08-22 16:17                   ` Alex Williamson
2013-08-23  1:30                     ` Wei Yang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).