Skip to content

wip: draft porting guide#81

Draft
josecm wants to merge 2 commits into
mainfrom
wip/porting_guide
Draft

wip: draft porting guide#81
josecm wants to merge 2 commits into
mainfrom
wip/porting_guide

Conversation

@josecm

@josecm josecm commented Jan 19, 2024

Copy link
Copy Markdown
Member

This PR details the steps for porting the Bao Hypervisor to a new platform. Still WIP, but any feedback is welcome.

@Diogo21Costa Diogo21Costa self-requested a review January 29, 2024 16:32
Comment thread source/bao_hyp/user_manual/porting.rst Outdated
Comment on lines +4 to +8
The Bao Hypervisor only contains architecture-specific drivers (e.g., interrupt controllers or
IOMMUS). Therefore porting the hypervisor essentially resumes to two simple operation: creating a
platform description folder containing a platform definition source and header files which
indicates, among others, the number of CPUs or the memory available. The exception is an UART driver
used fore logging, so if a driver is not available for a UART on the target platform this might

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In my opinion, the first sentence doesn't contribute significantly. It looks like a bit disconnected from the remaining text.

Suggested change
The Bao Hypervisor only contains architecture-specific drivers (e.g., interrupt controllers or
IOMMUS). Therefore porting the hypervisor essentially resumes to two simple operation: creating a
platform description folder containing a platform definition source and header files which
indicates, among others, the number of CPUs or the memory available. The exception is an UART driver
used fore logging, so if a driver is not available for a UART on the target platform this might
Porting the hypervisor involves two basic steps: (i) creating a platform description folder with
source and header files that specify platform details, such as the number of CPUs or available
memory, and (ii) integrating a UART driver used for logging, so if a driver is not available for a
UART on the target platform this might require writing a custom driver.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addressed in 04edb5e.

Comment thread source/bao_hyp/user_manual/porting.rst Outdated
Comment on lines +9 to +10
require writing such a driver. Finally, given for some platforms provide a custom mechanism to
define DMA device Master IDs required for configuring IOMMUs, one might require to configure

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

At this point, it would be interesting to refer to some examples to contextualize the firmware changes

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will done in later sections.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that should be done in a later section dedicated to describing how to define DMA device master IDs

Comment thread source/bao_hyp/user_manual/porting.rst Outdated
Comment thread source/bao_hyp/user_manual/porting.rst Outdated
Comment on lines +97 to +98
- **base** [mandatory] - Is the base physical address of that memory region. Must be aligned to the minimum architecture's page size;
- **size** [mandatory] - The size of the memory region. Must be aligned to the minimum architecture's page size;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- **base** [mandatory] - Is the base physical address of that memory region. Must be aligned to the minimum architecture's page size;
- **size** [mandatory] - The size of the memory region. Must be aligned to the minimum architecture's page size;
- **base** [mandatory] - Is the base physical address of that memory region.
- **size** [mandatory] - The size of the memory region.
.. warning::
Ensure that the memory ``base`` and ``size`` are aligned to the minimum architecture's page size.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change the format to inline code.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addressed in 04edb5e.

Comment thread source/bao_hyp/user_manual/porting.rst Outdated
Comment on lines +100 to +101
Note that, by convention, we do not add on-chip/scratcpad SRAMs as a platform memory region as the hypervisor as an uniform view of memory.
This regions should be assigned to guests in the form of devices.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Note that, by convention, we do not add on-chip/scratcpad SRAMs as a platform memory region as the hypervisor as an uniform view of memory.
This regions should be assigned to guests in the form of devices.
.. note::
By convention, we do not add on-chip/scratcpad SRAMs as a platform memory region as the hypervisor as an uniform view of memory. This regions should be assigned to guests in the form of devices.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addressed in 04edb5e.

@danielRep danielRep self-assigned this Feb 14, 2024
@bao-project bao-project deleted a comment from Diogo21Costa Feb 14, 2024

@danielRep danielRep left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't have any major suggestions to add on the structure of the document. I considerer it already touches all the necessary topics.
Few points:

  • inline code format must be used be used for file paths, file names, shell commands, programming language directives/keywords/identifiers, syntax characters as required in the Documentation Guidelines;
  • when using tabs, the contents of each tab must one step indented from the ..tab: directive;
  • an image from the folder structure of a platform definition would be helpful

Comment thread source/bao_hyp/user_manual/porting.rst Outdated
Comment thread source/bao_hyp/user_manual/porting.rst Outdated
Comment thread source/bao_hyp/user_manual/porting.rst Outdated
Comment thread source/bao_hyp/user_manual/porting.rst Outdated
Comment thread source/bao_hyp/user_manual/porting.rst Outdated
Comment thread source/bao_hyp/user_manual/porting.rst Outdated
Comment thread source/bao_hyp/user_manual/porting.rst Outdated
Comment thread source/bao_hyp/user_manual/porting.rst
Comment thread source/bao_hyp/user_manual/porting.rst
Comment thread source/bao_hyp/user_manual/porting.rst Outdated
@DavidMCerdeira DavidMCerdeira force-pushed the main branch 5 times, most recently from 1654e31 to d42b0fa Compare August 26, 2024 10:38
Comment thread source/bao_hyp/user_manual/porting.rst
Comment thread source/bao_hyp/user_manual/porting.rst Outdated
Comment thread source/bao_hyp/user_manual/porting.rst Outdated
Comment thread source/bao_hyp/user_manual/porting.rst
@danielRep danielRep force-pushed the wip/porting_guide branch 2 times, most recently from 11de124 to 4d5c5b3 Compare August 8, 2025 17:43
josecm and others added 2 commits August 8, 2025 18:48
Signed-off-by: Jose Martins <josemartins90@gmail.com>
Signed-off-by: Daniel Oliveira <drawnpoetry@gmail.com>
@danielRep danielRep removed their assignment Aug 8, 2025
@danielRep danielRep dismissed their stale review August 8, 2025 17:52

I'm in charge now of this PR, therefore I'm withdrawing as a reviewer.

@danielRep danielRep requested review from danielRep and removed request for danielRep August 8, 2025 17:55
@danielRep

Copy link
Copy Markdown
Member

This PR details the steps for porting the Bao Hypervisor to a new platform. Still WIP, but any feedback is welcome.

I'm taking over this PR.

@DavidMCerdeira DavidMCerdeira self-assigned this Aug 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants