Skip to content

Commit

Permalink
update(guest_img): update separately_loaded description
Browse files Browse the repository at this point in the history
Signed-off-by: Diogo Costa <diogoandreveigacosta@gmail.com>
  • Loading branch information
Diogo21Costa committed Jan 17, 2024
1 parent 1c373fe commit 4b057cd
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 8 deletions.
24 changes: 16 additions & 8 deletions source/bao_hyp/config.rst
Original file line number Diff line number Diff line change
Expand Up @@ -128,21 +128,16 @@ guest side. It encompasses the following options:
where:

- **base_addr** [mandatory] - corresponds to the ``image`` load address in the VM's address space;
- **load_addr** [mandatory] - corresponds to the ``image`` load address in the hypervisor address
space. This value can be defined using the macro VM_IMAGE_OFFSET(img_name);
- **load_addr** [mandatory] - corresponds to the ``image`` load address in physical memory/physical
address space. This value can be defined using the macro VM_IMAGE_OFFSET(img_name);
- **size** [mandatory] - corresponds to the image size. For builtin images declared using
`VM_IMAGE`, this value can be defined using the macro VM_IMAGE_SIZE(img_name);
- **separately_loaded** [optional] - informs the hypervisor if the VM image is to be loaded
separately by a bootloader; By default, separately_loaded is set as false;
- **inplace** [optional]- use the image inplace and don’t copy the image. By default, inplace is
set as false;

.. figure:: img/vm-image.svg
:align: center
:name: vm-image-fig

To ease the process of configuring the image running on each VM, the configuration of Bao allows
the use of two different macros:
To simplify the image configuration process for each VM, Bao allows the use of two macros:

1. **VM_IMAGE_BUILTIN** - This macro simplifies image configuration by requiring only the
``img_name`` and the image ``base_addr``. This macro specifies both the base address and image
Expand All @@ -151,6 +146,19 @@ the use of two different macros:
2. **VM_IMAGE_LOADED** - This macro requires additional configurations. It requires the definition
of image ``base_addr``, the image ``load_addr``, and the image ``size``.

If the ``separately_loaded`` parameter is configured as false, the hypervisor interprets this
setting as the offset of the built-in guest image within its own image, denoted as
``VM_IMAGE_OFFSET``. During run-time, the hypervisor adjusts this value to be subsequently
interpreted as a physical address. This adjustment involves adding the address at which the
hypervisor itself was loaded. However, if the ``separately_loaded`` parameter is configured as true,
the guest image is not embedded in the hypervisor image; instead, it is loaded independently. For
more details, refer to the figure below.

.. figure:: img/guest-image.svg
:align: center
:name: vm-image-fig


Virtual Machine Configuration
*****************************

Expand Down
Loading

0 comments on commit 4b057cd

Please sign in to comment.