All of lore.kernel.org
 help / color / mirror / Atom feed
From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
To: Chen Baozi <cbz@baozis.org>
Cc: stefano.stabellini@eu.citrix.com, xen-devel@lists.xen.org
Subject: Re: [PATCH] xen: Add __GFP_DMA flag when xen_swiotlb_init gets free pages.
Date: Mon, 20 Apr 2015 09:37:35 -0400	[thread overview]
Message-ID: <20150420133735.GG9002@l.oracle.com> (raw)
In-Reply-To: <1429526904-27176-1-git-send-email-cbz@baozis.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 <baozich@gmail.com>
> ---
>  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

      parent reply	other threads:[~2015-04-20 13:37 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-20 10:48 [PATCH] xen: Add __GFP_DMA flag when xen_swiotlb_init gets free pages Chen Baozi
2015-04-20 10:53 ` David Vrabel
2015-04-20 11:07   ` [Xen-devel] " Chen Baozi
2015-04-20 11:07     ` Chen Baozi
2015-04-20 12:02     ` David Vrabel
2015-04-20 12:02     ` [Xen-devel] " David Vrabel
2015-04-20 12:02       ` David Vrabel
2015-04-20 17:54       ` Stefano Stabellini
2015-04-20 17:54       ` [Xen-devel] " Stefano Stabellini
2015-04-20 17:54         ` Stefano Stabellini
2015-04-21  7:57         ` Ian Campbell
2015-04-21  7:57           ` Ian Campbell
2015-04-21 10:36           ` Stefano Stabellini
2015-04-21 10:36           ` [Xen-devel] " Stefano Stabellini
2015-04-21 10:36             ` Stefano Stabellini
2015-04-21 11:05             ` Ian Campbell
2015-04-21 11:05             ` [Xen-devel] " Ian Campbell
2015-04-21 11:05               ` Ian Campbell
2015-04-21 11:11             ` Stefano Stabellini
2015-04-21 11:11             ` [Xen-devel] " Stefano Stabellini
2015-04-21 11:11               ` Stefano Stabellini
2015-04-23  2:33               ` Chen Baozi
2015-04-23  2:33                 ` Chen Baozi
2015-04-23  2:33               ` Chen Baozi
2015-04-21 12:01             ` Roger Pau Monné
2015-04-21 12:01             ` [Xen-devel] " Roger Pau Monné
2015-04-21 12:01               ` Roger Pau Monné
2015-04-21  7:57         ` Ian Campbell
2015-04-20 11:07   ` Chen Baozi
2015-04-20 13:37 ` Konrad Rzeszutek Wilk [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20150420133735.GG9002@l.oracle.com \
    --to=konrad.wilk@oracle.com \
    --cc=cbz@baozis.org \
    --cc=stefano.stabellini@eu.citrix.com \
    --cc=xen-devel@lists.xen.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.