linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH V3 0/5] x86/Hyper-V: Add Hyper-V Isolation VM support(Second part)
@ 2021-12-01 16:02 Tianyu Lan
  2021-12-01 16:02 ` [PATCH V3 1/5] Swiotlb: Add Swiotlb bounce buffer remap function for HV IVM Tianyu Lan
                   ` (4 more replies)
  0 siblings, 5 replies; 19+ messages in thread
From: Tianyu Lan @ 2021-12-01 16:02 UTC (permalink / raw)
  To: kys, haiyangz, sthemmin, wei.liu, decui, tglx, mingo, bp,
	dave.hansen, x86, hpa, jgross, sstabellini, boris.ostrovsky,
	joro, will, davem, kuba, jejb, martin.petersen, arnd, hch,
	m.szyprowski, robin.murphy, Tianyu.Lan, thomas.lendacky,
	xen-devel, michael.h.kelley
  Cc: iommu, linux-arch, linux-hyperv, linux-kernel, linux-scsi,
	netdev, vkuznets, brijesh.singh, konrad.wilk, hch, parri.andrea,
	dave.hansen

From: Tianyu Lan <Tianyu.Lan@microsoft.com>

Hyper-V provides two kinds of Isolation VMs. VBS(Virtualization-based
security) and AMD SEV-SNP unenlightened Isolation VMs. This patchset
is to add support for these Isolation VM support in Linux.

The memory of these vms are encrypted and host can't access guest
memory directly. Hyper-V provides new host visibility hvcall and
the guest needs to call new hvcall to mark memory visible to host
before sharing memory with host. For security, all network/storage
stack memory should not be shared with host and so there is bounce
buffer requests.

Vmbus channel ring buffer already plays bounce buffer role because
all data from/to host needs to copy from/to between the ring buffer
and IO stack memory. So mark vmbus channel ring buffer visible.

For SNP isolation VM, guest needs to access the shared memory via
extra address space which is specified by Hyper-V CPUID HYPERV_CPUID_
ISOLATION_CONFIG. The access physical address of the shared memory
should be bounce buffer memory GPA plus with shared_gpa_boundary
reported by CPUID.

This patchset is to enable swiotlb bounce buffer for netvsc/storvsc
in Isolation VM.

This version follows Michael Kelley suggestion in the following link.
https://lkml.org/lkml/2021/11/24/2044

Change since v2:
     * Remove Hyper-V dma ops and dma_alloc/free_noncontiguous. Add
       hv_map/unmap_memory() to map/umap netvsc rx/tx ring into extra
       address space.
     * Leave mem->vaddr in swiotlb code with phys_to_virt(mem->start)
       when fail to remap swiotlb memory.

Change since v1:
     * Add Hyper-V Isolation support check in the cc_platform_has()
       and return true for guest memory encrypt attr.
     * Remove hv isolation check in the sev_setup_arch()

Tianyu Lan (5):
  Swiotlb: Add Swiotlb bounce buffer remap function for HV IVM
  x86/hyper-v: Add hyperv Isolation VM check in the cc_platform_has()
  hyperv/IOMMU: Enable swiotlb bounce buffer for Isolation VM
  scsi: storvsc: Add Isolation VM support for storvsc driver
  hv_netvsc: Add Isolation VM support for netvsc driver

 arch/x86/hyperv/ivm.c             |  28 ++++++
 arch/x86/kernel/cc_platform.c     |  15 ++++
 arch/x86/xen/pci-swiotlb-xen.c    |   3 +-
 drivers/hv/hv_common.c            |  11 +++
 drivers/hv/vmbus_drv.c            |   4 +
 drivers/iommu/hyperv-iommu.c      |  56 ++++++++++++
 drivers/net/hyperv/hyperv_net.h   |   5 ++
 drivers/net/hyperv/netvsc.c       | 136 +++++++++++++++++++++++++++++-
 drivers/net/hyperv/netvsc_drv.c   |   1 +
 drivers/net/hyperv/rndis_filter.c |   2 +
 drivers/scsi/storvsc_drv.c        |  37 ++++----
 include/asm-generic/mshyperv.h    |   2 +
 include/linux/hyperv.h            |  14 +++
 include/linux/swiotlb.h           |   6 ++
 kernel/dma/swiotlb.c              |  47 +++++++++--
 15 files changed, 342 insertions(+), 25 deletions(-)

-- 
2.25.1


^ permalink raw reply	[flat|nested] 19+ messages in thread

end of thread, other threads:[~2021-12-04  7:42 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-01 16:02 [PATCH V3 0/5] x86/Hyper-V: Add Hyper-V Isolation VM support(Second part) Tianyu Lan
2021-12-01 16:02 ` [PATCH V3 1/5] Swiotlb: Add Swiotlb bounce buffer remap function for HV IVM Tianyu Lan
2021-12-02 14:42   ` Tom Lendacky
2021-12-03 11:20     ` Tianyu Lan
2021-12-03 19:11       ` Tom Lendacky
2021-12-03 20:06         ` Tom Lendacky
2021-12-04  7:21           ` Tianyu Lan
2021-12-01 16:02 ` [PATCH V3 2/5] x86/hyper-v: Add hyperv Isolation VM check in the cc_platform_has() Tianyu Lan
2021-12-02 14:39   ` Wei Liu
2021-12-03 11:23     ` Tianyu Lan
2021-12-01 16:02 ` [PATCH V3 3/5] hyperv/IOMMU: Enable swiotlb bounce buffer for Isolation VM Tianyu Lan
2021-12-02 14:43   ` Wei Liu
2021-12-03 11:25     ` Tianyu Lan
2021-12-03 19:17   ` Michael Kelley (LINUX)
2021-12-04  7:26     ` Tianyu Lan
2021-12-01 16:02 ` [PATCH V3 4/5] scsi: storvsc: Add Isolation VM support for storvsc driver Tianyu Lan
2021-12-01 16:02 ` [PATCH V3 5/5] hv_netvsc: Add Isolation VM support for netvsc driver Tianyu Lan
2021-12-03 18:59   ` Michael Kelley (LINUX)
2021-12-04  7:42     ` Tianyu Lan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).