public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Sean Christopherson <seanjc@google.com>
To: Anish Moorthy <amoorthy@google.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>,
	linux-kernel@vger.kernel.org, kvm@vger.kernel.org,
	 isaku.yamahata@intel.com, binbin.wu@linux.intel.com,
	xiaoyao.li@intel.com,
	 Rick Edgecombe <rick.p.edgecombe@intel.com>
Subject: Re: [PATCH v5 2/7] KVM: Add KVM_PRE_FAULT_MEMORY vcpu ioctl to pre-populate guest memory
Date: Wed, 10 Jul 2024 14:56:30 -0700	[thread overview]
Message-ID: <Zo8DjhQq3GOpmO5f@google.com> (raw)
In-Reply-To: <CAF7b7mogOgTs5FZMfuUDms2uHqy3_CNu7p=3TanLzHkem=EMyA@mail.gmail.com>

On Wed, Jul 10, 2024, Anish Moorthy wrote:
> On Wed, Jul 10, 2024 at 10:41 AM Paolo Bonzini <pbonzini@redhat.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.

  reply	other threads:[~2024-07-10 21:56 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-10 17:40 [PATCH v5 0/7] KVM: Guest Memory Pre-Population API Paolo Bonzini
2024-07-10 17:40 ` [PATCH v5 1/7] KVM: Document KVM_PRE_FAULT_MEMORY ioctl Paolo Bonzini
2024-07-10 17:40 ` [PATCH v5 2/7] KVM: Add KVM_PRE_FAULT_MEMORY vcpu ioctl to pre-populate guest memory Paolo Bonzini
2024-07-10 20:46   ` Anish Moorthy
2024-07-10 21:56     ` Sean Christopherson [this message]
2024-07-10 22:04       ` Paolo Bonzini
2024-07-10 17:40 ` [PATCH v5 3/7] KVM: x86/mmu: Bump pf_taken stat only in the "real" page fault handler Paolo Bonzini
2024-07-10 17:40 ` [PATCH v5 4/7] KVM: x86/mmu: Account pf_{fixed,emulate,spurious} in callers of "do page fault" Paolo Bonzini
2024-07-10 17:40 ` [PATCH v5 5/7] KVM: x86/mmu: Make kvm_mmu_do_page_fault() return mapped level Paolo Bonzini
2024-07-10 17:40 ` [PATCH v5 6/7] KVM: x86: Implement kvm_arch_vcpu_pre_fault_memory() Paolo Bonzini
2024-07-11  5:36   ` Binbin Wu
2024-07-11  8:30     ` Paolo Bonzini
2024-07-10 17:40 ` [PATCH v5 7/7] KVM: selftests: x86: Add test for KVM_PRE_FAULT_MEMORY Paolo Bonzini

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=Zo8DjhQq3GOpmO5f@google.com \
    --to=seanjc@google.com \
    --cc=amoorthy@google.com \
    --cc=binbin.wu@linux.intel.com \
    --cc=isaku.yamahata@intel.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pbonzini@redhat.com \
    --cc=rick.p.edgecombe@intel.com \
    --cc=xiaoyao.li@intel.com \
    /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