1. 前言
kernel版本:5.10
平台:arm64
本专题主要基于《arm64_linux head.S的执行流程》系列文章,前者是基于3.18,本专题针对的是内核5.10。主要分析head.S的执行过程。本文主要记录head.S的__cpu_setup执行过程。
2. __cpu_setup
#arch/arm64/mm/proc.S
/*
* __cpu_setup
*
* Initialise the processor for turning the MMU on.
*
* Output:
* Return in x0 the value of the SCTLR_EL1 register.
*/
.pushsection ".idmap.text", "awx"
SYM_FUNC_START(__cpu_setup)
为开启mmu做一些cpu的初始化工作
TLB/FP/ASIMD/DCC/PMU/AMU初始化
tlbi vmalle1 // Invalidate local TLB
dsb nsh
mov x1, #3 << 20
msr cpacr_el1, x1 // Enable FP/ASIMD
mov x1, #1 << 12 // Reset mdscr_el1 and disable
msr
ARM64 MMU 初始化

最低0.47元/天 解锁文章
1867

被折叠的 条评论
为什么被折叠?



