KVM: selftests: Add KVM_SET_USER_MEMORY_REGION2 helper
authorChao Peng <chao.p.peng@linux.intel.com>
Fri, 27 Oct 2023 18:22:14 +0000 (11:22 -0700)
committerPaolo Bonzini <pbonzini@redhat.com>
Tue, 14 Nov 2023 13:01:08 +0000 (08:01 -0500)
commite6f4f345b259cad178bad7e40a9d4b65cf195067
treebc7015891ab8fed039ee8fa08c0ce3c3244c0477
parent43f623f350ce1c46c53b6b77f4dbe741af8c44f3
KVM: selftests: Add KVM_SET_USER_MEMORY_REGION2 helper

Add helpers to invoke KVM_SET_USER_MEMORY_REGION2 directly so that tests
can validate of features that are unique to "version 2" of "set user
memory region", e.g. do negative testing on gmem_fd and gmem_offset.

Provide a raw version as well as an assert-success version to reduce
the amount of boilerplate code need for basic usage.

Signed-off-by: Chao Peng <chao.p.peng@linux.intel.com>
Signed-off-by: Ackerley Tng <ackerleytng@google.com>
Signed-off-by: Sean Christopherson <seanjc@google.com>
Message-Id: <20231027182217.3615211-33-seanjc@google.com>
Reviewed-by: Fuad Tabba <tabba@google.com>
Tested-by: Fuad Tabba <tabba@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
tools/testing/selftests/kvm/include/kvm_util_base.h
tools/testing/selftests/kvm/lib/kvm_util.c