[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200413094714.432b5841@w520.home>
Date: Mon, 13 Apr 2020 09:47:14 -0600
From: Alex Williamson <alex.williamson@...hat.com>
To: Dave Hansen <dave.hansen@...el.com>
Cc: Alexander Duyck <alexander.h.duyck@...ux.intel.com>,
Mel Gorman <mgorman@...hsingularity.net>, linux-mm@...ck.org,
linux-kernel@...r.kernel.org,
Andrea Arcangeli <aarcange@...hat.com>,
Dan Williams <dan.j.williams@...el.com>,
David Hildenbrand <david@...hat.com>,
Michal Hocko <mhocko@...nel.org>,
Andrew Morton <akpm@...ux-foundation.org>,
"Raj, Ashok" <ashok.raj@...el.com>
Subject: Re: [RFC PATCH 0/4] mm: Add PG_zero support
On Mon, 13 Apr 2020 08:14:32 -0700
Dave Hansen <dave.hansen@...el.com> wrote:
> On 4/13/20 7:49 AM, Alex Williamson wrote:
> >> VFIO's unconditional page pinning is the real problem here IMNHO. They
> >> don't *really* need to pin the memory. We just don't have good
> >> paravirtualized IOMMU support or want to pay the runtime cost for
> >> pin/unpin operations. You *could* totally have speedy VM startup if
> >> only the pages being accessed or having DMA performed to them were
> >> allocated. But, the hacks that are in place mean that everything must
> >> be pinned.
> > Maybe in an SEV or Secure Boot environment we can assume the VM guest
> > OS uses the IOMMU exclusively for DMA, but otherwise the IOMMU is
> > optional (at least for x86, other archs do require IOMMU support
> > afaik). Therefore, how would we know which pages to pin when there are
> > only limited configs where we might be able to lean on the vIOMMU to
> > this extent? Thanks,
>
> You can delay pinning until the device is actually used. That should be
> late enough for the host to figure out whether a paravirtualized IOMMU
> is in place.
So the guest enables the bus master bit in the command register and at
that point we'd stall the VM for an indeterminate length of time while
we potentially pin all memory, and hope that both the user and the host
has the resources to account and allocate that memory, otherwise the
VM suddenly crashes? All of this potentially taking place in the
pre-boot environment to support option ROMs as well. A delay starting
the VM seems a lot more predictable. Thanks,
Alex
Powered by blists - more mailing lists