Zephyr API Documentation 4.4.99
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
Xen memory management

Manage domain physmaps and Xen-owned resources. More...

Files

file  memory.h
 Xen memory management operations.

Functions

int xendom_add_to_physmap (int domid, unsigned long idx, unsigned int space, xen_pfn_t gpfn)
 Add a single mapping to a domain physmap.
int xendom_add_to_physmap_batch (int domid, int foreign_domid, unsigned int space, unsigned int size, xen_ulong_t *idxs, xen_pfn_t *gpfns, int *errs)
 Add multiple mappings to a domain physmap.
int xendom_remove_from_physmap (int domid, xen_pfn_t gpfn)
 Remove a mapping from a domain physmap.
int xendom_populate_physmap (int domid, unsigned int extent_order, unsigned int nr_extents, unsigned int mem_flags, xen_pfn_t *extent_start)
 Populate guest frames with memory.
int xendom_acquire_resource (domid_t domid, uint16_t type, uint32_t id, uint64_t frame, uint32_t *nr_frames, xen_pfn_t *frame_list)
 Acquire a Xen-managed resource mapping for a domain.

Detailed Description

Manage domain physmaps and Xen-owned resources.

Function Documentation

◆ xendom_acquire_resource()

int xendom_acquire_resource ( domid_t domid,
uint16_t type,
uint32_t id,
uint64_t frame,
uint32_t * nr_frames,
xen_pfn_t * frame_list )

#include <zephyr/xen/memory.h>

Acquire a Xen-managed resource mapping for a domain.

Parameters
domidTarget domain identifier.
typeXen resource type, for example XENMEM_resource_ioreq_server.
idResource instance identifier interpreted according to type.
frameStarting frame within the Xen resource. Ignored when *nr_frames is 0 (size query).
[in,out]nr_framesOn entry, number of frames to acquire. On return, the number of frames that Xen reports for the request.
[out]frame_listGuest frame list buffer: input GFNs for HVM guests, output MFNs for PV guests.
Returns
0 on success, negative errno value on failure.

◆ xendom_add_to_physmap()

int xendom_add_to_physmap ( int domid,
unsigned long idx,
unsigned int space,
xen_pfn_t gpfn )

#include <zephyr/xen/memory.h>

Add a single mapping to a domain physmap.

Parameters
domidDomain whose physmap is updated. Unprivileged callers must use DOMID_SELF.
idxIndex within the Xen mapping space identified by space.
spaceMapping space selector, typically one of the XENMAPSPACE_* constants.
gpfnGuest frame number where the mapping becomes visible.
Returns
0 on success, negative errno value on failure.

◆ xendom_add_to_physmap_batch()

int xendom_add_to_physmap_batch ( int domid,
int foreign_domid,
unsigned int space,
unsigned int size,
xen_ulong_t * idxs,
xen_pfn_t * gpfns,
int * errs )

#include <zephyr/xen/memory.h>

Add multiple mappings to a domain physmap.

Parameters
domidDomain whose physmap is updated. Unprivileged callers must use DOMID_SELF.
foreign_domidForeign domain identifier used with XENMAPSPACE_gmfn_foreign. Pass 0 for the other mapping spaces.
spaceMapping space selector, typically one of the XENMAPSPACE_* constants.
sizeNumber of mappings described by the arrays.
idxsArray of mapping-space indexes.
gpfnsArray of guest frame numbers that receive the mappings.
[out]errsArray that receives a per-entry Xen status code.
Returns
0 on success, negative errno value on failure.

◆ xendom_populate_physmap()

int xendom_populate_physmap ( int domid,
unsigned int extent_order,
unsigned int nr_extents,
unsigned int mem_flags,
xen_pfn_t * extent_start )

#include <zephyr/xen/memory.h>

Populate guest frames with memory.

Parameters
domidDomain whose physmap is populated. Unprivileged callers must use DOMID_SELF.
extent_orderExtent order used by Xen, where each extent covers 2^extent_order pages.
nr_extentsNumber of entries in extent_start.
mem_flagsXen memory flags. Arm guests currently pass 0.
extent_startArray of guest frame numbers that receive the populated extents.
Returns
Number of populated extents on success, negative errno value on failure.

◆ xendom_remove_from_physmap()

int xendom_remove_from_physmap ( int domid,
xen_pfn_t gpfn )

#include <zephyr/xen/memory.h>

Remove a mapping from a domain physmap.

Parameters
domidDomain whose physmap is updated. Unprivileged callers must use DOMID_SELF.
gpfnGuest frame number to remove.
Returns
0 on success, negative errno value on failure.