lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Thu, 4 Sep 2008 13:11:46 +0900
From:	FUJITA Tomonori <fujita.tomonori@....ntt.co.jp>
To:	joro@...tes.org
Cc:	fujita.tomonori@....ntt.co.jp, linux-kernel@...r.kernel.org,
	tony.luck@...el.com, iommu@...ts.linux-foundation.org,
	mingo@...hat.com, kamezawa.hiroyu@...fujitsu.com
Subject: Re: [PATCH 3/3] swiotlb: use GFP_DMA32 instead of GFP_DMA in
 swiotlb_alloc_coherent

On Wed, 3 Sep 2008 22:05:27 +0200
Joerg Roedel <joro@...tes.org> wrote:

> On Thu, Sep 04, 2008 at 03:04:25AM +0900, FUJITA Tomonori wrote:
> > x86 sets up gfp flag propely so swiotlb_alloc_coherent doesn't need to
> > use GFP_DMA unconditionally. It leads to allocation failures in some
> > systems.
> > 
> > Signed-off-by: FUJITA Tomonori <fujita.tomonori@....ntt.co.jp>
> > ---
> >  lib/swiotlb.c |    7 +------
> >  1 files changed, 1 insertions(+), 6 deletions(-)
> > 
> > diff --git a/lib/swiotlb.c b/lib/swiotlb.c
> > index 977edbd..b88d7c2 100644
> > --- a/lib/swiotlb.c
> > +++ b/lib/swiotlb.c
> > @@ -467,12 +467,7 @@ swiotlb_alloc_coherent(struct device *hwdev, size_t size,
> >  	void *ret;
> >  	int order = get_order(size);
> >  
> > -	/*
> > -	 * XXX fix me: the DMA API should pass us an explicit DMA mask
> > -	 * instead, or use ZONE_DMA32 (ia64 overloads ZONE_DMA to be a ~32
> > -	 * bit range instead of a 16MB one).
> > -	 */
> > -	flags |= GFP_DMA;
> > +	flags |= GFP_DMA32;
> 
> No. This is exactly the place where the swiotlb iommu implementation
> should handle the dma_mask of the specific device. Unconditionally use
> DMA32 here is not the best possible handling.

Not best but it works though ideally we can just remove the flags hack
completely.
--
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