Re: [RFC PATCH V3 10/11] HV/Netvsc: Add Isolation VM support for netvsc driver

2021-06-15 Thread Tianyu Lan
On 6/14/2021 11:33 PM, Christoph Hellwig wrote: On Mon, Jun 14, 2021 at 10:04:06PM +0800, Tianyu Lan wrote: The pages in the hv_page_buffer array here are in the kernel linear mapping. The packet sent to host will contain an array which contains transaction data. In the isolation VM, data in

Re: [RFC PATCH V3 10/11] HV/Netvsc: Add Isolation VM support for netvsc driver

2021-06-14 Thread Christoph Hellwig
On Mon, Jun 14, 2021 at 10:04:06PM +0800, Tianyu Lan wrote: > The pages in the hv_page_buffer array here are in the kernel linear > mapping. The packet sent to host will contain an array which contains > transaction data. In the isolation VM, data in the these pages needs to be > copied to

Re: [RFC PATCH V3 10/11] HV/Netvsc: Add Isolation VM support for netvsc driver

2021-06-14 Thread Tianyu Lan
On 6/14/2021 3:09 PM, Christoph Hellwig wrote: On Mon, Jun 07, 2021 at 11:21:20PM +0800, Tianyu Lan wrote: dma_map_single can only be used on page baked memory, and if this is using page backed memory you wouldn't need to do thee phys_to_virt tricks. Can someone explain the mess here in more

Re: [RFC PATCH V3 10/11] HV/Netvsc: Add Isolation VM support for netvsc driver

2021-06-14 Thread Christoph Hellwig
On Mon, Jun 07, 2021 at 11:21:20PM +0800, Tianyu Lan wrote: >> dma_map_single can only be used on page baked memory, and if this is >> using page backed memory you wouldn't need to do thee phys_to_virt >> tricks. Can someone explain the mess here in more detail? > > Sorry. Could you elaborate the

Re: [RFC PATCH V3 10/11] HV/Netvsc: Add Isolation VM support for netvsc driver

2021-06-10 Thread Vitaly Kuznetsov
Tianyu Lan writes: > From: Tianyu Lan > > In Isolation VM, all shared memory with host needs to mark visible > to host via hvcall. vmbus_establish_gpadl() has already done it for > netvsc rx/tx ring buffer. The page buffer used by vmbus_sendpacket_ > pagebuffer() still need to handle. Use DMA

Re: [RFC PATCH V3 10/11] HV/Netvsc: Add Isolation VM support for netvsc driver

2021-06-07 Thread Tianyu Lan
On 6/7/2021 2:50 PM, Christoph Hellwig wrote: On Sun, May 30, 2021 at 11:06:27AM -0400, Tianyu Lan wrote: + if (hv_isolation_type_snp()) { + pfns = kcalloc(buf_size / HV_HYP_PAGE_SIZE, sizeof(unsigned long), + GFP_KERNEL); + for

Re: [RFC PATCH V3 10/11] HV/Netvsc: Add Isolation VM support for netvsc driver

2021-06-07 Thread Christoph Hellwig
On Sun, May 30, 2021 at 11:06:27AM -0400, Tianyu Lan wrote: > + if (hv_isolation_type_snp()) { > + pfns = kcalloc(buf_size / HV_HYP_PAGE_SIZE, sizeof(unsigned > long), > +GFP_KERNEL); > + for (i = 0; i < buf_size / HV_HYP_PAGE_SIZE; i++) > +

[RFC PATCH V3 10/11] HV/Netvsc: Add Isolation VM support for netvsc driver

2021-05-30 Thread Tianyu Lan
From: Tianyu Lan In Isolation VM, all shared memory with host needs to mark visible to host via hvcall. vmbus_establish_gpadl() has already done it for netvsc rx/tx ring buffer. The page buffer used by vmbus_sendpacket_ pagebuffer() still need to handle. Use DMA API to map/umap these memory