[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20090618200256.GE19771@sequoia.sous-sol.org>
Date: Thu, 18 Jun 2009 13:02:56 -0700
From: Chris Wright <chrisw@...s-sol.org>
To: "Yu, Fenghua" <fenghua.yu@...el.com>
Cc: "'Chris Wright'" <chrisw@...s-sol.org>,
"'David Woodhouse'" <dwmw2@...radead.org>,
"'Linus Torvalds'" <torvalds@...ux-foundation.org>,
"'Stephen Rothwell'" <sfr@...b.auug.org.au>,
"'Andrew Morton'" <akpm@...ux-foundation.org>,
"'Ingo Molnar'" <mingo@...e.hu>,
"'Christopher Wright'" <chrisw@...hat.com>,
"Kay, Allen M" <allen.m.kay@...el.com>,
"'iommu'" <iommu@...ts.linux-foundation.org>,
"'lkml'" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 2/2] IOMMU Identity Mapping Support: Intel IOMMU
implementation
* Yu, Fenghua (fenghua.yu@...el.com) wrote:
> >> @@ -2259,6 +2394,9 @@ static dma_addr_t __intel_map_single(struct device
> >*hwdev, phys_addr_t paddr,
> >> int ret;
> >> struct intel_iommu *iommu;
> >>
> >> + if (identity_list(pdev))
> >> + return paddr;
> >> +
> >
> >This is same as DUMMY_DEVICE_DOMAIN_INFO. Please consolidate to a test
> >that just says "do i need translation".
> >
>
> The purpose of identity_list() is to have an interface for future when we need to set 1:1 mapping on some specific devices instead of all (just like Muli Ben-Yehuda suggested earlier in this thread).
>
> Right now it's almost empty. Yeah, I can change this checking to simply:
> if (iommu_identity_mapping)
> return paddr;
>
That's fine, I figured that's why you had the list check. But my point is
there are 2 ways to test for the same thing, which is whether a translation
is needed or not.
So a simple helper to help clarify what is going on. Like this:
static int iommu_dummy(struct pci_device *pdev)
{
return (pdev->dev.archdata.iommu == DUMMY_DEVICE_DOMAIN_INFO);
}
static int iommu_no_mapping(struct pci_device *pdev)
{
if (identity_list(pdev) || iommu_dummy(pdev))
return 1;
return 0;
}
> >And what about DMA mask smaller than physical memory. The PT mode drops
> >back to swiotlb iirc.
Also...this?
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists