arm64: xenvm: Add Xen hypercall interface for arm64

This commit adds Xen hypervisor call interface for arm64 architecture.
This is needed for further development of Xen features in Zephyr.

Signed-off-by: Dmytro Firsov <dmytro_firsov@epam.com>
This commit is contained in:
Dmytro Firsov 2021-07-02 10:26:29 +03:00 committed by Carles Cufí
commit c4ab278688
4 changed files with 50 additions and 0 deletions

View file

@ -30,3 +30,5 @@ if ((CONFIG_MP_NUM_CPUS GREATER 1) OR (CONFIG_SMP))
endif ()
zephyr_cc_option_ifdef(CONFIG_USERSPACE -mno-outline-atomics)
add_subdirectory_ifdef(CONFIG_SOC_XENVM xen)

View file

@ -0,0 +1,10 @@
# SPDX-License-Identifier: Apache-2.0
# Copyright (c) 2021 EPAM Systems
# Needed to separate definitions in common Xen headers
zephyr_compile_options($<$<COMPILE_LANGUAGE:ASM>:-D__ASSEMBLY__>)
# Xen interface version used in headers for correct definition
zephyr_compile_options(-D__XEN_INTERFACE_VERSION__=0x00040e00)
zephyr_library_sources(hypercall.S)

View file

@ -0,0 +1,26 @@
/*
* Copyright (c) 2021 EPAM Systems
*
* SPDX-License-Identifier: Apache-2.0
*/
#include <toolchain.h>
#include <linker/sections.h>
#include <xen/public/arch-arm.h>
#include <xen/public/xen.h>
#define HYPERCALL(hypercall) \
GTEXT(HYPERVISOR_##hypercall); \
SECTION_FUNC(TEXT, HYPERVISOR_##hypercall) \
mov x16, #__HYPERVISOR_##hypercall; \
hvc XEN_HYPERCALL_TAG; \
ret;
_ASM_FILE_PROLOGUE
HYPERCALL(console_io);
HYPERCALL(grant_table_op);
HYPERCALL(sched_op);
HYPERCALL(event_channel_op);
HYPERCALL(hvm_op);
HYPERCALL(memory_op);

View file

@ -0,0 +1,12 @@
/*
* Copyright (c() 2021 EPAM Systems
*
* SPDX-License-Identifier: Apache-2.0
*/
/* defined in hypercall.S by HYPERCALL(hypercall) */
int HYPERVISOR_console_io(int op, int cnt, char *str);
int HYPERVISOR_sched_op(int op, void *param);
int HYPERVISOR_event_channel_op(int op, void *param);
int HYPERVISOR_hvm_op(int op, void *param);
int HYPERVISOR_memory_op(int op, void *param);