Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion tools/testing/selftests/kvm/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ else
LINUX_TOOL_ARCH_INCLUDE = $(top_srcdir)/tools/arch/$(ARCH)/include
endif
CFLAGS += -Wall -Wstrict-prototypes -Wuninitialized -O2 -g -std=gnu99 \
-Wno-gnu-variable-sized-type-not-at-end -MD\
-Wno-gnu-variable-sized-type-not-at-end -MD -DCONFIG_64BIT\
-U_FORTIFY_SOURCE \
-fno-builtin-memcmp -fno-builtin-memcpy -fno-builtin-memset \
-fno-builtin-strnlen \
Expand Down
18 changes: 0 additions & 18 deletions tools/testing/selftests/kvm/include/riscv/processor.h
Original file line number Diff line number Diff line change
Expand Up @@ -167,24 +167,6 @@ void vm_install_interrupt_handler(struct kvm_vm *vm, exception_handler_fn handle
#define SATP_MODE_39 _AC(0x8000000000000000, UL)
#define SATP_MODE_48 _AC(0x9000000000000000, UL)

/* SBI return error codes */
#define SBI_SUCCESS 0
#define SBI_ERR_FAILURE -1
#define SBI_ERR_NOT_SUPPORTED -2
#define SBI_ERR_INVALID_PARAM -3
#define SBI_ERR_DENIED -4
#define SBI_ERR_INVALID_ADDRESS -5
#define SBI_ERR_ALREADY_AVAILABLE -6
#define SBI_ERR_ALREADY_STARTED -7
#define SBI_ERR_ALREADY_STOPPED -8

#define SBI_EXT_EXPERIMENTAL_START 0x08000000
#define SBI_EXT_EXPERIMENTAL_END 0x08FFFFFF

#define KVM_RISCV_SELFTESTS_SBI_EXT SBI_EXT_EXPERIMENTAL_END
#define KVM_RISCV_SELFTESTS_SBI_UCALL 0
#define KVM_RISCV_SELFTESTS_SBI_UNEXP 1

static inline void local_irq_enable(void)
{
csr_set(CSR_SSTATUS, SR_SIE);
Expand Down
1 change: 1 addition & 0 deletions tools/testing/selftests/kvm/include/riscv/sbi.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ enum sbi_ext_base_fid {
SBI_EXT_BASE_GET_IMP_VERSION,
SBI_EXT_BASE_PROBE_EXT = 3,
};

enum sbi_ext_pmu_fid {
SBI_EXT_PMU_NUM_COUNTERS = 0,
SBI_EXT_PMU_COUNTER_GET_INFO,
Expand Down
1 change: 1 addition & 0 deletions tools/testing/selftests/kvm/include/riscv/ucall.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
#define SELFTEST_KVM_UCALL_H

#include "processor.h"
#include "sbi.h"

#define UCALL_EXIT_REASON KVM_EXIT_RISCV_SBI

Expand Down
1 change: 1 addition & 0 deletions tools/testing/selftests/kvm/lib/riscv/ucall.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

#include "kvm_util.h"
#include "processor.h"
#include "sbi.h"

void *ucall_arch_get_ucall(struct kvm_vcpu *vcpu)
{
Expand Down
1 change: 1 addition & 0 deletions tools/testing/selftests/kvm/riscv/ebreak_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
*
*/
#include "kvm_util.h"
#include "ucall_common.h"

#define LABEL_ADDRESS(v) ((uint64_t)&(v))

Expand Down
1 change: 1 addition & 0 deletions tools/testing/selftests/kvm/riscv/sbi_pmu_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
#include "processor.h"
#include "sbi.h"
#include "arch_timer.h"
#include "ucall_common.h"

/* Maximum counters(firmware + hardware) */
#define RISCV_MAX_PMU_COUNTERS 64
Expand Down
Loading