From mboxrd@z Thu Jan 1 00:00:00 1970 From: Konrad Rzeszutek Wilk Subject: Re: [PATCH] xen: Add __GFP_DMA flag when xen_swiotlb_init gets free pages. Date: Mon, 20 Apr 2015 09:37:35 -0400 Message-ID: <20150420133735.GG9002@l.oracle.com> References: <1429526904-27176-1-git-send-email-cbz@baozis.org> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline In-Reply-To: <1429526904-27176-1-git-send-email-cbz@baozis.org> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Chen Baozi Cc: stefano.stabellini@eu.citrix.com, xen-devel@lists.xen.org List-Id: xen-devel@lists.xenproject.org On Mon, Apr 20, 2015 at 06:48:24PM +0800, Chen Baozi wrote: > Make sure that xen_swiotlb_init allocates buffers that is DMA capable. > > Signed-off-by: Chen Baozi > --- > drivers/xen/swiotlb-xen.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/drivers/xen/swiotlb-xen.c b/drivers/xen/swiotlb-xen.c > index 810ad41..7345afd 100644 > --- a/drivers/xen/swiotlb-xen.c > +++ b/drivers/xen/swiotlb-xen.c > @@ -235,7 +235,8 @@ retry: > #define SLABS_PER_PAGE (1 << (PAGE_SHIFT - IO_TLB_SHIFT)) > #define IO_TLB_MIN_SLABS ((1<<20) >> IO_TLB_SHIFT) > while ((SLABS_PER_PAGE << order) > IO_TLB_MIN_SLABS) { > - xen_io_tlb_start = (void *)__get_free_pages(__GFP_NOWARN, order); > + xen_io_tlb_start = (void *)__get_free_pages( > + __GFP_NOWARN|__GFP_DMA, order); This is not good for x86 PV guests - as the GFP_DMA pool does not really have pages below 4GB. Could you make this __GFP_DMA be dependent on (!xen_pv_domain()) or such? > if (xen_io_tlb_start) > break; > order--; > -- > 2.1.4 > > > _______________________________________________ > Xen-devel mailing list > Xen-devel@lists.xen.org > http://lists.xen.org/xen-devel