We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
关联 #9511 (comment)
rt-thread/libcpu/risc-v/common64/asid.c
Lines 30 to 51 in 906d1ca
这里的 write_csr(satp, satp_reg); 重置 satp 怪怪的。因为正常是两个启动阶段,做两次 satp 设置。第一次是初始映射,使用大粒度 pte,为了给初始化过程配置最基础的虚存属性(比如 cache 属性),并进入线性地址空间。第二次是按照虚存配置的映射(可能从静态/动态配置中读取运行时虚存布局),按照应用、驱动的需求配置内核地址空间。
write_csr(satp, satp_reg);
这里在中间又重置了一次 satp,并不是特别必要。或许是可以把 ASID 初始化操作合并到 rt_hw_mem_setup_early (第一次的初始映射)中。
rt_hw_mem_setup_early
The text was updated successfully, but these errors were encountered:
目前rt_hw_asid_init中通过向satp寄存器的bit[59:44]写1以确定ASIDLEN的值,此函数最好在MMU页表未使能前调用,所以把 ASID 初始化操作合并到 rt_hw_mem_setup_early的开始处比较合理些。
rt_hw_asid_init
Sorry, something went wrong.
再就是commn64中通过ARCH_USING_ASID来决定是否使用ASID,是否可以通过rt_hw_asid_init中的ASID_BITS值确定当前cpu是否支持ASID,如果支持,则默认在rt_hw_aspace_switch中使用asid功能。
commn64
ARCH_USING_ASID
No branches or pull requests
Describe problem solved by the proposed feature
关联 #9511 (comment)
rt-thread/libcpu/risc-v/common64/asid.c
Lines 30 to 51 in 906d1ca
这里的
write_csr(satp, satp_reg);
重置 satp 怪怪的。因为正常是两个启动阶段,做两次 satp 设置。第一次是初始映射,使用大粒度 pte,为了给初始化过程配置最基础的虚存属性(比如 cache 属性),并进入线性地址空间。第二次是按照虚存配置的映射(可能从静态/动态配置中读取运行时虚存布局),按照应用、驱动的需求配置内核地址空间。这里在中间又重置了一次 satp,并不是特别必要。或许是可以把 ASID 初始化操作合并到
rt_hw_mem_setup_early
(第一次的初始映射)中。The text was updated successfully, but these errors were encountered: