当前位置:网站首页>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 .
边栏推荐
- cmake_ example
- 【Unity】打包WebGL項目遇到的問題及解决記錄
- Bai ruikai Electronic sprint Scientific Innovation Board: proposed to raise 360 million Funds, Mr. And Mrs. Wang binhua as the main Shareholder
- Leetcode daily question - 890 Find and replace mode
- 1000粉丝啦~
- Application and routine of C language typedef struct
- C language complex type description
- Opencv camera calibration (1): internal and external parameters, distortion coefficient calibration and 3D point to 2D image projection
- 16 embedded C language interview questions (Classic)
- (novice to) detailed tutorial on machine / in-depth learning with colab from scratch
猜你喜欢

万字讲清 synchronized 和 ReentrantLock 实现并发中的锁
![[the 4th day of the 10 day smart lock project based on stm32f401ret6] what is interrupt, interrupt service function, system tick timer](/img/c4/0d97def5fb587b8301bcb907fc6fcf.jpg)
[the 4th day of the 10 day smart lock project based on stm32f401ret6] what is interrupt, interrupt service function, system tick timer

Huawei equipment is configured with IP and virtual private network hybrid FRR

Build MySQL environment under mac

Vivo released originos ocean, and the domestic customized system is getting better and better

Why is Huawei matebook x Pro 2022 leading a "laptop" revolution

Ruixing coffee moves towards "national consumption"

Uniapp preview function

Huawei equipment is configured with dual reflectors to optimize the backbone layer of the virtual private network

How to learn C language and share super detailed experience (learning note 1 -- basic data types of C language)
随机推荐
cin,cin. get(),cin. Summary of the use of getline() and getline()
Parameter measurement method of brushless motor
Uniapp preview function
Record: how to solve the problem of "the system cannot find the specified path" in the picture message uploaded by transferto() of multipartfile class [valid through personal test]
[pytorch]fixmatch code explanation - data loading
[keras] data of 3D u-net source code analysis py
The execution results of i+=2 and i++ i++ under synchronized are different
[learning notes] xr872 GUI littlevgl 8.0 migration (display part)
Compiling minicom-2.7.1 under msys2
Stm32 mpu6050 servo pan tilt support follow
C language compressed string is saved to binary file, and the compressed string is read from binary file and decompressed.
Day 1 of the 10 day smart lock project (understand the SCM stm32f401ret6 and C language foundation)
柏瑞凱電子沖刺科創板:擬募資3.6億 汪斌華夫婦為大股東
Restrict cell input type and display format in CXGRID control
Get started quickly cmake
华为设备配置CE双归属
Barrykay electronics rushes to the scientific innovation board: it is planned to raise 360million yuan. Mr. and Mrs. Wang Binhua are the major shareholders
cmake_ example
1000 fans ~
Why is "iFLYTEK Super Brain 2030 plan" more worthy of expectation than "pure" virtual human