[LTP] [PATCH 0/9] Add functional test for AMD VMSAVE/VMLOAD instructions

Martin Doucha mdoucha@suse.cz
Tue Apr 30 14:21:56 CEST 2024


Thanks to a minor bug in LTP KVM library, LTP test kvm_svm02 found a kernel
bug in emulation of VMSAVE and VMLOAD instructions in nested VMs. Add
a thorough functional test for both instructions which can detect and pinpoint
emulation bugs.

Also implement basic printf-like formatting for tst_res() and tst_brk() so
that the test can print incorrect register values to simplify result analysis.
Only standard integer and character conversions are supported. Floating point
number conversions, field alignment and padding are not implemented.

Martin Doucha (9):
  KVM: Disable EBP register use in 32bit code
  KVM: Implement strchr() and basic sprintf()
  KVM: Implement printf-like formatting for tst_res() and tst_brk()
  kvm_svm02: Fix saved stack segment index value
  kvm_find_free_descriptor(): Skip descriptor 0
  KVM: Add system control MSR constants
  KVM: Add VMSAVE/VMLOAD functions to x86 SVM library
  KVM: Add functional test for VMSAVE/VMLOAD instructions
  KVM: Move kvm_pagefault01 to the end of KVM runfile

 runtest/kvm                                |   4 +-
 testcases/kernel/kvm/.gitignore            |   1 +
 testcases/kernel/kvm/Makefile              |   2 +-
 testcases/kernel/kvm/include/kvm_guest.h   |  23 +-
 testcases/kernel/kvm/include/kvm_x86.h     |  10 +
 testcases/kernel/kvm/include/kvm_x86_svm.h |   6 +
 testcases/kernel/kvm/kvm_svm02.c           |  14 +-
 testcases/kernel/kvm/kvm_svm04.c           | 307 ++++++++++++++++++
 testcases/kernel/kvm/lib_guest.c           | 348 ++++++++++++++++++++-
 testcases/kernel/kvm/lib_x86.c             |  20 +-
 10 files changed, 713 insertions(+), 22 deletions(-)
 create mode 100644 testcases/kernel/kvm/kvm_svm04.c

-- 
2.44.0



More information about the ltp mailing list