Skip to content
GitLab
Explore
Projects
Groups
Topics
Snippets
Projects
Groups
Topics
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
educg-net-17066-1466467
proj264-lightweight-tee-optimization-2040
Commits
bd8ffc14
Commit
bd8ffc14
authored
2 years ago
by
兴趣使然
Browse files
Options
Download
Patches
Plain Diff
update README
parent
02d4e678
main
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
source/light_tee/README.md
+2
-66
source/light_tee/README.md
with
2 additions
and
66 deletions
+2
-66
source/light_tee/README.md
+
2
−
66
View file @
bd8ffc14
源版本 commit b657cd2f27d9171b75c846f21e7b4bb581b3ed29 (grafted, HEAD -> rpi-5.10.y, origin/rpi-5.10.y, origin/HEAD)
目前完成了rpi-5.10.y内核的改造,使得其能够支持对CPU的热插拔。下面是编译的步骤:
# 环境配置
...
...
@@ -17,69 +17,5 @@ make -j4
# install 所有组件
./
my_
install_kernel.sh
./install_kernel.sh
```
# 用户态安全区的建立与启动
```
bash
kexec
-p
/boot/rpi4-boot.img
--dtb
=
/boot/bcm2711-rpi-4-b.dtb
# 分配 CPU 并跳转执行
echo
0
>
/sys/devices/system/cpu/cpu3/online
```
# LKM
【测试】加载内核和敏感应用二进制文件的内核模块,测试是否能相对 kexec 的实现方式减少一次用户态内存拷贝从而加快速度。
# ftrace
可trace的点
```
cat /sys/kernel/debug/tracing/available_events | grep cpuhp
```
使用 ftrace 获取 cpuhp_enter 和 cpuhp_exit 之间的执行时间
```
trace-cmd record -e cpuhp:cpuhp_enter -e cpuhp:cpuhp_exit -e cpuhp:cpuhp_multi_enter
```
使用 ftrace 跟踪函数 cpu_down,可以获取 cpu_down的执行时间
```
sh
trace-cmd record
-p
function
-l
cpu_device_down
```
同时跟踪,function_graph 可以直接获取某个函数起始和结束并计算出函数的执行时间。
```
sh
trace-cmd record
-p
function_graph
-l
cpu_device_down
-e
cpuhp:cpuhp_enter
-e
cpuhp:cpuhp_exit
-e
cpuhp:cpuhp_multi_enter
```
跟踪系统调用
```
trace-cmd record -p function_graph -l __arm64_sys_removecpus -e cpuhp:cpuhp_enter -e cpuhp:cpuhp_exit -e cpuhp:cpuhp_multi_enter
```
# taskset
```
sh
# taskset -cp $core $pid
taskset
-cp
0,3
$pid
```
# 注意点
串口打印中断迁移到 sanctuary kernel 后,打印速度急剧变慢,如果在CPU热插拔过程中添加了log,则时间会变得很长。
用户态
`get_time`
获取的启动时间,内核态
`printk`
输出的是
`sched_clock`
时间,两者不一致
## 时间开销
-
fork一个新进程是存在时间开销的,5ms左右
-
系统调用从用户态陷入到内核态开始执行处理函数时间开销在 50-80us 左右,内核退出到用户态同样。 这个可以忽略不记
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment
Menu
Explore
Projects
Groups
Topics
Snippets