All of lore.kernel.org
 help / color / mirror / Atom feed
From: Maxim Levitsky <mlevitsk@redhat.com>
To: Manali Shukla <manali.shukla@amd.com>,
	pbonzini@redhat.com, seanjc@google.com
Cc: kvm@vger.kernel.org
Subject: Re: [kvm-unit-tests PATCH v2 0/4] Move npt test cases and NPT code improvements
Date: Thu, 24 Mar 2022 17:58:20 +0200	[thread overview]
Message-ID: <68b1caabe6242dda55720c553102f7eca0587c00.camel@redhat.com> (raw)
In-Reply-To: <20220324053046.200556-1-manali.shukla@amd.com>

On Thu, 2022-03-24 at 05:30 +0000, Manali Shukla wrote:
> If __setup_vm() is changed to setup_vm(), KUT will build tests with PT_USER_MASK set on all 
> PTEs. It is a better idea to move nNPT tests to their own file so that tests don't need to 
> fiddle with page tables midway.
> 
> The quick approach to do this would be to turn the current main into a small helper, 
> without calling __setup_vm() from helper.
> 
> Current implementation of nested page table does the page table build up statistically 
> with 2048 PTEs and one pml4 entry. With newly implemented routine, nested page table can 
> be implemented dynamically based on the RAM size of VM which enables us to have separate 
> memory ranges to test various npt test cases.
> 
> Based on this implementation, minimal changes were required to be done in below mentioned 
> existing APIs:
> npt_get_pde(), npt_get_pte(), npt_get_pdpe().
> 
> v1 -> v2
> Added new patch for building up a nested page table dynamically and did minimal changes 
> required to make it adaptable with old test cases.
> 
> There are four patches in this patch series
> 1) Turned current main into helper function minus setup_vm().
> 2) Moved all nNPT test cases from svm_tests.c to svm_npt.c.
> 3) Enabled PT_USER_MASK for all nSVM test cases other than nNPT tests.
> 4) Implemented routine to build up nested page table dynamically.
> 
> *** BLURB HERE ***
> 
> Manali Shukla (4):
>   x86: nSVM: Move common functionality of the main() to helper
>     run_svm_tests
>   x86: nSVM: Move all nNPT test cases from svm_tests.c to a separate
>     file.
>   x86: nSVM: Allow nSVM tests run with PT_USER_MASK enabled
>   x86: nSVM: Build up the nested page table dynamically
> 
>  x86/Makefile.common |   2 +
>  x86/Makefile.x86_64 |   2 +
>  x86/svm.c           | 169 ++++++++++++-------
>  x86/svm.h           |  18 ++-
>  x86/svm_npt.c       | 386 ++++++++++++++++++++++++++++++++++++++++++++
>  x86/svm_tests.c     | 369 +-----------------------------------------
>  6 files changed, 526 insertions(+), 420 deletions(-)
>  create mode 100644 x86/svm_npt.c
> 

Yesterday I was prototyping something similar for my use case.
 
I would like to have mini SVM library which can be called from any test,
and in particular from a test which is mostly not SVM, but sometimes
one of its vCPU enters a nested guest.

(The test in question sends lots of IPIs between vCPUs, and sometimes,
it likes a vCPU to be running a nested guest to test that this works.
 
I'll see if I can finish this. Meanwhile these patches do look good to me.
 
Best regards,
	Maxim Levitsky
 
 
 


      parent reply	other threads:[~2022-03-24 15:59 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-24  5:30 [kvm-unit-tests PATCH v2 0/4] Move npt test cases and NPT code improvements Manali Shukla
2022-03-24  5:30 ` [kvm-unit-tests PATCH v2 1/4] x86: nSVM: Move common functionality of the main() to helper run_svm_tests Manali Shukla
2022-04-13 20:28   ` Sean Christopherson
2022-04-14 16:42     ` Shukla, Manali
2022-03-24  5:30 ` [kvm-unit-tests PATCH v2 2/4] x86: nSVM: Move all nNPT test cases from svm_tests.c to a separate file Manali Shukla
2022-03-24  5:30 ` [kvm-unit-tests PATCH v2 3/4] x86: nSVM: Allow nSVM tests run with PT_USER_MASK enabled Manali Shukla
2022-03-24  5:30 ` [kvm-unit-tests PATCH v2 4/4] x86: nSVM: Build up the nested page table dynamically Manali Shukla
2022-04-13 21:33   ` Sean Christopherson
2022-04-14 16:39     ` Shukla, Manali
2022-03-24 15:58 ` Maxim Levitsky [this message]

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=68b1caabe6242dda55720c553102f7eca0587c00.camel@redhat.com \
    --to=mlevitsk@redhat.com \
    --cc=kvm@vger.kernel.org \
    --cc=manali.shukla@amd.com \
    --cc=pbonzini@redhat.com \
    --cc=seanjc@google.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.