当前位置:网站首页>Think: when do I need to disable mmu/i-cache/d-cache?
Think: when do I need to disable mmu/i-cache/d-cache?
2022-06-13 02:13:00 【Code changes the world CTW】
stay armv8/armv9 Of aarch64 Under the architecture , Software startup process :BL1--->BL2--->BL31--->BL32--->BL33....
In different BL Mirror switching , Need to be disable MMU/i-cache/d-cache Do you ?
We use BL2 To BL31 For example , Discuss the scenario .
BL2—>BL31
BL2 load BL31 To the memory , And then jump to BL31, Then there are two scenarios to analyze :
bl2 at EL3
- If bl2 yes EL3,BL31 It's also EL3, They use the same Transslation Regime, So in BL2 Jump BL31 When , need disable MMU/i-cache, as for d-cache There is no need for disabled, But if you are BL2 load Of BL31 Mirror image , So in load When finished mirroring , Need flush d-cache
bl2 at S-EL1
- If bl2 yes aarch64, that BL2 yes S-EL1,BL31 yes EL3, They have different Transslation Regime, So I Unwanted disable MMU/i-cache 了 , as for d-cache There is no need for disabled, But if you are BL2 load Of BL31 Mirror image , So in load When finished mirroring , Need flush d-cache
- If bl2 yes aarch32, that BL2 yes S-EL1,BL31 It's also S-EL1, They use the same Transslation Regime, So in BL2 Jump BL31 When , need disable MMU/i-cache, as for d-cache There is no need for disabled, But if you are BL2 load Of BL31 Mirror image , So in load When finished mirroring , Need flush d-cache
summary :
- (1) When BL When the image is switched , Just consider whether disable MMU/i-cache, There is no need to consider whether disable d-cache;
- (2) When BL When the image is switched , If Transslation Regime There is a change , There is no need for disable MMU/i-cache
- (3) When BL When the image is switched , If Transslation Regime Nothing has changed , You need to disable MMU/i-cache
- (4) for example uboot To kernel Handoff , Satisfy step (3), So we need to disable MMU/i-cache
Keep thinking about
During image switching ( When the program switches ), Why shut down MMU? Why shut down i-cache?
First answer the first , Why shut down MMU?
Because the program 1 Manager Program 1 Page table of , It's impossible to manage programs 2 Page table of . Just entering the program 2 When , The jump points to the physical address , Therefore, it is required to enter the program 2 when , need disable MMU.
Answer the second question , Close everything i-cache Well ?
Because if it's just MMU,i-cache It can still be speculated , It may cache outdated instructions . Jump to program 2 Then point to , It could break down .
边栏推荐
- How to do Internet for small enterprises
- [the second day of actual combat of smart lock project based on stm32f401ret6 in 10 days] (lighting with library function and register respectively)
- Why is "iFLYTEK Super Brain 2030 plan" more worthy of expectation than "pure" virtual human
- CCF 201409-1: adjacent number pairs (100 points + problem solving ideas)
- LabVIEW large project development tools to improve quality
- JS get element
- cmake_ example
- Configuring virtual private network FRR for Huawei equipment
- Combining strings and numbers using ssstream
- 传感器:SHT30温湿度传感器检测环境温湿度实验(底部附代码)
猜你喜欢

What did Hello travel do right for 500million users in five years?

柏瑞凱電子沖刺科創板:擬募資3.6億 汪斌華夫婦為大股東

柏瑞凯电子冲刺科创板:拟募资3.6亿 汪斌华夫妇为大股东

STM32 sensorless brushless motor drive

In the third quarter, the revenue and net profit increased "against the trend". What did vatti do right?

传感器:MQ-5燃气模块测量燃气值(底部附代码)

10 days based on stm32f401ret6 smart lock project practice day 1 (environment construction and new construction)

Ruixing coffee 2022, extricating itself from difficulties and ushering in a smooth path

华为设备配置私网IP路由FRR

Sqlserver2008 denied select permission on object'***** '(database'*****', schema'dbo')
随机推荐
Sqlserver2008 denied select permission on object'***** '(database'*****', schema'dbo')
1000粉丝啦~
Interruption of 51 single chip microcomputer learning notes (external interruption, timer interruption, interrupt nesting)
[the second day of the actual combat of the smart lock project based on stm32f401ret6 in 10 days] light up with the key ----- input and output of GPIO
Rsync transport exclusion directory
QT realizes mind mapping function (II)
[arithmetic, relation, logic, bit, compound assignment, self increasing, self decreasing and other] operators (learning note 4 -- C language operators)
Anti crawling strategy (IP proxy, setting random sleep time, bilbili video information crawling, obtaining real URLs, processing special characters, processing timestamp, and multithreading)
Use of Arduino series pressure sensors and detected data displayed by OLED (detailed tutorial)
SQL Server 删除数据库所有表和所有存储过程
The new wild prospect of JD instant retailing from the perspective of "hour shopping"
Gome's ambition of "folding up" app
Parameter measurement method of brushless motor
[keras] generator for 3D u-net source code analysis py
JS get element
(novice to) detailed tutorial on machine / in-depth learning with colab from scratch
Easydl related documents and codes
STM32 IIC protocol controls pca9685 steering gear drive board
Basic exercises of test questions Fibonacci series
Sensorless / inductive manufacturing of brushless motor drive board based on stm32