linux-hyperv.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFC V2 PATCH 00/12] x86/Hyper-V: Add Hyper-V Isolation VM support
@ 2021-04-13 15:22 Tianyu Lan
  2021-04-13 15:22 ` [RFC V2 PATCH 1/12] x86/HV: Initialize GHCB page in Isolation VM Tianyu Lan
                   ` (10 more replies)
  0 siblings, 11 replies; 17+ messages in thread
From: Tianyu Lan @ 2021-04-13 15:22 UTC (permalink / raw)
  To: kys, haiyangz, sthemmin, wei.liu, tglx, mingo, bp, x86, hpa,
	arnd, akpm, gregkh, konrad.wilk, hch, m.szyprowski, robin.murphy,
	joro, will, davem, kuba, jejb, martin.petersen
  Cc: Tianyu Lan, iommu, linux-arch, linux-hyperv, linux-kernel,
	linux-mm, linux-scsi, netdev, vkuznets, thomas.lendacky,
	brijesh.singh, sunilmut

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 to
host.

There are two exceptions - packets sent by vmbus_sendpacket_
pagebuffer() and vmbus_sendpacket_mpb_desc(). These packets
contains IO stack memory address and host will access these memory.
So add Hyper-V DMA Ops and use DMA API in the netvsc and storvsc
drivers to allocate bounce buffer via swiotlb interface.

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.

Change since v1:
       * Add DMA API support in the netvsc and storvsc driver.
       * Add Hyper-V DMA ops.
       * Add static branch for the check of isolation type snp.
       * Fix some code style comments.

Tianyu Lan (12):
  x86/HV: Initialize GHCB page in Isolation VM
  x86/HV: Initialize shared memory boundary in Isolation VM
  x86/Hyper-V: Add new hvcall guest address host visibility support
  HV: Add Write/Read MSR registers via ghcb
  HV: Add ghcb hvcall support for SNP VM
  HV/Vmbus: Add SNP support for VMbus channel initiate message
  HV/Vmbus: Initialize VMbus ring buffer for Isolation VM
  UIO/Hyper-V: Not load UIO HV driver in the isolation VM.
  swiotlb: Add bounce buffer remap address setting function
  HV/IOMMU: Add Hyper-V dma ops support
  HV/Netvsc: Add Isolation VM support for netvsc driver
  HV/Storvsc: Add Isolation VM support for storvsc driver

 arch/x86/hyperv/Makefile           |   2 +-
 arch/x86/hyperv/hv_init.c          |  70 +++++--
 arch/x86/hyperv/ivm.c              | 289 +++++++++++++++++++++++++++++
 arch/x86/include/asm/hyperv-tlfs.h |  22 +++
 arch/x86/include/asm/mshyperv.h    |  90 +++++++--
 arch/x86/kernel/cpu/mshyperv.c     |   5 +
 arch/x86/kernel/pci-swiotlb.c      |   3 +-
 drivers/hv/channel.c               |  44 ++++-
 drivers/hv/connection.c            |  68 ++++++-
 drivers/hv/hv.c                    |  73 ++++++--
 drivers/hv/hyperv_vmbus.h          |   3 +
 drivers/hv/ring_buffer.c           |  83 ++++++---
 drivers/hv/vmbus_drv.c             |   3 +
 drivers/iommu/hyperv-iommu.c       | 127 +++++++++++++
 drivers/net/hyperv/hyperv_net.h    |  11 ++
 drivers/net/hyperv/netvsc.c        | 137 +++++++++++++-
 drivers/net/hyperv/rndis_filter.c  |   3 +
 drivers/scsi/storvsc_drv.c         |  67 ++++++-
 drivers/uio/uio_hv_generic.c       |   5 +
 include/asm-generic/hyperv-tlfs.h  |   1 +
 include/asm-generic/mshyperv.h     |  18 +-
 include/linux/hyperv.h             |  12 +-
 include/linux/swiotlb.h            |   5 +
 kernel/dma/swiotlb.c               |  13 +-
 mm/ioremap.c                       |   1 +
 mm/vmalloc.c                       |   1 +
 26 files changed, 1068 insertions(+), 88 deletions(-)
 create mode 100644 arch/x86/hyperv/ivm.c

-- 
2.25.1


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

end of thread, other threads:[~2021-04-18  9:53 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-13 15:22 [RFC V2 PATCH 00/12] x86/Hyper-V: Add Hyper-V Isolation VM support Tianyu Lan
2021-04-13 15:22 ` [RFC V2 PATCH 1/12] x86/HV: Initialize GHCB page in Isolation VM Tianyu Lan
2021-04-13 15:22 ` [RFC V2 PATCH 2/12] x86/HV: Initialize shared memory boundary " Tianyu Lan
2021-04-13 15:22 ` [RFC V2 PATCH 3/12] x86/Hyper-V: Add new hvcall guest address host visibility support Tianyu Lan
2021-04-13 15:22 ` [RFC V2 PATCH 4/12] HV: Add Write/Read MSR registers via ghcb Tianyu Lan
2021-04-13 15:22 ` [RFC V2 PATCH 5/12] HV: Add ghcb hvcall support for SNP VM Tianyu Lan
2021-04-13 15:22 ` [RFC V2 PATCH 6/12] HV/Vmbus: Add SNP support for VMbus channel initiate message Tianyu Lan
2021-04-13 15:22 ` [RFC V2 PATCH 7/12] HV/Vmbus: Initialize VMbus ring buffer for Isolation VM Tianyu Lan
2021-04-13 15:22 ` [RFC V2 PATCH 8/12] UIO/Hyper-V: Not load UIO HV driver in the isolation VM Tianyu Lan
2021-04-13 15:59   ` Greg KH
2021-04-13 16:00   ` Greg KH
2021-04-14 15:20     ` Tianyu Lan
2021-04-14 15:36       ` Greg KH
2021-04-13 15:22 ` [RFC V2 PATCH 10/12] HV/IOMMU: Add Hyper-V dma ops support Tianyu Lan
2021-04-13 15:22 ` [RFC V2 PATCH 11/12] HV/Netvsc: Add Isolation VM support for netvsc driver Tianyu Lan
2021-04-18  9:53   ` Leon Romanovsky
2021-04-13 15:22 ` [RFC V2 PATCH 12/12] HV/Storvsc: Add Isolation VM support for storvsc driver 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).