Skip to content

Commit 7a09c81

Browse files
dbkinderlijinxia
authored andcommitted
doc: fix primer reST errors, update folder layout
Remove UEFI boot material that was causing doc build to fail (seems to be a duplicate of material in the Getting Started Guide anyway) Fix reST formatting for the DM memory allocation section. Update folder layout description Fixes: #202 Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
1 parent 130f45e commit 7a09c81

File tree

1 file changed

+65
-56
lines changed

1 file changed

+65
-56
lines changed

doc/primer/index.rst

Lines changed: 65 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,20 @@ Source Tree Structure
2424

2525
Understanding the ACRN hypervisor and the ACRN device model source tree
2626
structure is helpful for locating the code associated with a particular
27-
hypervisor and device emulation feature. The ACRN hypervisor and the
28-
ACRN device model source tree provides the following top-level
29-
directories:
27+
hypervisor and device emulation feature.
28+
29+
The ACRN source code (and documentation) are maintained in the
30+
https://github.com/projectacrn/acrn-hypervisor repo, with the
31+
hypervisor, device model, tools, and documentation in their own
32+
folders::
33+
34+
acrn-hypervisor
35+
├─ hypervisor
36+
├─ devicemodel
37+
├─ tools
38+
└─ doc
39+
40+
Here's a brief description of each of these source tree folders:
3041

3142
ACRN hypervisor source tree
3243
===========================
@@ -68,9 +79,6 @@ ACRN Device Model source tree
6879
**hw/**
6980
Hardware emulation code, with the following subdirectories:
7081

71-
**acpi/**
72-
ACPI table generator.
73-
7482
**pci/**
7583
PCI devices, including VBS-Us (Virtio backend drivers in user-space).
7684

@@ -82,7 +90,24 @@ ACRN Device Model source tree
8290
files are used to generate the :ref:`acrn_apis` documentation)
8391

8492
**samples/**
85-
include files for all public APIs (doxygen comments in these source
93+
scripts (included in the Clear Linux build) for setting up the network
94+
and launching the User OS on the platform.
95+
96+
ACRN Tools source tree
97+
=============================
98+
99+
The tools folder holds source code for ACRN-provided tools such as:
100+
101+
acrnlog
102+
a userland tool to capture the log output from the currently running
103+
hypervisor, and from the last previous run if the hypervisor crashed.
104+
105+
acrnctl
106+
a utility to create, delete, list, launch, and stop a User OS (UOS).
107+
108+
acrntrace
109+
a Service OS (SOS) utility to capture trace data and scripts to
110+
analyze the collected data.
86111

87112
ACRN documentation source tree
88113
==============================
@@ -95,10 +120,6 @@ reading now.) Developers can view this content either in its raw form as
95120
the HTML content and view it with a web browser directly on your
96121
workstation, useful if you're contributing documentation to the project.
97122

98-
**_templates/**
99-
Sphinx configuration updates for the standard read-the-docs templates
100-
used to format the generated HTML output
101-
102123
**api/**
103124
ReST files for API document generation
104125

@@ -129,6 +150,10 @@ workstation, useful if you're contributing documentation to the project.
129150
Sphinx folder for extras added to the generated output (such as custom
130151
CSS additions)
131152

153+
**_templates/**
154+
Sphinx configuration updates for the standard read-the-docs templates
155+
used to format the generated HTML output
156+
132157
CPU virtualization
133158
******************
134159

@@ -912,55 +937,39 @@ or
912937
913938
screen /dev/pts/0
914939
915-
UEFI Boot
916-
*********
917-
This section introduces UEFI boot support by ACRN.
918940
919-
Usage of acrn.efi
920-
=================
941+
Device Manager memory allocation mechanism
942+
******************************************
921943

922-
ACRN supports boot from UEFI FW, this section is the UEFI boot HOWTO under
923-
Clear Linux environment.
944+
There are two Device Manager memory allocation mechanisms available:
924945

925-
The pre-condition is like below:
926-
- You have installed the Service OS (bare-metal for now)
927-
- CL Bootloader is "\EFI\org.clearlinux\bootloaderx64.efi"
928-
- Boot device is '/dev/sda'
929-
- EFI System Partition (ESP) is '1'
946+
- Contiguous Memory Allocator (CMA), and
947+
- Huge Page Tables (HugeTLB). HugeTLB is the default.
930948

931-
Suggest to follow the following step:
932-
1. Build out the acrn.efi image with command "make PLATFORM=uefi".
933-
2. Put the acrn.efi under "\EFI\acrn\"
934-
3. To change the default boot entry to boot the ACRN hypervisor, enter:
935-
# efibootmgr -c -l "\EFI\acrn\acrn.efi" -d /dev/sda -p 1 \
936-
-L "ACRN Hypervisor" -u "bootloader=\EFI\org.clearlinux\bootloaderx64.efi"
937-
4. Update the bsp/uefi/clearlinux/acrn.conf file by filling the field
938-
<UUID of rootfs partition> with the your native rootfs partition uuid.
939-
5. Copy bsp/uefi/clearlinux/acrn.conf to loader\\entries\\ directory.
940-
6. Reboot.
949+
To choose CMA, do the following:
941950

951+
1) Add ``cma=reserved_mem_size@recommend_memory_offset-0``, (for example
952+
``cma=2560M@0x100000000-0``) to the SOS cmdline in ``acrn.conf``
942953

943-
DM memory allocation mechanism
944-
==============================
954+
2) Start ``acrn-dm`` *without* the ``-T`` option
955+
956+
To support HugeTLB, do the following:
957+
958+
1) Do huge page reservation
959+
960+
- For 1G huge page reservation, add ``hugepagesz=1G hugepages=reserved_pg_num``
961+
(for example, ``hugepagesz=1G hugepages=4``) to the SOS cmdline in
962+
``acrn.conf`` (for EFI)
963+
964+
- For 2M huge page reservation, after the SOS starts up, run the
965+
command::
966+
967+
echo reserved_pg_num > /sys/kernel/mm/hugepages/hugepages-2048kB/nr_hugepages
968+
969+
.. note::
970+
You can use 2M reserving method to do reservation for 1G page size, but it
971+
may fail. For an EFI platform, you may skip 1G page reservation
972+
by using a 2M page, but make sure your huge page reservation size is
973+
large enough for your usage.
945974

946-
There are two kinds of DM memory allocation mechanism - CMA & Hugetlb, they can
947-
be choose to support but hugetlb will become the default one.
948-
949-
To support CMA, please make sure:
950-
1) add "cma=reserved_mem_size@recommend_memory_offset-0" like
951-
"cma=2560M@0x100000000-0" to the SOS cmdline in acrn.conf
952-
2) start acrn-dm without "-T" option
953-
954-
To support Hugetlb, please make sure:
955-
1) Do huge page reservation
956-
- For 1G huge page reservation, add "hugepagesz=1G hugepages=reserved_pg_num"
957-
like "hugepagesz=1G hugepages=4" to the SOS cmdline(in acrn.conf for EFI)
958-
- For 2M huge page reservation, after SOS start up,
959-
echo reserved_pg_num > /sys/kernel/mm/hugepages/hugepages-2048kB/nr_hugepages
960-
- NOTE:
961-
You can use 2M reserving method to do reservation for 1G page size, but it
962-
may fail.
963-
For EFI platform, you may skip 1G page reservation by just using 2M page,
964-
but make sure your huge page reservation size is enough for your usage.
965-
2) Let acrn-dm use hugetlb
966-
- start acrn-dm with "-T" option
975+
2) Start ``acrn-dm`` *with* the ``-T`` option.

0 commit comments

Comments
 (0)