KVM: selftests: Add #define of expected KVM exit reason for ucall
authorSean Christopherson <seanjc@google.com>
Mon, 31 Jul 2023 20:30:25 +0000 (13:30 -0700)
committerSean Christopherson <seanjc@google.com>
Wed, 2 Aug 2023 21:42:52 +0000 (14:42 -0700)
Define the expected architecture specific exit reason for a successful
ucall so that common tests can assert that a ucall occurred without the
test needing to implement arch specific code.

Suggested-by: Andrew Jones <ajones@ventanamicro.com>
Reviewed-by: Andrew Jones <ajones@ventanamicro.com>
Link: https://lore.kernel.org/r/20230731203026.1192091-3-seanjc@google.com
Signed-off-by: Sean Christopherson <seanjc@google.com>
tools/testing/selftests/kvm/include/aarch64/ucall.h
tools/testing/selftests/kvm/include/riscv/ucall.h
tools/testing/selftests/kvm/include/s390x/ucall.h
tools/testing/selftests/kvm/include/x86_64/ucall.h

index fe65fdf4f0d3ae033844de8c8755027eee15029e..4b68f37efd368aeca9cea55bfd3c489a3f78339e 100644 (file)
@@ -4,6 +4,8 @@
 
 #include "kvm_util_base.h"
 
+#define UCALL_EXIT_REASON       KVM_EXIT_MMIO
+
 /*
  * ucall_exit_mmio_addr holds per-VM values (global data is duplicated by each
  * VM), it must not be accessed from host code.
index 86ed0500972b72db03fda86e253ae64d8707d189..be46eb32ec2773eb672dd8470287c93ec868a22f 100644 (file)
@@ -4,6 +4,8 @@
 
 #include "processor.h"
 
+#define UCALL_EXIT_REASON       KVM_EXIT_RISCV_SBI
+
 static inline void ucall_arch_init(struct kvm_vm *vm, vm_paddr_t mmio_gpa)
 {
 }
index 47ad4b1fbccbaeb068fc638041a3648510a28c71..b231bf2e49d620a64c48e11caab8587c4a466c95 100644 (file)
@@ -4,6 +4,8 @@
 
 #include "kvm_util_base.h"
 
+#define UCALL_EXIT_REASON       KVM_EXIT_S390_SIEIC
+
 static inline void ucall_arch_init(struct kvm_vm *vm, vm_paddr_t mmio_gpa)
 {
 }
index 05cc69b0d5508932788b25980f1367d0b95b4ada..06b244bd06eeb8b34cc50410d3c49718a8353f8b 100644 (file)
@@ -4,6 +4,8 @@
 
 #include "kvm_util_base.h"
 
+#define UCALL_EXIT_REASON       KVM_EXIT_IO
+
 static inline void ucall_arch_init(struct kvm_vm *vm, vm_paddr_t mmio_gpa)
 {
 }