Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp4597387pxb; Mon, 27 Sep 2021 22:40:50 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxqRZ4hhKQn0wYy1/iZmZo60kdGY9+mczCgCTuw4fnccZcZt7j9k1yjBeGfhRnJ5Q/jIO3I X-Received: by 2002:a05:6a00:c8c:b0:447:bddb:c83 with SMTP id a12-20020a056a000c8c00b00447bddb0c83mr3790673pfv.1.1632807650473; Mon, 27 Sep 2021 22:40:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632807650; cv=none; d=google.com; s=arc-20160816; b=Ucaaq/07zxDSuYQJo46Vlmcx1BE+iIT7SGID5kb0OiSEuxOMwG38PfIi5xiP5A+aRd XQY2mvxh8KfCPw4Pzv5RHZw6/fZYa9iNsVJHtTN3OX7fnBQ++RFBJd55DSX0CPxBSGRP uZlbMprHrK1KFG/5k0oky4iCfHYbD6QxqdGTi9wcaz86/u/dtJ9ukcukFe0VaEGWZC83 gJnieCYD21sYv448tIGJhbeNrStee6S8UMKOQkD7ATNurJpiPutcF8NlbLwDQOaE2aGe 6N0rQ32+JU/dQOJMXVLH5jfdgIlU2T4WDClaQjAdooRemCJ3QuKBvO/ZJKAvw5nXP+qs edcA== 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-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=nSLjHuMsF4f+rn1kscvUOi6u2mHOD75t/UxKPFBCrCg=; b=Ga/2SftoT63Gw6PgMHi4WUKcWYmh2ELUtFDkggwLPsPfHVtHf77BO3up0LuNVCUb0G 0jSwNN2PS2T1z4VBmAGyqolmC5wFaWR+FKYy2uzwuzNZHgU+Tdnh8AQkaqV6NijPUCbn JfAhvphzCAORsPzfinr9/5BT6fG5D5fXh+VQNoEB0iTL3IzWnL3XgZ4ksz2aYwKxXGp0 zMD2/C0bsuUqdTAjKiaQKh2gVJmliOCbURZh7X9uyMXPJrfGChh0ThSVXWvWvcQY8Sbp s/1y0cplpTg9exXpWTpT86xIj5tLH0/BPjKDvb0ET2tGWlfn8g7JHVeG1SDENWuTOUTV zflg== 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 p11si23282353plw.196.2021.09.27.22.40.38; Mon, 27 Sep 2021 22:40:50 -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 S234298AbhI1FlA (ORCPT + 99 others); Tue, 28 Sep 2021 01:41:00 -0400 Received: from verein.lst.de ([213.95.11.211]:50132 "EHLO verein.lst.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234243AbhI1Fk5 (ORCPT ); Tue, 28 Sep 2021 01:40:57 -0400 Received: by verein.lst.de (Postfix, from userid 2407) id ED5FC67373; Tue, 28 Sep 2021 07:39:11 +0200 (CEST) Date: Tue, 28 Sep 2021 07:39:11 +0200 From: Christoph Hellwig To: Tianyu Lan Cc: Christoph Hellwig , "iommu@lists.linux-foundation.org" , "linux-arch@vger.kernel.org" , "linux-hyperv@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "linux-scsi@vger.kernel.org" , "netdev@vger.kernel.org" , vkuznets , "parri.andrea@gmail.com" , "dave.hansen@intel.com" , Michael Kelley , KY Srinivasan , Haiyang Zhang , Stephen Hemminger , "wei.liu@kernel.org" , Dexuan Cui , "tglx@linutronix.de" , "mingo@redhat.com" , "bp@alien8.de" , "x86@kernel.org" , "hpa@zytor.com" , "dave.hansen@linux.intel.com" , "luto@kernel.org" , "peterz@infradead.org" , "konrad.wilk@oracle.com" , "boris.ostrovsky@oracle.com" , "jgross@suse.com" , "sstabellini@kernel.org" , "joro@8bytes.org" , "will@kernel.org" , "davem@davemloft.net" , "kuba@kernel.org" , "jejb@linux.ibm.com" , "martin.petersen@oracle.com" , "gregkh@linuxfoundation.org" , "arnd@arndb.de" , "m.szyprowski@samsung.com" , "robin.murphy@arm.com" , "brijesh.singh@amd.com" , Tianyu Lan , "thomas.lendacky@amd.com" , "pgonda@google.com" , "akpm@linux-foundation.org" , "kirill.shutemov@linux.intel.com" , "rppt@kernel.org" , "sfr@canb.auug.org.au" , "aneesh.kumar@linux.ibm.com" , "saravanand@fb.com" , "krish.sadhukhan@oracle.com" , "xen-devel@lists.xenproject.org" , "tj@kernel.org" , "rientjes@google.com" Subject: Re: [PATCH V5 12/12] net: netvsc: Add Isolation VM support for netvsc driver Message-ID: <20210928053911.GA29208@lst.de> References: <20210914133916.1440931-1-ltykernel@gmail.com> <20210914133916.1440931-13-ltykernel@gmail.com> <43e22b84-7273-4099-42ea-54b06f398650@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.17 (2007-11-01) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Sep 27, 2021 at 10:26:43PM +0800, Tianyu Lan wrote: > Hi Christoph: > Gentile ping. The swiotlb and shared memory mapping changes in this > patchset needs your reivew. Could you have a look? I'm a little too busy for a review of such a huge patchset right now. That being said here are my comments from a very quick review: - the bare memremap usage in swiotlb looks strange and I'd definitively expect a well documented wrapper. - given that we can now hand out swiotlb memory for coherent mappings we need to carefully audit what happens when this memremaped memory gets mmaped or used through dma_get_sgtable - the netscv changes I'm not happy with at all. A large part of it is that the driver already has a bad structure, but this series is making it significantly worse. We'll need to find a way to use the proper dma mapping abstractions here. One option if you want to stick to the double vmapped buffer would be something like using dma_alloc_noncontigous plus a variant of dma_vmap_noncontiguous that takes the shared_gpa_boundary into account.