All of lore.kernel.org
 help / color / mirror / Atom feed
* [kvm-unit-tests RESEND PATCH v3 0/8] Move npt test cases and NPT code improvements
@ 2022-04-25 11:44 Manali Shukla
  2022-04-25 11:44 ` [kvm-unit-tests RESEND PATCH v3 1/8] x86: nSVM: Move common functionality of the main() to helper run_svm_tests Manali Shukla
                   ` (8 more replies)
  0 siblings, 9 replies; 13+ messages in thread
From: Manali Shukla @ 2022-04-25 11:44 UTC (permalink / raw)
  To: pbonzini, seanjc; +Cc: kvm

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.

setup_mmu_range() function in vm.c was modified to allocate new user 
pages to implement nested page table.

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.

v2 -> v3
Added new patch to change setup_mmu_range to use it in implementation 
of nested page table.
Added new patches to correct indentation errors in svm.c, svm_npt.c and 
svm_tests.c.
Used scripts/Lindent from linux source code to fix indentation errors.

Last patch from this series was bounced back due to maximum characters for
patch was crossed, so resending the whole series again by spliting the patch in
multiples.

Manali Shukla (8):
  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: Improve set_mmu_range() to implement npt
  x86: nSVM: Build up the nested page table dynamically
  x86: nSVM: Correct indentation for svm.c
  x86: nSVM: Correct indentation for svm_tests.c part-1
  x86: nSVM: Correct indentation for svm_tests.c part-2

 lib/x86/vm.c        |   37 +-
 lib/x86/vm.h        |    3 +
 x86/Makefile.common |    2 +
 x86/Makefile.x86_64 |    2 +
 x86/svm.c           |  272 ++--
 x86/svm.h           |    5 +-
 x86/svm_npt.c       |  391 +++++
 x86/svm_tests.c     | 3535 ++++++++++++++++++++-----------------------
 x86/unittests.cfg   |    6 +
 9 files changed, 2157 insertions(+), 2096 deletions(-)
 create mode 100644 x86/svm_npt.c

-- 
2.30.2


^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2022-04-27  3:36 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-25 11:44 [kvm-unit-tests RESEND PATCH v3 0/8] Move npt test cases and NPT code improvements Manali Shukla
2022-04-25 11:44 ` [kvm-unit-tests RESEND PATCH v3 1/8] x86: nSVM: Move common functionality of the main() to helper run_svm_tests Manali Shukla
2022-04-25 11:44 ` [kvm-unit-tests RESEND PATCH v3 2/8] x86: nSVM: Move all nNPT test cases from svm_tests.c to a separate file Manali Shukla
2022-04-25 11:44 ` [kvm-unit-tests RESEND PATCH v3 3/8] x86: nSVM: Allow nSVM tests run with PT_USER_MASK enabled Manali Shukla
2022-04-25 11:44 ` [kvm-unit-tests RESEND PATCH v3 4/8] x86: Improve set_mmu_range() to implement npt Manali Shukla
2022-04-25 11:44 ` [kvm-unit-tests RESEND PATCH v3 5/8] x86: nSVM: Build up the nested page table dynamically Manali Shukla
2022-04-25 11:44 ` [kvm-unit-tests RESEND PATCH v3 6/8] x86: nSVM: Correct indentation for svm.c Manali Shukla
2022-04-25 11:44 ` [kvm-unit-tests RESEND PATCH v3 7/8] x86: nSVM: Correct indentation for svm_tests.c part-1 Manali Shukla
2022-04-25 11:44 ` [kvm-unit-tests RESEND PATCH v3 8/8] x86: nSVM: Correct indentation for svm_tests.c part-2 Manali Shukla
2022-04-25 13:29   ` Paolo Bonzini
2022-04-27  3:36     ` Shukla, Manali
2022-04-25 13:31 ` [kvm-unit-tests RESEND PATCH v3 0/8] Move npt test cases and NPT code improvements Paolo Bonzini
2022-04-25 14:48   ` Sean Christopherson

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.