From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
To: Christoph Hellwig <hch@lst.de>
Cc: Michael Ellerman <mpe@ellerman.id.au>,
iommu@lists.linux-foundation.org, xen-devel@lists.xenproject.org,
Claire Chang <tientzu@chromium.org>,
linuxppc-dev@lists.ozlabs.org,
Dongli Zhang <dongli.zhang@oracle.com>
Subject: Re: [PATCH 2/8] xen-swiotlb: use is_swiotlb_buffer in is_xen_swiotlb_buffer
Date: Fri, 19 Feb 2021 15:43:00 -0500 [thread overview]
Message-ID: <YDAi1FXOHVWd1DcI@Konrads-MacBook-Pro.local> (raw)
In-Reply-To: <20210207160934.2955931-3-hch@lst.de>
On Sun, Feb 07, 2021 at 05:09:28PM +0100, Christoph Hellwig wrote:
> Use the is_swiotlb_buffer to check if a physical address is
> a swiotlb buffer. This works because xen-swiotlb does use the
> same buffer as the main swiotlb code, and xen_io_tlb_{start,end}
> are just the addresses for it that went through phys_to_virt.
>
Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
> Signed-off-by: Christoph Hellwig <hch@lst.de>
> ---
> drivers/xen/swiotlb-xen.c | 6 ++----
> 1 file changed, 2 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/xen/swiotlb-xen.c b/drivers/xen/swiotlb-xen.c
> index 2b385c1b4a99cb..a4026822a889f7 100644
> --- a/drivers/xen/swiotlb-xen.c
> +++ b/drivers/xen/swiotlb-xen.c
> @@ -111,10 +111,8 @@ static int is_xen_swiotlb_buffer(struct device *dev, dma_addr_t dma_addr)
> * have the same virtual address as another address
> * in our domain. Therefore _only_ check address within our domain.
> */
> - if (pfn_valid(PFN_DOWN(paddr))) {
> - return paddr >= virt_to_phys(xen_io_tlb_start) &&
> - paddr < virt_to_phys(xen_io_tlb_end);
> - }
> + if (pfn_valid(PFN_DOWN(paddr)))
> + return is_swiotlb_buffer(paddr);
> return 0;
> }
>
> --
> 2.29.2
>
_______________________________________________
iommu mailing list
iommu@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/iommu
next prev parent reply other threads:[~2021-02-19 20:43 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-02-07 16:09 swiotlb cleanups Christoph Hellwig
2021-02-07 16:09 ` [PATCH 1/8] powerpc/svm: stop using io_tlb_start Christoph Hellwig
2021-02-07 16:09 ` [PATCH 2/8] xen-swiotlb: use is_swiotlb_buffer in is_xen_swiotlb_buffer Christoph Hellwig
2021-02-19 20:43 ` Konrad Rzeszutek Wilk [this message]
2021-02-07 16:09 ` [PATCH 3/8] xen-swiotlb: use io_tlb_end in xen_swiotlb_dma_supported Christoph Hellwig
2021-02-19 21:00 ` Konrad Rzeszutek Wilk
2021-02-07 16:09 ` [PATCH 4/8] xen-swiotlb: remove xen_set_nslabs Christoph Hellwig
2021-02-07 16:09 ` [PATCH 5/8] xen-swiotlb: remove xen_io_tlb_start and xen_io_tlb_nslabs Christoph Hellwig
2021-02-07 16:09 ` [PATCH 6/8] swiotlb: lift the double initialization protection from xen-swiotlb Christoph Hellwig
2021-02-07 16:09 ` [PATCH 7/8] xen-swiotlb: split xen_swiotlb_init Christoph Hellwig
2021-02-07 16:09 ` [PATCH 8/8] xen-swiotlb: remove the unused size argument from xen_swiotlb_fixup Christoph Hellwig
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=YDAi1FXOHVWd1DcI@Konrads-MacBook-Pro.local \
--to=konrad.wilk@oracle.com \
--cc=dongli.zhang@oracle.com \
--cc=hch@lst.de \
--cc=iommu@lists.linux-foundation.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=mpe@ellerman.id.au \
--cc=tientzu@chromium.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).