Skip to content

drivers: vhost: Add Xen-MMIO VIRTIO backend #91605

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 11 commits into
base: main
Choose a base branch
from
Open
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
13 changes: 13 additions & 0 deletions MAINTAINERS.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5848,6 +5848,19 @@ West:
- "area: Networking"
- "area: Crypto / RNG"

"West project: xen":
status: maintained
maintainers:
- firscity
collaborators:
- lorc
- luca-fancellu
- soburi
files:
- modules/xen/
labels:
- "area: Xen Platform"

"West project: zcbor":
status: maintained
maintainers:
Expand Down
4 changes: 2 additions & 2 deletions arch/arm64/core/xen/enlighten.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
#include <zephyr/arch/arm64/hypercall.h>
#include <zephyr/xen/events.h>
#include <zephyr/xen/generic.h>
#include <zephyr/xen/public/xen.h>
#include <zephyr/xen/public/memory.h>
#include <xen/public/xen.h>
#include <xen/public/memory.h>

#include <zephyr/device.h>
#include <zephyr/init.h>
Expand Down
5 changes: 3 additions & 2 deletions arch/arm64/core/xen/hypercall.S
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@

#include <zephyr/toolchain.h>
#include <zephyr/linker/sections.h>
#include <zephyr/xen/public/arch-arm.h>
#include <zephyr/xen/public/xen.h>
#include <xen/public/arch-arm.h>
#include <xen/public/xen.h>

#define HYPERCALL(hypercall) \
GTEXT(HYPERVISOR_##hypercall); \
Expand All @@ -23,6 +23,7 @@ HYPERCALL(sched_op);
HYPERCALL(event_channel_op);
HYPERCALL(hvm_op);
HYPERCALL(memory_op);
HYPERCALL(dm_op);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Generic comment regarding commit message for arch: arm64: core: xen: hypercall: Add dm_op hypercall:

You need to not only describe what was added, but also explain why it is needed in Zephyr and how it will be used.


#ifdef CONFIG_XEN_DOM0
HYPERCALL(domctl);
Expand Down
1 change: 1 addition & 0 deletions drivers/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ add_subdirectory_ifdef(CONFIG_STEPPER stepper)
add_subdirectory_ifdef(CONFIG_SYSCON syscon)
add_subdirectory_ifdef(CONFIG_SYS_CLOCK_EXISTS timer)
add_subdirectory_ifdef(CONFIG_TEE tee)
add_subdirectory_ifdef(CONFIG_VHOST vhost)
add_subdirectory_ifdef(CONFIG_VIDEO video)
add_subdirectory_ifdef(CONFIG_VIRTIO virtio)
add_subdirectory_ifdef(CONFIG_VIRTUALIZATION virtualization)
Expand Down
1 change: 1 addition & 0 deletions drivers/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ source "drivers/syscon/Kconfig"
source "drivers/timer/Kconfig"
source "drivers/usb/Kconfig"
source "drivers/usb_c/Kconfig"
source "drivers/vhost/Kconfig"
source "drivers/video/Kconfig"
source "drivers/virtio/Kconfig"
source "drivers/virtualization/Kconfig"
Expand Down
6 changes: 3 additions & 3 deletions drivers/serial/uart_hvc_xen.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
#include <zephyr/xen/events.h>
#include <zephyr/xen/generic.h>
#include <zephyr/xen/hvm.h>
#include <zephyr/xen/public/io/console.h>
#include <zephyr/xen/public/sched.h>
#include <zephyr/xen/public/xen.h>
#include <xen/public/io/console.h>
#include <xen/public/sched.h>
#include <xen/public/xen.h>

#include <zephyr/device.h>
#include <zephyr/init.h>
Expand Down
2 changes: 1 addition & 1 deletion drivers/serial/uart_hvc_xen_consoleio.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
*/

#include <zephyr/arch/arm64/hypercall.h>
#include <zephyr/xen/public/xen.h>
#include <xen/public/xen.h>

#include <zephyr/device.h>
#include <zephyr/drivers/uart.h>
Expand Down
7 changes: 7 additions & 0 deletions drivers/vhost/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Copyright (c) 2025 TOKITA Hiroshi
# SPDX-License-Identifier: Apache-2.0

zephyr_library()

zephyr_library_sources_ifdef(CONFIG_VHOST vringh.c)
zephyr_library_sources_ifdef(CONFIG_VHOST_XEN_MMIO vhost_xen_mmio.c)
22 changes: 22 additions & 0 deletions drivers/vhost/Kconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Copyright (c) 2025 TOKITA Hiroshi
# SPDX-License-Identifier: Apache-2.0

config VHOST
bool "support for VIRTIO"
help
Enable options for VIRTIO

if VHOST

config VHOST_XEN_MMIO
bool "support for MMIO-based VIRTIO backend on Xen hypervisor"
default y
depends on DT_HAS_XEN_VHOST_MMIO_ENABLED
help
Enable VIRTIO-MMIO backedn on Xen hypervisor

endif # VIRTIO

module = VHOST
module-str = VHOST
source "subsys/logging/Kconfig.template.log_config"
Loading
Loading