[lkml]   [2016]   [Dec]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: possible dmar_init_reserved_ranges() error
Hi Bjorn,

On Tue, Dec 27, 2016 at 05:44:17PM -0600, Bjorn Helgaas wrote:
> dmar_init_reserved_ranges()
> {
> ...
> for_each_pci_dev(pdev) {
> for (i = 0; i < PCI_NUM_RESOURCES; i++) {
> r = &pdev->resource[i];
> reserve_iova(r)
> But I assume it's possible to have more than one IOTLB in a system,

You meant IOMMU?

> so you could have some PCI devices under one IOTLB and others under a
> different IOTLB. So it seems like we should reserve only the IOVA
> space used by the devices under *this* IOTLB.

Yes, it seems we are aggressive reserving all pci devices bars's when
potentially you need to only reserve ranges for the IOMMU under which
this pci device exist. We also need to make sure devices under the
INCLUDE_ALL is handled correctly.
> Also, we may hot-add a device under the IOTLB, and I don't see where
> we reserve the IOVA space it uses.
> I think the best thing to do would be to reserve the host bridge
> apertures related to each IOTLB. That would resolve both questions.
> It looks like iova_reserve_pci_windows() does this in the
> iommu_dma_init_domain() path.

This sounds reasonable, if we can reserve from the host bridge apertures
it should take care of hot-plug cases as well, and should simply how the
reservation is made.


 \ /
  Last update: 2016-12-28 04:23    [W:0.149 / U:0.012 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site