net: netvsc: Add Isolation VM support for netvsc driver
authorTianyu Lan <Tianyu.Lan@microsoft.com>
Mon, 13 Dec 2021 07:14:06 +0000 (02:14 -0500)
committerWei Liu <wei.liu@kernel.org>
Mon, 20 Dec 2021 18:01:09 +0000 (18:01 +0000)
commit846da38de0e8224f2f94b885125cf1fd2d7b0d39
treeaba66bfd4d591939ca8ad0b80830c5e18b9e46a6
parent743b237c3a7b0f5b44aa704aae8a1058877b6322
net: netvsc: Add Isolation VM support for netvsc driver

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() stills need to be handled. Use DMA API to map/umap
these memory during sending/receiving packet and Hyper-V swiotlb
bounce buffer dma address will be returned. The swiotlb bounce buffer
has been masked to be visible to host during boot up.

rx/tx ring buffer is allocated via vzalloc() and they need to be
mapped into unencrypted address space(above vTOM) before sharing
with host and accessing. Add hv_map/unmap_memory() to map/umap rx
/tx ring buffer.

Signed-off-by: Tianyu Lan <Tianyu.Lan@microsoft.com>
Reviewed-by: Haiyang Zhang <haiyangz@microsoft.com>
Reviewed-by: Michael Kelley <mikelley@microsoft.com>
Link: https://lore.kernel.org/r/20211213071407.314309-6-ltykernel@gmail.com
Signed-off-by: Wei Liu <wei.liu@kernel.org>
arch/x86/hyperv/ivm.c
drivers/hv/hv_common.c
drivers/net/hyperv/hyperv_net.h
drivers/net/hyperv/netvsc.c
drivers/net/hyperv/netvsc_drv.c
drivers/net/hyperv/rndis_filter.c
include/asm-generic/mshyperv.h
include/linux/hyperv.h