[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20161228032139.GA254916@otc-nc-03>
Date: Tue, 27 Dec 2016 19:21:39 -0800
From: "Raj, Ashok" <ashok.raj@...el.com>
To: Bjorn Helgaas <helgaas@...nel.org>
Cc: David Woodhouse <dwmw2@...radead.org>,
Joerg Roedel <joro@...tes.org>,
g@...lgaas-glaptop.roam.corp.google.com, linux-pci@...r.kernel.org,
iommu@...ts.linux-foundation.org, linux-kernel@...r.kernel.org,
rwright@....com, ashok.raj@...el.com
Subject: Re: 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.
Cheers,
Ashok
Powered by blists - more mailing lists