Commit graph zephyr/drivers/xen/Kconfig
Author SHA1 Message Date
Sergiy Kibrik
032166627b drivers: xen: add xen_flask_op hypercall wrappers
This set of subops is used to access and modify some parameters of
FLASK security server and access vector cache.

Signed-off-by: Sergiy Kibrik <Sergiy_Kibrik@epam.com>
2026-09-23 10:36:28 +01:00
Vladyslav Goncharuk
80f24c58f1 sys: add boot FDT handling
Add a small OS helper for validating and copying a boot firmware device
tree blob into caller-owned storage.

The helper checks the FDT magic and total-size fields, verifies that
the caller-provided destination is large enough, copies the blob, and
returns 0 or a negative errno value. It does not own the destination
buffer or make policy decisions about which firmware argument contains
an FDT.

Add optional Xen support for preserving the boot device tree blob from
the first firmware argument when running on xenvm. The Xen driver code
owns the storage and policy, then exposes the copied data through
xen_fdt_get().

Signed-off-by: Vladyslav Goncharuk <vladyslav_goncharuk@epam.com>
Assisted-by: Codex:gpt-5
2026-09-18 11:14:23 +01:00
Oleksii Moisieiev
26d1dce50e drivers: xen: add Xen extended regions driver
Introduce a driver for the extended regions provided by Xen to Zephyr,
running as Xen Domain-0. Extended regions are the unmapped spaces in
Stage 2 address space, and can be used by Zephyr for foreign mapping,
i.e. mapping pages managed by Xen or belonging to other domains. The
regions are configured via the regs property in the hypervisor node,
compatible with xen,xen.

For example, the following device-tree overlay:

&hypervisor {
    reg = < 0x0 0x40200000 0x0 0x1000000
            0x0 0x40400000 0x0 0x1FC00000
            0x0 0x80000000 0x1 0x40000000>;
};

will allocate two extended regions:
- 0x40400000 with size 0x1fc00000
- 0x80000000 with size 0x140000000

The first region, 0x40200000 (size 0x1000000), is used for grant_tables
and will be ignored.

Signed-off-by: Oleksii Moisieiev <oleksii_moisieiev@epam.com>
Signed-off-by: Mykola Kvach <mykola_kvach@epam.com>
Signed-off-by: Svitlana Drozd <svitlana_drozd@epam.com>
2026-05-15 12:27:44 -05:00
Grygorii Strashko
db1bea3ae2 drivers: xen: add XEN_EVENTS Kconfig option
The Xen events channel driver consume 72K of RAM, but may not be
required in all use cases.

Added a XEN_EVENTS Kconfig option so that Xen events can be gracefully
disabled if not required. Updated the relevant CMakeLists.txt and
Kconfig files to guard the inclusion of the Xen events driver and its
source files by this option.

Signed-off-by: Grygorii Strashko <grygorii_strashko@epam.com>
Signed-off-by: Svitlana Drozd <svitlana_drozd@epam.com>
2026-01-30 16:56:52 -06:00
TOKITA Hiroshi
571f5b92a0 drivers: xen: add DMOP hypercall wrappers
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 <tokita.hiroshi@gmail.com>
2025-11-20 06:06:43 -05:00
Dmytro Firsov
cd31a41328 drivers: xen: gnttab: limit number of grant frames via config
Xen allocates a region that should be used as a place for grant table
mapping and passes it via the device tree. By design, this region may
be quite large (up to 4096+ frames/pages), but the number of frames is
usually limited by the max_grant_frames domain parameter (usually 32 or
64).

Linux maps these frames on demand and when reaches mentioned limit
it just stops expanding. At the same time, previous implementation of
Zephyr gnttab driver calculated the number of grant frames by dividing
whole region by page size and tried to map it during init. If the
region specified in the device tree was larger than the
max_grant_frames set by Xen, it would fail on ASSERT, since Xen would
return an error.

To address these issues CONFIG_NR_GRANT_FRAMES was introduced. It
allows to limit size of grant table and map only required number of
pages. Additionally, a check for max_grant_frames Xen limit was
introduced to initialization - if this value will be less than
CONFIG_NR_GRANT_FRAMES, k_panic() will be called.

Signed-off-by: Dmytro Firsov <dmytro_firsov@epam.com>
2025-02-14 10:41:33 +01:00
Dmytro Firsov
c9d2fb7d40 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>
2023-09-15 11:15:00 +01:00
Dmytro Firsov
f4cea5da70 xenvm: drivers: xen: add Xen grant table driver
This commit introduces driver for granting access for own grant
table and for mapping/unmapping foreign gref. Grant tables are used
for data exchange between Xen domains via shared memory page(s) (e.g.
for sharing ring buffer with driver data) This functionality is
widely used and needed for implementing PV backend/frontend drivers.

Signed-off-by: Dmytro Firsov <dmytro_firsov@epam.com>
2022-06-28 22:34:26 -04:00