Skip to content

Commit

Permalink
KVM: selftests: Add #define of expected KVM exit reason for ucall
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
sean-jc committed Aug 2, 2023
1 parent b35f4c7 commit edb5b70
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 0 deletions.
2 changes: 2 additions & 0 deletions tools/testing/selftests/kvm/include/aarch64/ucall.h
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 2 additions & 0 deletions tools/testing/selftests/kvm/include/riscv/ucall.h
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
}
Expand Down
2 changes: 2 additions & 0 deletions tools/testing/selftests/kvm/include/s390x/ucall.h
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
}
Expand Down
2 changes: 2 additions & 0 deletions tools/testing/selftests/kvm/include/x86_64/ucall.h
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
}
Expand Down

0 comments on commit edb5b70

Please sign in to comment.