Re: [PATCH v3 00/17] Introducing Linux root partition support for Microsoft Hypervisor

From: Wei Liu
Date: Tue Feb 02 2021 - 07:19:29 EST


On Tue, Feb 02, 2021 at 10:40:43AM +0000, David Woodhouse wrote:
> On Tue, 2020-12-15 at 16:42 +0000, Wei Liu wrote:
> > On Tue, Dec 15, 2020 at 04:25:03PM +0100, Enrico Weigelt, metux IT consult wrote:
> > > On 03.12.20 00:22, Wei Liu wrote:
> > >
> > > Hi,
> > >
> > > > I don't follow. Do you mean reusing /dev/kvm but with a different set of
> > > > APIs underneath? I don't think that will work.
> > >
> > > My idea was using the same uapi for both hypervisors, so that we can use
> > > the same userlands for both.
> > >
> > > Are the semantis so different that we can't provide the same API ?
> >
> > We can provide some similar APIs for ease of porting, but can't provide
> > 1:1 mappings. By definition KVM and MSHV are two different things. There
> > is no goal to make one ABI / API compatible with the other.
>
> I'm not sure I understand.
>
> KVM is the Linux userspace API for virtualisation. It is designed to be
> versatile enough that it can support multiple implementations across
> multiple architectures, including both AMD SVM and Intel VMX on x86.
>
> Are you saying that KVM has *failed* to be versatile enough that this
> can be "just another implementation"? What are the problems? Is it
> unfixable?

The KVM APIs are good enough to cover guest life cycle management. To
make MSHV another implementation of the KVM APIs, we essentially need to
massage the data structures both way.

They are There is also an aspect for controlling the hypervisor that
affect the whole virtualization system. KVM APIs don't handle those. We
would need /dev/mshv for that purpose alone.

There is another aspect for Microsoft Hypervisor specific features and
enhancements, which aren't applicable to KVM. Features make sense for a
specific type-1 hypervisor may not make sense for KVM (a type-2
hypervisor). We have no intention to pollute KVM APIs with those.

All in all the latter two points make /dev/mshv is a more viable route
in the long run.

Wei.