-
Notifications
You must be signed in to change notification settings - Fork 8.2k
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
base: main
Are you sure you want to change the base?
Conversation
|
The following west manifest projects have changed revision in this Pull Request:
⛔ DNM label due to: 1 added project Note: This message is automatically posted and updated by the Manifest GitHub Action. |
9451269 to
144315f
Compare
144315f to
91ba84f
Compare
4741c1a to
141d60f
Compare
21b1787 to
98d1f30
Compare
d64559b to
986ef95
Compare
034196e to
7b209be
Compare
7793ab7 to
de7c012
Compare
|
Generic comment regarding this PR - a see a lot of force-pushes and no much replies to previous comment. Thus, I don't understand if I should re-review it, if you decided to rework it - please mark it as draft (unfortunately, it will not prevent e-mail storm, but at least I will be sure, that no re-review needed). |
Xen API contains hypercall, which allows domains to identify Xen version, that is currently used on the system. It can be used to check if current version is supported by Zephyr or to change behavior of the drivers or services. Signed-off-by: Dmytro Semenets <[email protected]> Signed-off-by: Dmytro Firsov <[email protected]>
This hypercall can be used get some information about physical machine and running guests: - sysctl hypercall "xen_sysctl_getphysinfo" allows read information about physical machine: number CPUs, memory sizes, hardware capabilities, etc. - sysctl hypercall "xen_sysctl_getdomaininfolist" returns array of domain info structures that provide information about particular domain(s). Signed-off-by: Dmytro Semenets <[email protected]> Signed-off-by: Mykyta Poturai <[email protected]> Signed-off-by: Dmytro Firsov <[email protected]>
Add the XEN_DOMCTL_getvcpuinfo domain control call to allow Domain-0 to query information about a domain's virtual CPUs. This can be used by management tools and services for gathering statistics and monitoring the current status of vCPUs. Signed-off-by: Dmytro Semenets <[email protected]> Signed-off-by: Dmytro Firsov <[email protected]>
The size is passed in bytes, not in megabytes. So rename the parameter to avoid confusion. Signed-off-by: Mykyta Poturai <[email protected]> Signed-off-by: Dmytro Firsov <[email protected]>
Document all of the public functions in the domctl API with doxygen Signed-off-by: Mykyta Poturai <[email protected]> Signed-off-by: Dmytro Firsov <[email protected]>
If 0 is passed as domain id to the Xen createdomain hypercall, it will allocate a new domain id and return it via the domctl structure. Allow callers to access this new domain id via a pointer arg. This will allow to create domains without explicitly specifying the domain id for them. Signed-off-by: Mykyta Poturai <[email protected]> Signed-off-by: Dmytro Firsov <[email protected]>
Add a new Kconfig option CONFIG_XEN_DOMCTL_INTERFACE_VERSION that allows to change the version of the Domctl interface used by Zephyr to issue domctl hypercalls. Add compile-time checks to enable or disable certain Domctl operations based on the selected Domctl interface version. For now versions 0x15, 0x16, and 0x17 are supported. Also it required to correctly guard domctl call that were not supported prior to specified version. Signed-off-by: Mykyta Poturai <[email protected]> Signed-off-by: Dmytro Firsov <[email protected]>
Add a new Kconfig option CONFIG_XEN_SYSCTL_INTERFACE_VERSION that allows to change the version of the Sysctl interface used by Zephyr to issue sysctl hypercalls. For now versions 0x15 is supported. Signed-off-by: Mykyta Poturai <[email protected]> Signed-off-by: Dmytro Firsov <[email protected]>
Add wrappers for following XEN_DMOP_* hypercalls.
These enables Xen device model control path:
dm_op provides operations to create/manage the ioreq server
so guest MMIO accesses are trapped and handled by the hypervisor.
These are guarded by CONFIG_XEN_DMOP.
- dmop
- dmop_create_ioreq_server
XEN_DMOP_create_ioreq_server
- dmop_map_io_range_to_ioreq_server
XEN_DMOP_map_io_range_to_ioreq_server
- dmop_set_ioreq_server_state
XEN_DMOP_set_ioreq_server_state
- dmop_nr_vcpus
XEN_DMOP_nr_vcpus
- dmop_set_irq_level:
XEN_DMOP_set_irq_level
Signed-off-by: TOKITA Hiroshi <[email protected]>
Import `zephyr-xenlib` module. That contains xen public headers. Signed-off-by: TOKITA Hiroshi <[email protected]>
This introduces the vhost driver framework, providing standard APIs for VIRTIO backend implementations in Zephyr. Includes vringh utility for host-side VIRTIO ring processing based on Linux kernel implementation. Signed-off-by: TOKITA Hiroshi <[email protected]>
Implements VirtIO backend over Xen MMIO interface Signed-off-by: TOKITA Hiroshi <[email protected]>
Add sample application demonstrating vhost driver usage for VIRTIO backend implementations. Includes basic setup and configuration examples for Xen MMIO VirtIO backend. Signed-off-by: TOKITA Hiroshi <[email protected]>
de7c012 to
3641e2d
Compare
|
The xenstore client functionality has been moved to zephyr-xenlib.
In Zephyr, we rebase every time there's a conflict, #95525, #95556, and #96727 have not yet been merged, but once they are merged, there will only be the last three primary commits. We apologize for the inconvenience and appreciate your continued support. |



This PR introduces the VHost driver framework for Zephyr, enabling VIRTIO backend implementations with initial support for Xen hypervisor environments.
This means we can use(create) Zephyr as VIRTIO devices in a Xen (and potentially other hypervisors).
VHost Driver Framework
Standard VHost API: Unified interface for VirtIO backend implementations
vringh Integration: Host-side VirtIO ring handling based on Linux kernel design
Xen MMIO VIRTIO Backend
Implementing VIRTIO-MMIO in a Xen environment using the VHost driver framework
Enhanced Xen Infrastructure
Some enhancements of Xen functions
XenStore Integration: Key-value store access for domain configuration
Add more hypercall wrapper: DM-op, scheduler, ...
note:
This pr needs #91643 finished.