xen: refactor Xen hypervisor Kconfig options

Xen-related Kconfig options were highly dependand on BOARD/SOC xenvm.
It is not correct because Xen support may be used on any board and SoC.

So, Kconfig structure was refactored, now CONFIG_XEN is located in
arch/ directory (same as in Linux kernel) and can be selected for
any Cortex-A arm64 setup (no other platforms are currently supported).

Also remove confusion in Domain 0 naming: Domain-0, initial domain,
Dom0, privileged domain etc. Now all options related to Xen Domain 0
will be controlled by CONFIG_XEN_DOM0.

Signed-off-by: Dmytro Firsov <dmytro_firsov@epam.com>
This commit is contained in:
Dmytro Firsov 2023-06-13 13:19:18 +03:00 committed by Fabio Baltieri
commit c9d2fb7d40
7 changed files with 30 additions and 16 deletions

View file

@ -54,4 +54,4 @@ if(CMAKE_C_COMPILER_ID STREQUAL "GNU")
zephyr_cc_option(-moverride=tune=no_ldp_stp_qregs) zephyr_cc_option(-moverride=tune=no_ldp_stp_qregs)
endif() endif()
add_subdirectory_ifdef(CONFIG_SOC_XENVM xen) add_subdirectory_ifdef(CONFIG_XEN xen)

View file

@ -197,6 +197,8 @@ config ARMV8_A
so that it can support some features included in the AArch64 state. so that it can support some features included in the AArch64 state.
It supports the T32 and A32 instruction sets. It supports the T32 and A32 instruction sets.
rsource "xen/Kconfig"
endif # CPU_CORTEX_A endif # CPU_CORTEX_A
if CPU_AARCH64_CORTEX_R if CPU_AARCH64_CORTEX_R

View file

@ -0,0 +1,20 @@
# Xen hypervisor configuration options
# Copyright (c) 2023 EPAM Systems
# SPDX-License-Identifier: Apache-2.0
config XEN
bool
default y
depends on ARMV8_A
depends on DT_HAS_XEN_XEN_ENABLED
help
Enables support of Xen hypervisor on arm64 platform. Get enabled
when board device tree contains "hypervisor" node with "xen,xen"
compatible enabled.
config XEN_DOM0
bool "Zephyr as Xen Domain 0"
depends on XEN
help
Built binary will be used as Xen privileged domain (Domain 0).

View file

@ -15,7 +15,7 @@ add_subdirectory(usb_c)
add_subdirectory_ifdef(CONFIG_ADC adc) add_subdirectory_ifdef(CONFIG_ADC adc)
add_subdirectory_ifdef(CONFIG_AUDIO audio) add_subdirectory_ifdef(CONFIG_AUDIO audio)
add_subdirectory_ifdef(CONFIG_BBRAM bbram) add_subdirectory_ifdef(CONFIG_BBRAM bbram)
add_subdirectory_ifdef(CONFIG_BOARD_XENVM xen) add_subdirectory_ifdef(CONFIG_XEN xen)
add_subdirectory_ifdef(CONFIG_BT_DRIVERS bluetooth) add_subdirectory_ifdef(CONFIG_BT_DRIVERS bluetooth)
add_subdirectory_ifdef(CONFIG_CACHE_MANAGEMENT cache) add_subdirectory_ifdef(CONFIG_CACHE_MANAGEMENT cache)
add_subdirectory_ifdef(CONFIG_CAN can) add_subdirectory_ifdef(CONFIG_CAN can)

View file

@ -1,6 +1,6 @@
# Xen hypervisor console via UART setup # Xen hypervisor console via UART setup
# #
# Copyright (c) 2021 EPAM Systems # Copyright (c) 2021-2023 EPAM Systems
# SPDX-License-Identifier: Apache-2.0 # SPDX-License-Identifier: Apache-2.0
# #
@ -10,7 +10,7 @@ config UART_XEN_HVC
depends on DT_HAS_XEN_HVC_UART_ENABLED depends on DT_HAS_XEN_HVC_UART_ENABLED
select SERIAL_HAS_DRIVER select SERIAL_HAS_DRIVER
select SERIAL_SUPPORT_INTERRUPT select SERIAL_SUPPORT_INTERRUPT
depends on !XEN_INITIAL_DOMAIN depends on XEN && !XEN_DOM0
help help
Enable Xen ring buffer based hypervisor console driver. Used Enable Xen ring buffer based hypervisor console driver. Used
for Zephyr as unprivileged domain. for Zephyr as unprivileged domain.
@ -18,8 +18,7 @@ config UART_XEN_HVC
config UART_XEN_HVC_CONSOLEIO config UART_XEN_HVC_CONSOLEIO
bool "Xen hypervisor Dom0 console UART driver" bool "Xen hypervisor Dom0 console UART driver"
select SERIAL_HAS_DRIVER select SERIAL_HAS_DRIVER
depends on BOARD_XENVM depends on XEN_DOM0
depends on XEN_INITIAL_DOMAIN
default y default y
help help
Enable Xen hypervisor console driver. Used for Zephyr as Enable Xen hypervisor console driver. Used for Zephyr as
@ -35,7 +34,6 @@ config XEN_HVC_INIT_PRIORITY
config XEN_EARLY_CONSOLEIO config XEN_EARLY_CONSOLEIO
bool "Early printk/stdout through console_io Xen interface" bool "Early printk/stdout through console_io Xen interface"
depends on BOARD_XENVM
depends on UART_XEN_HVC depends on UART_XEN_HVC
help help
Enable setting of console_io symbol hook for stdout and printk. Enable setting of console_io symbol hook for stdout and printk.

View file

@ -1,7 +1,7 @@
# SPDX-License-Identifier: Apache-2.0 # SPDX-License-Identifier: Apache-2.0
# Copyright (c) 2022 EPAM Systems # Copyright (c) 2022-2023 EPAM Systems
if SOC_XENVM if XEN
menu "Xen drivers" menu "Xen drivers"
@ -22,4 +22,4 @@ config XEN_GRANT_TABLE_INIT_PRIORITY
endmenu endmenu
endif # SOC_XENVM endif # XEN

View file

@ -6,9 +6,3 @@ config SOC_XENVM
select ARM64 select ARM64
select ARM_ARCH_TIMER if SYS_CLOCK_EXISTS select ARM_ARCH_TIMER if SYS_CLOCK_EXISTS
select CPU_CORTEX_A72 select CPU_CORTEX_A72
config XEN_INITIAL_DOMAIN
bool "Zephyr as Xen Domain 0"
depends on SOC_XENVM
help
Built binary will be used as Xen privileged domain.