Skip to content

Commit c9d2fb7

Browse files
firscityfabiobaltieri
authored andcommitted
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 <[email protected]>
1 parent 66dfe7b commit c9d2fb7

File tree

7 files changed

+30
-16
lines changed

7 files changed

+30
-16
lines changed

arch/arm64/core/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,4 +54,4 @@ if(CMAKE_C_COMPILER_ID STREQUAL "GNU")
5454
zephyr_cc_option(-moverride=tune=no_ldp_stp_qregs)
5555
endif()
5656

57-
add_subdirectory_ifdef(CONFIG_SOC_XENVM xen)
57+
add_subdirectory_ifdef(CONFIG_XEN xen)

arch/arm64/core/Kconfig

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,8 @@ config ARMV8_A
197197
so that it can support some features included in the AArch64 state.
198198
It supports the T32 and A32 instruction sets.
199199

200+
rsource "xen/Kconfig"
201+
200202
endif # CPU_CORTEX_A
201203

202204
if CPU_AARCH64_CORTEX_R

arch/arm64/core/xen/Kconfig

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Xen hypervisor configuration options
2+
3+
# Copyright (c) 2023 EPAM Systems
4+
# SPDX-License-Identifier: Apache-2.0
5+
6+
config XEN
7+
bool
8+
default y
9+
depends on ARMV8_A
10+
depends on DT_HAS_XEN_XEN_ENABLED
11+
help
12+
Enables support of Xen hypervisor on arm64 platform. Get enabled
13+
when board device tree contains "hypervisor" node with "xen,xen"
14+
compatible enabled.
15+
16+
config XEN_DOM0
17+
bool "Zephyr as Xen Domain 0"
18+
depends on XEN
19+
help
20+
Built binary will be used as Xen privileged domain (Domain 0).

drivers/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ add_subdirectory(usb_c)
1515
add_subdirectory_ifdef(CONFIG_ADC adc)
1616
add_subdirectory_ifdef(CONFIG_AUDIO audio)
1717
add_subdirectory_ifdef(CONFIG_BBRAM bbram)
18-
add_subdirectory_ifdef(CONFIG_BOARD_XENVM xen)
18+
add_subdirectory_ifdef(CONFIG_XEN xen)
1919
add_subdirectory_ifdef(CONFIG_BT_DRIVERS bluetooth)
2020
add_subdirectory_ifdef(CONFIG_CACHE_MANAGEMENT cache)
2121
add_subdirectory_ifdef(CONFIG_CAN can)

drivers/serial/Kconfig.xen

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Xen hypervisor console via UART setup
22
#
3-
# Copyright (c) 2021 EPAM Systems
3+
# Copyright (c) 2021-2023 EPAM Systems
44
# SPDX-License-Identifier: Apache-2.0
55
#
66

@@ -10,16 +10,15 @@ config UART_XEN_HVC
1010
depends on DT_HAS_XEN_HVC_UART_ENABLED
1111
select SERIAL_HAS_DRIVER
1212
select SERIAL_SUPPORT_INTERRUPT
13-
depends on !XEN_INITIAL_DOMAIN
13+
depends on XEN && !XEN_DOM0
1414
help
1515
Enable Xen ring buffer based hypervisor console driver. Used
1616
for Zephyr as unprivileged domain.
1717

1818
config UART_XEN_HVC_CONSOLEIO
1919
bool "Xen hypervisor Dom0 console UART driver"
2020
select SERIAL_HAS_DRIVER
21-
depends on BOARD_XENVM
22-
depends on XEN_INITIAL_DOMAIN
21+
depends on XEN_DOM0
2322
default y
2423
help
2524
Enable Xen hypervisor console driver. Used for Zephyr as
@@ -35,7 +34,6 @@ config XEN_HVC_INIT_PRIORITY
3534

3635
config XEN_EARLY_CONSOLEIO
3736
bool "Early printk/stdout through console_io Xen interface"
38-
depends on BOARD_XENVM
3937
depends on UART_XEN_HVC
4038
help
4139
Enable setting of console_io symbol hook for stdout and printk.

drivers/xen/Kconfig

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# SPDX-License-Identifier: Apache-2.0
2-
# Copyright (c) 2022 EPAM Systems
2+
# Copyright (c) 2022-2023 EPAM Systems
33

4-
if SOC_XENVM
4+
if XEN
55

66
menu "Xen drivers"
77

@@ -22,4 +22,4 @@ config XEN_GRANT_TABLE_INIT_PRIORITY
2222

2323
endmenu
2424

25-
endif # SOC_XENVM
25+
endif # XEN

soc/arm64/xenvm/Kconfig.soc

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,3 @@ config SOC_XENVM
66
select ARM64
77
select ARM_ARCH_TIMER if SYS_CLOCK_EXISTS
88
select CPU_CORTEX_A72
9-
10-
config XEN_INITIAL_DOMAIN
11-
bool "Zephyr as Xen Domain 0"
12-
depends on SOC_XENVM
13-
help
14-
Built binary will be used as Xen privileged domain.

0 commit comments

Comments
 (0)