Messages in this thread | | | Subject | Re: [PATCH 3/3] x86: make GART to respect device's dma_mask about virtual mappings | From | FUJITA Tomonori <> | Date | Sat, 13 Sep 2008 00:11:34 +0900 |
| |
On Fri, 12 Sep 2008 16:52:27 +0200 Joerg Roedel <joerg.roedel@amd.com> wrote:
> On Fri, Sep 12, 2008 at 07:42:35PM +0900, FUJITA Tomonori wrote: > > Currently, GART IOMMU ingores device's dma_mask when it does virtual > > mappings. So it could give a device a virtual address that the device > > can't access to. > > > > This patch fixes the above problem. > > > > Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> > > --- > > arch/x86/kernel/pci-gart_64.c | 39 ++++++++++++++++++++++++++++----------- > > 1 files changed, 28 insertions(+), 11 deletions(-) > > > > diff --git a/arch/x86/kernel/pci-gart_64.c b/arch/x86/kernel/pci-gart_64.c > > index 47abe43..9739d56 100644 > > --- a/arch/x86/kernel/pci-gart_64.c > > +++ b/arch/x86/kernel/pci-gart_64.c > > @@ -83,23 +83,34 @@ static unsigned long next_bit; /* protected by iommu_bitmap_lock */ > > static int need_flush; /* global flush state. set for each gart wrap */ > > > > static unsigned long alloc_iommu(struct device *dev, int size, > > - unsigned long align_mask) > > + unsigned long align_mask, u64 dma_mask) > > You can calculate the dma_mask in this function from the dev parameter. > There is no need to pass it two levels down to this function extending > various parameter lists.
No, we can't because we need to use dev->coherent_dma_mask for alloc_coherent and dev->dma_mask for the rest.
| |