Skip to content

Commit

Permalink
feat(doc): add shared memory configuration
Browse files Browse the repository at this point in the history
Signed-off-by: Diogo21Costa <[email protected]>
  • Loading branch information
Diogo21Costa committed Sep 6, 2024
1 parent a139c99 commit 8b6eb3b
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 0 deletions.
40 changes: 40 additions & 0 deletions source/bao_hyp/config.rst
Original file line number Diff line number Diff line change
Expand Up @@ -529,6 +529,46 @@ However, this mechanism may not take effect if the physical mapping feature is e
specific memory region. Cache coloring exclusively operates in virtual memory systems, i.e.,
systems featuring Memory Management Units (MMUs) for address translation.

Shared Memory Configuration
---------------------------
.. _Shared Memory Configuration:

In Bao's configuration multiple (``shmem0``, ``shmem1``, ...) or no shared memory can be set. If
at least one shared memory is defined, an ID is assigned to which the shared memory is
associated. Later, this ID can be associated with an IPC in the multi-guest configuration.

.. figure:: img/shmem.svg
:align: center
:name: shmem-fig

|
The configuration of shared memories is done by populating a struct called
``shmem``, as follows:

.. code-block:: c
struct shmem {
size_t size;
bool place_phys;
union {
paddr_t base;
paddr_t phys;
};
};
This struct contains the following parameters:

- **size** [mandatory] - defines the total size of the shared memory. The size of the shared \
memory must always be multiples of 4Kb (0x1000);
- **place_phys** [optional] - shared memory is mapped into the virtual memory and it's \
important to note that the virtual address (VA) might not necessarily be the same as the \
physical address (PA). When ``place_phys`` is set to true, the virtual address corresponds to \
the physical address. By default, ``place_phy`` equals to false;
- **base / phys** [optional] - defines the physical address (base address) of the shared memory.


Configuration File Location
---------------------------

Expand Down
4 changes: 4 additions & 0 deletions source/bao_hyp/img/shmem.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 8b6eb3b

Please sign in to comment.