summaryrefslogtreecommitdiffstats
path: root/tools/testing/selftests/kvm/x86_64/evmcs_test.c
diff options
context:
space:
mode:
authorWei Wang <wei.w.wang@intel.com>2022-01-05 04:35:30 -0800
committerPaolo Bonzini <pbonzini@redhat.com>2022-01-14 13:44:42 -0500
commit415a3c33e847349c0f76575b3ebfdfae2f5a681a (patch)
tree928b52436fd1282c4cc1b097ec718340aa3ee3c4 /tools/testing/selftests/kvm/x86_64/evmcs_test.c
parentbe50b2065dfa3d88428fdfdc340d154d96bf6848 (diff)
downloadlinux-415a3c33e847349c0f76575b3ebfdfae2f5a681a.tar.bz2
kvm: selftests: Add support for KVM_CAP_XSAVE2
When KVM_CAP_XSAVE2 is supported, userspace is expected to allocate buffer for KVM_GET_XSAVE2 and KVM_SET_XSAVE using the size returned by KVM_CHECK_EXTENSION(KVM_CAP_XSAVE2). Signed-off-by: Wei Wang <wei.w.wang@intel.com> Signed-off-by: Guang Zeng <guang.zeng@intel.com> Signed-off-by: Jing Liu <jing2.liu@intel.com> Signed-off-by: Yang Zhong <yang.zhong@intel.com> Message-Id: <20220105123532.12586-20-yang.zhong@intel.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'tools/testing/selftests/kvm/x86_64/evmcs_test.c')
-rw-r--r--tools/testing/selftests/kvm/x86_64/evmcs_test.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/testing/selftests/kvm/x86_64/evmcs_test.c b/tools/testing/selftests/kvm/x86_64/evmcs_test.c
index 2b46dcca86a8..4c7841dfd481 100644
--- a/tools/testing/selftests/kvm/x86_64/evmcs_test.c
+++ b/tools/testing/selftests/kvm/x86_64/evmcs_test.c
@@ -129,7 +129,7 @@ static void save_restore_vm(struct kvm_vm *vm)
vcpu_set_hv_cpuid(vm, VCPU_ID);
vcpu_enable_evmcs(vm, VCPU_ID);
vcpu_load_state(vm, VCPU_ID, state);
- free(state);
+ kvm_x86_state_cleanup(state);
memset(&regs2, 0, sizeof(regs2));
vcpu_regs_get(vm, VCPU_ID, &regs2);