Commit 621191d7 authored by Nuno Das Neves's avatar Nuno Das Neves Committed by Wei Liu
Browse files

Drivers: hv: Introduce mshv_root module to expose /dev/mshv to VMMs



Provide a set of IOCTLs for creating and managing child partitions when
running as root partition on Hyper-V. The new driver is enabled via
CONFIG_MSHV_ROOT.

A brief overview of the interface:

MSHV_CREATE_PARTITION is the entry point, returning a file descriptor
representing a child partition. IOCTLs on this fd can be used to map
memory, create VPs, etc.

Creating a VP returns another file descriptor representing that VP which
in turn has another set of corresponding IOCTLs for running the VP,
getting/setting state, etc.

MSHV_ROOT_HVCALL is a generic "passthrough" hypercall IOCTL which can be
used for a number of partition or VP hypercalls. This is for hypercalls
that do not affect any state in the kernel driver, such as getting and
setting VP registers and partition properties, translating addresses,
etc. It is "passthrough" because the binary input and output for the
hypercall is only interpreted by the VMM - the kernel driver does
nothing but insert the VP and partition id where necessary (which are
always in the same place), and execute the hypercall.

Co-developed-by: default avatarAnirudh Rayabharam <anrayabh@linux.microsoft.com>
Signed-off-by: default avatarAnirudh Rayabharam <anrayabh@linux.microsoft.com>
Co-developed-by: default avatarJinank Jain <jinankjain@microsoft.com>
Signed-off-by: default avatarJinank Jain <jinankjain@microsoft.com>
Co-developed-by: default avatarMukesh Rathor <mrathor@linux.microsoft.com>
Signed-off-by: default avatarMukesh Rathor <mrathor@linux.microsoft.com>
Co-developed-by: default avatarMuminul Islam <muislam@microsoft.com>
Signed-off-by: default avatarMuminul Islam <muislam@microsoft.com>
Co-developed-by: default avatarPraveen K Paladugu <prapal@linux.microsoft.com>
Signed-off-by: default avatarPraveen K Paladugu <prapal@linux.microsoft.com>
Co-developed-by: default avatarStanislav Kinsburskii <skinsburskii@linux.microsoft.com>
Signed-off-by: default avatarStanislav Kinsburskii <skinsburskii@linux.microsoft.com>
Co-developed-by: default avatarWei Liu <wei.liu@kernel.org>
Signed-off-by: default avatarNuno Das Neves <nunodasneves@linux.microsoft.com>
Reviewed-by: default avatarRoman Kisel <romank@linux.microsoft.com>
Link: https://lore.kernel.org/r/1741980536-3865-11-git-send-email-nunodasneves@linux.microsoft.com


Signed-off-by: default avatarWei Liu <wei.liu@kernel.org>
Message-ID: <1741980536-3865-11-git-send-email-nunodasneves@linux.microsoft.com>
parent 0bd921a4
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment