-
-
Notifications
You must be signed in to change notification settings - Fork 145
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
Patch feat robust futex #682
Patch feat robust futex #682
Conversation
@1037827920: no appropriate reviewer found, use |
@@ -0,0 +1 @@ | |||
{"rustc_fingerprint":4791525129410595491,"outputs":{"15729799797837862367":{"success":true,"status":"","code":0,"stdout":"___\nlib___.rlib\nlib___.so\nlib___.so\nlib___.a\nlib___.so\n/home/hmt/.rustup/toolchains/nightly-2023-08-15-x86_64-unknown-linux-gnu\noff\npacked\nunpacked\n___\ndebug_assertions\noverflow_checks\npanic=\"unwind\"\nproc_macro\ntarget_abi=\"\"\ntarget_arch=\"x86_64\"\ntarget_endian=\"little\"\ntarget_env=\"gnu\"\ntarget_family=\"unix\"\ntarget_feature=\"fxsr\"\ntarget_feature=\"sse\"\ntarget_feature=\"sse2\"\ntarget_has_atomic\ntarget_has_atomic=\"16\"\ntarget_has_atomic=\"32\"\ntarget_has_atomic=\"64\"\ntarget_has_atomic=\"8\"\ntarget_has_atomic=\"ptr\"\ntarget_has_atomic_equal_alignment=\"16\"\ntarget_has_atomic_equal_alignment=\"32\"\ntarget_has_atomic_equal_alignment=\"64\"\ntarget_has_atomic_equal_alignment=\"8\"\ntarget_has_atomic_equal_alignment=\"ptr\"\ntarget_has_atomic_load_store\ntarget_has_atomic_load_store=\"16\"\ntarget_has_atomic_load_store=\"32\"\ntarget_has_atomic_load_store=\"64\"\ntarget_has_atomic_load_store=\"8\"\ntarget_has_atomic_load_store=\"ptr\"\ntarget_os=\"linux\"\ntarget_pointer_width=\"64\"\ntarget_thread_local\ntarget_vendor=\"unknown\"\nunix\n","stderr":""},"4614504638168534921":{"success":true,"status":"","code":0,"stdout":"rustc 1.73.0-nightly (180dffba1 2023-08-14)\nbinary: rustc\ncommit-hash: 180dffba142c47240ca0d93096ce90b9fd97c8d7\ncommit-date: 2023-08-14\nhost: x86_64-unknown-linux-gnu\nrelease: 1.73.0-nightly\nLLVM version: 17.0.0\n","stderr":""},"551431409088304268":{"success":true,"status":"","code":0,"stdout":"___\nlib___.rlib\nlib___.a\nlib___.so\n/home/hmt/.rustup/toolchains/nightly-2023-08-15-x86_64-unknown-linux-gnu\noff\npacked\nunpacked\n___\ndebug_assertions\noverflow_checks\npanic=\"unwind\"\nproc_macro\ntarget_abi=\"\"\ntarget_arch=\"x86_64\"\ntarget_endian=\"little\"\ntarget_env=\"musl\"\ntarget_family=\"unix\"\ntarget_feature=\"fxsr\"\ntarget_feature=\"sse\"\ntarget_feature=\"sse2\"\ntarget_has_atomic\ntarget_has_atomic=\"16\"\ntarget_has_atomic=\"32\"\ntarget_has_atomic=\"64\"\ntarget_has_atomic=\"8\"\ntarget_has_atomic=\"ptr\"\ntarget_has_atomic_equal_alignment=\"16\"\ntarget_has_atomic_equal_alignment=\"32\"\ntarget_has_atomic_equal_alignment=\"64\"\ntarget_has_atomic_equal_alignment=\"8\"\ntarget_has_atomic_equal_alignment=\"ptr\"\ntarget_has_atomic_load_store\ntarget_has_atomic_load_store=\"16\"\ntarget_has_atomic_load_store=\"32\"\ntarget_has_atomic_load_store=\"64\"\ntarget_has_atomic_load_store=\"8\"\ntarget_has_atomic_load_store=\"ptr\"\ntarget_os=\"linux\"\ntarget_pointer_width=\"64\"\ntarget_thread_local\ntarget_vendor=\"unknown\"\nunix\n","stderr":"warning: dropping unsupported crate type `dylib` for target `x86_64-unknown-linux-musl`\n\nwarning: dropping unsupported crate type `cdylib` for target `x86_64-unknown-linux-musl`\n\nwarning: 2 warnings emitted\n\n"}},"successes":{}} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这测试项目没加.gitignore
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这些错误提交进来的东西要删掉。并且在测试项目里面添加ignore
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这些错误提交进来的东西要删掉。并且在测试项目里面添加ignore
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
除了license还有其他错误提交的文件吗?
@@ -0,0 +1,14 @@ | |||
# DragonOS Rust-Application Template |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
README需要改
@@ -0,0 +1,201 @@ | |||
Apache License |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
我记得LICENSE也是不要的
@dragonosbot author |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
请先删除多余的文件。
@dragonosbot review |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
应该要把整个target文件夹都删掉,并且把整个文件夹加到Ignore
@dragonosbot author |
@dragonosbot review |
@@ -0,0 +1,16 @@ | |||
# This file is automatically @generated by Cargo. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cargo.lock还没删
LICENSE
Outdated
@@ -1,339 +0,0 @@ | |||
GNU GENERAL PUBLIC LICENSE |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
不是要把DragonOS的LICENSE删了
r? @chiichen |
kernel/src/libs/futex/futex.rs
Outdated
} | ||
|
||
//获取当前线程的robust list head 和 长度 | ||
let robust_list_head = match *pcb.get_robust_list() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这里用ok_or方法比较好,所有这种match某个option的,都应该用OK_or
kernel/src/libs/futex/futex.rs
Outdated
.ok() | ||
{ | ||
Some(ubr) => ubr, | ||
None => return None, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这种地方直接打?就行了。不清楚为什么clippy没报错?
kernel/src/syscall/mod.rs
Outdated
let len = args[1]; | ||
|
||
//判断用户空间地址的合法性 | ||
verify_area(head_uaddr, core::mem::size_of::<u32>())?; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个校验应该在里面那个函数那里做
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
futex这个系统调用校验用户空间地址也在syscall/mod.rs里面校验,要不要顺便改了。https://code.dragonos.org.cn/xref/DragonOS/kernel/src/syscall/mod.rs?r=9b96c5b547c337502db7ec820312f119f95eece1#689
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
可以
@dragonosbot author |
PROT_READ, PROT_WRITE, | ||
}; | ||
|
||
const SYS_FUTEX: i64 = 202; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这些数字不要这么定义,而是应该使用sc库或者nix?系统调用号是跟架构相关的,将来我们移植到riscv,这些数值都会不一样。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
得先改一下测试程序的那个comment(刚才手滑点错了approve)
No description provided.