[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20080913001134J.fujita.tomonori@lab.ntt.co.jp>
Date: Sat, 13 Sep 2008 00:11:34 +0900
From: FUJITA Tomonori <fujita.tomonori@....ntt.co.jp>
To: joerg.roedel@....com
Cc: fujita.tomonori@....ntt.co.jp, mingo@...e.hu,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH 3/3] x86: make GART to respect device's dma_mask about
virtual mappings
On Fri, 12 Sep 2008 16:52:27 +0200
Joerg Roedel <joerg.roedel@....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@....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.
--
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