Skip to content
New issue

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

[rt-smart] kernel virtual memory management layer #6809

Merged
merged 14 commits into from
Jan 9, 2023

Conversation

polarvid
Copy link
Contributor

@polarvid polarvid commented Jan 3, 2023

拉取/合并请求描述:(PR description)

[

为什么提交这份PR (why to submit this PR)

synchronize virtual memory system works.

  • adding kernel virtual memory management layer for page-based MMU enabled architecture
  • porting libcpu MMU codes
  • porting lwp memory related codes

你的解决方案是什么 (what is your solution)

在什么测试环境下测试通过 (what is the test environment)

]

当前拉取/合并请求的状态 Intent for your PR

必须选择一项 Choose one (Mandatory):

  • 本拉取/合并请求是一个草稿版本 This PR is for a code-review and is intended to get feedback
  • 本拉取/合并请求是一个成熟版本 This PR is mature, and ready to be integrated into the repo

代码质量 Code Quality:

我在这个拉取/合并请求中已经考虑了 As part of this pull request, I've considered the following:

  • 已经仔细查看过代码改动的对比 Already check the difference between PR and old code
  • 代码风格正确,包括缩进空格,命名及其他风格 Style guide is adhered to, including spacing, naming and other styles
  • 没有垃圾代码,代码尽量精简,不包含#if 0代码,不包含已经被注释了的代码 All redundant code is removed and cleaned up
  • 所有变更均有原因及合理的,并且不会影响到其他软件组件代码或BSP All modifications are justified and not affect other components or BSP
  • 对难懂代码均提供对应的注释 I've commented appropriately where code is tricky
  • 代码是高质量的 Code in this PR is of high quality
  • 已经使用formatting等源码格式化工具确保格式符合RT-Thread代码规范 This PR complies with RT-Thread code specification

@polarvid polarvid marked this pull request as draft January 3, 2023 06:06
components/mm/mm_aspace.h Outdated Show resolved Hide resolved
components/mm/mm_object.c Outdated Show resolved Hide resolved
components/mm/mm_page.c Outdated Show resolved Hide resolved
components/mm/mm_page.c Outdated Show resolved Hide resolved
@mysterywolf mysterywolf added the -1 No vote label Jan 3, 2023
components/libc/compilers/common/include/sys/signal.h Outdated Show resolved Hide resolved
components/lwp/arch/risc-v/rv64/lwp_arch.c Show resolved Hide resolved
components/lwp/lwp.h Outdated Show resolved Hide resolved
components/mm/mm_aspace.h Outdated Show resolved Hide resolved
include/rtdef.h Outdated Show resolved Hide resolved
@polarvid polarvid force-pushed the memory-rel branch 4 times, most recently from 4891b5a to 2c528d4 Compare January 3, 2023 14:56
@mysterywolf
Copy link
Member

请将libc signal的这个问题单独抽出来提交一个PR,不要混在这个PR中

@mysterywolf mysterywolf removed the -1 No vote label Jan 4, 2023
@polarvid polarvid force-pushed the memory-rel branch 2 times, most recently from 60a0c2f to 142464f Compare January 4, 2023 11:05
@polarvid polarvid marked this pull request as ready for review January 4, 2023 12:04
components/lwp/arch/risc-v/rv64/lwp_arch.c Outdated Show resolved Hide resolved
components/lwp/arch/risc-v/rv64/lwp_arch.h Outdated Show resolved Hide resolved
@BernardXiong BernardXiong added the +1 Agree +1 label Jan 7, 2023
components/lwp/arch/arm/cortex-a/lwp_arch.c Outdated Show resolved Hide resolved
libcpu/risc-v/t-head/c906/riscv_mmu.h Outdated Show resolved Hide resolved
components/lwp/arch/arm/cortex-a/lwp_arch.c Outdated Show resolved Hide resolved
components/lwp/ioremap.c Outdated Show resolved Hide resolved
components/lwp/arch/arm/cortex-a/lwp_arch.c Outdated Show resolved Hide resolved
components/lwp/arch/arm/cortex-a/lwp_arch.c Outdated Show resolved Hide resolved
components/lwp/arch/arm/cortex-a/lwp_arch.c Outdated Show resolved Hide resolved
libcpu/arm/cortex-a/mmu.h Outdated Show resolved Hide resolved
@mysterywolf mysterywolf added the +2 Agree +2 label Jan 9, 2023
@mysterywolf
Copy link
Member

