Skip to content

Commit edb5b70

Browse files
committed
KVM: selftests: Add #define of expected KVM exit reason for ucall
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>
1 parent b35f4c7 commit edb5b70

File tree

4 files changed

+8
-0
lines changed

4 files changed

+8
-0
lines changed

tools/testing/selftests/kvm/include/aarch64/ucall.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44

55
#include "kvm_util_base.h"
66

7+
#define UCALL_EXIT_REASON KVM_EXIT_MMIO
8+
79
/*
810
* ucall_exit_mmio_addr holds per-VM values (global data is duplicated by each
911
* VM), it must not be accessed from host code.

tools/testing/selftests/kvm/include/riscv/ucall.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44

55
#include "processor.h"
66

7+
#define UCALL_EXIT_REASON KVM_EXIT_RISCV_SBI
8+
79
static inline void ucall_arch_init(struct kvm_vm *vm, vm_paddr_t mmio_gpa)
810
{
911
}

tools/testing/selftests/kvm/include/s390x/ucall.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44

55
#include "kvm_util_base.h"
66

7+
#define UCALL_EXIT_REASON KVM_EXIT_S390_SIEIC
8+
79
static inline void ucall_arch_init(struct kvm_vm *vm, vm_paddr_t mmio_gpa)
810
{
911
}

tools/testing/selftests/kvm/include/x86_64/ucall.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44

55
#include "kvm_util_base.h"
66

7+
#define UCALL_EXIT_REASON KVM_EXIT_IO
8+
79
static inline void ucall_arch_init(struct kvm_vm *vm, vm_paddr_t mmio_gpa)
810
{
911
}

0 commit comments

Comments
 (0)