-
Notifications
You must be signed in to change notification settings - Fork 7.8k
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
soburi
wants to merge
11
commits into
zephyrproject-rtos:main
Choose a base branch
from
soburi:xen-virtio-backend
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+3,551
−2,642
Open
Changes from 1 commit
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
9a620d7
[DNM] manifest: add Xen module
soburi ecc4750
modules: add and migrate to the Xen module
soburi 2bb5f42
[DNM] manifest: Update Xen module
soburi 710d11d
arch: arm64: core: xen: hypercall: Add `dm_op` hypercall
soburi 754452c
drivers: xen: add more hypercall wrapper
soburi 0ef7694
drivers: xen: implement grant table operations
soburi 834a8a3
drivers: virtio: Separate macros into a common header
soburi 071ee76
drivers: xen: add basic XenStore access features
soburi 8ed4fd1
drivers: Introduce vhost driver subsystem
soburi af226c7
drivers: vhost: add Xen MMIO VirtIO backend
soburi 9376df3
samples: drivers: virtualization: add vhost sample application
soburi File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
/* | ||
* Copyright (c) 2025 Antmicro <www.antmicro.com> | ||
* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
#ifndef ZEPHYR_DRIVERS_VIRTIO_VIRTIO_DEFINES_H_ | ||
#define ZEPHYR_DRIVERS_VIRTIO_VIRTIO_DEFINES_H_ | ||
|
||
#define DEVICE_STATUS_ACKNOWLEDGE 0 | ||
#define DEVICE_STATUS_DRIVER 1 | ||
#define DEVICE_STATUS_DRIVER_OK 2 | ||
#define DEVICE_STATUS_FEATURES_OK 3 | ||
#define DEVICE_STATUS_NEEDS_RESET 6 | ||
#define DEVICE_STATUS_FAILED 7 | ||
|
||
#define VIRTIO_F_ANY_LAYOUT 27 | ||
#define VIRTIO_F_VERSION_1 32 | ||
#define VIRTIO_F_ACCESS_PLATFORM 33 | ||
|
||
#define VIRTIO_RING_F_INDIRECT_DESC 28 | ||
#define VIRTIO_RING_F_EVENT_IDX 29 | ||
|
||
#define VIRTQ_AVAIL_F_NO_INTERRUPT 1 | ||
|
||
#define VIRTQ_USED_F_NO_NOTIFY 1 | ||
|
||
/* Ranges of feature bits for specific device types (see spec 2.2)*/ | ||
#define DEV_TYPE_FEAT_RANGE_0_BEGIN 0 | ||
#define DEV_TYPE_FEAT_RANGE_0_END 23 | ||
#define DEV_TYPE_FEAT_RANGE_1_BEGIN 50 | ||
#define DEV_TYPE_FEAT_RANGE_1_END 127 | ||
|
||
/* | ||
* While defined separately in 4.1.4.5 for PCI and in 4.2.2 for MMIO | ||
* the same bits are responsible for the same interrupts, so defines | ||
* with them can be unified | ||
*/ | ||
#define VIRTIO_QUEUE_INTERRUPT 1 | ||
#define VIRTIO_DEVICE_CONFIGURATION_INTERRUPT 2 | ||
|
||
/* | ||
* VIRTIO-MMIO register definitions. | ||
* | ||
* Based on Virtual I/O Device (VIRTIO) Version 1.3 specification: | ||
* https://docs.oasis-open.org/virtio/virtio/v1.3/csd01/virtio-v1.3-csd01.pdf | ||
*/ | ||
|
||
#define VIRTIO_MMIO_MAGIC_VALUE 0x000 | ||
#define VIRTIO_MMIO_VERSION 0x004 | ||
#define VIRTIO_MMIO_DEVICE_ID 0x008 | ||
#define VIRTIO_MMIO_VENDOR_ID 0x00c | ||
#define VIRTIO_MMIO_DEVICE_FEATURES 0x010 | ||
#define VIRTIO_MMIO_DEVICE_FEATURES_SEL 0x014 | ||
#define VIRTIO_MMIO_DRIVER_FEATURES 0x020 | ||
#define VIRTIO_MMIO_DRIVER_FEATURES_SEL 0x024 | ||
#define VIRTIO_MMIO_QUEUE_SEL 0x030 | ||
#define VIRTIO_MMIO_QUEUE_SIZE_MAX 0x034 | ||
#define VIRTIO_MMIO_QUEUE_SIZE 0x038 | ||
#define VIRTIO_MMIO_QUEUE_READY 0x044 | ||
#define VIRTIO_MMIO_QUEUE_NOTIFY 0x050 | ||
#define VIRTIO_MMIO_INTERRUPT_STATUS 0x060 | ||
#define VIRTIO_MMIO_INTERRUPT_ACK 0x064 | ||
#define VIRTIO_MMIO_STATUS 0x070 | ||
#define VIRTIO_MMIO_QUEUE_DESC_LOW 0x080 | ||
#define VIRTIO_MMIO_QUEUE_DESC_HIGH 0x084 | ||
#define VIRTIO_MMIO_QUEUE_AVAIL_LOW 0x090 | ||
#define VIRTIO_MMIO_QUEUE_AVAIL_HIGH 0x094 | ||
#define VIRTIO_MMIO_QUEUE_USED_LOW 0x0a0 | ||
#define VIRTIO_MMIO_QUEUE_USED_HIGH 0x0a4 | ||
#define VIRTIO_MMIO_SHM_SEL 0x0ac | ||
#define VIRTIO_MMIO_SHM_LEN_LOW 0x0b0 | ||
#define VIRTIO_MMIO_SHM_LEN_HIGH 0x0b4 | ||
#define VIRTIO_MMIO_SHM_BASE_LOW 0x0b8 | ||
#define VIRTIO_MMIO_SHM_BASE_HIGH 0x0bc | ||
#define VIRTIO_MMIO_QUEUE_RESET 0x0c0 | ||
#define VIRTIO_MMIO_CONFIG_GENERATION 0x0fc | ||
#define VIRTIO_MMIO_CONFIG 0x100 | ||
|
||
#endif /* ZEPHYR_DRIVERS_VIRTIO_VIRTIO_DEFINES_H_ */ |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Comment for
drivers: virtio: Separate macros into a common header
:I am not responsible for this part of code, but I have no idea why did you change it, commit message definitely should describe it better.