Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp728029pxj; Wed, 16 Jun 2021 12:09:15 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxsMDAaYzvxBIH6DavKuXl/ia49lKNDXphkaEIWlyfQf/OMkbzjPFXsyo9QCEzgsgJFvnR0 X-Received: by 2002:a17:906:b855:: with SMTP id ga21mr1037693ejb.550.1623870555310; Wed, 16 Jun 2021 12:09:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623870555; cv=none; d=google.com; s=arc-20160816; b=cDJH82fSDmVHt7cuKkO05iTsFbz45Rc4kUQQ+fsWtM5xPMig0v3JTnoeGN5wA9YFeU FIJ499ui+F8o7Dqrf1p9ATtBOHrZLeHnG7QuRTb2RAP1qrpzgbbsbuo7WTOIMPGP1nxV u51Ol4ADy5RMSXdiZalw7aWDfviwb14H1HAZKcgW0nUCdikD/Z9lpQiS/1sPL1VamVao O2cMf7zNa46sbV+9ElwYhTOqj/0IA8e+YtqSnqWHsY0JDniRXWOlmoXS70QbuadBSBhN o/op9LfahZUgsomfzH8o1ZKzJhMDtf+an19CjPuv55ABkQpIWeKBSRf+mAglhIORxHy/ 6DGQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=5tdxN59pxx17GnkVdZsc55p1moIaXNFd2ORp9E1eAfA=; b=o/pKORMTAc6CYh0A4c8KlZv2cWcMiLksHPYV3GrypFCViu2MNGghlpzoYsN1PTXD24 J6ZaTv9CHAK1WpmbLsgGCebAxzOmV2r5ozc0oU6hor3wnPSXNwmsLNgQvM8fYDITTcBU gqKIi7b61yXP2wgOIDNTLi24JFBUByXNF6TkMaGrspBVD34FfEnLIQfhp2louLg6gh9B HJSHFrZjBNKP1DTHH7wc4YBNc/XRjo/K8ZR3s43zYwB+6fMm5a1fLVFC9BnmITMfcJUr dQeT9ehWAGF8J76QSxh7AlF+ZModC2U6VOtpqbtKTRAIOwkSruoyw8rw5qN6C/NBstXy /SXg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id jx12si2827196ejc.502.2021.06.16.12.08.51; Wed, 16 Jun 2021 12:09:15 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233901AbhFPOX6 (ORCPT + 99 others); Wed, 16 Jun 2021 10:23:58 -0400 Received: from verein.lst.de ([213.95.11.211]:54649 "EHLO verein.lst.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232694AbhFPOX5 (ORCPT ); Wed, 16 Jun 2021 10:23:57 -0400 Received: by verein.lst.de (Postfix, from userid 2407) id E68C468BEB; Wed, 16 Jun 2021 16:21:48 +0200 (CEST) Date: Wed, 16 Jun 2021 16:21:48 +0200 From: Christoph Hellwig To: Boris Ostrovsky Cc: Roman Skakun , Konrad Rzeszutek Wilk , Juergen Gross , Stefano Stabellini , xen-devel@lists.xenproject.org, iommu@lists.linux-foundation.org, linux-kernel@vger.kernel.org, Christoph Hellwig , Oleksandr Tyshchenko , Oleksandr Andrushchenko , Volodymyr Babchuk , Roman Skakun , Andrii Anisov Subject: Re: [PATCH 2/2] swiotlb-xen: override common mmap and get_sgtable dma ops Message-ID: <20210616142148.GA764@lst.de> References: <855a58e2-1e03-4763-cb56-81367b73762c@oracle.com> <20210616114205.38902-1-roman_skakun@epam.com> <20210616114205.38902-2-roman_skakun@epam.com> <2834cdc0-534c-4f07-1901-e468a7713c1f@oracle.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <2834cdc0-534c-4f07-1901-e468a7713c1f@oracle.com> User-Agent: Mutt/1.5.17 (2007-11-01) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jun 16, 2021 at 10:12:55AM -0400, Boris Ostrovsky wrote: > I wonder now whether we could avoid code duplication between here and dma_common_mmap()/dma_common_get_sgtable() and use your helper there. > > > Christoph, would that work?? I.e. something like You should not duplicate the code at all, and just make the common helpers work with vmalloc addresses.