On Tue, Apr 22, 2025, Zack Rusin wrote:
Add a testcase to exercise KVM_CAP_X86_VMWARE_HYPERCALL and validate that KVM exits to userspace on hypercalls and registers are correctly preserved.
Signed-off-by: Zack Rusin zack.rusin@broadcom.com Cc: Doug Covelli doug.covelli@broadcom.com Cc: Paolo Bonzini pbonzini@redhat.com Cc: Shuah Khan shuah@kernel.org Cc: Sean Christopherson seanjc@google.com Cc: Namhyung Kim namhyung@kernel.org Cc: Joel Stanley joel@jms.id.au Cc: Zack Rusin zack.rusin@broadcom.com Cc: Isaku Yamahata isaku.yamahata@intel.com Cc: Arnaldo Carvalho de Melo acme@redhat.com Cc: linux-kernel@vger.kernel.org Cc: kvm@vger.kernel.org Cc: linux-kselftest@vger.kernel.org
tools/include/uapi/linux/kvm.h | 3 + tools/testing/selftests/kvm/Makefile.kvm | 1 + .../selftests/kvm/x86/vmware_hypercall_test.c | 121 ++++++++++++++++++ 3 files changed, 125 insertions(+) create mode 100644 tools/testing/selftests/kvm/x86/vmware_hypercall_test.c
diff --git a/tools/include/uapi/linux/kvm.h b/tools/include/uapi/linux/kvm.h index 502ea63b5d2e..3b3ad1827245 100644 --- a/tools/include/uapi/linux/kvm.h +++ b/tools/include/uapi/linux/kvm.h @@ -933,6 +933,9 @@ struct kvm_enable_cap { #define KVM_CAP_PRE_FAULT_MEMORY 236 #define KVM_CAP_X86_APIC_BUS_CYCLES_NS 237 #define KVM_CAP_X86_GUEST_MODE 238 +#define KVM_CAP_X86_VMWARE_BACKDOOR 239 +#define KVM_CAP_X86_VMWARE_HYPERCALL 240 +#define KVM_CAP_X86_VMWARE_NESTED_BACKDOOR_L0 241
Can I bribe/convince you to port KVM-Unit-Tests' x86/vmware_backdoors.c to a KVM selftest that verifies KVM's behavior for the various combination of module param and capability values?