[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20210709133456.awctvxgtivjo6fuj@liuwe-devbox-debian-v2>
Date: Fri, 9 Jul 2021 13:34:56 +0000
From: Wei Liu <wei.liu@...nel.org>
To: Robin Murphy <robin.murphy@....com>
Cc: Wei Liu <wei.liu@...nel.org>,
Linux on Hyper-V List <linux-hyperv@...r.kernel.org>,
"K. Y. Srinivasan" <kys@...rosoft.com>,
Stephen Hemminger <sthemmin@...rosoft.com>,
pasha.tatashin@...een.com, kumarpraveen@...ux.microsoft.com,
Will Deacon <will@...nel.org>,
Haiyang Zhang <haiyangz@...rosoft.com>,
Dexuan Cui <decui@...rosoft.com>,
Linux Kernel List <linux-kernel@...r.kernel.org>,
Michael Kelley <mikelley@...rosoft.com>,
"open list:IOMMU DRIVERS" <iommu@...ts.linux-foundation.org>,
Nuno Das Neves <nunodasneves@...ux.microsoft.com>,
Sunil Muthuswamy <sunilmut@...rosoft.com>,
virtualization@...ts.linux-foundation.org,
Vineeth Pillai <viremana@...ux.microsoft.com>
Subject: Re: [RFC v1 6/8] mshv: command line option to skip devices in
PV-IOMMU
On Fri, Jul 09, 2021 at 01:46:19PM +0100, Robin Murphy wrote:
> On 2021-07-09 12:43, Wei Liu wrote:
> > Some devices may have been claimed by the hypervisor already. One such
> > example is a user can assign a NIC for debugging purpose.
> >
> > Ideally Linux should be able to tell retrieve that information, but
> > there is no way to do that yet. And designing that new mechanism is
> > going to take time.
> >
> > Provide a command line option for skipping devices. This is a stopgap
> > solution, so it is intentionally undocumented. Hopefully we can retire
> > it in the future.
>
> Huh? If the host is using a device, why the heck is it exposing any
> knowledge of that device to the guest at all, let alone allowing the guest
> to do anything that could affect its operation!?
The host in this setup consists of the hypervisor, the root kernel and a
bunch of user space programs.
Root is not an ordinary guest. It does need to know all the hardware to
manage the platform. Hypervisor does not claim more devices than it
needs to, nor does it try to hide hardware details from the root.
The hypervisor can protect itself just fine. Any attempt to use the
already claimed devices will be blocked or rejected, so are the attempts
to attach them to device domains.
That, however, leads to some interesting interactions between the
hypervisor and Linux kernel. When kernel initializes IOMMU during boot,
it will try to attach all devices in one go. Any failure there will
cause kernel to detach the already attached devices. That's not fatal to
kernel, and is only a minor annoyance to our current use case, because
the default domain is a passthrough domain anyway. It will become
problematic once we switch the default domain to a DMA domain to further
tighten security during Linux boot.
Wei.
>
> Robin.
>
Powered by blists - more mailing lists