[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 2/8] xen-swiotlb: use is_swiotlb_buffer in is_xen_swiotlb_buffer
- To: Christoph Hellwig <hch@xxxxxx>
- From: Konrad Rzeszutek Wilk <konrad.wilk@xxxxxxxxxx>
- Date: Fri, 19 Feb 2021 15:43:00 -0500
- Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none
- Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=tB/dvSZM1X/jBc7PdsTaWhjcO8FcDvh672wUSDa5wD8=; b=i0M2wFX7Ob40JUrfIizLpHIdhvATot0XRFhBB38F/ealWLAunzUoefcfUE4/pJg5h8D5THDC1RyVfqnysU1W18i4iV6vllkqssbgEqZCDqvPh28UrPgumZ2UugvVd2sxDe1B5n0vvI9w25T5xegQrMwk8XGPdJyKqnL4dC9UjNF+eb2G0+RHU0omugavTRAkBkOuI20vUW/usdRC4kml8MiSQJKegbRPpOmz1V84tpV3e/vpnvRaY1Eh0VW6uhiMW07DmhXMen9aEM2U2HY21wbvc7wtiv8QL5rPHyYug2UGXpiO49UD54v9vsIPRs9C0cnRzN2BS99Rcz2ne2oJfQ==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=LIqrkcrVIf4cX991XyND1nlQh6kd4fIKaN/zt7Wxsb6WGJntAct1J7nunQiH3i+BHjLtgSgQ2plKvBjre08CuajTCaOjgcXNVuuWBkngmOGMqaVsQ1mlWRkqbfMsEzAH6UE9cattxM2/j/qV42WYNo5RutYSUoy89YetWOdWICmbulMsfWZBQV50iWByk0zBoknfKWCQgbAi6cltCUJoVcQ2v5rh/ir+IOuxLmtqfy50Me1NlXYpXdhqrWHDTWwueNCQDsXFMraCc0JsdAmJG558OaFD0wDA8yyDmghL3vCWUZovtYsN85V+e3QN46ZnehMxbI0LA3DeHxSai3ckFg==
- Authentication-results: lst.de; dkim=none (message not signed) header.d=none;lst.de; dmarc=none action=none header.from=oracle.com;
- Cc: Michael Ellerman <mpe@xxxxxxxxxxxxxx>, Dongli Zhang <dongli.zhang@xxxxxxxxxx>, Claire Chang <tientzu@xxxxxxxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx, linuxppc-dev@xxxxxxxxxxxxxxxx, iommu@xxxxxxxxxxxxxxxxxxxxxxxxxx
- Delivery-date: Fri, 19 Feb 2021 20:43:21 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
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@xxxxxxxxxx>
> Signed-off-by: Christoph Hellwig <hch@xxxxxx>
> ---
> 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
>
|