From: Nuno Das Neves <nunodasneves@linux.microsoft.com>
To: Wei Liu <wei.liu@kernel.org>
Cc: linux-hyperv@vger.kernel.org, linux-kernel@vger.kernel.org,
x86@kernel.org, linux-arm-kernel@lists.infradead.org,
linux-arch@vger.kernel.org, mikelley@microsoft.com,
kys@microsoft.com, haiyangz@microsoft.com, decui@microsoft.com,
ssengar@linux.microsoft.com, mukeshrathor@microsoft.com,
stanislav.kinsburskiy@gmail.com, jinankjain@linux.microsoft.com,
apais@linux.microsoft.com, Tianyu.Lan@microsoft.com,
vkuznets@redhat.com, tglx@linutronix.de, mingo@redhat.com,
bp@alien8.de, dave.hansen@linux.intel.com, hpa@zytor.com,
will@kernel.org, catalin.marinas@arm.com
Subject: Re: [PATCH 15/15] Drivers: hv: Add modules to expose /dev/mshv to VMMs running on Hyper-V
Date: Thu, 17 Aug 2023 10:57:01 -0700 [thread overview]
Message-ID: <e8d95099-0477-4930-8a87-d4abacd1587f@linux.microsoft.com> (raw)
In-Reply-To: <ZMsBjAmPdqZdNPEF@liuwe-devbox-debian-v2>
On 8/2/2023 6:23 PM, Wei Liu wrote:
> On Thu, Jul 27, 2023 at 12:54:50PM -0700, Nuno Das Neves wrote:
>> Add mshv, mshv_root, and mshv_vtl modules.
>> - mshv provides /dev/mshv and common code, and is the parent module
>> - mshv_root provides APIs for creating and managing child partitions
>> - mshv_vtl provides VTL (Virtual Trust Level) support for VMMs
>
> Please provide a slightly more detailed description of what these
> modules do. This is huge patch after all. People doing code archaeology
> will appreciate a better commit message.
>
> For example (please correct if I'm wrong):
>
> Module mshv provides /dev/mshv and common code, and is the parent module
> to the other two modules. At its core, it implements an eventfd frame
> work, and defines some helper functions for the other modules.
>
> Module mshv_root provides APIs for creating and managing child
> partitions. It defines abstractions for vcpus, partitions and other
> things related to running a guest inside the kernel. It also exposes
> user space interfaces for the VMMs.
>
> Module mshv_vtl provides VTL (Virtual Trust Level) support for VMMs. It
> allows the VMM to run in a higher trust level than the guest but still
> within the same context as the guest. This is a useful feature for in
> guest emulation for better isolation and performance.
>
Thanks - I will provide some more detail, including what you described.
I will make a couple of changes - the eventfd framework is in mshv_root,
not mshv. I will amend the mshv_vtl part a little for clarity.
>>
>> Signed-off-by: Nuno Das Neves <nunodasneves@linux.microsoft.com>
>> ---
>> drivers/hv/Kconfig | 54 +
>> drivers/hv/Makefile | 21 +
>> drivers/hv/hv_call.c | 119 ++
>> drivers/hv/mshv.h | 156 +++
>> drivers/hv/mshv_eventfd.c | 758 ++++++++++++
>> drivers/hv/mshv_eventfd.h | 80 ++
>> drivers/hv/mshv_main.c | 208 ++++
>> drivers/hv/mshv_msi.c | 129 +++
>> drivers/hv/mshv_portid_table.c | 84 ++
>> drivers/hv/mshv_root.h | 194 ++++
>> drivers/hv/mshv_root_hv_call.c | 1064 +++++++++++++++++
>> drivers/hv/mshv_root_main.c | 1964 ++++++++++++++++++++++++++++++++
>> drivers/hv/mshv_synic.c | 689 +++++++++++
>> drivers/hv/mshv_vtl.h | 52 +
>> drivers/hv/mshv_vtl_main.c | 1541 +++++++++++++++++++++++++
>> drivers/hv/xfer_to_guest.c | 28 +
>> include/uapi/linux/mshv.h | 298 +++++
>> 17 files changed, 7439 insertions(+)
>> create mode 100644 drivers/hv/hv_call.c
>> create mode 100644 drivers/hv/mshv.h
>> create mode 100644 drivers/hv/mshv_eventfd.c
>> create mode 100644 drivers/hv/mshv_eventfd.h
>> create mode 100644 drivers/hv/mshv_main.c
>> create mode 100644 drivers/hv/mshv_msi.c
>> create mode 100644 drivers/hv/mshv_portid_table.c
>> create mode 100644 drivers/hv/mshv_root.h
>> create mode 100644 drivers/hv/mshv_root_hv_call.c
>> create mode 100644 drivers/hv/mshv_root_main.c
>> create mode 100644 drivers/hv/mshv_synic.c
>> create mode 100644 drivers/hv/mshv_vtl.h
>> create mode 100644 drivers/hv/mshv_vtl_main.c
>> create mode 100644 drivers/hv/xfer_to_guest.c
>> create mode 100644 include/uapi/linux/mshv.h
>>
>> diff --git a/drivers/hv/Kconfig b/drivers/hv/Kconfig
>> index 00242107d62e..b150d686e902 100644
>> --- a/drivers/hv/Kconfig
>> +++ b/drivers/hv/Kconfig
>> @@ -54,4 +54,58 @@ config HYPERV_BALLOON
>> help
>> Select this option to enable Hyper-V Balloon driver.
>>
>> +config MSHV
>> + tristate "Microsoft Hypervisor root partition interfaces: /dev/mshv"
>> + depends on X86_64 && HYPERV
>> + select EVENTFD
>> + select MSHV_VFIO
>
> This is not needed yet, right? I think this is just dead code right now.
>
> It can be introduced when we start upstreaming the VFIO bits.
>
Right. Removed, along with config MSHV_VFIO below.
>> + select MSHV_XFER_TO_GUEST_WORK
>> + help
>> + Select this option to enable core functionality for managing guest
>> + virtual machines running under the Microsoft Hypervisor.
>> +
>> + The interfaces are provided via a device named /dev/mshv.
>> +
>> + To compile this as a module, choose M here.
>> +
>> + If unsure, say N.
>> +
>> +config MSHV_ROOT
>> + tristate "Microsoft Hyper-V root partition APIs driver"
>> + depends on MSHV
>> + help
>> + Select this option to provide /dev/mshv interfaces specific to
>> + running as the root partition on Microsoft Hypervisor.
>> +
>> + To compile this as a module, choose M here.
>> +
>> + If unsure, say N.
>> +
>> +config MSHV_VTL
>> + tristate "Microsoft Hyper-V VTL driver"
>> + depends on MSHV
>> + select HYPERV_VTL_MODE
>> + select TRANSPARENT_HUGEPAGE
>> + help
>> + Select this option to enable Hyper-V VTL driver.
>> + Virtual Secure Mode (VSM) is a set of hypervisor capabilities and
>> + enlightenments offered to host and guest partitions which enables
>> + the creation and management of new security boundaries within
>> + operating system software.
>> +
>> + VSM achieves and maintains isolation through Virtual Trust Levels
>> + (VTLs). Virtual Trust Levels are hierarchical, with higher levels
>> + being more privileged than lower levels. VTL0 is the least privileged
>> + level, and currently only other level supported is VTL2.
>> +
>> + To compile this as a module, choose M here.
>> +
>> + If unsure, say N.
>
> The changes to the function which indicates if output pages are needed
> should be in this patch.
>
Yes - I will add it in this patch.
>> +
>> +config MSHV_VFIO
>> + bool
>> +
>> +config MSHV_XFER_TO_GUEST_WORK
>> + bool
>> +
>> endmenu
>> diff --git a/drivers/hv/Makefile b/drivers/hv/Makefile
>> index d76df5c8c2a9..113c79cfadb9 100644
>> --- a/drivers/hv/Makefile
>> +++ b/drivers/hv/Makefile
>> @@ -2,10 +2,31 @@
>> obj-$(CONFIG_HYPERV) += hv_vmbus.o
>> obj-$(CONFIG_HYPERV_UTILS) += hv_utils.o
>> obj-$(CONFIG_HYPERV_BALLOON) += hv_balloon.o
>> +obj-$(CONFIG_DXGKRNL) += dxgkrnl/
>
> This is not yet upstreamed. It shouldn't be here. Does this not break
> the build for you?
>
Oops! Nope, it doesn't seem to break the build... Anyway, removed.
> The rest is basically a copy of what was posted many moons before plus
> some VTL stuff, and new code for the root scheduler and async hypercall
> support. I've probably gone through some versions of this code already,
> so I only skim the code.
>
> Since this is a Microsoft only driver, I don't expect to get much review
> from the community -- the last few rounds were quiet. I will however let
> this patch series float for a while before taking any further actions
> just in case.
>
> If people are interested in specific bits of the code in the driver,
> please let Nuno and I know.
>
> Thanks,
> Wei.
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
prev parent reply other threads:[~2023-08-17 17:57 UTC|newest]
Thread overview: 38+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-07-27 19:54 [PATCH 00/15] Introduce /dev/mshv drivers Nuno Das Neves
2023-07-27 19:54 ` [PATCH 01/15] hyperv-tlfs: Change shared HV_REGISTER_* defines to HV_MSR_* Nuno Das Neves
2023-08-03 1:25 ` Wei Liu
2023-07-27 19:54 ` [PATCH 02/15] mshyperv: Introduce hv_get_hypervisor_version Nuno Das Neves
2023-08-02 23:39 ` Wei Liu
2023-08-15 21:57 ` Nuno Das Neves
2023-07-27 19:54 ` [PATCH 03/15] mshyperv: Introduce numa_node_to_proximity_domain_info Nuno Das Neves
2023-08-02 23:47 ` Wei Liu
2023-07-27 19:54 ` [PATCH 04/15] asm-generic/mshyperv: Introduce hv_recommend_using_aeoi() Nuno Das Neves
2023-08-02 23:48 ` Wei Liu
2023-07-27 19:54 ` [PATCH 05/15] hyperv: Move hv_connection_id to hyperv-tlfs Nuno Das Neves
2023-08-02 23:55 ` Wei Liu
2023-08-15 22:04 ` Nuno Das Neves
2023-07-27 19:54 ` [PATCH 06/15] hyperv-tlfs: Introduce hv_status_to_string and hv_status_to_errno Nuno Das Neves
2023-07-27 19:54 ` [PATCH 07/15] Drivers: hv: Move hv_call_deposit_pages and hv_call_create_vp to common code Nuno Das Neves
2023-08-03 0:02 ` Wei Liu
2023-07-27 19:54 ` [PATCH 08/15] Drivers: hv: Introduce per-cpu event ring tail Nuno Das Neves
2023-08-03 0:10 ` Wei Liu
2023-08-16 21:40 ` Nuno Das Neves
2023-07-27 19:54 ` [PATCH 09/15] Drivers: hv: Introduce hv_output_arg_exists in hv_common Nuno Das Neves
2023-08-03 0:16 ` Wei Liu
2023-08-16 21:56 ` Nuno Das Neves
2023-07-27 19:54 ` [PATCH 10/15] x86: hyperv: Add mshv_handler irq handler and setup function Nuno Das Neves
2023-08-03 0:17 ` Wei Liu
2023-07-27 19:54 ` [PATCH 11/15] Drivers: hv: export vmbus_isr, hv_context and hv_post_message Nuno Das Neves
2023-08-03 0:17 ` Wei Liu
2023-07-27 19:54 ` [PATCH 12/15] Documentation: Reserve ioctl number for mshv driver Nuno Das Neves
2023-08-03 0:23 ` Wei Liu
2023-08-03 13:23 ` Jonathan Corbet
2023-08-03 21:05 ` Wei Liu
2023-07-27 19:54 ` [PATCH 13/15] uapi: hyperv: Add mshv driver headers hvhdk.h, hvhdk_mini.h, hvgdk.h, hvgdk_mini.h Nuno Das Neves
2023-08-03 0:27 ` Wei Liu
2023-07-27 19:54 ` [PATCH 14/15] asm-generic: hyperv: Use mshv headers conditionally. Add asm-generic/hyperv-defs.h Nuno Das Neves
2023-08-03 0:48 ` Wei Liu
2023-08-17 16:41 ` Nuno Das Neves
2023-07-27 21:05 ` [PATCH 00/15] Introduce /dev/mshv drivers Nuno Das Neves
[not found] ` <1690487690-2428-16-git-send-email-nunodasneves@linux.microsoft.com>
2023-08-03 1:23 ` [PATCH 15/15] Drivers: hv: Add modules to expose /dev/mshv to VMMs running on Hyper-V Wei Liu
2023-08-17 17:57 ` Nuno Das Neves [this message]
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=e8d95099-0477-4930-8a87-d4abacd1587f@linux.microsoft.com \
--to=nunodasneves@linux.microsoft.com \
--cc=Tianyu.Lan@microsoft.com \
--cc=apais@linux.microsoft.com \
--cc=bp@alien8.de \
--cc=catalin.marinas@arm.com \
--cc=dave.hansen@linux.intel.com \
--cc=decui@microsoft.com \
--cc=haiyangz@microsoft.com \
--cc=hpa@zytor.com \
--cc=jinankjain@linux.microsoft.com \
--cc=kys@microsoft.com \
--cc=linux-arch@vger.kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-hyperv@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mikelley@microsoft.com \
--cc=mingo@redhat.com \
--cc=mukeshrathor@microsoft.com \
--cc=ssengar@linux.microsoft.com \
--cc=stanislav.kinsburskiy@gmail.com \
--cc=tglx@linutronix.de \
--cc=vkuznets@redhat.com \
--cc=wei.liu@kernel.org \
--cc=will@kernel.org \
--cc=x86@kernel.org \
/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
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).