Skip to content
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

feat(doc): add guest configuration to bao-classic config documentation #78

Open
wants to merge 71 commits into
base: wip/bao-classic_config
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
71 commits
Select commit Hold shift + click to select a range
746823c
feat(doc): add guest configuration introduction
Diogo21Costa Dec 7, 2023
407c8dd
feat(doc): add guest image configuration
Diogo21Costa Dec 7, 2023
c92f56b
feat(doc): add VM configuration - introduction
Diogo21Costa Jul 29, 2023
413b37b
feat(doc): add VM configuration - number of vCPUs
Diogo21Costa Jul 29, 2023
b6db67a
feat(doc): add VM configuration - memory mapping
Diogo21Costa Jul 29, 2023
da5b673
feat(doc): add VM configuration - IPC
Diogo21Costa Jul 29, 2023
b78ee89
feat(doc): add VM configuration - devices
Diogo21Costa Jul 29, 2023
c22ba39
feat(doc): add VM configuration - memory management
Diogo21Costa Dec 7, 2023
3d43ffb
feat(doc): add VM configuration - architectural-specific configurations
Diogo21Costa Jul 29, 2023
1300f5a
feat(doc): add cpu affinity
Diogo21Costa Jul 29, 2023
7415b8d
feat(doc): add cache coloring
Diogo21Costa Jul 29, 2023
77c4429
fix(doc): include format tweaks to use the new column limit of 100
Diogo21Costa Dec 7, 2023
223e053
fix(img): update cpu-affinity
Diogo21Costa Jan 5, 2024
b5096f0
fix(heading): update section naming
Diogo21Costa Dec 23, 2023
88b3e28
fix(vm_config): fix introduction text
Diogo21Costa Jan 5, 2024
fedaf73
fix(vm_config): update vm entry description
Diogo21Costa Dec 23, 2023
9d82a52
fix(vm_config): fix struct vm_image declaration
Diogo21Costa Jan 5, 2024
8e218ad
fix(guest_image): update size field description
Diogo21Costa Jan 5, 2024
4af39fd
fix(typo): improve Virtual Machine Configuration section
Diogo21Costa Jan 5, 2024
31f18ac
update(doc): refactor Virtual Machine Configuration description
Diogo21Costa Jan 5, 2024
0155757
update(VM Config): improve struct description
Diogo21Costa Jan 5, 2024
4aa86ec
update(doc): improve Virtual Machine Configuration description
Diogo21Costa Jan 5, 2024
d6c2e0a
update(n_cpus): add warning to number of vCPUs description
Diogo21Costa Jan 5, 2024
580d626
fix(vm_config): rename memory regions subsection
Diogo21Costa Jan 5, 2024
5f9b9ea
fix(vm_config): improve region_num description
Diogo21Costa Jan 5, 2024
9bf7c0c
update(mem_reg): include small entry
Diogo21Costa Jan 5, 2024
1ca6f2e
update(mem_reg): include important notes
Diogo21Costa Jan 5, 2024
1c373fe
update(mem_reg): include details on the use of place_phys
Diogo21Costa Jan 5, 2024
4b057cd
update(guest_img): update separately_loaded description
Diogo21Costa Jan 17, 2024
3264cd3
fix(vm_config): fix format
Diogo21Costa Jan 17, 2024
af0601c
fix(vm_config): fix format
Diogo21Costa Jan 17, 2024
ba5a87f
fix(guest_img): fix format
Diogo21Costa Jan 17, 2024
42c87ce
fix(guest_img): remove outdated image
Diogo21Costa Jan 17, 2024
987878a
update(guest_img): empashise the importance of using macros to configure
Diogo21Costa Jan 17, 2024
dd49512
update(guest_img): include macros use-cases examples
Diogo21Costa Jan 17, 2024
e9e1c43
update(mem_manag): fix struct declaration
Diogo21Costa Jan 17, 2024
431be7f
update(arch): fix typo
Diogo21Costa Jan 17, 2024
e501eb4
update(cache_col): update image
Diogo21Costa Jan 17, 2024
2bbd78f
update(cache_col): improve coloring description
Diogo21Costa Jan 19, 2024
404de5a
update(ipc): add note regarding to shmem size and base
Diogo21Costa Jan 19, 2024
854fe14
update(ipc): add overview of IPC workflow
Diogo21Costa Jan 19, 2024
ae5a5bd
update(ipc): include note regarding to base and size
Diogo21Costa Jan 19, 2024
c77efcb
fix(vm_config): improve readability
Diogo21Costa Mar 12, 2024
7ea8acb
fix(guest_image): improve readability
Diogo21Costa Mar 12, 2024
a899626
fix(vm_config): improve readability
Diogo21Costa Mar 12, 2024
e671c5b
ref(arch): remove mem. management section and split arch specific config
Diogo21Costa Mar 12, 2024
3594c13
fix(format): include format tweaks
Diogo21Costa Mar 12, 2024
df43831
fix(cpu_affinity): include improved description
Diogo21Costa Mar 12, 2024
7bfac37
fix(doc): improve readability
Diogo21Costa May 22, 2024
8a6069e
fix(vm_config): update image struct definition
Diogo21Costa Sep 4, 2024
00a28ff
fix(doc): improve readability
Diogo21Costa Sep 4, 2024
69735d9
fix(doc): remove content from memory regions section
Diogo21Costa Sep 4, 2024
e564d6e
fix(doc): redefine IPC nomenclature
Diogo21Costa Sep 4, 2024
696ae37
fix(doc): improve IPC section readability
Diogo21Costa Sep 4, 2024
a83bb96
fix(doc): fix typo
Diogo21Costa Sep 4, 2024
831e066
fix(doc): improve readability by introducing GA and PA terms
Diogo21Costa Sep 4, 2024
3558ec9
fix(doc): update device configuration note
Diogo21Costa Sep 4, 2024
d2efdcf
fix(doc): remove empty subsection
Diogo21Costa Sep 4, 2024
a139c99
fix(doc): update MPU VA and PA configuration description
Diogo21Costa Sep 4, 2024
8b6eb3b
feat(doc): add shared memory configuration
Diogo21Costa Jul 29, 2023
33652e5
fix(doc): improve shared memory documentation
Diogo21Costa Sep 17, 2024
b4d14d8
fix(doc): improve shared memory documentation
Diogo21Costa Sep 17, 2024
f6b8cde
fix(doc): improve shared memory documentation
Diogo21Costa Sep 17, 2024
07452d7
fix(doc): improve shared memory documentation
Diogo21Costa Sep 17, 2024
3f2a6f1
fix(doc): improve shared memory documentation
Diogo21Costa Sep 17, 2024
12a303c
fix(doc): fix guest image documentation
Diogo21Costa Sep 19, 2024
9ffd91e
fix(doc): fix VM config documentation
Diogo21Costa Sep 19, 2024
9744a25
fix(doc): fix shared memory documentation
Diogo21Costa Sep 19, 2024
b778726
fix(doc): fix devices documentation
Diogo21Costa Sep 19, 2024
0c360b5
fix(doc): add note regarding to MMIO mapping
Diogo21Costa Dec 2, 2024
7cc5013
fix(doc): update note regarding to MMIO mapping
Diogo21Costa Jan 29, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
ref(arch): remove mem. management section and split arch specific config
Signed-off-by: Diogo Costa <[email protected]>
Diogo21Costa committed Mar 12, 2024
commit e671c5b5c256bfde087aaefd017f54e8d6ffbde4
127 changes: 92 additions & 35 deletions source/bao_hyp/config.rst
Original file line number Diff line number Diff line change
@@ -209,7 +209,6 @@ definition of:
- ``Memory regions`` - see details in `Memory Regions`_;`
- ``Inter-Process Comunication (IPC)`` - see details in `Inter-Process Communication (IPC)`_;
- ``Devices`` - see details in `Devices`_;
- ``Memory Management`` - see details in `Memory Management`_;
- ``Architectural-Specific Configurations`` - see details in `Architectural-Specific
Configurations`_;

@@ -373,52 +372,110 @@ where:
Specifying a number of interrupts in the ``interrupts`` buffer that differs from the
``interrupt_num`` may result in unforeseen behavior.

5. Memory Management
####################
.. _Memory Management:

``mmu`` [optional] - In MPU-based platforms which might also support virtual memory (i.e. aarch64
cortex-r) the hypervisor sets up the VM using an MPU by default. If the user wants this VM to use
the MMU they must set the config ``mmu`` parameter to true;

6. Architectural-Specific Configurations
5. Architectural-Specific Configurations
########################################
.. _Architectural-Specific Configurations:

- ``arch`` [mandatory] - allows the definition of architecture dependent configurations and is
configured through the following structure:

.. code-block:: c
.. tabs::
.. tab:: Arm

struct arch_vm_platform {

// Configuration of the Generic Interrupt Controller (GIC)
struct vgic_dscrp {
paddr_t gicd_addr;
paddr_t gicc_addr;
paddr_t gicr_addr;
size_t interrupt_num;
} gic;

// Configuration of the System Memory Management Unit (SMMU)
struct smmu_config{
streamid_t global_mask;
size_t group_num;
struct smmu_group {
streamid_t mask;
streamid_t id;
} *groups;
} smmu;
};
For the Arm architecure:

.. code-block:: c

where:
struct arch_platform {
struct gic_dscrp {
paddr_t gicc_addr;
paddr_t gich_addr;
paddr_t gicv_addr;
paddr_t gicd_addr;
paddr_t gicr_addr;

irqid_t maintenance_id;
} gic;

struct smmu_dscrp {
paddr_t base;
streamid_t global_mask;
} smmu;

struct clusters {
size_t num;
size_t* core_num;
} clusters;
};

Where, for the GIC interrupt controller ``struct gic_dscrp`` description:

- ``gic.gicc_addr`` [mandatory for GICv2 platforms] - base address for the GIC's CPU Interface;
- ``gic.gich_addr`` [mandatory for GICv2 platforms] - base address for the GIC's Virtual
Interface Control Registers;
- ``gic.gicv_addr`` [mandatory for GICv2 platforms] - base address for the GIC's Virtual CPU
Interface;
- ``gic.gicd_addr`` [mandatory] - base address for the GIC's Distributor;
- ``gic.gicr_addr`` [mandatory for GICv3/4 platforms] - base address for the GIC's
Redistributor;
- ``gic.maintenance_id`` [mandatory] - The interrupt ID for the GIC's maintenance interrupt;

For the SMMU `struct smmu_dscrp`:

- ``smmu.base`` [mandatory] - is the base address for the SMMU;
- ``smmu.global_mask`` [optional; only valid for SMMUv2] - a mask to be applied to all SMMUv2's
Stream Match Registers;


Finally, when CPUs are organized in clusters, in the Arm architecture their IDs are assigned
using an hierarchical schema. To be able to calculate the linearized ID for each core, we
require the port to provide the number of CPUs of cluster in ascending order of AFF1.

.. tab:: RISC-V

For the RISC-V architecture:

.. code-block:: c

struct arch_platform {
union irqc_dscrp {

struct {
paddr_t base;
} plic;

struct {
struct {
paddr_t base;
} aplic;
} aia;

} irqc;

struct {
paddr_t base; // Base address of the IOMMU mmapped IF
irqid_t fq_irq_id;
} iommu;

struct {
paddr_t base;
} aclint_sswi;
};

In case the available interrupt controller is the legacy PLIC:

- ``irqc.plic.base`` [mandatory if PLIC is available] - is the base address for the PLIC;

In case the available interrupt controller is an AIA contaning an APLIC:

- ``irqc.aia.aplic.base`` [mandatory if APLIC is available] - is the base address for the APLIC;

- ``vgic_dscrp`` [mandatory] - corresponds to the configuration of the Generic Interrupt Controller
(GIC);
- ``smmu_config`` [optional] - corresponds to the configuration of the System Memory Management
Unit (SMMU);
When an IOMMU is available:

- ``iommu.base`` [mandatory if IOMMU is available] - is the base address for the IOMMU;
- ``iommu.fq_irq_id`` [mandatory if IOMMU is available] - the Fault Queue interrupt ID (the
current implementatio assumes this is a wired interrupt);

CPU Affinity
************