[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CABgObfbfA6oGVcHwFH10YC7EEMw2A9W-L1aJjHAWGRajog6uwA@mail.gmail.com>
Date: Thu, 11 Jul 2024 00:04:42 +0200
From: Paolo Bonzini <pbonzini@...hat.com>
To: Sean Christopherson <seanjc@...gle.com>
Cc: Anish Moorthy <amoorthy@...gle.com>, linux-kernel@...r.kernel.org, kvm@...r.kernel.org,
isaku.yamahata@...el.com, binbin.wu@...ux.intel.com, xiaoyao.li@...el.com,
Rick Edgecombe <rick.p.edgecombe@...el.com>
Subject: Re: [PATCH v5 2/7] KVM: Add KVM_PRE_FAULT_MEMORY vcpu ioctl to
pre-populate guest memory
On Wed, Jul 10, 2024 at 11:56 PM Sean Christopherson <seanjc@...gle.com> wrote:
>
> On Wed, Jul 10, 2024, Anish Moorthy wrote:
> > On Wed, Jul 10, 2024 at 10:41 AM Paolo Bonzini <pbonzini@...hat.com> wrote:
> > >
> > > + if (!PAGE_ALIGNED(range->gpa) ||
> > > + !PAGE_ALIGNED(range->size) ||
> > > ...
> > > + return -EINVAL;
> >
> > If 'gpa' and 'size' must be page-aligned anyways, doesn't it make
> > sense to just take a 'gfn' and 'num_pages' and eliminate this error
> > condition?
>
> The downside is that taking gfn+num_pages prevents supporting sub-page pre-faulting
> in the future. I highly doubt that sub-page mappings will ever be a thing in KVM,
> but two PAGE_ALIGNED() checks is super cheap, so it's soft of a "why not?" scenario.
With ARM having multiple page sizes, and not necessarily the same size
in host and guest, using a gfn argument is also unnecessarily
confusing.
Paolo
Powered by blists - more mailing lists