kvmarm.lists.cs.columbia.edu archive mirror
 help / color / mirror / Atom feed
From: Ricardo Koller <ricarkol@google.com>
To: Ben Gardon <bgardon@google.com>
Cc: kvm <kvm@vger.kernel.org>, Marc Zyngier <maz@kernel.org>,
	Paolo Bonzini <pbonzini@redhat.com>,
	Axel Rasmussen <axelrasmussen@google.com>,
	kvmarm@lists.cs.columbia.edu
Subject: Re: [PATCH 04/11] KVM: selftests: Add vm_alloc_page_table_in_memslot library function
Date: Fri, 18 Mar 2022 13:33:10 -0700	[thread overview]
Message-ID: <YjTshgT6ByCPEubc@google.com> (raw)
In-Reply-To: <CANgfPd8u_K3cOpaUPY8+rU+4RFehj8J61gdzuDyOZv4dSDZ+xQ@mail.gmail.com>

On Wed, Mar 16, 2022 at 12:07:21PM -0600, Ben Gardon wrote:
> On Fri, Mar 11, 2022 at 12:02 AM Ricardo Koller <ricarkol@google.com> wrote:
> >
> > Add a library function to allocate a page-table physical page in a
> > particular memslot.  The default behavior is to create new page-table
> > pages in memslot 0.
> >
> > Signed-off-by: Ricardo Koller <ricarkol@google.com>
> 
> This is very similar to one of the patches in the NX hugepages control
> series I sent out last week, I guess we both had similar needs at the
> same time.
> Your solution introduces way less churn though, so it's probably
> better. I might use this commit or wait for it to be merged before I
> send out v2 of my NX control series.

Both options sound good to me. I'm glad it helps.

> 
> In any case,
> Reviewed-by: Ben Gardon <bgardon@google.com>
> 
> > ---
> >  tools/testing/selftests/kvm/include/kvm_util_base.h | 1 +
> >  tools/testing/selftests/kvm/lib/kvm_util.c          | 8 +++++++-
> >  2 files changed, 8 insertions(+), 1 deletion(-)
> >
> > diff --git a/tools/testing/selftests/kvm/include/kvm_util_base.h b/tools/testing/selftests/kvm/include/kvm_util_base.h
> > index d6acec0858c0..c8dce12a9a52 100644
> > --- a/tools/testing/selftests/kvm/include/kvm_util_base.h
> > +++ b/tools/testing/selftests/kvm/include/kvm_util_base.h
> > @@ -307,6 +307,7 @@ vm_paddr_t vm_phy_page_alloc(struct kvm_vm *vm, vm_paddr_t paddr_min,
> >  vm_paddr_t vm_phy_pages_alloc(struct kvm_vm *vm, size_t num,
> >                               vm_paddr_t paddr_min, uint32_t memslot);
> >  vm_paddr_t vm_alloc_page_table(struct kvm_vm *vm);
> > +vm_paddr_t vm_alloc_page_table_in_memslot(struct kvm_vm *vm, uint32_t pt_memslot);
> >
> >  /*
> >   * Create a VM with reasonable defaults
> > diff --git a/tools/testing/selftests/kvm/lib/kvm_util.c b/tools/testing/selftests/kvm/lib/kvm_util.c
> > index 64ef245b73de..ae21564241c8 100644
> > --- a/tools/testing/selftests/kvm/lib/kvm_util.c
> > +++ b/tools/testing/selftests/kvm/lib/kvm_util.c
> > @@ -2409,9 +2409,15 @@ vm_paddr_t vm_phy_page_alloc(struct kvm_vm *vm, vm_paddr_t paddr_min,
> >  /* Arbitrary minimum physical address used for virtual translation tables. */
> >  #define KVM_GUEST_PAGE_TABLE_MIN_PADDR 0x180000
> >
> > +vm_paddr_t vm_alloc_page_table_in_memslot(struct kvm_vm *vm, uint32_t pt_memslot)
> > +{
> > +       return vm_phy_page_alloc(vm, KVM_GUEST_PAGE_TABLE_MIN_PADDR,
> > +                       pt_memslot);
> > +}
> > +
> >  vm_paddr_t vm_alloc_page_table(struct kvm_vm *vm)
> >  {
> > -       return vm_phy_page_alloc(vm, KVM_GUEST_PAGE_TABLE_MIN_PADDR, 0);
> > +       return vm_alloc_page_table_in_memslot(vm, 0);
> >  }
> >
> >  /*
> > --
> > 2.35.1.723.g4982287a31-goog
> >
_______________________________________________
kvmarm mailing list
kvmarm@lists.cs.columbia.edu
https://lists.cs.columbia.edu/mailman/listinfo/kvmarm

  reply	other threads:[~2022-03-18 20:33 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-11  6:01 [PATCH 00/11] KVM: selftests: Add aarch64/page_fault_test Ricardo Koller
2022-03-11  6:01 ` [PATCH 01/11] KVM: selftests: Add a userfaultfd library Ricardo Koller
2022-03-16 18:02   ` Ben Gardon
2022-03-18 20:27     ` Ricardo Koller
2022-03-11  6:01 ` [PATCH 02/11] KVM: selftests: Add vm_mem_region_get_src_fd library function Ricardo Koller
2022-03-16 18:08   ` Ben Gardon
2022-03-18 20:30     ` Ricardo Koller
2022-03-21 17:01       ` Ben Gardon
2022-03-11  6:01 ` [PATCH 03/11] KVM: selftests: aarch64: Add vm_get_pte_gpa " Ricardo Koller
2022-03-11  6:02 ` [PATCH 04/11] KVM: selftests: Add vm_alloc_page_table_in_memslot " Ricardo Koller
2022-03-16 18:07   ` Ben Gardon
2022-03-18 20:33     ` Ricardo Koller [this message]
2022-03-11  6:02 ` [PATCH 05/11] KVM: selftests: aarch64: Export _virt_pg_map with a pt_memslot arg Ricardo Koller
2022-03-11  6:02 ` [PATCH 06/11] KVM: selftests: Add missing close and munmap in __vm_mem_region_delete Ricardo Koller
2022-03-16 18:09   ` Ben Gardon
2022-03-18 20:33     ` Ricardo Koller
2022-03-11  6:02 ` [PATCH 07/11] KVM: selftests: aarch64: Add aarch64/page_fault_test Ricardo Koller
2022-03-11  6:02 ` [PATCH 08/11] KVM: selftests: aarch64: Add userfaultfd tests into page_fault_test Ricardo Koller
2022-03-11  6:02 ` [PATCH 09/11] KVM: selftests: aarch64: Add dirty logging " Ricardo Koller
2022-03-11  6:02 ` [PATCH 10/11] KVM: selftests: aarch64: Add readonly memslot " Ricardo Koller
2022-03-11  6:02 ` [PATCH 11/11] KVM: selftests: aarch64: Add mix of " Ricardo Koller

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=YjTshgT6ByCPEubc@google.com \
    --to=ricarkol@google.com \
    --cc=axelrasmussen@google.com \
    --cc=bgardon@google.com \
    --cc=kvm@vger.kernel.org \
    --cc=kvmarm@lists.cs.columbia.edu \
    --cc=maz@kernel.org \
    --cc=pbonzini@redhat.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;
as well as URLs for NNTP newsgroup(s).