CI 报错不用理

@mysterywolf
Copy link
Member

这个PR重新命名一下 标题名字太模糊了 写一下PR的描述

@polarvid polarvid changed the title [smart] memory API [smart] kernel virtual memory management layer Jan 9, 2023
@mysterywolf mysterywolf changed the title [smart] kernel virtual memory management layer [rt-smart] kernel virtual memory management layer Jan 9, 2023
@mysterywolf mysterywolf merged commit 7450ef6 into RT-Thread:master Jan 9, 2023
@polarvid polarvid deleted the memory-rel branch January 9, 2023 02:15
@wosayttn
Copy link
Contributor

Failed to build all arm926ejs BSPs after the merging.
Miss arm926ejs CPU driver support?

image

@polarvid
Copy link
Contributor Author

polarvid commented Jan 10, 2023

I suppose SConscript should be replaced

diff --git a/components/mm/SConscript b/components/mm/SConscript
index d6f78ee06..111da70f8 100644
--- a/components/mm/SConscript
+++ b/components/mm/SConscript
@@ -3,7 +3,7 @@ from building import *
 
 objs = []
 
-if GetDepend('ARCH_MM_MMU'):
+if GetDepend('ARCH_ARM_CORTEX_A') or GetDepend('ARCH_ARMV8') or GetDepend('ARCH_RISCV64'):
     cwd  = GetCurrentDir()
     src	= Glob('*.c') + Glob('*_gcc.S')
     CPPPATH = [cwd]

@wosayttn
Copy link
Contributor

How about that?

import os
from building import *

cwd  = GetCurrentDir()
src = Glob('*.c') + Glob('*_gcc.S')
CPPPATH = [cwd]

group = DefineGroup('mm', src, depend = ['RT_USING_SMART', 'ARCH_MM_MMU'], CPPPATH = CPPPATH)

objs = [group]
list = os.listdir(cwd)

for d in list:
    path = os.path.join(cwd, d)
    if os.path.isfile(os.path.join(path, 'SConscript')):
        objs = objs + SConscript(os.path.join(d, 'SConscript'))

Return('objs')

@polarvid
Copy link
Contributor Author

polarvid commented Jan 10, 2023

for the latest branch

diff --git a/components/mm/SConscript b/components/mm/SConscript
index aee18c27c..725f097c0 100644
--- a/components/mm/SConscript
+++ b/components/mm/SConscript
@@ -3,7 +3,7 @@ from building import *
 
 objs = []
 
-if GetDepend('ARCH_MM_MMU'):
+if GetDepend('ARCH_ARM_CORTEX_A') or GetDepend('ARCH_ARMV8') or GetDepend('ARCH_RISCV64'):
     cwd  = GetCurrentDir()
     src = Glob('*.c') + Glob('*_gcc.S')
     CPPPATH = [cwd]

@polarvid
Copy link
Contributor Author

How about that?

import os
from building import *

cwd  = GetCurrentDir()
src = Glob('*.c') + Glob('*_gcc.S')
CPPPATH = [cwd]

group = DefineGroup('mm', src, depend = ['RT_USING_SMART', 'ARCH_MM_MMU'], CPPPATH = CPPPATH)

objs = [group]
list = os.listdir(cwd)

for d in list:
    path = os.path.join(cwd, d)
    if os.path.isfile(os.path.join(path, 'SConscript')):
        objs = objs + SConscript(os.path.join(d, 'SConscript'))

Return('objs')

On armv7 armv8 and riscv64, the MM is enabled even without rt smart configured

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
important +1 Agree +1 +2 Agree +2
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants