linux-hyperv.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Nuno Das Neves <nunodasneves@linux.microsoft.com>
To: linux-hyperv@vger.kernel.org, linux-kernel@vger.kernel.org
Cc: virtualization@lists.linux-foundation.org,
	mikelley@microsoft.com, viremana@linux.microsoft.com,
	sunilmut@microsoft.com, wei.liu@kernel.org, vkuznets@redhat.com,
	ligrassi@microsoft.com, kys@microsoft.com,
	sthemmin@microsoft.com, anbelski@linux.microsoft.com
Subject: [PATCH v2 00/19] Microsoft Hypervisor root partition ioctl interface
Date: Thu,  5 Aug 2021 14:23:42 -0700	[thread overview]
Message-ID: <1628198641-791-1-git-send-email-nunodasneves@linux.microsoft.com> (raw)

This patch series provides a userspace interface for creating and running guest
virtual machines while running on the Microsoft Hypervisor [0].

Since managing guest machines can only be done when Linux is the root partition,
this series depends on Wei Liu's patch series merged in 5.12:
https://lore.kernel.org/linux-hyperv/20210203150435.27941-1-wei.liu@kernel.org/

The first two patches provide some helpers for converting hypervisor status
codes to linux error codes, and printing hypervisor status codes to dmesg for
debugging.

Hyper-V related headers asm-generic/hyperv-tlfs.h and x86/asm/hyperv-tlfs.h are
split into uapi and non-uapi. The uapi versions contain structures used in both
the ioctl interface and the kernel.

The mshv API is introduced in drivers/hv/mshv_main.c. As each interface is
introduced, documentation is added in Documentation/virt/mshv/api.rst.
The API is file-desciptor based, like KVM. The entry point is /dev/mshv.

/dev/mshv ioctls:
MSHV_CHECK_EXTENSION
MSHV_CREATE_PARTITION

Partition (vm) ioctls:
MSHV_MAP_GUEST_MEMORY, MSHV_UNMAP_GUEST_MEMORY
MSHV_INSTALL_INTERCEPT
MSHV_ASSERT_INTERRUPT
MSHV_GET_PARTITION_PROPERTY, MSHV_SET_PARTITION_PROPERTY
MSHV_CREATE_VP

Vp (vcpu) ioctls:
MSHV_GET_VP_REGISTERS, MSHV_SET_VP_REGISTERS
MSHV_RUN_VP
MSHV_GET_VP_STATE, MSHV_SET_VP_STATE
MSHV_VP_TRANSLATE_GVA
mmap() (register page)

[0] Hyper-V is more well-known, but it really refers to the whole stack
    including the hypervisor and other components that run in Windows kernel
    and userspace.

Changes since v1:
1. Correct mshv_dev mode to octal 0600
2. Fix bug in mshv_vp_iotcl_run - correctly set suspend registers on early exit
3. Fix bug in translate gva patch, provided by Anatol Belski
4. Address comments from Wei Liu, Sunil Muthuswamy, and Vitaly Kuznetsov
5. Run checkpatch.pl - fix whitespace and other style issues

Changes since RFC:
1. Moved code from virt/mshv to drivers/hv
2. Split hypercall helper functions and synic code to hv_call.c and hv_synic.c
3. MSHV_REQUEST_VERSION ioctl replaced with MSHV_CHECK_EXTENSION
3. Numerous suggestions, fixes, style changes, etc from Michael Kelley, Vitaly
   Kuznetsov, Wei Liu, and Vineeth Pillai
4. Added patch to enable hypervisor enlightenments on partition creation
5. Added Wei Liu's patch for GVA to GPA translation

Nuno Das Neves (18):
  x86/hyperv: convert hyperv statuses to linux error codes
  x86/hyperv: convert hyperv statuses to strings
  drivers/hv: minimal mshv module (/dev/mshv/)
  drivers/hv: check extension ioctl
  drivers/hv: create partition ioctl
  drivers/hv: create, initialize, finalize, delete partition hypercalls
  drivers/hv: withdraw memory hypercall
  drivers/hv: map and unmap guest memory
  drivers/hv: create vcpu ioctl
  drivers/hv: get and set vcpu registers ioctls
  drivers/hv: set up synic pages for intercept messages
  drivers/hv: run vp ioctl and isr
  drivers/hv: install intercept ioctl
  drivers/hv: assert interrupt ioctl
  drivers/hv: get and set vp state ioctls
  drivers/hv: mmap vp register page
  drivers/hv: get and set partition property ioctls
  drivers/hv: Add enlightenment bits to create partition ioctl

Wei Liu (1):
  drivers/hv: Translate GVA to GPA

 .../userspace-api/ioctl/ioctl-number.rst      |    2 +
 Documentation/virt/mshv/api.rst               |  173 +++
 arch/x86/hyperv/Makefile                      |    1 +
 arch/x86/hyperv/hv_init.c                     |    2 +-
 arch/x86/hyperv/hv_proc.c                     |   51 +-
 arch/x86/include/asm/hyperv-tlfs.h            |   15 +-
 arch/x86/include/asm/mshyperv.h               |    1 +
 arch/x86/include/uapi/asm/hyperv-tlfs.h       | 1274 +++++++++++++++++
 arch/x86/kernel/cpu/mshyperv.c                |   16 +
 drivers/hv/Kconfig                            |   18 +
 drivers/hv/Makefile                           |    3 +
 drivers/hv/hv_call.c                          |  742 ++++++++++
 drivers/hv/hv_synic.c                         |  181 +++
 drivers/hv/mshv.h                             |  120 ++
 drivers/hv/mshv_main.c                        | 1166 +++++++++++++++
 include/asm-generic/hyperv-tlfs.h             |  354 +++--
 include/asm-generic/mshyperv.h                |    4 +
 include/linux/mshv.h                          |   61 +
 include/uapi/asm-generic/hyperv-tlfs.h        |  242 ++++
 include/uapi/linux/mshv.h                     |  117 ++
 20 files changed, 4398 insertions(+), 145 deletions(-)
 create mode 100644 Documentation/virt/mshv/api.rst
 create mode 100644 arch/x86/include/uapi/asm/hyperv-tlfs.h
 create mode 100644 drivers/hv/hv_call.c
 create mode 100644 drivers/hv/hv_synic.c
 create mode 100644 drivers/hv/mshv.h
 create mode 100644 drivers/hv/mshv_main.c
 create mode 100644 include/linux/mshv.h
 create mode 100644 include/uapi/asm-generic/hyperv-tlfs.h
 create mode 100644 include/uapi/linux/mshv.h

-- 
2.23.4


             reply	other threads:[~2021-08-05 21:24 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-05 21:23 Nuno Das Neves [this message]
2021-08-05 21:23 ` [PATCH 01/19] x86/hyperv: convert hyperv statuses to linux error codes Nuno Das Neves
2021-08-05 21:23 ` [PATCH 02/19] x86/hyperv: convert hyperv statuses to strings Nuno Das Neves
2021-08-05 21:23 ` [PATCH 03/19] drivers/hv: minimal mshv module (/dev/mshv/) Nuno Das Neves
2021-08-05 21:23 ` [PATCH 04/19] drivers/hv: check extension ioctl Nuno Das Neves
2021-08-05 21:23 ` [PATCH 05/19] drivers/hv: create partition ioctl Nuno Das Neves
2021-08-05 21:23 ` [PATCH 06/19] drivers/hv: create, initialize, finalize, delete partition hypercalls Nuno Das Neves
2021-08-05 21:23 ` [PATCH 07/19] drivers/hv: withdraw memory hypercall Nuno Das Neves
2021-08-05 21:23 ` [PATCH 08/19] drivers/hv: map and unmap guest memory Nuno Das Neves
2021-08-05 21:23 ` [PATCH 09/19] drivers/hv: create vcpu ioctl Nuno Das Neves
2021-08-05 21:23 ` [PATCH 10/19] drivers/hv: get and set vcpu registers ioctls Nuno Das Neves
2021-08-06 20:08   ` kernel test robot
2021-08-05 21:23 ` [PATCH 11/19] drivers/hv: set up synic pages for intercept messages Nuno Das Neves
2021-08-06  2:50   ` kernel test robot
2021-08-07  2:17   ` kernel test robot
2021-08-05 21:23 ` [PATCH 12/19] drivers/hv: run vp ioctl and isr Nuno Das Neves
2021-08-05 21:23 ` [PATCH 13/19] drivers/hv: install intercept ioctl Nuno Das Neves
2021-08-05 21:23 ` [PATCH 14/19] drivers/hv: assert interrupt ioctl Nuno Das Neves
2021-08-05 21:23 ` [PATCH 15/19] drivers/hv: get and set vp state ioctls Nuno Das Neves
2021-08-05 21:23 ` [PATCH 16/19] drivers/hv: mmap vp register page Nuno Das Neves
2021-08-05 21:23 ` [PATCH 17/19] drivers/hv: get and set partition property ioctls Nuno Das Neves
2021-08-05 21:24 ` [PATCH 18/19] drivers/hv: Add enlightenment bits to create partition ioctl Nuno Das Neves
2021-08-05 21:24 ` [PATCH 19/19] drivers/hv: Translate GVA to GPA Nuno Das Neves

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1628198641-791-1-git-send-email-nunodasneves@linux.microsoft.com \
    --to=nunodasneves@linux.microsoft.com \
    --cc=anbelski@linux.microsoft.com \
    --cc=kys@microsoft.com \
    --cc=ligrassi@microsoft.com \
    --cc=linux-hyperv@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mikelley@microsoft.com \
    --cc=sthemmin@microsoft.com \
    --cc=sunilmut@microsoft.com \
    --cc=viremana@linux.microsoft.com \
    --cc=virtualization@lists.linux-foundation.org \
    --cc=vkuznets@redhat.com \
    --cc=wei.liu@kernel.org \
    --subject='Re: [PATCH v2 00/19] Microsoft Hypervisor root partition ioctl interface' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

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).