Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp4716372pxb; Tue, 28 Sep 2021 02:24:48 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzFYKR7ZxEhR6ppCgN6L4M7X2WVBXBrPKw4pbfowif336Bj1jP9PsAGPoExusg+zvuiWGe0 X-Received: by 2002:aa7:9e90:0:b0:43f:2abb:a504 with SMTP id p16-20020aa79e90000000b0043f2abba504mr4541479pfq.35.1632821088291; Tue, 28 Sep 2021 02:24:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632821088; cv=none; d=google.com; s=arc-20160816; b=CvFWo+jpBOnQiKKg+OAoVtWOmDaxpB12dx5MkZXCf29ifJjILlBmClPa546npReSJm Ts61SQ82BUQkAh95FylMxQJM+h1zt27c2CA/kF3zVtDL3NnwzIts76P27m4zuFIiEesR aJ9fz67uJXYEHbzweCZg2XLRnMWXY0HsHnbhGR54wjBLmKbsiHSQAVan9KmLwLmvNIrb wloR+yt8Y7hmddCuDh26nkYjmBbq8pkl2JkSWoFUARf2Jt5c0lU9YojKtjECtEN0SYgO v54CUGwtFffSKAVnQVBiC+Gf59o3nhmjVd+Qbj+SJo5AVR15YGTjmaZduTXyc+0YBrrC YaVg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dkim-signature; bh=bNCbpKkDoRa/LEy6AE/asdoXmkV09NnhXW1RxZk9Sdg=; b=e1GHLD5UgtmrGqOc35uLgIqW98ENTmXp6SaEUWsRlnkclsw2EVva4ZLTTIQI7D70U3 Fi6jlDuqtQVcEobekjEd+3qvxB0Zml55FO3tYhFqCU+QIU036XO1M1P9AJcy2OcpelUH RGSD7ZX+0TdW1OaIzYKNouleG6uX5hnD/JG9bekxfOMDm2zYVU26On94UVUhgPa+E1km pwRfQ80CF4Cg0svWwzrWH+yXMOaEa7QBP5aNL+QAUNjuY3S1jOssUmbUAvjzf9SdM4fT Boh9DHg76f3jN9rS18ZEgjo2ayP2ymI0Fvboexw/pEedXA8RF1dbYp8NFA6EBAMeHbRB BbtA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=d7EQaIO2; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d27si24785458pgd.29.2021.09.28.02.24.35; Tue, 28 Sep 2021 02:24:48 -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; dkim=pass header.i=@gmail.com header.s=20210112 header.b=d7EQaIO2; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239809AbhI1JZ1 (ORCPT + 99 others); Tue, 28 Sep 2021 05:25:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36038 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239573AbhI1JZ0 (ORCPT ); Tue, 28 Sep 2021 05:25:26 -0400 Received: from mail-pg1-x530.google.com (mail-pg1-x530.google.com [IPv6:2607:f8b0:4864:20::530]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A96B2C061575; Tue, 28 Sep 2021 02:23:47 -0700 (PDT) Received: by mail-pg1-x530.google.com with SMTP id 75so4159114pga.3; Tue, 28 Sep 2021 02:23:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=bNCbpKkDoRa/LEy6AE/asdoXmkV09NnhXW1RxZk9Sdg=; b=d7EQaIO2BrzYhwnuLWNgscYrGYoCF1llQTdP7VsnWfHPgbO7X8mwFpRL1rP0sxjRol /+BkBsfPxs/6kB2aGGiarfL3uCD04VsP3Qvt0ysEyyh6Gt2+3I1FWrhhioqM5RZZcaaQ 08hitTmCaLcQBEott0EDr+wFaOq4jqZ1NJtcmmH1pPW9zZ2ctPp9TAkDzkUATz66B0OO APGXI2+QPUkq1LfuP1SdBGqjMyXvkbKRa4yN0N3eDg3lv3bc7gcKGRD1XvdkWanbXoPX wdfl6sy2mQQiSep/qjiZSaFK4BGckINkhPOtEFqjaiLg960K/wVSLQzxtSjHYSHxv/ie tbaw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=bNCbpKkDoRa/LEy6AE/asdoXmkV09NnhXW1RxZk9Sdg=; b=6pvsUNZ7GDN99vZaBo4jhqdk6EIpZL5QPQGzfBm/5pKcUXgxh5ieE2VESZLdKsDdxi AKqTvPMQV/5mvXgizF1IERFcIe61NYpY3MUb4PE2wPXxxJYA2HJW5iz7ylWyOd6uvz58 c0zRS60Y9EiKQKYPfIYVCQ+jf5tg5EeD9rU/O8lj9AtJg3WZNY9x1NWuJIpyVq5HM/2r 5YBiNnQmLktU3Pw+0nlnCnf+8SWSxPhubNusWIN1oi4PbREDRGFHptu8sJAqJsl0zCrP YnNn7kZLx5og4M4fhHhu4995ttRO2+6mZy3m8zybYWmh5imWAduN0kdNu+PGoUs6dfnx aAnA== X-Gm-Message-State: AOAM532kJb344XCiUusObebg+PdxcIjUyZTvyFARpNsI+88PLTpRHn8G pHs+L9yLxz02aoewMiQXb0g= X-Received: by 2002:aa7:9f03:0:b0:447:dd09:6dda with SMTP id g3-20020aa79f03000000b00447dd096ddamr4300020pfr.36.1632821027229; Tue, 28 Sep 2021 02:23:47 -0700 (PDT) Received: from ?IPv6:2404:f801:0:5:8000::50b? ([2404:f801:9000:1a:efea::50b]) by smtp.gmail.com with ESMTPSA id mv6sm1943328pjb.16.2021.09.28.02.23.31 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 28 Sep 2021 02:23:46 -0700 (PDT) Subject: Re: [PATCH V5 12/12] net: netvsc: Add Isolation VM support for netvsc driver To: Christoph Hellwig Cc: "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" References: <20210914133916.1440931-1-ltykernel@gmail.com> <20210914133916.1440931-13-ltykernel@gmail.com> <43e22b84-7273-4099-42ea-54b06f398650@gmail.com> <20210928053911.GA29208@lst.de> From: Tianyu Lan Message-ID: Date: Tue, 28 Sep 2021 17:23:31 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.14.0 MIME-Version: 1.0 In-Reply-To: <20210928053911.GA29208@lst.de> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 9/28/2021 1:39 PM, Christoph Hellwig wrote: > 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: Hi Christoph: Thanks for your comments. Most patches in the series are Hyper-V change. I will split patchset and make it easy to review. > > - the bare memremap usage in swiotlb looks strange and I'd > definitively expect a well documented wrapper. OK. Should the wrapper in the DMA code? How about dma_map_decrypted() introduced in the V4? https://lkml.org/lkml/2021/8/27/605 > - 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 OK. I check that. > - 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. > OK. I will do that.