All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrii Anisov <andrii.anisov@gmail.com>
To: Stefano Stabellini <sstabellini@kernel.org>
Cc: xen-devel@lists.xenproject.org,
	Julien Grall <julien.grall@arm.com>,
	Andrii Anisov <andrii_anisov@epam.com>,
	Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Subject: Re: [PATCH v2 2/2] swiotlb-xen: implement xen_swiotlb_get_sgtable callback
Date: Wed, 18 Jan 2017 14:20:01 +0200	[thread overview]
Message-ID: <CAC1Wxdjop59Wft9QxQH753p2Wo9+pk2bZuUHxK+MUz8_VDgs1w@mail.gmail.com> (raw)
In-Reply-To: <alpine.DEB.2.10.1701161705430.2960@sstabellini-ThinkPad-X260>

Stefano,

About this piece:

>
> -       if (__generic_dma_ops(dev)->get_sgtable)
> +
> +       if (__generic_dma_ops(dev)->get_sgtable) {
> +               /* We can't handle foreign pages here. */
> +#ifdef CONFIG_ARM
> +               unsigned long bfn = dma_to_pfn(dev, handle);
> +#else
> +               unsigned long bfn = handle >> PAGE_SHIFT;
> +#endif
> +               BUG_ON (!page_is_ram(bfn));
>                 return __generic_dma_ops(dev)->get_sgtable(dev, sgt, cpu_addr, handle,
>                                                                  size, attrs);
> +       }
>         return dma_common_get_sgtable(dev, sgt, cpu_addr, handle, size);
>  }


Would it be in drivers/xen/swiotlb-xen.c as you suggested, the whole
"if (__generic_dma_ops(dev)->get_sgtable) {}" should be under ifdef.

IMO it would be better to avoid ifdefs in drivers/xen/swiotlb-xen.c,
but I haven't find out how to do that.

Sincerely,
Andrii Anisov.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

  parent reply	other threads:[~2017-01-18 12:20 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-16 11:19 [PATCH v2 0/2] XEN SWIOTLB for ARM dma operations extension Andrii Anisov
2017-01-16 11:19 ` [PATCH v2 1/2] swiotlb-xen: implement xen_swiotlb_dma_mmap callback Andrii Anisov
2017-01-16 11:19 ` [PATCH v2 2/2] swiotlb-xen: implement xen_swiotlb_get_sgtable callback Andrii Anisov
2017-01-17  1:09   ` Stefano Stabellini
2017-01-17 18:17     ` Konrad Rzeszutek Wilk
2017-01-18 12:20     ` Andrii Anisov [this message]
2017-01-18 19:23       ` Stefano Stabellini
2017-01-16 11:23 [PATCH v2 0/2] XEN SWIOTLB for ARM dma operations extension Andrii Anisov
2017-01-16 11:23 ` [PATCH v2 2/2] swiotlb-xen: implement xen_swiotlb_get_sgtable callback Andrii Anisov

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=CAC1Wxdjop59Wft9QxQH753p2Wo9+pk2bZuUHxK+MUz8_VDgs1w@mail.gmail.com \
    --to=andrii.anisov@gmail.com \
    --cc=andrii_anisov@epam.com \
    --cc=julien.grall@arm.com \
    --cc=konrad.wilk@oracle.com \
    --cc=sstabellini@kernel.org \
    --cc=xen-devel@lists.xenproject.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.