Skip to content

Commit 4f5844a

Browse files
author
wayne ren
committed
doc: Update the SecureShield docs
1 parent a298b86 commit 4f5844a

8 files changed

+44
-2
lines changed

doc/documents/lib/lib_description.doc

Lines changed: 44 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,21 @@ System resources are resources that are not isolated and protected by MPU, e.g.,
7070
System resources APIs are used by normal containers to access secure system resources. Because secure containers have secure privilege level, then can access secure system resources directly.
7171

7272
### Container Interfaces
73-
A container can provide services to other containers through an interface. An interface is a C function with parameters and return value registered in an access control table
73+
A container can provide services to other containers through an interface. An interface is a C function with parameters and return value registered in an access control table.
74+
75+
As shown below, a container can call the interface of another container through container call. The container interface will be executed in the context of callee container.
76+
77+
\htmlonly
78+
<div class="imagebox">
79+
<div style="width: 600px">
80+
<img src="pic/secureshield_container_interface.jpg" alt="Container interface"/>
81+
<p>Container interface</p>
82+
</div>
83+
</div>
84+
\endhtmlonly
85+
\image latex pic/secureshield_container_interface.jpg "Container interface" width=12cm
86+
87+
Background container has no interfaces as it is a global shared container, i.e., regular C function calls can be performed.
7488

7589
### Resources of a container
7690
A container has implicit resources: code sections (.text, .rodata, .bss, .data) and stack; as well as explicit resources defined in an access control table, e.g., memory mapped resources, system resources and container interfaces
@@ -105,7 +119,35 @@ static CONTAINER_AC_TABLE g_container_act[] = {
105119

106120
According to this access control table, the container is allocated the peripheral area of PIN_MUX, a 0x1000 bytes ram region starting from 0x10000, a GPIO interrupt (INTNO_GPIO), an auxiliary-register area starting from 0x21 with a size of 03. The container also has an interface (tst_func4) to provide the service with 4 arguments in the interface handler function
107121

108-
The resource type describes the kind of resource, such as interrupt, register, or memory. The access-control attribute describes how it is accessed: secure or normal, read/write/execute. The detailed definitions of resource type and access-control attribute can be found in secureshield_vmpu_exports.h.
122+
The resource type describes the kind of resource, such as interrupt, register, or memory. The access-control attribute describes how it is accessed: secure or normal, read/write/execute. The detailed definitions of resource type and access-control attribute is listed as follow.
123+
124+
125+
| Basic Resource Type | Parameters | Comments |
126+
| :---------------------------------: | :-------------------------------------: | :-------------------------------------: |
127+
| SECURESHIELD_AC_MEMORY | (start_address, size) | |
128+
| SECURESHIELD_AC_PERIPHERAL | (start_address, size) | Currently, only memory-mapped peripherals are supported |
129+
| SECURESHIELD_AC_IRQ | (interrupt_handler, interrupt no) | |
130+
| SECURESHIELD_AC_AUX | (aux start address, size) | AUX is in auxiliary address space |
131+
| SECURESHIELD_AC_INTERFACE | (interface_handler, arguments number) | No extra resource attribute |
132+
133+
| Basic Resource Access Attribute | Comments |
134+
| :---------------------------------: | :-------------------------------------: |
135+
| SECURESHIELD_AC_UEXECUTE | Execution with user privilege |
136+
| SECURESHIELD_AC_UWRITE | Write with user privilege |
137+
| SECURESHIELD_AC_UREAD | Read with user privilege |
138+
| SECURESHIELD_AC_KEXECUTE | Execution with kernel privilege |
139+
| SECURESHIELD_AC_KWRITE | Write with kernel privilege |
140+
| SECURESHIELD_AC_KREAD | Read with kernel Privilege |
141+
142+
| Extended Resource Access Attribute | Comments |
143+
| :---------------------------------: | :-------------------------------------: |
144+
| SECURESHIELD_AC_SIZE_ROUND_UP | the resource size should be rounded up |
145+
| SECURESHIELD_AC_SIZE_ROUND_DOWN | the resource size should be rounded down |
146+
| SECURESHIELD_AC_SHARED | the resource is a shared resource (no implementation now) |
147+
| SECURESHIELD_AC_SECURE | the resource is a secure resource |
148+
| SECURESHIELD_AC_NORMAL | the resource is a normal resource |
149+
150+
More details can be found in secureshield_vmpu_exports.h. For some resources, there are pre-defined CONTAINER_AC, e.g., SECURESHIELD_ACDEF_U/KROM, SECURESHIELD_ACDEF_U/KRAM.
109151

110152
## Secure Call
111153
In SecureShield, a secure call is implemented as a section of assembly code and invoked as a normal function call. The secure call is the only communication interface for a container to call the SecureShield runtime services. The following SecureShield runtime services are provided:
4.29 KB
Loading
-421 Bytes
Loading
46.4 KB
Loading
5.87 KB
Loading
-23.3 KB
Loading
53.7 KB
Loading
50.9 KB
Loading

0 commit comments

Comments
 (0)