[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <de145e13-2444-aa01-906e-e3abe5a64dc4@gmail.com>
Date: Thu, 15 Apr 2021 16:39:45 +0800
From: Tianyu Lan <ltykernel@...il.com>
To: Christoph Hellwig <hch@....de>
Cc: kys@...rosoft.com, haiyangz@...rosoft.com, sthemmin@...rosoft.com,
wei.liu@...nel.org, tglx@...utronix.de, mingo@...hat.com,
bp@...en8.de, x86@...nel.org, hpa@...or.com, arnd@...db.de,
akpm@...ux-foundation.org, gregkh@...uxfoundation.org,
konrad.wilk@...cle.com, m.szyprowski@...sung.com,
robin.murphy@....com, joro@...tes.org, will@...nel.org,
davem@...emloft.net, kuba@...nel.org, jejb@...ux.ibm.com,
martin.petersen@...cle.com, Tianyu Lan <Tianyu.Lan@...rosoft.com>,
iommu@...ts.linux-foundation.org, linux-arch@...r.kernel.org,
linux-hyperv@...r.kernel.org, linux-kernel@...r.kernel.org,
linux-mm@...ck.org, linux-scsi@...r.kernel.org,
netdev@...r.kernel.org, vkuznets@...hat.com,
thomas.lendacky@....com, brijesh.singh@....com,
sunilmut@...rosoft.com
Subject: Re: [Resend RFC PATCH V2 11/12] HV/Netvsc: Add Isolation VM support
for netvsc driver
On 4/14/2021 11:50 PM, Christoph Hellwig wrote:
>> +struct dma_range {
>> + dma_addr_t dma;
>> + u32 mapping_size;
>> +};
>
> That's a rather generic name that is bound to create a conflict sooner
> or later.
Good point. Will update.
>
>> #include "hyperv_net.h"
>> #include "netvsc_trace.h"
>> +#include "../../hv/hyperv_vmbus.h"
>
> Please move public interfaces out of the private header rather than doing
> this.
OK. Will update.
>
>> + if (hv_isolation_type_snp()) {
>> + area = get_vm_area(buf_size, VM_IOREMAP);
>
> Err, no. get_vm_area is private a for a reason.
>
>> + if (!area)
>> + goto cleanup;
>> +
>> + vaddr = (unsigned long)area->addr;
>> + for (i = 0; i < buf_size / HV_HYP_PAGE_SIZE; i++) {
>> + extra_phys = (virt_to_hvpfn(net_device->recv_buf + i * HV_HYP_PAGE_SIZE)
>> + << HV_HYP_PAGE_SHIFT) + ms_hyperv.shared_gpa_boundary;
>> + ret |= ioremap_page_range(vaddr + i * HV_HYP_PAGE_SIZE,
>> + vaddr + (i + 1) * HV_HYP_PAGE_SIZE,
>> + extra_phys, PAGE_KERNEL_IO);
>> + }
>> +
>> + if (ret)
>> + goto cleanup;
>
> And this is not something a driver should ever do. I think you are badly
> reimplementing functionality that should be in the dma coherent allocator
> here.
>
OK. I will try hiding these in the Hyper-V dma ops callback. Thanks.
Powered by blists - more mailing lists