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

Martin Doucha
2024-05-14T12:09:39Z

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 (4):
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: Add functional test for VMSAVE/VMLOAD instructions

configure.ac | 2 +
include/mk/config.mk.in | 1 +
runtest/kvm | 1 +
testcases/kernel/kvm/.gitignore | 1 +
testcases/kernel/kvm/Makefile | 4 +
testcases/kernel/kvm/include/kvm_guest.h | 19 +-
testcases/kernel/kvm/kvm_svm04.c | 307 ++++++++++++++++++++
testcases/kernel/kvm/lib_guest.c | 348 ++++++++++++++++++++++-
8 files changed, 675 insertions(+), 8 deletions(-)
create mode 100644 testcases/kernel/kvm/kvm_svm04.c